Message: Re: List of created isotopes in neutron induced reactions Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Idea Re: List of created isotopes in neutron induced reactions 

Forum: Hadronic Processes
Re: Question List of created isotopes in neutron induced reactions (Vitaly Mechinsky)
Date: 03 Oct, 2014
From: Michael H. Kelsey <Michael H. Kelsey>

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

 Add Message Add Message
to: "Re: List of created isotopes in neutron induced reactions"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews

[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]