Output kinetic energy of source primaries

Dear fluka experts,

How to output the kinetic energy of the primary particles in mgdraw.f?
From the output, the ETARCK-AM(JTRACK) values are not complied with the description of source particles, neither the following expression.
Primaries write in source.f follow a uniform energy distribution(10~120keV).
The ETRACK seems not the total energy of user-defined primary.
The TKESUM is defined as the total kinetic energy of user-defined primaries in FM guide, however, the particle energies distribution (by misusing previous energy value) do not accord with the source.f distribution either.

      ENTRY EEDRAW ( ICODE )
      IF (TLocalEdep .GT. 0 .OR. TContiEdep .GT. 0.) THEN
*            WRITE(99,*) ETRACK-AM(JTRACK),TLocalEdep + TContiEdep,NCASE
            WRITE(99,*) TKESUM,TLocalEdep + TContiEdep,NCASE
      END IF
      TContiEdep = 0.
      TLocalEdep = 0.
      SamePari = NCASE
      RETURN

And I am not sure about my energy depositon calculation. Sometimes I found the energy depostion bigger than the primary kinetic energy.
mgdraw_pocariV2.f (11.6 KB)
The mgdraw.f was based on previous post : Energy deposition: DETECT or MGDRAW

Any sugggestions are appreciated.

Best regards,
honghu

Dear honghu,

you can definitely access the parameters of the primary particle in the SODRAW entry of the mgdraw.f user routine. The kinetic energy in stored in the TKEFLK(I) variable, where I is the index of the primaries in the stack, up to NPFLKA. If your source routine generates only one primary per call, then NPFLKA should equal one.

The SODRAW entry is called every time the source routine is called. You can probably use the TKEFLK(I) variable in the EEDRAW entry as well.

The difference in kinetic and deposited energy could be explained by exoenergic nuclear interaction, but without knowing more about sour primary particles, or an input file, I can’t confirm if that is the case.

Cheers,
David

7 posts were split to a new topic: Disagreement between deposited energy expectation and results