CERN homepage INFN homepage
FLUKA: 13.2.13} mgdraw.f general event interface Previous Index Next

13.2.13} mgdraw.f general event interface

 -----------------------------------------

 Subroutine MGDRAW, activated by option USERDUMP with 
WHAT(1)
>= 100., usually writes a "collision tape", i.e. a file where all or selected transport events are recorded. The default version (unmodified by the user) offers several possibilities, selected by
WHAT(3)
in USERDUMP. Details are given in 11}. Additional flexibility is offered by a user entry USDRAW, selected by
WHAT(4)
in USERDUMP, interfaced with the most important physical events happening during particle transport. The user can modify of course also any other entry of this subroutine (BXDRAW called at boundary crossings, EEDRAW called at event end, MGDRAW for trajectory drawing, ENDRAW for recording of energy depositions and SODRAW for recording of source events: for instance the format of the output file can be changed, and different combinations of events can be written to file. No information is written by default at EEDRAW and BXDRAW calls, but the entries are called for any value of
WHAT(3)
in USERDUMP (EEDRAW also for
WHAT(4)
>= 1). But the most interesting aspect of the routine is that the five entries (all of which, if desired, can be activated at the same time by setting USERDUMP with
WHAT(3)
= 0.0 and
WHAT(4)
>= 1.0) constitute a complete interface to the whole FLUKA transport. Therefore, MGDRAW can be used not only to write a collision tape, but to do any kind of complex analysis (for instance studying correlations between events). Entries:
* MGDRAW (trajectory dumping for drawing)
Argument list (all variables are input only): ICODE : FLUKA physical compartment originating the call = 1: call from Kaskad (hadrons and muons) = 2: call from Emfsco (electrons, positrons and photons) = 3: call from Kasneu (low-energy neutrons) = 4: call from Kashea (heavy ions) = 5: call from Kasoph (optical photons) MREG : current region MGDRAW writes by default, for each trajectory, the following variables (contained in COMMON TRACKR): NTRACK : number of track segments MTRACK : number of continuous energy deposition events along the track. Local energy deposition events, i.e. energy deposition at a point, such as that from heavy recoils, particles below threshold and low energy neutron kerma, are written instead by ENTRY ENDRAW (see below). JTRACK : type of particle ETRACK : total energy of the particle WTRACK : weight of the particle Ntrack values of XTRACK, YTRACK, ZTRACK : end of each track segment Mtrack values of DTRACK : energy deposited at each deposition event CTRACK : total length of the curved path Other variables are available in TRACKR (but not written by MGDRAW unless the latter is modified by the user: particle momentum, direction cosines, cosines of the polarisation vector, age, generation, etc. (see a full list in the comment in the INCLUDE file). If name-based input is being used, the name corresponding to MREG can be obtained via a call to routine GEOR2N: CALL GEOR2N (NUMREG, NAMREG, IERR) where NUMREG (input variable) is the region number, and NAMREG (returned variable) is the corresponding region name (to be declared as CHARACTER*8). IERR is a returned error code: if = 0, the conversion is successful. See example in the description of BXDRAW below.
* BXDRAW (boundary crossing dumping)
Argument list (all variables are input only): ICODE : FLUKA physical compartment originating the call = 19: call from Kaskad (hadrons and muons) = 29: call from Emfsco (electrons, positrons and photons) = 39: call from Kasneu (low-energy neutrons) = 49: call from Kashea (heavy ions) = 59: call from Kasoph (optical photons) MREG : number of region before boundary crossing NEWREG : number of region after boundary crossing XSCO, YSCO, ZSCO : coordinates of crossing point BXDRAW is called at each boundary crossing (if requested by the user with USERDUMP,
WHAT(3)
< 7.0). There is no default output: any output must be supplied by the user. If name-based input is being used, the names corresponding to MREG and NEWREG can be obtained via a call to routine GEOR2N: CALL GEOR2N (NUMREG, NAMREG, IERR) where NUMREG (input variable) is a region number, and NAMREG (returned variable) is the corresponding region name (to be declared as CHARACTER*8). IERR is a returned error code: if = 0, the conversion is successful.
Example:
....................................... CHARACTER*8 MRGNAM, NRGNAM ....................................... ENTRY BXDRAW ( ICODE, MREG, NEWREG, XSCO, YSCO, ZSCO ) CALL GEOR2N ( MREG, MRGNAM, IERR1 ) CALL GEOR2N ( NEWREG, NRGNAM, IERR2 ) IF(IERR1 .NE. 0 .OR. IERR2 .NE. 0) STOP "Error in name conversion" ....................................... IF(MRGNAM .EQ. "MyUpsREG" .AND. NRGNAM .EQ. "MyDwnREG") THEN .......................................
* EEDRAW (event end)
Argument list: ICODE = -1: event not completed = 0: normal event termination = 4: stack overflow EEDRAW is called at the end of each event, or primary history, (if requested by the user with USERDUMP,
WHAT(3)
=< 0.0). There is no default output: any output must be supplied by the user.
* ENDRAW (dumping of energy deposition at a point)
Argument list (all variables are input only): ICODE : type of event originating energy deposition 1x: call from Kaskad (hadrons and muons) 10: elastic interaction recoil 11: inelastic interaction recoil 12: stopping particle 13: pseudo-neutron deposition 14: particle escaping (energy deposited in blackhole) 15: time kill 2x: call from Emfsco (electrons, positrons and photons) 20: local energy deposition (i.e. photoelectric) 21 or 22: particle below threshold 23: particle escaping (energy deposited in blackhole) 24: time kill 3x: call from Kasneu (low-energy neutrons) 30: target recoil 31: neutron below threshold 32: neutron escaping (energy deposited in blackhole) 33: time kill 4x: call from Kashea (heavy ions) 40: ion escaping (energy deposited in blackhole) 41: time kill 42: delta ray stack overflow 5x: call from Kasoph (optical photons) 50: optical photon absorption 51: optical photon escaping (energy deposited in blackhole) 52: time kill MREG : current region RULL : energy amount deposited XSCO, YSCO, ZSCO : point where energy is deposited If name-based input is being used, the name corresponding to MREG can be obtained via a call to routine GEOR2N: CALL GEOR2N (NUMREG, NAMREG, IERR) where NUMREG (input variable) is the region number, and NAMREG (returned variable) is the corresponding region name (to be declared as CHARACTER*8). IERR is a returned error code: if = 0, the conversion is successful. See example in the description of BXDRAW above. ENDRAW writes by default, for each energy deposition point: 0 : flag identifying ENDRAW output from that of other entries ICODE : see argument list JTRACK, ETRACK, WTRACK : see MGDRAW above. Note that for recoils, electrons, positrons and photons below threshold and kerma deposition, JTRACK can be outside the allowed particle ID range, assuming values like: 208: heavy recoil 211: electron, positron or photon below threshold 308: low energy neutron kerma In those cases the ID of the particle originating the interaction is saved in the TRACKR variable J0TRK (which otherwise has value zero) XSCO, YSCO, ZSCO, RULL : see argument list
* SODRAW (source particle dumping)
No arguments SODRAW writes by default, for each source or beam particle: -NCASE (in COMMON CASLIM, with a minus sign to identify Sodraw output): number of primaries followed so far NPFLKA (in COMMON FLKSTK): stack pointer NSTMAX (in COMMON FLKSTK): highest value of the stack pointer encountered so far TKESUM (in COMMON SOURCM): total kinetic energy of the primaries of a user written source (see source.f here below), if applicable. Otherwise = 0.0 WEIPRI (in COMMON SUMCOU): total weight of the primaries handled so far Npflka times: ILOFLK : type of source particle TKEFLK+AM : total particle energy (kinetic+mass) WTFLK : source particle weight XFLK, YFLK, ZFLK : source particle position TXFLK, TYFLK, TZFLK : source particle direction cosines
* USDRAW
Argument list (all variables are input only): ICODE : 10x: call from Kaskad (hadron and muon interactions) 100: elastic interaction secondaries 101: inelastic interaction secondaries 102: particle decay secondaries 103: delta ray generation secondaries 104: pair production secondaries 105: bremsstrahlung secondaries 110: radioactive decay products 20x: call from Emfsco (electron, positron and photon interactions) 208: bremsstrahlung secondaries 210: Moller secondaries 212: Bhabha secondaries 214: in-flight annihilation secondaries 215: annihilation at rest secondaries 217: pair production secondaries 219: Compton scattering secondaries 221: photoelectric secondaries 225: Rayleigh scattering secondaries 30x: call from Kasneu (low-energy neutron interactions) 300: interaction secondaries 40x: call from Kashea (heavy ion interactions) 400: delta ray generation secondaries MREG : current region XSCO, YSCO, ZSCO : interaction point USDRAW is called after each particle interaction (if requested by the user with USERDUMP,
WHAT(4)
>= 1.0). There is no default output: any output must be supplied by the user. Information about the secondary particles produced is available in COMMON GENSTK, except that concerning delta rays produced by heavy ions (in which case the properties of the single electron produced are available in COMMON EMFSTK, with index NP). Another exception is that about heavy evaporation fragments (deuterons, 3-H, 3-He, alphas, with JTRACK ID equal respectively to -3, -4, -5, -6) and fission/fragmentation products generated in an inelastic interaction (with JTRACK = -7 to -12) which are all stored in COMMON FHEAVY, with index NPHEAV. To get the kinetic energy of particles with JTRACK < -6, one must subtract from their total energy (ETRACK} in COMMON TRACKR) their fully stripped nuclear mass (AMNHEA in COMMON FHEAVY). Information about the interacting particle and its trajectory can be found in COMMON TRACKR (see description under the MGDRAW entry above). In TRACKR there are also some spare variables at the user's disposal: LLOUSE (integer), ISPUSR (integer array) and SPAUSR (double precision array). Like many other TRACKR variables, each of them has a correspondent in the particle stacks, i.e. the COMMONs from which the particles are unloaded at the beginning of their transport: FLKSTK, EMFSTK and OPPHST (respectively, the stack of hadrons/muons, electrons/photons, and optical photons). The correspondence with TRACKR is shown below under STUPRF/STUPRE. When a particle is generated, its properties (weight, momentum, energy, coordinates etc., as well as the values of the user flags) are loaded into one of the stacks. The user can write a STUPRF or STUPRE subroutine (see description below) to change anyone of such flags just before it is saved in stack. When a particle starts to be transported, its stack variables are copied to the corresponding TRACKR ones. Unlike the other TRACKR variables, which in general become modified during transport due to energy loss, scattering etc., the user flags keep their original value copied from stack until they are changed by the user himself (generally in USDRAW). One common application is the following: after an interaction which has produced sencondaries, let USDRAW copy some properties of the interacting particle into the TRACKR user variables. When STUPRF is called next to load the secondaries into stack, by default it copies the TRACKR user variables to the stack ones. In this way, information about the parent can be still carried by its daughters (and possibly by further descendants). This technique is sometimes referred to as "latching". If name-based input is being used, the name corresponding to MREG can be obtained via a call to routine GEOR2N: CALL GEOR2N (NUMREG, NAMREG, IERR) where NUMREG (input variable) is the region number, and NAMREG (returned variable) is the corresponding region name (to be declared as CHARACTER*8). IERR is a returned error code: if = 0, the conversion is successful. See example in the description of BXDRAW above.

Previous Index Next