Efficiency of a NaI detector ( effect photoelectrics )

Dear @youssef.allay,

One solution might be to use the mgdraw routine in the USDRAW entry (detailed example from the forum).

Here is a piece of code to insert in the routine which will write in a file some information only for photons inducing a photoelectric effect.

ENTRY USDRAW ( ICODE, MREG, XSCO, YSCO, ZSCO )
* if photoelectric effect
      IF(ICODE.EQ.221) THEN 
* we write id of the prim, the total energy, the part code of prim,
* the number of secondaries
            WRITE (72,*) NCASE, ETRACK, JTRACK, NP 
* for each secondary
            DO I=1,NP
* we write the part code and the kinetic energy
                  WRITE(72,*) KPART(I), TKI(I)
            END DO
      END IF
RETURN

You will find in attachment my input file and the modified routine (I tried it, it worked), I let you adapt them (especially concerning the primay and the material of the target) and then you will have to process the output file by yourself.

It is also important to specify in the EMF-cut card the energy theshold for EM particles when you want to track low energy particles.

Some useful links:

2023_05_NaI.zip (5.7 KB)