Alice Alice Off-Line Project


User Manual and Reference (version 2.05)

page under construction

please send comments to: Yiota Foka


Foreword

The new version of GALICE has assembled in few months to be used for the Technical Design Report exercise. This has left little time to work on documentation. Therefore we invite readers of this page to provide comments, suggestions and complaints to the Simulation Mailing list.

Content

  1. Input Data Cards
    1. User GEANT control cards
    2. GALICE specific control cards

  2. The Cut File
  3. The Lego option
  4. Code description
    1. Content of galice.cmz
    2. FORTRAN coding Conventions
    3. Numbering and Names
    4. Common Block Description
    5. Routine Description

  5. Output Format
  6. ROOT Interface to Galice
  7. Magnetic Field
  8. Version History Back to: ALICE home, Offline home, GALICE home.



    1. Input Data Cards

    page under construction

    please send comments to: Yiota Foka


    The data card file distributed with GALICE contains three categories of FFREAD cards:

    1.1 User GEANT control cards

    page under construction

    please send comments to: Yiota Foka


    KINE

    This is a standard GEANT data card, but the meaning of the different field is defind by the user. The first field is integer and the others floating point. Note that this is a mixed data cards, and it mandatory to input floating point numbers with a decimal point. In GALICE the meaning is the following:

    KINE 1 x y z theta phi pmom part

    One particle per trigger, starting from x, y, z with angles theta and phi, momentum pmom and particle type NINT(part). Angles are given in degrees.

    KINE 2 thmin thmax phimin phimax pmin pmax part npart

    NINT(npart) particles per trigger centered at the interaction point (SXIPXS) with theta, phi and p in the range (thmin,thmax), (phimin,phimax), (pmin,pmax) and particle type NINT(part). Angles are given in degrees.

    KINE -2 thmin thmax phimin phimax pmean sigma part npart

    Same as before, but with a gaussian momentum distribution with average pmean and standard deviation sigma. Angles are given in degrees.

    KINE 3 parmin parmax thmin thmax phimin phimax pmin pmax

    Source is read from an external file in VENUS format. Only accept particle with part, theta, phi, pmom in the range (parmin, parmax), (thmin, themax), (phimin, phimax) and (pmin, pmax) where part is the GEANT particle code. Angles are given in degrees. This interface is now obsolete and has been kept for backward compatibility only.

    KINE 4 thmin thmax phimin phimax pmin pmax npart

    NINT(npart) source particles are generated per event according to a pt and eta distribution which is parametrised on the SHAKER distribution. Angular and momentum cuts are possible with the same meaning than the previous cards.

    KINE 5 thmin thmax phimin phimax pmin pmax part

    One particle of type part is generated per event according to a pt and eta distribution which is parametrised on the CDF data and PYTHIA simulation. Code provided by Andreas Morsch (see ALICE notes 95-05 and 96-31); decay is simulated only in phase space. Only accept particle with theta, phi and pmom in the range (thmin, themax), (phimin, phimax) and (pmin, pmax). Angles are given in degrees. The code of the particles is the following:

    partParticle
    113J/Psi
    114Upsilon
    115Phi

    1.2 GALICE specific control cards

    SXLEGO thmin thmax phimin phimax rmin rmax zmax nthe nphi iflego

    Activates LEGO option. See below for explanation of this option. GEANTINOS are shot in nthe bins in theta and nphi in phi with the above angular limitations, and statistics on the matter traversed is accumulated per r in the range (rmin,rmax) and z in the range (0, zmax). iflego has to be set to 1 for the card to take effect.

    SXEVT ifirst

    First even to be used when reading from file.

    SXnnn OnOff Gate Version Debug TrackPrint GeomDraw TrackDraw RAW/SPC PAW

    Steers the simulation of a module. nnn can be any of the currently implemented module names (see above). All values are integers.

    Flag Explanation
    OnOff 0 the module is absent from the run 1 the module is present in the run
    Gate time gate in nanoseconds for the module
    Version version of the geometry. -1 is the default version, whichever is defined in the program
    Debug debug level for a module, can be 0, 1 or 2
    TrackPrint print flag for tracks, can be 0 or 1
    GeomDraw draw flag for the geometry, can be 0 or 1
    TrackDraw draw flag for the tracks, can be 0 or 1
    RAW/SPC 0 do not output raw data and space points 1 output raw data and space points
    PAW level of paw output (0,1,2)

    The meaning of these cards is largely module dependent.

    SXDCH idraw

    Select charge of tracks to be drawn: idraw=100*ineg+10*ineut*ipos, where the track is drawn if the flag of the corresponding charge is 1.

    SXHID ihid

    Hidden line removal (ihid 0=off, 1=on) for drawings.

    SXLUN input zebra spc paw draw rdb raw

    Fortran logical unit numbers.

    Parameter Explanation
    input input unit for the event generator file containing the events as column wise ntuples (CWN)
    zebra output unit in zebra format for the /hits
    spc output unit for the raw space points (explained later)
    paw output unit for histograms and other paw objects
    draw output unit for metafile
    rdb input/output unit for initialisation data structures in RZ format. If positive the initialisation structures are written to disk, and if negative they are read from disk.
    raw logical unit for writing raw data information (not used yet)

    SXWKS imeta

    Workstation type of graphics output. See the HIGZ manual for more information.

    SXIPX X Y Z

    Sigma in (X,Y,Z) (cm) on interaction point position.

    SXFLD ISXFLD ISXFMAP SXMAGN SXMGMX

    Defines the magnetic field to be used:

    Flag Explanation
    ISXFLD Magnetic field transport flag 0=no field, 1=Runge Kutta, 2=helix
    ISXFMAP Magnetic field map version (see later)
    SXMAGN Scale factor for the magnetic field
    SXMGMX Maximum value for the magnetic field

    SXHACC isxhacc

    Selects acceptance of heavy particles decay in muon chambers: when isxhacc is different from zero, Galice keeps only events with both muons in the 2-9 degrees window.

    SXTREE chtree

    Selects the Root trees that are written onto the Root output file. One letter selects one tree:

    Letter Tree
    E Event Header Tree
    K Event Kinematic Tree
    H Hits Tree
    D Digits Tree

    SXVAC ivac

    Selects the material of the Alice mother volume (1 vacuum, 0 air).

    SXMAXD sxrmax sxzmax

    Tracking stops if the radius is larger than SXRMA or the absolute value of z is larger than SXZMA.

    Module specific control cards can be defined via the nnn_FKEY routines.



    2. The Cut file

    page under construction

    please send comments to: Yiota Foka


    In the simulation of the transport of radiation in matter it is important to be able to change the energy cuts of the different particles and the physic processes for each tracking medium. In GEANT 3.21 this is done by setting the parameters directly in the code. To allow changing these parameters without recompiling, a file, if it exists, is read in at initialisation time, where the energy thresholds and the flags for the different physics processes can be specified for each tracking medium.

    The format of the file is the following:

    ITMED GAM ELE NH CH MU EBR MBR EDEL MUDEL MUPA ANNI BREM COMP DRAY LOSS MULS PAIR PHOT RAYL

    Where

    Field Meaning
    ITMED user tracking medium number, i.e. the position in the array IDTMED where the actual tracking medium number has been returned by the routine SXSTME.
    GAM (REAL) Photon transport threshold
    ELE (REAL) Electron/positron transport threshold
    NH (REAL) Neutral hadrons transport threshold
    CH (REAL) Charged hadrons transport threshold
    MU (REAL) Muon transport threshold
    EBR (REAL) Electron/positron energy threshold for bremstrahlung production
    MUBR (REAL) Muon energy threshold for bremstrahlung
    EDEL (REAL) Electron/positron energy threshold for delta rays production
    MUDEL (REAL) Muon energy threshold for delta rays production
    MUPA (REAL) Muon energy threshold for direct pair production
    ANNI (INTEGER) Positron annihilation flag
    BREM (INTEGER) Bremstrahlung flag
    COMP (INTEGER) Compton scattering flag
    DRAY (INTEGER) Delta Ray flag
    LOSS (INTEGER) Energy loss flag
    MULS (INTEGER) Multiple scattering flag
    PAIR (INTEGER) Pair production flag
    PHOT (INTEGER) Photelectric effect flag
    RAYL (INTEGER) Rayleigh scattering flag

    The first 10 paremeters are energy cuts, and should be entered as floating point numbers. Energies are kinetic, and should be entered in GeV. The remaining 9 numbers are integers. A negative value is ignored. The file name is fixed: galice.cuts.

    Please note: when reading the initialisation data structure from disk (triggered when the rdb parameter in SXLUN data card is negative) the galice.cuts file is not read. So any change will remain ineffective. If cuts need to be changed, then the initialisation data structure needs to be recreated.



    3. The LEGO Option

    page under construction

    please send comments to: Yiota Foka


    This transport option allows to evaluate the material budget from a given radius to the surface of an arbitrary cylinder along radial directions from the centre. When the SXLEGO data card is specified, the normal event generation and transport cycle is altered. In this case Galice will produce only nthe times nphi events. Each event is composed by a single primary track, a geantino, corresponding to GEANT particle code 48, with unit momentum and angle at regular intervals between phimin and phimax and themin and themax.

    Geantinos are produced at the origin and then moved at the surface of a cylinder of radius rmin, where they start being transported. If rmin=0 geantinos start from the origin. Geantinos are stopped when they reach the surface of a cylinder of radius rmax and half length in z zmax.

    At the beginning of the job, three double dimensional plots are created with nphi times nthe bins:

    -100Radiation length map
    -101Interaction length map
    -102g/cm2 length map



    4. Code description

    page under construction

    please send comments to: Yiota Foka


    The code of GALICE is composed by two parts. One is a set of FORTRAN routines in the framework of GEANT and the other is a set of C++ routines that constitute the interface with ROOT. The FORTRAN code is contained in a single cmz file called galice.cmz, while the C++ code is contained in a set of file and headers that are managed by a makefile.

    4.1 Content of galice.cmz

    4.1.1 cmz flags

    ROOTIO Activates the ROOT interface.

    4.1.2 Patches in GALICE

    The code is divided in modules, each one describing a part of the experiment. The code relevant to each module is kept in a dedicated cmz directory, called PATCH. Each module is composed by one or more routines, which are called at different times during the execution of the program and perform different actions related to the module. They are contained in dedicated to the module DECKs which compose the corresponding PATCH, as can be seen for the TPC.

    The code contains the following patches:

    Patch Content
    $VERSION Standard cmz PATCH containing version control information.
    WRITEUP Description of the program (this file).
    HISTORY The modification log.
    $KUMACS The macros needed to install the program.
    DATA Examples of data cards and cut files.
    EXAMPLES Examples of run decks.
    *GALICE Pilot patch for the standalone version of GALICE.
    *ALIROOT Pilot patch for the ROOT I/O version of GALICE.
    GCDES GEANT common blocks
    GALICE Main programs.
    GUCODE GEANT user routines.
    STEER Steering routines for GALICE.
    ITS Description of the Inner Tracking System
    MAG Description of the L3 magnet.
    TPC Description of the Time Projection Chamber
    TOF Description of the Time Of Flight apparatus
    PMD Description of the Photon Multiplicity Detector
    PHOS Description of the Photon Detector
    RICH Description of the HMPID Rich detector
    MUON Description of the Muon Chambers in the Muon Arm
    FRAME Description of the Support Frame for the TPC
    CASTOR Description of the Castor detector
    FMD Description of the Forward Multiplicity Detector
    SUCODE Dummy user routines
    HALL Description of the experimental hall
    ABSO Description of the Muon Absorber
    SHIL Description of the Muon Arm Shield
    DIPO Description of the Dipole Magnet
    TRD Description of the Transition Radiation Detector
    PIPE Description of the Beam Pipe
    LEGO Routines needed for the LEGO option
    MISC Miscellaneous routines
    DUMMIES Dummy routines
    GPATCH Corrections for GEANT 3.21
    GDEBUG Debug version of GEANT 3.21 routines
    ROOTIO Code specific for ROOT I/O
    LAST Last PATCH

    4.2 FORTRAN Coding Conventions

    page under construction

    please send comments to: Yiota Foka


    Some simple coding conventions have been adopted. Only standard ANSI Fortran 77 is accepted with the following Fortran 90 compatible extensions:

    FORTRAN statements are written in CAPITALS. Comment lines start with a CAPITAL C or * while the rest of the comment line can be written in mixed case. The use of explicit type defintion in combination with IMPLICIT NONE is recommended but not enforced. In any case variable names should follow the implicit typing of FORTRAN:

    Type Coding
    INTEGER Variable name starts with I-N
    REAL Variable names starts with A-H or O-Z
    CHARACTER Variable name starts with CH
    LOGICAL Variable name starts with L
    DOUBLE PRECISION Variable name starts with D

    This allows the detector space point data to be directly entered into the SPC data CWN and also the type of routines/functions arguments can be checked directly from the variable names by compiler utilities and/or CMZ.

    We strongly encourage the users developing code to follow these rules.

    4.3 Numbering and Names

    page under construction

    please send comments to: Yiota Foka


    Each module has a name, a number and a one letter code:

    Description Name Number Code
    Inner Tracking System ITS 2 I
    L3 magnet MAG 3 M
    Time Projection Chamber TPC 4 T
    Time Of Flight apparatus TOF 5 F
    Photon Multiplicity Detector PMD 6 W
    Photon Detector PHOS 7 P
    Zero Degree Calorimeter ZDC 8 Z
    Forward Multiplicity Detector FMD 9 G
    HMPID Rich detector RICH 10 R
    Muon Chambers in the Muon Arm MUON 11 C
    Support Frame for the TPC FRAME 12 B
    Transition Radiation Detector TRD 13 U
    Castor detector CASTOR 15 S
    Muon Absorber ABSO 16 A
    Muon Arm Shield SHIL 17 Y
    Dipole Magnet DIPO 18 D
    Experimental hall HALL 19 H
    Beam Pipe PIPE 20 Q

    The detector module numbers are contained in PARAMETERs called ID_nnn in sequence SCXDB.

    To each module is assigned a range of integers:

    ID_nnn*100->ID_nnn*100+99

    thad is used throughout the program every time a detector identifier is needed. We will refer to this range as the module range. The modules specific letter will be hereon indicated with char.

    The ROUTINES in the different modules are called nnn_fff, where nnn is the name of the module: ITS, MAG, TPC, TOF, PMD, PHOS, RICH, MUON, FRAME, CASTOR, FMD, HALL, ABSO, SHIL, DIPO, TRD, PIPE.

    When several version of a given module are present, a routine may act as a switchyard, to version-specific routines where the last letter is replaced by a digit. So if there are 2 version of the TPC, the routine TPC_GEOM would just call TPC_GEO0 or TPC_GEO1 according to the version chosen for the run.

    The complete code referring to a certain detector has to be contained in 1 patch with the structure:

     +PATCH,name.          Contains the code related to module 'nnn'
     +DECK,CDES.           Contains the private KEEP sequences
     +DECK,nnn_fff.        Contains the code of routine 'nnn_fff'
    

    Example:

    
          +PATCH,TOF.
    
          +DECK,CDES.
          +KEEP,T_START.
                COMMON /S_START/ JCOUNT,MOD_FIRST
          C
          +KEEP,T_SPC.
                PARAMETER (MAX6=1000)
                COMMON /SCXSCR/ NHIT6,IROW6(MAX6),ICOL6(MAX6),IADC6(MAX6)
          C
    
          +DECK,TOF_INIT.
                SUBROUTINE TOF_INIT
          C
          +CDE,T_START.
          C
          *
                END
    
          +DECK,TOF_DIGT.
                SUBROUTINE TOF_DIGT
          C
          +CDE,T_SPC.
          C
          *
                END
    

    These patches are in the galice.cmz file as described in the layout of the galice.cmz file.

    Any printout message should contain the name of the routine which produced it. The recommended way to produce printouts is the FORTRAN WRITE instruction. The nnn_INIT and nnn_END routines must printout a message with the name of the detector.

    The dummy SU routines may be used to test out new component simulation packages. Note that these routines are always called, irrespective of the FFREAD data cards selections.

    Each module can create private histograms and/or ntuples to investigate its performance. All this HBOOK/PAW activity must be under the control of the flags related to the SXnnn FFREAD data cards.

    Examples of actions in the module routines are:

    PAW file opening, directory setting and writing out of the ntuples etc... is done by the general steering routines.

    4.4 Common Block Description

    page under construction

    please send comments to: Yiota Foka


    The COMMONS of the various detectors are called char_uuuuuu, uuuuuu = Left free to the user. An exception on this are the STEERING commons which are called SCXuuuuu

    Note:
    1. The KEEP sequence MUST have the same name as the (first) COMMON in that sequence and the use of BLOCKDATA must be omitted (all initialisation in name_INIT).
    2. Executable statements or DATA statements are NOT allowed in a KEEP sequence.

    SCXIO

    +KEEP,SCXIO.------------------------------------------------------------------------
    C --- Common which contains the units for the various I/O streams ---
          INTEGER LUNIN,LUNZEB,LUNSPC,LUNPAW,LUNDRW,LUNRDB,LUNRAW
         $,       NKEYS,JRECO
    C
          COMMON /SCXIO/ LUNIN,LUNZEB,LUNSPC,LUNPAW,LUNDRW,LUNRDB,LUNRAW
         $,              NKEYS,JRECO
          CHARACTER*4 KEYS
          COMMON /SCXIO2/ KEYS(4)
    C
    
          LUNIN     Logical input unit for the generator data file in case
                    IKINE=3 (see card KINE).
          LUNZEB    Logical input unit for writing ZEBRA data structures.
          LUNSPC    Logical unit for writing Alice space point Column Wise
                    Ntuples.
          LUNPAW    Logical unit for PAW Ntuple output
          LUNDRW    Logical unit for graphic metafil
          LUNRDB    Logical unit for initial data structure file
          NKEYS     Number of structures to save every event on LUNZEB
          KEYS      Name of the structures to save every event on LUNZEB
    

    SCXDB

    +KEEP,SCXDB.------------------------------------------------------------------------
    C --- Common which contains debug flags for the various detectors ---
    C IDBUGF(J) = Debug level (0,1,2) for detector "J"
    C --- Also control flags (JPAWF,JVERF,JOUTF) for each detector added ---
          INTEGER NDBMAX
          PARAMETER (NDBMAX=20)
    C
          INTEGER       ID_ITS,ID_MAG,ID_TPC,ID_TOF,ID_PMD,ID_PHOS
         $,       ID_ZDC,ID_FMD,ID_RICH,ID_STEE,ID_MUON,ID_FRAME,ID_TRD
         $,       ID_CASTOR,ID_ABSO,ID_SHIL,ID_DIPO,ID_HALL,ID_PIPE
         $,       ID_ALICE
    C
          PARAMETER (ID_ALICE=0,        ID_ITS=2,ID_MAG=3,ID_TPC=4,ID_TOF=5
         $,          ID_PMD=6,ID_PHOS=7,ID_ZDC=8,ID_FMD=9,ID_RICH=10
         $,          ID_MUON=11,ID_FRAME=12,ID_TRD=13,ID_CASTOR=15
         $,          ID_ABSO=16,ID_SHIL=17,ID_DIPO=18,ID_HALL=19,ID_PIPE=20
         $,          ID_STEE=NDBMAX+1)
    C
          INTEGER IDBUGF,JPAWF,JVERF,JOUTF,IDTMED,ILTMED
    C
          INTEGER MMEDIA
          CHARACTER*6 CHNVOL
          PARAMETER (MMEDIA=1000)
          COMMON /SCXDB/ IDBUGF(NDBMAX+1),JPAWF(NDBMAX+1),JVERF(NDBMAX+1)
         $,              JOUTF(NDBMAX+1)
         $,              IDTMED(100*(NDBMAX+1))
         $,              ILTMED(2,0:NDBMAX)
         $,              IMEDIA(MMEDIA),CHNVOL(0:NDBMAX)
    C
    
          IDBUGF         Debug flag for all modules (0->2). The storing of the hits
                         requires a value >0 of this flag.
          JPAWF          PAW flag for all modules (0->2). This flag triggers
                         booking and filling of histograms.
          JVERF          Version chosen for all modules.
          JOUTF          Raw data (digits) output flag for modules (0, 1).
          IDTMED         Translation array between tracking media codes and
                         GEANT numbers.
          ILTMED         Tracking media id ranges for different modules. The
                         tracking media identifiers (ID) of module I are such
                         that ILTMED(1,I)
    
    

    SCXFF

    +KEEP,SCXFF.------------------------------------------------------------------------
    C --- Common which contains FFREAD stuff for the GALICE package ---
    C --- as well as the total processed event counter ---
          INTEGER NSXDET,NLUNS,NPARS
         $,       JDETF,JTRAF,JDRGF,JDRTF,IFDRAT,ISXDCH,JDCHM,JDCHN,JDCHP
         $,       ISXWKS,ISXVAC,NSXEVT,IFPART,IFVOLU,IFMATE
         $,       IFTMED,IFVERT,IFKINE,IFSETS,IFHITS,IFDIGI,IFSECS
         $,       IFXSEC,IFLOSS,ISXEVT,ISXHID,ISXFLD,ISXFMAP
         $,       ISXITS,ISXMAG,ISXTPC,ISXTOF,ISXPMD,ISXPHOS
         $,       ISXZDC,ISXFMD,ISXRICH,ISXMUON,ISXFRAME,ISXTRD,ISXCASTOR
         $,       ISXSTEE,ISXABSO,ISXSHIL,ISXDIPO,ISXHALL,ISXPIPE
         $,       ISXHACC
          REAL SXGATE,SXMAGN,SXIPXS,SXMGMX,SXRMAX,SXZMAX
    C
          PARAMETER (NSXDET=20,NLUNS=7,NPARS=9)
          COMMON /SCXFF/ JDETF(NSXDET+1),JTRAF(NSXDET+1)
         $,              JDRGF(NSXDET+1),JDRTF(NSXDET+1),IFDRAT
         $,              ISXDCH,JDCHM,JDCHN,JDCHP
         $,              SXGATE(NSXDET)
         $,              ISXWKS,ISXVAC,NSXEVT
         $,              IFPART,IFVOLU,IFMATE,IFTMED,IFVERT,IFKINE
         $,              IFSETS,IFHITS,IFDIGI,IFSECS
         $,              IFXSEC,IFLOSS
         $,              ISXEVT,SXIPXS(3),ISXHID
         $,              ISXFLD,ISXFMAP,SXMAGN,SXMGMX
         $,              ISXITS(NPARS),ISXMAG(NPARS)
         $,              ISXTPC(NPARS),ISXTOF(NPARS),ISXPMD(NPARS)
         $,              ISXPHOS(NPARS),ISXZDC(NPARS),ISXFMD(NPARS)
         $,              ISXRICH(NPARS),ISXMUON(NPARS),ISXFRAME(NPARS)
         $,              ISXTRD(NPARS),ISXCASTOR(NPARS)
         $,              ISXABSO(NPARS),ISXSHIL(NPARS),ISXDIPO(NPARS)
         $,              ISXHALL(NPARS),ISXPIPE(NPARS)
         $,              ISXSTEE(NPARS),SXRMAX,SXZMAX
         $,              ISXHACC
    C
          JDETF          0 if the module does not exist, 1 otherwise
          JTRAF          Step by step printing for the module if not 0
          JDRGF          Draw in the view bank for the module if not 0
          JDRTF          Store the track points in memory for the module 
                         if not 0
          IFDRAT         Not 0 if at least one module is drawn. Then every
                         event is drawn superinposed to the modules in the view
                         banks.
          ISXDCH         Charge of particles drawn (100*NEG+10*NEUT+ICHAR,
                         where NEG, NEUT and ICHAR can be 0 or 1)
          JDCHM          1 if negative particles are drawn
          JDCHN          1 if neutral particles are drawn
          JDCHP          1 if positive particles are drawn
          SXGATE         Time gate for the each module
          ISXWKS         Graphics metafile code
          ISXVAC         If 1 Alice will be filled with vacuum, if 0 with air
          NSXEVT         Global event counter
          IFPART         If 1 PART data structure is printed
          IFVOLU         If 1 VOLU data structure is printed
          IFMATE         If 1 MATE data structure is printed
          IFTMED         If 1 TMED data structure is printed
          IFVERT         If 1 VERT data structure is printed
          IFKINE         If 1 KINE data structure is printed
          IFSETS         If 1 SETS data structure is printed
          IFHITS         If 1 HITS data structure is printed
          IFDIGI         If 1 DIGI data structure is printed
          IFSECS         If 1 Secondary statistic is printed
          IFXSEC         If 1 hadronic cross section is printed
          IFLOSS         If 1 energy loss information is printed
          ISXEVT         Start event number when reading from a file
          SXIPXS         Interaction point
          ISXHID         If 1 turns on HIDE option for drawing
          ISXFLD         Magnetic field transport flag 0=no field, 2=helix, 3=Runge Kutta
          ISXFMAP        Magnetic field map version (1, 2 see later)
          SXMAGN         Scale factor for the magnetic field
          SXMGMX         Maximum value for the magnetic field
          ISXITS         Input array of flags for ITS
          ISXMAG         Input array of flags for MAG
          ISXTPC         Input array of flags for TPC
          ISXTOF         Input array of flags for TOF
          ISXPMD         Input array of flags for PMD
          ISXPHOS        Input array of flags for PHOS
          ISXZDC         Input array of flags for ZDC
          ISXFMD         Input array of flags for FMD
          ISXRICH        Input array of flags for RICH
          ISXMUON        Input array of flags for MUON
          ISXFRAME       Input array of flags for FRAME
          ISXTRD         Input array of flags for TRD
          ISXCASTOR      Input array of flags for CASTOR
          ISXABSO        Input array of flags for ABSO
          ISXSHIL        Input array of flags for SHIL
          ISXDIPO        Input array of flags for DIPO
          ISXHALL        Input array of flags for HALL
          ISXPIPE        Input array of flags for PIPE
          ISXSTEE        Input array of flags for STEE
          SXRMAX         Maximum radius for transport
          SXZMAX         Maximum value of z for transport
          ISXHACC        Accept heavy particle decays within mu-chambers acceptance
    C
    

    SCXGEO

    +KEEP,SCXGEO.-----------------------------------------------------------------------
    C --- Common which contains some general geometry parameters ---
          REAL DALIC
    C
          COMMON /SCXGEO/ DALIC(3)
    C
           
          DALIC          Dimension of the Alice mother volume
    
    

    SCXPAW

    +KEEP,SCXPAW.-----------------------------------------------------------------------
    C --- Common which contains the NTUPLE info for the steerings ---
          INTEGER NVRS1
          REAL VALS1
    C
          PARAMETER (NVRS1=2)
          CHARACTER*6 VARS1
          COMMON /SCXPAW/ VALS1(NVRS1)
          COMMON /SCXPW2/ VARS1(NVRS1)
    C
    
          VALS1          Names of the NTUPLE variables for the steering
          VARS1          Values of the NTUPLE variables for the steering
    
    

    SCXPST

    +KEEP,SCXPST.-----------------------------------------------------------------------
    C --- Common which contains secondary particle statistics ---
          INTEGER IPCNT
    C
          COMMON /SCXPST/ IPCNT(100)
          CHARACTER*20 NAME,NAMES
          COMMON /SCXPS2/ NAME,NAMES(100)
    C
          SAVE /SCXPST/
          SAVE /SCXPS2/
    C
    
          IPCNT          Number of secondaries for each particle species
          NAME           Temporary storage for the name of the particle
          NAMES          Names of the particles
    
    

    SCXEVT

    +KEEP,SCXEVT.-----------------------------------------------------------------------
    C --- Common which contains standard event parameters ---
          INTEGER JSXRUN,JSXEVT,JSXNPA,JSXZB,JSXZT,NSXPIN,IPX,IPY,IPZ
          REAL RSXIMP,RSXPNU,RSXECM
    C
          COMMON /SCXEVT/ JSXRUN,JSXEVT,JSXNPA,JSXZB,JSXZT
         $,               RSXIMP,RSXPNU,RSXECM,NSXPIN(48)
         $,               IPX,IPY,IPZ
    C
          JSXRUN
          JSXEVT
          JSXNPA
          JSXZB
          JSXZT
          RSXIMP
          RSXPNU
          RSXECM
          NSXPIN(48)
          IPX
          IPY
          IPZ
    
    

    SCXSCR

    +KEEP,SCXSCR.-----------------------------------------------------------------------
    C --- Common containing scratch space for detector SPC/RAW arrays ---
          INTEGER NSCR,IARR
    C
          PARAMETER (NSCR=100000)
          COMMON /SCXSCR/ IARR(NSCR)
    C
    

    SLATE

    +KEEP,SLATE.
    C --- CERNLIB common with additional info for the DATIME package ---
          INTEGER ISL
          REAL DUMMY
    C
          COMMON /SLATE/ ISL(6),DUMMY(34)
    C
    

    QUEST

    +KEEP,QUEST.
    C --- CERNLIB common for communication with the ZEBRA package ---
          INTEGER IQUEST
    C
          COMMON /QUEST/ IQUEST(100)
    C
    

    SCXGEN

    +KEEP,SCXGEN.
    C --- Common containing event generator data ---
          INTEGER NIHMAX,NRHMAX,NRGEN,JRGEN,JTKGEN,NIHEAD,IHEAD,NRHEAD,IPAR
          REAL RHEAD,THETA,PHI,PMOM,E
    C
          PARAMETER (NIHMAX=12,NRHMAX=6)
          COMMON /SCXGEN/ NRGEN,JRGEN,JTKGEN
         $,               NIHEAD,IHEAD(NIHMAX),NRHEAD,RHEAD(NRHMAX)
         $,               IPAR,THETA,PHI,PMOM,E
    C
    

    SCXZLN

    +KEEP,SCXZLN
    C --- Alice permanent links for ZEBRA banks
          INTEGER NALINK, JALINK, JLEDEP
          PARAMETER (NALINK=1)
          COMMON / SCXZLN / JALINK(NALINK)
          EQUIVALENCE (JLEDEP,JALINK(1))
    
    

    SCKINE

    +KEEP,SCKINE,IF=ROOTIO
          CHARACTER*4 CHTREE
          COMMON / SCKINE / MTRACK, MPRIMA
         +,                 CHTREE(2)
    
    C     MTRACK     Track number in the Root stack
    C     MPRIMA     Number of primaries generated
    C     CHTREE     Root trees to be created in memory
    
    

    SCXMFD

    +KEEP,SCXMFD,IF=-ROOTIO.
    C --- Common containing magnetic field map data
          REAL DZ,DX,DY,UDX,UDY,UDZ
         $,XMBEG,YMBEG,ZMBEG,XMEND,YMEND,ZMEND
         $,BV
          INTEGER NX,NY,NZ
    
          PARAMETER(MAXFLD=250000)
          COMMON /SCXMFD/ NX,NY,NZ,DZ,DX,DY,UDX,UDY,UDZ
         $,XMBEG,YMBEG,ZMBEG,XMEND,YMEND,ZMEND
         $,BV(MAXFLD)
    C
    C       NX, NY, NZ    Number of map points
    C       DX, DY, DZ    Map cell side
    C       XMBEG, XMEND  Map extension in X
    C       YMBEG, YMEND  Map extension in Y
    C       ZMBEG, ZMEND  Map extension in Z
    C       BV            Array of field values (BX,BY,BZ)(IX,IY,IZ)
    C
    C       
    

    SCXLEGO

    +KEEP,SCXLEGO
    C --- LEGO option for calculating material traversed
    C
    C       THEMIN   Minimum generation theta
    C       THEMAX   Maximum generation theta
    C       PHIMIN   Minimum generation phi
    C       PHIMAX   Maximum generation phi
    C       RLMIN    Generation radius
    C       RLMAX    Maximum tracking radius
    C       ZLMAX    Maximum tracking Z
    C       NLTHE    Number of bins in Theta
    C       NLPHI    Numner of bins in Phi
    C       IFLEGO   Lego Flag
    C       ICTHE    Current theta bin
    C       ICPHI    Current phi bin
    C       CURTHE   Current theta of track
    C       CURPHI   Current phi of track
    C       TOTRADL  Total Radiation length
    C       TOTABSO  Total absorption length
    C       TOTGCM2  Total G/CM2 traversed
    C
          COMMON / SCXLEGO / THEMIN, THEMAX, PHIMIN, PHIMAX, RLMIN, RLMAX,
         $ZLMAX, NLTHE, NLPHI, IFLEGO, ICTHE, ICPHI, TOTRADL, TOTABSO,
         $TOTGCM2, CURPHI, CURTHE
    
    

    SCCPROTO

    +KEEP,SCCPROTO,IF=ROOTIO
    //
    //  Prototypes for Galice
    //
    #ifdef WIN32
    #define sxsrot SXSROT
    #define type_of_call _stdcall
    #else
    #define sxsrot sxsrot_
    #define type_of_call
    #endif
    
    extern "C" void type_of_call
         sxsrot(int &nmat, const float &theta1, const float &phi1,
                           const float &theta2, const float &phi2,
                           const float &theta3, const float &phi3);
    

    4.5 Routine Description

    page under construction

    please send comments to: Yiota Foka


    PATCH GALICE

    Contains the main programs for the standalone FORTRAN version:

    $GALIBAT Batch main program.
    $GALINT Interactive main program.

    These are obsolete.

    PATCH DUMMIES

    Contains dummy routines needed to satisfy all externals. These are called internally from CERNLIB routines.

    PATCH LEGO

    Contains the routines to calculate the material budget maps when the LEGO option is activated by the SXLEGO data card.

    SXLGCY(X,V,R,Z,T)
    Routine to propagate a track to the boundary of a cylinder from the inside. The cylinder is centered in the origin and has the axis along z. Called by SXLGST.

    X(3) Current position
    V(3) Current direction (unnormalised)
    R Radius of the cylinder
    Z half length of the cylinder
    T distance to the boundary

    SXLGIN
    Initialises LEGO calculations. Called by UGINIT.

    SXLGKI
    Generates kinematic for lego calculation. Called by GUKINE.

    SXLGOU
    End of event routine for LEGO option. Called by GUOUT.

    SXLGST
    Step routine for the LEGO option. Called by GUSTEP.

    PATCH MISC

    fpe
    Thanks to W. Metzenthen, 22 Parker St, Ormond, Vic 3163, Australia, This code implements floating point trap for the Linux g77/egcs FORTRAN compilers.

    PATCH GPATCH

    Contains corrections for GEANT 3.21

    CGHPLA
    Precision problem corrected in case of volumes with very disuniform dimensions.

    GGPERP
    Correction in error message.

    GGPPAR
    Modified to support TRD1 in TRD1 with negative parameters.

    GRFILE Modified to support I/O of ZEBRA linear structures.

    GROUT
    Modified to support I/O of ZEBRA linear structures.

    PATCH ROOTIO

    GTREVE
    Modified version of the original GEANT routine. Particles are fetched from the ROOT stack by the routine RXGTRAK and loaded into the JKINE/JVERT structure as track N 1 and vertex N 1. From there on the

    GTRIGI
    Modified version of the original GEANT routine. It calls a RXSTIN to initialise the ROOT stack.

    Routines for Detector Modules

    The routines in the different modules are called nnn_fff, where nnn is the name of the module, which can be:

    ITS, MAG, TPC, TOF, PMD, PHOS, RICH, MUON, FRAME, CASTOR, FMD, HALL, ABSO, SHIL, DIPO, TRD, PIPE

    and fff is:

    nnn_FKEY Definition of the FFREAD data cards specific for a given module.
    nnn_INIT Initialisation routine for a given module.
    nnn_MEDIA Definition of materials and tracking media
    nnn_GEOM Definition of geometry
    nnn_SENS Definition of hits and digit structure
    nnn_DRAW Drawing routine
    nnn_STEP Specific routine called at each step
    nnn_TRKI Routine called at the beginning of each new track
    nnn_TRKE Routine called at the end of each new track
    nnn_DIGT Digitisation routine called at the end of each track
    nnn_DIGE Digitisation routine called after each event
    nnn_EVE Termination routine called after each event
    nnn_END Termination routine called at the end of the run

    When several version of a given module are present, a routine may act as a switchyard, to version-specific routines where the last letter is replaced by a digit. So if there are 2 version of the TPC, the routine TPC_GEOM would just call TPC_GEO0 or TPC_GEO1 according to the version chosen for the run.

    PATCH STEER

    This patch contains the GALICE Steering Routines

    SXACCUT
    Selects the particles from heavy resonances decay that are within the acceptance of the muon chambers (2-9 degrees).

    SXCOLOR
    Defines the color attribute for the different elements of the setup. Only the first seven colors are used to allow the possibility to make drawing with shading. The algorithm assigns the same color to volumes that are filled with the same tracking medium (modulo 6).

    SXCUTS
    Reads the file galice.cuts and sets the cuts for a specific tracking medium. Called by UGINIT.

    SXDIGT
    Digitising and recording of hits after each track. This routine is called from SXTRKE for tracks saved in the JKINE bank after the calls to the nnn_TRKE routines. This routine in turn calls the nnn_DIGT routines for each module, but ONLY in case that the detector spc flag has been selected.

    In the nnn_DIGT routines the detector specific SPC data arrays contained in the _SPC KEEP sequence are filled and written onto the SPC data CWN by a call to HFNTB with the corresponding block name. _SPC should contain the common /SCXSCR/ which serves as a scratch space buffer for all detector raw data. Note that all SPC data consist of INTEGER values. As an example consider the PHOS SPC data structure.

    Note that this code has not yet been developed for all detectors and it implies that the CWN I/O instead that the ROOT I/O is used. CWN output is not supported and will be discontinued soon. When using the ROOT I/O, the digitisation is performed after the simulation in a separate pass with a ROOT macro or a C++ program.

    SXDRAW
    Drawing of the layout of the various detectors. Called from UGINIT. This routine calls the nnn_DRAW routines of the various detectors. In case view banks are used in the nnn_xxxx routines, then the identifiers of these view banks have to be in the module range. Actual drawing (GDRAW, GDSHOW etc...) may only take place in the SuDRAW routines, and the view banks created have to be deleted (GDELET) at the end of the name_DRAW routines.

    SXEDIN
    Initialises the recording of the deposited energy in all volumes. Called by GUKINE.

    SXEDOU
    Updates the statistics for the deposited energy at the end of each event. Called by GUOUT.

    SXEDSU
    Prints the summary of the energy deposited in all volumes. Called by UGLAST.

    SXFMAP
    Routine to read the field map in case the map 2 is chosen. This routine is called by UGINIT and it stores the field map either in the common block SCXMFD for the standalone Galice, or in the class AliMagFCM in the version interfaced with Root.

    SXGEOM
    Defines the geometry of the complete setup. Called from UGINIT. This routine calls the nnn_GEOM routines of the various modules. SXGEOM defines the Alice mother volume, ALIC, which is a rectangular box filled with air containing the various detectors. All the volumes defined by a module should start with the letter specific to the detector to avoid name clashes. Unfortunately this rule has not been followed entirely, and we reserve the possibility to enforce it in a future version of the program.

    SXKEY
    Defines the FFREAD data cards. Called by UGINIT.

    SXMECA(MEC,CHMECA)
    Returns the name of a GEANT interaction mechanism.

    MEC Mechanism code.
    CHMECA (CHARACTER*4) Mechanism name.

    SXMEDIA
    Steers the definition of materials and tracking media for the whole setup. Called by UGINIT. The routines acts as a switchyard calling all the nnn_MEDIA routines for each module. Tracking media identifiers are stored into the IDTMED array in common SCXDB in the appropriate module range. For instance, all tracking media of the TPC are stored in IDTMED(400:499). They do not need to be stored contiguously.

    SXMULO
    Routine to save and restore information that is needed when reading the initialisation structures from disk. Called by UGINIT.

    For a detector complex as Alice the creation of the permanent ZEBRA data structures (DRAW, MATE, PART, ROTM, RUNG, SETS, TMED, VOLU and SCAN) can be quite a long process. This is not disturbing in long production runs, but can hit badly a debug cycle. The structures can be saved on disk and reread, but in the standard version of GEANT the common /GCMULO/ is not saved and restored. This implies that a call to the GPHYSI routine is always needed, which can be very time-consuming. The routine SXMULO save and restores this common together with the arrays IDTMED and IMEDIA in common SCXDB.

    Not to alter the generality of the standard GEANT I/O routines this information is attached as a next bank to the JRUNG bank, that in the original version of GEANT does not have a next bank. Unfortunately the standard I/O routines of GEANT do not read or write linear structures, so we had to introduce modified I/O routines in GPATCH.

    SXOUT
    Termination routine called by GUOUT. It perform various I/O operations under user control.

    SXPART
    Defines additional particles and their decay modes. Called by UGINIT. The particles defined are: OMEGA(783), PHI(1020), D+, D-, D0, ANTI D0 RHO+, RHO- and RHO0 and the related decay modes. This routine has mainly been kept for backward compatibility. GEANT 3.21 decays particles according to phase space, which is not correct for these particles. The decay of heavy particles should be performed via some specialised routine such as the ones found in the LUND MonteCarlo library.

    SXPMAT(IMATE,IPART,MECA)
    Called by UGLAST, it provides material and particle information for phyisics mechanisms in GEANT. Arguments:

    IMATE Material number. 0 means all materials.
    IPART Particle number. 0 means Electron, Positron, Gamma, Pi+, Pi-, Neutron, Proton, Alpha.
    MECHA (CHARACTER*4) the mechanism for which the information is requested. It can be 'LOSS', 'PHOT', 'ANNI', 'COMP', 'MUNU', 'BREM', 'PAIR', 'DRAY', 'PFIS', 'HADT', 'HADG', 'ALL'

    SXPSTA(IPAR)
    Secondary particle statistics called by GUSTEP, UGINIT, UGLAST.

    IPAR Action flag:
    1 initialisation
    2 updating statistics
    3 printout of statistics.

    SXSATS(EDEP,DEDX,RKB,C)
    Apply Birk's saturation law to energy deposition. Called by the user. This routine does practically the same as GBIRK but it returns the parameters used instead the visible energy alone.

    MODE Attenuation mode.
    1 organic scintillator
    2 Liquid (Not yet implemented)
    3 for Gas (Not yet implemented).

    The material is assumed ideal, which means that impurities and aging effects are not taken into account. The algorithm for MODE=1, the only one implemented is:

    EDEP = DESTEP / (1. + RKB*DE/DX +C*(DE/DX)**2)

    The values of MODE, RKB and C can be entered via GSTPAR:

    CALL GSTPAR(IMATE,'BIRK1',VALUE) to set MODE
    CALL GSTPAR(IMATE,'BIRK2',VALUE) to set RKB
    CALL GSTPAR(IMATE,'BIRK3',VALUE) to set C

    The basic units of the coefficient are g/(MeV*cm2) because the DE/DX is expressed in MeV/cm Exp. values from NIM 80 (1970) 239-244 are:

    RKB = 0.013 g/MeV*cm2
    C = 9.6 10-6 g2/(MeV2)(cm4)

    SXSENS
    Steers the definition of the sensitive module elements. Called from UGINIT. This routine calls the nnn_SENS routines of the various modules. The nnn_SENS routines don't have any arguments. The names used in the nnn_SENS routines to define (sets of) sensitive module elements have to start with the pre-defined character as specified for the geometry volumes. Again this use has been lost during evolution of the program and it should probably be reinforced. In case user identifiers (IDTYPE) are used for various module elements (GSDET), these identifiers have to be in the module range.

    SXSMAT(IMAT,NAMATE,A,Z,DENS,RADL,ABSL,UBUF,NWBUF)
    Defines a material. This routine is the same as GSMATE with the difference that the material identifier IMAT is an output parameter. The next free material identifier is returned.

    SXSMIX(IMAT,NAMATE,A,Z,DENS,NLMAT,WMAT)
    Defines a mixture or a compound. This routine is the same as GSMIXT with the difference that the material identifier IMAT is an output parameter. The next free material identifier is returned.

    SXSROT(NMAT,THETA1,PHI1,THETA2,PHI2,THETA3,PHI3)
    Defines a rotation matrix. This routine is the same as GSROTM with the difference that the matrix identifier NMAT is an output parameter. The next free matrix identifier is returned.

    SXSTME(KTMED,NATMED,NMAT,ISVOL,IFIELD,FIELDM,TMAXFD,
    + STEMAX,DEEMAX,EPSIL,STMIN,UBUF,NWBUF)
    Defines a tracking media. This routine is the same as GSTMED GSTMED with the difference that the tracking medium identifier KTMED is an output parameter. The next free matrix identifier is returned.

    SXTRKE
    End statistics after tracking for each track. Called from GUTRAK. This routine calls the nnn_TRKE routines of the various detectors. The nnn_TRKE routines have 1 argument (IFLAG) to denote primary (1) and secondary (2) tracks.

    SXTRKI
    Initialisation before tracking for each track. Called from GUTRAK. This routine calls the nnn_TRKI routines of the various detectors. The nnn_TRKI routines have 1 argument (IFLAG) to denote primary (1) and secondary (2) tracks. Note : The name_TRKI routines are THE location to reset the detector specific hit statistics arrays for a certain track.

    SXWSIM(X,Y,Z,PX,PY,PZ,JTK,IPA,JSTACK)
    Handles track information for pattern recognition development. Called by user.

    X,Y,Z Position of the particle;
    PX,PY,PZ Momentum of the particle;
    JTK Track number;
    IPA Particle code;
    JSTACK Stack number;

    SXZINI
    Initialises the Alice Zebra structure. Called by UGINIT. The Alice Zebra structure contains the scratch space for recording the energy deposition in all volumes, and it depends on the link JLEDEP in common /SCXZLN/.

    PATCH SUCODE

    User Steering Routines

    SUDIGE
    User entry to digitise and record raw data after each event. Called by GUDIGI.

    SUDIGT
    User entry to digitise and record hits after each track. Called by SXDIGT.

    SUDRAW
    User entry to draw detector layout. Called by SXDRAW.

    SUEND
    User entry for a termination routine at end of a run. Called by SXEND.

    SUEVE
    User entry called at the end of each event. Called by SXEVE.

    SUGEOM
    User entry for geometry definition. Called SXGEOM.

    SUINIT
    User entry for initialisation. Called UGINIT.

    SUMEDIA
    User entry for material and tracking media definition. Called by SXMEDIA.

    SUSENS
    User entry for sensitive detector definition. Called by SXSENS.

    SUSTEP
    User entry at each step. Called by GUSTEP.

    SUTRKE
    User entry called at the end of eack track. Called by SXTRKE.

    SUTRKI
    User entry called at the beginning of eack track. Called by SXTRKI.

    PATCH GUCODE

    Description of Geant User Routines

    GUDIGI
    Digitising and recording of raw data after each event. This routine calls the nnn_DIGE routines of the various detectors ONLY in case that detector has been selected for writing out the RAW data. In the nnn_DIGE routines the detector specific RAW data arrays as specified in +KEEP,char_RAW is filled and written onto the RAW data output stream. Here char stands for the detector specific identification character as specified above. The sequence +KEEP,char_RAW however should actually contain the common /SCXSCR/ which serves as a scratch space buffer for all detector raw data. Note that all RAW data consist of INTEGER values. However, the RAW format still has to be defined at the moment.

    GUFLD(VECT,B)
    User routine to return the magnetic field. The field model is controlled by the FFREAD card SXFLD. This routine has a FORTRAN version, selected when the standalone version of GALICE is compiled, and a C++ version to be used with the version of GALICE interfaced with ROOT.

    GUHADR and GUPHAD
    User routines to steer the hadronic package used. If the IHADR flag (FFKEY card or tracking media parameter) is 4, the GEANT FLUKA92 interface is called, while if IHADR is 1 GHEISHA is called.

    GUKINE
    Event generation routine. It is steered by the KINE card. See galice data cards as an example.

    GUOUT
    Termination routine after each event. This routine calls the nnn_EVE routines of the various detectors.

    GUSTEP
    Records possible hits after each step. This routine calls the nnn_STEP routines of the various detectors.

    GUTRAK
    User routine called for each primary track.

    GUTREV
    User routine called for each event.

    UGINIT
    Initialisation at the beginning of a simulation run called from the main program GALICE. This routine calls the nnn_INIT routines of the various modules. For example the initialization of the PHOS is in PHOS_INIT These nnn_INIT routines perform module specific initialisations (if needed) and also specify the content of the module SPC data block in case the SPC data CWN is used. The name of the SPC data block should be the same as the module name (i.e. PHOS, ZDC etc.). As the names of the variables within the SPC data block have to be unique, each variable has to have as the last character the module specific identification number (see before). Each nnn_INIT should to produce a short printout indicating the routine name, so that from the log file of a certain run it can be directly seen which detectors were invoked and correctly initialised.

    UGLAST
    Termination at the end of a simulation run. This routine calls the nnn_END routines of the various detectors. The nnn_END routines don't have any arguments.


    5. Output Format

    page under construction

    please send comments to: Yiota Foka


    There are currently two options for the output format of GALICE:

    The FORTRAN/ZEBRA output format has been kept for backward compatiblity and may be removed in the near future if there are no requests to maintain it. It is described in the galice.cmz file in the DECK FORMAT of the different patches, and the reader is referred to the code for more information.

    The ROOT Object I/O is described together with the rest of the ROOT interface to Galice in the next chapter.



    6. ROOT Interface to Galice

    page under construction

    please send comments to: Yiota Foka


    During 1998 GALICE has been upgraded and modified to provide a simulation tool for the Technical Design Reports. Those upgrades lead to two releases of the package in June 1998 and are detailed elsewhere. Version 2.02 of GALICE is the first version of the package that includes the ROOT interface.

    The main reasons for that were to:

    6.1 The traditional GEANT3.21

    The old galice 1.05 program uses GEANT3.21 in the standard way, with KUIP as the interactive interface and the FFREAD cards to specify at run time the source of primary tracks in one event, to select the detectors taking part in the simulation and to switch on or off the sensitive media of the detectors that produce hits that are written out as PAW ntuples. The user routine UGINIT initializes the package and calls UGEOM that sets up the geometry.
    Logical Diagram of OLD GALICE

    To process an event GUKINE takes an event from the event generator or generates the primary tracks internally, creating the Geant stacks JVERTEX and JKINE. These stacks are too small to contain a full ALICE event, then secondary tracks are added to them as the tracks are followed though the setup and produce secondaries, overflowing at 65K tracks.

    The Geometry of the setup and the Hits in the sensitive parts of the detectors are coded by the users in FORTRAN.

    6.2 The ROOT interface in GALICE

    page under construction

    please send comments to: Yiota Foka


    To move to the Object Oriented world and to be able to handle simulations of the ALICE detectors in an efficient way for the work being done for the Technical Design Reports (TDRs), it was decided to provide GALICE with a ROOT output. This was done in a way almost transparent to the galice users, keeping the KUIP and FFCARDS steering and the definition of the Geometry and Hits with the same user routines in FORTRAN. A future version in which the steering is done within ROOT and the Geometry and Hits can be defined by users in C++ is in preparation.

    The code of this C++ interface is entirely documented here.

    Logical Diagram of NEW GALICE

    The GEANT routines GUKINE, GTREVE and GUSTEP have been modified so that the GEANT engine only follows one particle at a time and the output objects of the kinematics and hits are stored in ROOT Tree structures. The advantage of treating one particle at a time is that even if in one full ALICE event hundred of thousands of particles are followed, the program runs in less than 20 MBytes of memory.

    GUKINE when given an event to simulate, sets up a ROOT stack: fParticles, in which all particles are inserted, which will not overflow and which also keeps all the history of all the particles so that if in a later generation a particle crosses a sensitive detector and the hit is written out, one can know from what type of primary it originates and which processes and in which materials gave rise to it.

    When simulating one event, GUKINE takes one particle at a time and inserts it in the GEANT stack JKINE which is taken by GTREVE and followed through the setup. If in a given tracking step new particles are produced, GUSTEP inserts in the ROOT stack the kinematics of the secondary vertex and all the produced particles which will be fed eventually one by one to the GEANT 3 engine.

    An ALICE class library has been created that contains classes corresponding to the Hits defined for each detector in the Fortran routines.

    The Hits are written out after each track in a ROOT Tree structure TreeH, of the file galice.root. There is one such tree per event. The kinematics of all the particles that produce hits, together with their genealogy up to the primary tracks is stared in the galice.root file in an other tree TreeK of which exists one per event. An additional tree of digits called TreeD is written out at each event. This tree contains information which is relative to the whole event and not track per track, as for instance the energy clusters in the TPC and PHOS. Finally the information of the events in the run is stored in the same file in the tree TreeE, containing the run and event number, the number of vertices, tracks and primary tracks in the event.

    The class AliRun

    Control class for Alice C++ Only one single instance of this class exists. The object is created in main program aliroot and is pointed by the global gAlice.

    Logical Diagram of OLD GALICE

    FORTRAN / C++ Interface routines

    To be able to communicate between the FORTRAN code of GEANT and the ROOT data structure, a number of interface routines have been developed. These are in the source file aliroot.cxx.

    RXSTMG
    C++ step manager dispatcher. This is a direct interface to the AliRun step manager routine. It is called by the default version of GUSTEP and allows the user to handle directly the data structures from C++ instead that via the FORTRAN interface.

    RXAHIT(IDET, MTRACK, NUMBV, HITS)
    Stores a hit in the ROOT structure. This routine is supposed to be called by the nnn_step routines.

    IDET detector number as found in GEANT common block GCSETS.
    MTRACK Number of the track generting the hit. The ROOT stack track number is found in common block SCKINE
    NUMBV Array of voume numbers as found in common block GCSETS.
    HITS Array of user defined hits.

    RXDINI
    Initialises all detectors. This routine is called by UGINIT.

    RXGTRAK (MTRACK, IPART, PMOM, E, VPOS, TOF)
    Fetches next track from the ROOT stack for transport. Called by the modified version of GTREVE.

    MTRACK Track number in the ROOT stack. If MTRACK=0 no more tracks are left in the stack to be transported.
    IPART Particle code in the GEANT conventions.
    PMOM(3) Particle momentum in GeV/c
    E Particle energy in GeV
    VPOS(3) Particle position
    TOF Particle time of flight in seconds

    RXSTRAK (IDONE, IPARENT, IPART, PMOM, VPOS, TOF, CHMECA, NT)
    Fetches next track from the ROOT stack for transport. Called by GUKINE and GUSTEP.

    IDONE Status of the track. If IDONE=0 the track is put on the ROOT stack but it is not fetched for transport.
    IPARENT Parent track. If IPARENT=0 the track is a primary. In GUSTEP the routine is normally called to store secondaries generated by the current track whose ROOT stack number is MTRACK (common SCKINE.
    IPART Particle code in the GEANT conventions.
    PMOM(3) Particle momentum in GeV/c
    VPOS(3) Particle position
    TOF Particle time of flight in seconds
    CHMECA (CHARACTER*10) Particle origin. This field is user defined and it is not used inside the GALICE code.
    NT Number assigned to the particle in the ROOT stack.

    RXSTIN(IRUN,IDEVT)
    Called by GTRIGI at the beginning of each event.

    IRUN Current run number
    IDEVT Current user event number

    RXFILE (CHFILE)
    Opens the ROOT output file. Called by UGINIT.

    CHFILE (CHARACTER*(*)) file name to be opened.

    RXOUTH
    Called by GTREVE at the end of each primary track.

    RXOUTK(IEVENT)
    Called by GUOUT to write out kinematics at the end of the event:

    IEVENT Number of the current event.

    RXFEND
    Called by UGLAST to write out everything and close down.


    7. Magnetic Field

    page under construction

    please send comments to: Yiota Foka


    At the moment there are two magnetic field maps supported.

    Map 1
    This is a constant field map for the L3 magnet and a parametrised dipole field with the following features:

    position field
    z (725,1225) {7*(1-1E-5*(975-z)**2), 0, 0)
    z (-700,700) and sqrt(x**2+(y+30)**2)<560 {0,0,2)
    elsewhere {0,0,0}

    Map 2
    This is a constant field map for the L3 magnet and a field map for the dipole. The data are contained in the file field01.dat in the same directory than the rest of the files.



    8. Version history

    page under construction

    please send comments to: Yiota Foka


    The detailed history of the changes to the fortran code can be found in the CMZ history file. A general description of the modifications including those in the C++ code can be found in the introduction.

    page under construction

    please send comments to: Yiota Foka





    page maintained by : Yiota Foka
    Back to: ALICE home, Offline home