|Message: Re: List of created isotopes in neutron induced reactions||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)|
On Fri, 03 Oct 2014 17:30:43 GMT, Vitaly Mechinsky wrote:
> Could you tell me how to create a list of isotopes, that appeared during > neutron reactions with some medium (Pb etc.)? It's necessary to obtain > simple 2-rows file in which the 1st row is isotope name, and in the 2nd > -- "intensity" of its appearance in neutron induced reactions at given > number of primary neutrons, that strike the medium.
You can do this with a combination of G4UserTrackingAction and G4UserRunAction, along with either a singleton utility class, or a "hit data" and "hit collection".
In the singleton utility class, create a key-value table (such as std::map) which connects either a string (the isotope name) or a G4ParticleDefinition pointer (const G4ParticleDefinition*), with a G4int counter. Provide a function which increments the counter for a given key (function input), and provide functions to initialize (zero out) and to dump the table on demand.
If you want to use G4HitCollection instead, then your "hit data" class would be a simple struct with the key/counter. You would search the hit collection to see if a hit with the key already existed, and either create it or increment its counter, as needed (std::map<> can do this for you automatically).
In G4UserTrackingAction, each time a new track appears, check it's particle definition; if it is an ion (class G4Ions), then you have an isotope. At that point, call the increment function of the singleton.
In G4UserRunAction, implement BeginOfRunAction() to zero out the singleton table, and implement EndOfRunAction() to dump the contents of the table in the format you like.
If you want the intensities normalized, then you may wish to implement a G4UserEventAction as well, and include an event counter in the singleton class (or a special hit entry in the hit collection).
-- Michael Kelsey