Saving secondaries with USDRAW

Dear FLUKA experts,

I am currently running a simulation involving the production of muons (mu+/-). To facilitate muon production, I have enabled photonuclear interactions with a bias-interaction length of 0.001.

I’m interested on saving informations regarding the muon when it is generated (position, momentum and weight).

So, I followed this logic:

  1. I create a routine mgdraw.f that uses the USDRAW entry. So, whenever any particle interacts it “activates”.
  2. I check if there are muons among its secondaries
  3. If there are muons, then I save the interaction vertex and the properties of the muon (momentum, weight, etc)

Here is the code snippet I am using to accomplish this:

      DO n=1, NP
            IF ((KPART(n).eq.10).or.(KPART(n).eq.11)) THEN
                  WRITE(IODRAW, '(4(I15, ","), 7(ES15.7,","), ES15.7)') 
     &            NCASE, JTRACK, ICODE, KPART(n), 
     &            XSCO, YSCO, ZSCO,
     &            PLR(n), CXR(n), CYR(n), CZR(n), WEI(n)
            END IF
      END DO

However, I have noticed that I am not saving the muons that are produced through photonuclear interactions. Instead of seeing muons with photons as their parent particles in the dump, I only observe muons with other muons as their secondaries.


Therefore, I would appreciate your guidance on whether my logic is flawed or if there is a better approach to achieve my objective.

Thank you for your assistance.

Dear @antonino.fulci ,

Thank you for your question. Probably you miss the muons created via pair production from photons since those go directly to FLKSTK directly, instead of GENSTK (please see the post PHOTONUC card, SDUM=MUMUPAIR, biasing, suppress the photon - #3 by msacrist).

To identify those cases in USDRAW, I suggest you filter ICODE=217 (pair production from photon). After that, you only have to differentiate electron and muon pair productions. The first will place electron and positron in GENSTK (NP=2), while the second will not. Due to the biasing you may find again in GENSTK a replica of the initial photon, so for muon pair production NP=0 or 1. The last step is simply
reading the information from the last two entries of FLKSTK (muon and antimuon). One way to achive this would be:

  IF ( (ICODE .EQ. 217) .AND. (NP .LE. 1) ) THEN
     END DO

I hope this helps.

Best regards,
Mario Sacristan


Thank you Mario,
that piece of code seems to work perfectly for my need, thank you so much!