Problem 2136

Summary: /gps/source/list shows wrong value
Product: Geant4 Reporter: Sanchit Sharma <sanchitsharma>
Component: eventAssignee: asai
Status: RESOLVED WONTFIX    
Severity: minor CC: John.Allison, sanchitsharma
Priority: P4    
Version: 10.5   
Hardware: All   
OS: All   
Attachments: /gps/source/list error

Description Sanchit Sharma 2019-02-16 01:37:05 CET
Created attachment 544 [details]
/gps/source/list error

Hello All,

I believe I have found a bug in Geant 4. My source definition is below:
/gps/particle neutron
/gps/pos/radius 0.5 cm
/gps/pos/centre 0.704 0. 1. cm
/gps/pos/type Beam
/gps/pos/shape Circle
/gps/ang/type beam2d
/gps/ene/mono 0.025 eV

However, whenever I do /gps/source/list, it shows me the wrong value as 1MeV which is default. To prove it I did /tracking/verbose 1 and saw that the transport is for the correct value of the source. I have attached a screenshot as a proof.

Thanks very much!

Regards,

Sanchit Sharma
Comment 1 Sanchit Sharma 2019-02-16 01:38:24 CET
Comment on attachment 544 [details]
/gps/source/list error

I am having this problem for a long time.
Comment 2 asai 2019-07-10 19:53:47 CEST
Hello.

I'm sorry for taking so long to respond.

This is a known issue of primary generator classes (both particle gun and general particle source) that are used in the multithreaded mode. 

Given primary generator is thread-local, all UI commands for primary generator are broadcasted all together to worker threads at the beginning of event loop. While /gps/source/list command displays the "current" value before the beginning of the event loop. This is the reason why you see the default values. We cannot broadcast each individual command to worker threads during the Idle state. Thus, even though the printout is not instantly updated, commands are actually sent to worker threads. 

We understand your inconvenience. But, in addition to the incorrect printout during the Idle state, could you please check that the correct printout from each worker thread?

Makoto
Comment 3 Sanchit Sharma 2019-07-10 19:57:37 CEST
Respected Dr. Asai,

When I check my emerging particle energy with "/tracking/verbose 1", It shows me the correct value.

Thanks!
Comment 4 asai 2019-07-10 20:05:52 CEST
Thanks for confirming it.
Makoto
Comment 5 asai 2020-01-31 00:58:42 CET
*** Problem 2207 has been marked as a duplicate of this problem. ***