Coincidence time between two detectors

Versions

Please provide the used software versions.

FLUKA:FLUKA Version 4-5.1
Flair: 3.4-5.4
Operating system: FEDORA 42
Compiler:

Description

Dear all

Greetings! I am trying to simulate the coincidence timing between two detectors. The setup is similar to the one shown in - FLUKA for fast timing method

In short, I have a Na22 source. I have two detectors around the source. one is for 1.2 MeV gamma while the other is for 511 keV one. I want to simulate the time difference between the detection of these two gamma photons. For this, I have modified the mgdraw.f file to include the following section-

  ENTRY USDRAW ( ICODE, MREG, XSCO, YSCO, ZSCO )
  IF ( .NOT. LFCOPE ) THEN
     LFCOPE = .TRUE.

! the files will record the gamma energy dep in the detectors
OPEN ( UNIT = 92, FILE = “colldet1”, STATUS = ‘UNKNOWN’)
OPEN ( UNIT = 93, FILE = “colldet2”, STATUS = ‘UNKNOWN’)
END IF
! IF( ICODE .EQ. 110) THEN
DO KP = 1, NP
! now check if the particle is gamma and is product of annihilation and in the correct region
IF (KPART(KP) .EQ.7 .AND. MREG .EQ.4 ) THEN
WRITE(92,‘(1P,4G25.15)’) ZSCO, TKI (KP),
& ATRACK, NCASE
ELSE IF (KPART(KP) .EQ.7 .AND. MREG .EQ.5 ) THEN
WRITE(93,‘(1P,4G25.15)’) ZSCO, TKI (KP),
& ATRACK, NCASE
!
END IF
ENDDO
!
RETURN

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?

thanks and regards

saurabh

Input files

triple_coink1.flair (2.0 KB)

mgdraw_pos_ann_gamma_timing.f (15.6 KB)

Please upload all relevant files. (FLUKA input file, Flair project file, user routines, and data files)

Dear Saurabh,

Thank you for your question. I am currently looking into it and will get back to you soon.

Best regards,

Alexandra

Thank you for the reply. One way might be that we distinguish the 511 keV and 1.2 MeV based on their origin. 511 keV comes from annihilation event while 1.2 MeV is emitted when the Ne atom transitions to the ground state. Will it be possible to distinguish these two events in USDRAW? This method may not work for other isotope, say Co60. thanks & regards

Dear Saurabh,

Thanks for the follow-up, and my apologies for the wait.

There are two main points to be addressed:

  1. 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.

  1. 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

Dear Alexandra,

Sorry it took me so long to reply. I was making very slow progress, actually none at all. I realized that for my simulation, instead of using Na22 as source, it will be better that i use the source_newgen to emit 3 gamma photons at the same time- one 1.2 MeV and two 511 keV. The relevant part of the source_newgen code is here-

 particle_code = 7

  momentum_energy = 0.0012
  call sample_isotropic_direction( direction_cosx, direction_cosy, direction_cosz )
  call set_primary()
  
  momentum_energy = 0.000511
  call sample_isotropic_direction( direction_cosx, direction_cosy, direction_cosz )
  call set_primary()

  momentum_energy = 0.000511
  call sample_isotropic_direction( direction_cosx, direction_cosy, direction_cosz )
  call set_primary()
  
  return

Then, I use the SODROW part in MGDRAW to assign the kinetic energy of the primary particle to SPAUSR(1).

      ENTRY SODRAW
*     capture the kinetic energy of the primary particle (TKEFLK)
*     and save it to the first user variable slot in the
*     tracking common block
      SPAUSR(1) = TKEFLK(1)
      RETURN

Following this, I use the USDRAW part of MGDRAW to write the parent particle energy-

 ENTRY USDRAW ( ICODE, MREG, XSCO, YSCO, ZSCO )
  IF ( .NOT. LFCOPE ) THEN
     LFCOPE = .TRUE.
     WRITE ( 89, * ) '#Information about particles in region', MREG
	 WRITE ( 89, * ) '#NCASE,ICODE,JTRACK,LTRACK, ETRACK'
	 WRITE ( 88, * ) '#Information about parent particles in region', MREG
	 WRITE ( 88, * ) '#NCASE,ICODE,JTRACK,ETRACK'
  END IF

  IF ( MREG .EQ.4) THEN
  •   current particles attributes		 
       WRITE ( 89, * ) NCASE,ICODE,JTRACK,LTRACK, ETRACK
    
  •   the number of secondary particles and the corresponding particle ID		 
       WRITE ( 89, * ) NP, (KPART(I),I=1,NP)
        END IF 
    
  •   parent particles attributes	  
       WRITE ( 88, * ) SPAUSR(1)
    

The output of this is all zeros in the 88 file. I thought that it could be because of source_newgen.f. But changing the source to plain photon of 2 MeV yielded the same result.

can you please help?

apologies for the delay.

sincerely

saurabh

triple_coink1.flair (2.3 KB)

stupre.f (3.8 KB)

source_newgen_gamma_timing1.f (4.8 KB)

mgdraw_with_parent_particle_energy.f (10.8 KB)

Dear Saurabh,

Thank you for your follow-up.

Now that you are using source_newgen.f to generate your gammas directly as primary particles, you can invoke the ISPARK and SPAREK arrays within the source routine itself to tag them at production, as shown below:

Proceeding like this, you no longer need the stupre.f or stuprf.f routines. Additionally, the kinetic energy assignment in the SODRAW entry of mgdraw.f should be removed.

Regarding mgdraw.f, please refer back to my previous reply, and in particular to the places where the continuous and point-like energy depositions need to be scored.

P.S.: Make sure to uncomment the SOURCE card in your input file.

I hope this helps.

Best regards,

Alexandra

Dear Alexandra,

Thanks! That worked nicely.

sincerely

saurabh