Dear Saurabh,
Thanks for the follow-up, and my apologies for the wait.
There are two main points to be addressed:
-
I want to simulate the time difference between the detection of these two gamma photons.
Decaying radioisotopes as source terms in FLUKA are treated in semi-analogue mode. This implies that decay products are explicitly sampled and transported, but they are sampled from inclusive spectra: on average you get the right number, kind, and energy of decay products, but one loses possible correlations among them, i.e., no correlated gamma cascade is reproduced.
-
My question is that is there a way to modify USDRAW so that it outputs which gamma ray initiated the energy deposition- 1.2 MeV or the 511 keV one?
Gammas themselves do not deposit energy directly, but they create secondary electrons (and positrons) which then travel and deposit the actual energy in your detector.
If you only track the gamma in USDRAW, you will miss the actual energy deposited by the electron shower. Instead, you need to score the energy in two places inside mgdraw.f, using a tagging system to trace where that energy came from:
- continuous energy loss: as tracked electrons travel through your detector, they continuously deposit energy along their step. This must be scored at the very top of
mgdraw.f (before the other entries) using the DTRACK array.
- point-like energy deposition: when an electron’s kinetic energy falls below the transport threshold (which defaults to 100 keV under the
PRECISIOn default settings without any EMFCUT card applied), FLUKA stops tracking it and dumps its remaining energy locally. This must be scored in the ENDRAW entry of mgdraw.f using the RULL variable.
To identify which gamma initiated the shower you can use the ISPUSR integer array which allows you to tag a particle and propagate that tag to all of its daughter particles.
For this, in addition to the mgdraw.f that you are already using, you will need the stupre.f and stuprf.f user routines. Whenever a new particle is created and put on a stack, STUPRE or STUPRF is called depending on the type of interaction that created the particle.
Whenever a gamma is created you can intercept it as follows:
- if its energy is around 1.27 MeV (the prompt gamma from the Na transition), tag it as 1 in
stuprf.f (triggered by primary generations, as well as hadronic and photonuclear interactions) using the main stack variables (ILOFLK = 7 and TKEFLK in GeV).
- if its energy is around 511 keV (originating from secondary positron annihilation), tag it as 2 in
stupre.f (triggered by pure electromagnetic interactions) using the EMF stack variables (ICHEMF = 0 and ETEMF in MeV).
- if it is a secondary electron, it inherits the tag of its parent.
Now that every electron in the shower carries the tag (1 or 2) of the gamma that spawned it, you can score the actual deposited energy in your detectors.
Finally, to get the total energy deposited in the detector for a single coincidence event, you will need to post-process the output and sum up all the DTRACK (from the continous energy loss) andRULL (from the point-like energy depositions) values that share the same event number (NCASE), region (MREG), and tag (ISPUSR).
P.S. 1: As you pointed out, origin-based tagging (e.g., only checking if the parent is a positron) fails for 60Co since both gammas are emitted directly from the nucleus. Checking the initial energy of the gamma is therefore a way to overcome this.
P.S. 2: For good measure, I recommend starting from the mgdraw_empty.f user routine. And then you can safely select Score: All (WHAT(4) = 0) in the USERDUMP card.
Hope this helps!
Best regards,
Alexandra