Energy Deposition Spectrum

Dear FLUKA experts,

I hope you are all well. I am trying to represent the spectrum of all the single energy depositions provoked by any particle (primary or secondary) in a region of interest (called in the routine “region-int”).

For that matter, I tried to use the USERDUMP card in FLUKA with the mgdraw.f subroutine. I just wanted to check that I am indeed storing all such depositions through the routine I am using (please find it attached).

As far as I am concerned, there are two types of energy deposition I can score with mgdraw.f:

  • Those given by DTRACK in the MGDRAW entry of the subroutine.
  • Those given by RULL in the ENDRAW entry of the subroutine.

Are there any other I should add, even if that requires the use of another card or routine?

I also wanted to confirm if the results were in GeV, as every energy output in FLUKA.

Thank you very much for your time in advance.

Best wishes,
Daniel

mgdraw.f (11.6 KB)

Dear @danipuerta.

Indeed, there are two types of energy depositions: i) continuous - per ionization, and ii) discrete - local (pointlike).

Please note that region-int is a wrong string for a region name, simply because it exceeds the 8 characters limit.

Moreover, calling CALL GEOR2N ( MREG, MRGNAM, IERR1 ) every time is redundant, so you could read at the first call only, using something similar to:

      LOGICAL LFIRST
      SAVE LFIRST
      DATA LFIRST /.TRUE./
      IF (LFIRST) THEN
         CALL GEOR2N (MREG, MRGNAM, IERR1)
         IF(IERR1 .NE. 0) STOP "Error in name conversion"
         LFIRST = .FALSE.
      ENDIF

Note that your resulting file will be very large, as you are scoring every single energy deposition.

And of course that the values are given in GeV.

I hope this helped your use case.

Best.
Daniel

Dear @dprelipc,

Thank you very much for your reply, it is really helpful! I apologise for the wrong region name, I changed it here for the sake of clarity in the subroutine (region-int(erest)).

Best,
Daniel