CERN homepage INFN homepage
FLUKA: 13.2.2} comscw.f: weighting deposited energy, stars or residual nuclei Previous Index Next

13.2.2} comscw.f: weighting deposited energy, stars or residual nuclei


     Argument list:
          IJ    : particle type (1 = proton, 8 = neutron, etc.: see code in 5})
                  Input only, cannot be modified.
          XA,YA,ZA : current particle position
          MREG  : current geometry region
          RULL  : amount to be deposited (unweighted)
          LLO   : particle generation. Input only, cannot be modified.
          ICALL : internal code calling flag (not for general use)

 This routine is activated by option USERWEIG, with 
> 0.0. Energy and star densities obtained via SCORE and USRBIN, and energy and stars obtained via EVENTBIN and production of residual nuclei obtained via RESNUCLEi are multiplied by the value returned by this function. The user can implement any desired logic to differentiate the returned value according to any information contained in the argument list (particle type, position, region, amount deposited, particle generation), or information available in the SCOHLP COMMON block (binning number, type of scored quantity). The scored quantity is given by the flag ISCRNG (in SCOHLP): ISCRNG = 1 --> Energy density binning ISCRNG = 2 --> Star density binning ISCRNG = 3 --> Residual nuclei scoring The binning/detector number is given by JSCRNG (in SCOHLP) and is printed in output: Res. nuclei n. 3 "any-name" , "high" energy products, region n. 4 R-Phi-Z binning n. 5 "other-name" , generalised particle n. 1 Note that a detector of residual nuclei can have the same JSCRNG number as a binning (use the value of ISCRNG to discriminate). Further information can be obtained including COMMON TRACKR (for instance particle's total energy, direction cosines, age). TRACKR contains also special user variables (both integer and in double precision) which can be used to save information about particles which have undergone some particular event. If data concerning the current material are needed, it can be accessed as MEDIUM(MREG) if file (FLKMAT) is included. Indeed, a common simple application of COMSCW is to score dose according to the local density (especially useful to get the correct average dose in bins straddling a boundary between two different media): .................. INCLUDE '(FLKMAT)' INCLUDE '(SCOHLP)' ..................
* ========== In order to compute doses ========= *
* Medium(n) is the material number of region n
* Rho(m) is the density of material m (in g/cm3)
* Iscrng = 1 means we are depositing energy (not stars)
* to get dose in Gy (elcmks is the electron charge in C)
* oneone is defined as 1.D0 in include DBLPRC
COMSCW = ONEONE ENDIF .................. Note that the variables in the argument list, with the exception of IJ, LLO and ICALL, are local copies of those used for particle transport, and therefore can be modified to have an effect on scoring, without affecting transport. 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.
setting the variable LSCZER = .TRUE. before RETURN (LSCZER is in COMMON SCOHLP), will cause zero scoring whatever the value returned by COMSCW. This is more efficient than returning a zero value.

Previous Index Next