|Message: Re: simulation efficiency||Not Logged In (login)|
Click on the Forum title, e.g. on the "Forums by Category" page, to read a sequence of postings to the Forum and its threads all in one page. If you are only interested in one thread or the thread following a specific posting, click the thread or the posting, which takes you to a smaller page, which contains only the part you are interested in and may be easier to navigate.
Messages are "chained" if there are only replies at the first level, i.e. 1/1.html, 1/1/1.html etc. In case of "chained" messages the message number is replaced by the icon and there is no indentation.
Inline: Display the subject line only or also the text of the posting(s); for the choice "All" the "Outline" choices are switched off.
|1||0||1||no text / full text of posting|
|2||1||All||text for level 1 only / text for All postings|
Outline: Choose the depth of the posting thread, successive toggle controls provide increasing detail.
|1||2||1||2 levels / 1 level (original posting)|
|2||3||2||3 levels / 2 levels|
|3||3||All||3 levels / all levels (all postings)|
If you are interested in easily counting particles that are *created* during a run, you should derive your own G4UserStackingAction class and use the G4UserStackingAction::ClassifyNewTrack method, which is called during the tracking process when new particles need to be added to the stack for tracking. You can increment your created particle hits in your G4UserRunAction class (after passing the G4UserRunAction pointer to your G4UserStackingAction class, just as you are presently doing with your G4UserSteppingAction class).
Because G4UserSteppingAction::UserSteppingAction is called at every step, you should make every effort to minimize code in this function especially for CPU intensive simulation. Putting the code in G4UserStackingAction::ClassifyNewTrack ensures highly efficient accumulation of the data you want and only *once* for each particle when it is newly created. It appears that the code you now have will "count" the same neutron/Au198 each time it takes a step, which will result in many more neutrons/Au198 being tallied at the end of the run than there should be.
You can find an example in $G4INSTALL/examples/extended/electromagnetic/TestEm5/src/StackingAction.cc. See also the G4 user manual: http://geant4.web.cern.ch/geant4/UserDocumentation/UsersGuides/ForApplicationDeveloper/html/ch06s02.html
Hope this helps.
|Inline Depth:||Outline Depth:||Add message:|