Is it possible to print information about the ancestor (“mother”) of a particle produced in FLUKA?
At any time during a FLUKA run the common block FLKSTK is carrying those particles which have not yet been followed in the cascade, such as the primary beam particle or any other secondaries produced. Beside variables containing information on the type, momentum, position etc. of the respective entry it also contains variables which can be used by the user in order to save additional information:
SPAREK (11,0:MFSTCK) (11 double precision variables for each stack entry) ISPARK (11,0:MFSTCK) (11 integer variables for each stack entry) LOUSE (0:MFSTCK) (one integer variable for each stack entry)
Furthermore the user-subroutine stuprf (in subdirectory usermvax) is called every time a new particle is produced and put onto the stack. The identity and coordinates of the “mother” particle are handed over to stuprf as arguments (IJ, XX, YY, ZZ) and further information on the “mother” particle is stored in common TRACKR.
Hence in stuprf any information on the “mother” particle of a particle, which has just been produced and is put onto the stack, can be stored in addition using the above 11 user variables.
For example if you want to save the identity, total energy and z-coordinate of the mother you must edit stuprf as follows
LOUSE (NPFLKA) = JTRACK SPAREK (1,NPFLKA) = ETRACK SPAREK (2,NPFLKA) = ZTRACK
and leave the other user variables untouched
DO 100 ISPR = 3, MKBMX1 SPAREK (ISPR,NPFLKA) = SPAUSR (ISPR) 100 CONTINUE DO 200 ISPR = 1, MKBMX2 ISPARK (ISPR,NPFLKA) = ISPUSR (ISPR) 200 CONTINUE
When a new particle is taken from the stack in order to transport it this particle is filled into TRACKR with the above 11 variables saved on LLOUSE, SPAUSR and ISPUSR (the following lines are not visible for the user):
LLOUSE = LOUSE (NPFLKA) DO 96 ISPR = 1, MKBMX1 SPAUSR (ISPR) = SPAREK (ISPR,NPFLKA) 96 CONTINUE DO 98 ISPR = 1, MKBMX2 ISPUSR (ISPR) = ISPARK (ISPR,NPFLKA) 98 CONTINUE
Therefore common block TRACKR now contains not only the information on the presently transported particle but also the information on its mother and can be printed using mgdraw (see manual, collision tape, input card USERDUMP).
You’ll therefore have to edit stuprf and mgdraw, to compile and link them with the FLUKA-library and to use the USERDUMP to plot all information.
In a similar way, one can save the information about the mother particle (and possibly other ancestors) when the particle is an electron or a photon. In this case the stack concerned is EMFSTK, and the user subroutine is stupre.