Dear @tuneu,
When the routine STUPR is called you are loading the secondary particles from the GENSTK to the FLKSTK. You could use the information from the GENSTK. In particular the one related to the particle IS is “KPART”
Thus, you can do the following:
-
In your stupr.f, create a counter that will be incremented every time you load a muon. To do that, you could define an INTEGER with an initial value equal to 0 and with the command SAVE to be able to maintain the modified value after calling the routine:
INTEGER COUNTER SAVE COUNTER DATA COUNTER / 0 /
Then, when you try to load a muon:
IF((KPART(NPSECN).eq.10).or.(KPART(NPSECN).eq.11)) THEN
COUNTER = COUNTER + 1
LOUSE(NPFLKA) = COUNTER
WRITE(60,*) ... [dump the info. Here you can dump the initial values of the muon**]
ENDIF
NPSECN is the index of the current secondary
** For more variables of the GENSTK, see here at the bottom of the page (
Accessing Secondary Particle Information - #5 by nnikolop)
In this way you are flagging the muons when you load them into the FLKSTK, and dump the information of these particles in your output.
- Use BXDRAW to dump the info you are interested when the muons cross the regions that you want.
This should be sufficient for your needs.
If you’re having difficulty with the problem, you can share the input files with me.
Best,
André