1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
4 <TITLE> cmz code description for GALICE </TITLE>
5 <!-- Changed by: Yiota Foka, 18-Mar-1999 -->
6 <META NAME="rating" CONTENT="General">
7 <META NAME="objecttype" CONTENT="Manual">
8 <META NAME="keywords" CONTENT="
9 software development, oo, object oriented">
10 <META NAME="description" CONTENT="
11 GALICE - Geant3 based Simulation Environment">
12 <META NAME="GENERATOR" CONTENT="
13 Mozilla/3.0Gold (X11; I; HP-UX B.10.20 9000/819) [Netscape]">
16 <STYLE TYPE="text/css">
17 H1 {font-style: italic ; color: green ; font-size: 24pt; align: center}
18 H2 { color: red ; font-size: 22pt }
19 H3 { color: blue ; font-size: 20pt }
20 H4 { color: violet; font-size: 18pt }
21 H5 { color: olive ; font-size: 16pt }
22 H6 { color: maroon; font-size: 14pt }
23 TABLE { font-size: 14pt }
26 <!-- Header material -->
28 <table border=0 cellpadding=5 cellspacing=0 width="100%">
30 <td align=left width=30%>
31 <img alt="Alice" src="gif/Logo.gif" width="60" height="60"
32 align="absmiddle" border=1>
33 <td align=center width=40%>
35 Alice Off-Line Project
37 <td align=right width=30% valign=bottom>
39 <script language="JavaScript">
40 document.write("Last modified "+ document.lastModified)
50 <BODY TEXT="#000000" BGCOLOR="#FFFFFF"
51 LINK="#0000FF" VLINK="#551A8B" ALINK="#FF0000">
53 <!=========================================================================>
58 User Manual and Reference <A HREF="history.html#V2_04">(version 2.05)</A>
61 <!======================================================================>
62 <H3><IMG src=gif/act.gif> page under construction </H3>
64 please send comments to: <A HREF="mailto:Yiota.Foka@cern.ch">Yiota Foka</A>
67 <!======================================================================>
75 <P>The new version of GALICE has assembled in few months to be used for the
76 Technical Design Report exercise. This has left little time to work on
77 documentation. Therefore we invite readers of this page to provide
78 comments, suggestions and complaints to the Simulation Mailing <A
79 HREF="mailto:alice-sim@alice-lb.cern.ch">list</A>.
88 <LI><A HREF="#1">Input Data Cards</A>
90 <LI><A HREF="#1.1">User GEANT control cards</A>
91 <LI><A HREF="#1.2">GALICE specific control cards</A>
94 <LI><A HREF="#2">The Cut File</A>
95 <LI><A HREF="#3">The Lego option</A>
96 <LI><A HREF="#4">Code description</A>
98 <LI><A HREF="#4.1">Content of galice.cmz</A>
99 <LI><A HREF="#4.2">FORTRAN coding Conventions</A>
100 <LI><A HREF="#4.3">Numbering and Names</A>
101 <LI><A HREF="#4.4">Common Block Description</A>
102 <LI><A HREF="#4.5">Routine Description</A>
105 <LI><A HREF="#5">Output Format</A>
106 <LI><A HREF="#6">ROOT Interface to Galice</A>
107 <LI><A HREF="#7">Magnetic Field</A>
108 <LI><A HREF="#8">Version History</A>
113 <A HREF="http://www1.cern.ch/ALICE/welcome.html">ALICE home</A>,
114 <A HREF="http://www1.cern.ch/ALICE/Projects/offline/AliceOffLineHomePage.html">
116 <A HREF="galice.html">
120 <!=========================================================================>
125 <A NAME="1">1. Input Data Cards
129 <!======================================================================>
130 <H3><IMG src=gif/act.gif> page under construction </H3>
132 please send comments to: <A HREF="mailto:Yiota.Foka@cern.ch">Yiota Foka</A>
135 <!======================================================================>
137 <P> The data card file distributed with GALICE contains three categories of
138 <A HREF="http://wwwinfo.cern.ch/asdoc/WWW/ffread/ffmain/ffmain.html">
144 HREF="http://wwwcn.cern.ch/asdoc/geant_html3/node21.html">GEANT control
147 <LI> User <A HREF="http://wwwcn.cern.ch/asdoc/geant_html3/node21.html">GEANT
150 <LI> Generic GALICE cards defined in the routine <A
151 HREF="#SXKEY"><B>SXKEY</B></A>
153 <li> Specific GALICE module cards, described in the single module <A
154 HREF="Welcome.html#Detectors">pages</a>.
158 <H3><FONT COLOR="#FF8050"><A NAME="1.1">1.1 User GEANT control cards</A></FONT></H3>
159 <!======================================================================>
160 <H3><IMG src=gif/act.gif> page under construction </H3>
162 please send comments to: <A HREF="mailto:Yiota.Foka@cern.ch">Yiota Foka</A>
165 <!======================================================================>
167 <DT><KBD><A NAME="KINE">KINE</A></KBD>
169 <DD><P>This is a standard GEANT data card, but the meaning of the different
170 field is defind by the user. The first field is integer and the others floating
171 point. Note that this is a mixed data cards, and it
172 mandatory to input floating point numbers with a decimal point. In
173 GALICE the meaning is the following:
177 KINE 1 x y z theta phi pmom part
180 <DD><P>One particle per trigger, starting from x, y, z with angles theta and
181 phi, momentum pmom and particle type NINT(part). Angles are given in
185 KINE 2 thmin thmax phimin phimax pmin pmax part npart
188 <DD><P>NINT(npart) particles per trigger centered at the interaction point
189 (SXIPXS) with theta, phi and p in the range (thmin,thmax), (phimin,phimax),
190 (pmin,pmax) and particle type NINT(part). Angles are given in degrees.
193 KINE -2 thmin thmax phimin phimax pmean sigma part npart
196 <DD><P>Same as before, but with a gaussian momentum distribution with average
197 pmean and standard deviation sigma. Angles are given in degrees.
200 KINE 3 parmin parmax thmin thmax phimin phimax pmin pmax
203 <DD><P>Source is read from an external file in <A
204 HREF="http://www-subatech.in2p3.fr/Sciences/Theorie/venus/venus.html">VENUS</A>
205 format. Only accept particle with part, theta, phi, pmom in the range
206 (parmin, parmax), (thmin, themax), (phimin, phimax) and (pmin, pmax) where
207 part is the GEANT particle code. Angles are given in degrees. This interface is
208 now obsolete and has been kept for backward compatibility only.
211 KINE 4 thmin thmax phimin phimax pmin pmax npart
214 <DD><P><CODE>NINT(npart)</CODE> source particles are generated per event
215 according to a pt and eta distribution which is parametrised on the SHAKER
216 distribution. Angular and momentum cuts are possible with the same meaning
217 than the previous cards.
220 KINE 5 thmin thmax phimin phimax pmin pmax part
223 <DD><P>One particle of type <code>part</code> is generated per event
224 according to a pt and eta distribution which is parametrised on the <a
225 href="http://www-cdf.fnal.gov/cdf.html">CDF</a> data and <a
226 href="http://www.thep.lu.se/tf2/staff/torbjorn/jetset/">PYTHIA</a>
227 simulation. Code provided by Andreas Morsch (see ALICE notes <a
228 href="http://consult.cern.ch/alice/Internal_Notes/1995/05/abstract">95-05</a>
230 href="http://consult.cern.ch/alice/Internal_Notes/1996/31/abstract">96-31</a>);
231 decay is simulated only in phase space. Only accept particle with theta,
232 phi and pmom in the range (thmin, themax), (phimin, phimax) and (pmin,
233 pmax). Angles are given in degrees. The code of the particles is the
239 <th><code>part</code><th>Particle
251 <H3><FONT COLOR="#FF8050"><A NAME="1.2">1.2 GALICE specific control cards</A></FONT></H3>
257 SXLEGO thmin thmax phimin phimax rmin rmax zmax nthe nphi iflego
260 <DD><P>Activates LEGO option. See below for explanation of this option.
261 GEANTINOS are shot in nthe bins in theta and nphi in phi with the above
262 angular limitations, and statistics on the matter traversed is accumulated
263 per r in the range (rmin,rmax) and z in the range (0, zmax). iflego has to
264 be set to 1 for the card to take effect.
270 <DD><P>First even to be used when reading from file.
274 SXnnn OnOff Gate Version Debug TrackPrint GeomDraw TrackDraw RAW/SPC PAW
277 <DD><P>Steers the simulation of a module. nnn can be any of the currently
278 implemented module names (see above). All values are integers.
281 <P><TABLE BORDER WIDTH=80% ALIGN=CENTRE>
283 <TH>Flag <TH>Explanation
286 <TD>0 the module is absent from the run 1 the module is present in the run
289 <TD>time gate in nanoseconds for the module
292 <TD>version of the geometry. -1 is the default version, whichever is defined in
296 <TD>debug level for a module, can be 0, 1 or 2
299 <TD>print flag for tracks, can be 0 or 1
302 <TD>draw flag for the geometry, can be 0 or 1
305 <TD>draw flag for the tracks, can be 0 or 1
308 <TD>0 do not output raw data and space points 1 output raw data and space points
311 <TD>level of paw output (0,1,2)
314 <P>The meaning of these cards is largely module dependent.
320 <DD><P>Select charge of tracks to be drawn: idraw=100*ineg+10*ineut*ipos, where
321 the track is drawn if the flag of the corresponding charge is 1.
327 <DD><P>Hidden line removal (ihid 0=off, 1=on) for drawings.
331 SXLUN input zebra spc paw draw rdb raw
334 <DD><P>Fortran logical unit numbers.
336 <P><TABLE ALIGN=CENTRE WIDTH=80% BORDER>
338 <TH>Parameter <TH>Explanation
341 <TD>input unit for the event generator file containing the events as column
345 <TD>output unit in zebra format for the /hits
348 <TD>output unit for the raw space points (explained later)
351 <TD>output unit for histograms and other paw objects
354 <TD>output unit for metafile
357 <TD>input/output unit for initialisation data structures in RZ format. If positive
358 the initialisation structures are written to disk, and if negative they are read
362 <TD>logical unit for writing raw data information (not used yet)
369 <DD><P>Workstation type of graphics output. See the <A
370 HREF="http://wwwcn.cern.ch/asdoc/higz/HIGZMAIN.html">HIGZ</A>
371 manual for more information.
377 <DD><P>Sigma in (X,Y,Z) (cm) on interaction point position.
380 <A NAME="SXFLD">SXFLD</A> ISXFLD ISXFMAP SXMAGN SXMGMX
383 <DD><P>Defines the magnetic field to be used:
385 <P><TABLE BORDER WIDTH=80% ALIGN=CENTRE>
387 <TH>Flag <TH>Explanation
390 <TD>Magnetic field transport flag 0=no field, 1=Runge Kutta, 2=helix
393 <TD>Magnetic field map version (see <a href="#7">later</a>)
396 <TD>Scale factor for the magnetic field
399 <TD>Maximum value for the magnetic field
403 <a name="SXHACC">SXHACC</a> isxhacc
406 <DD><P>Selects acceptance of heavy particles decay in muon chambers: when
407 <code>isxhacc</code> is different from zero, Galice keeps only events with
408 both muons in the 2-9 degrees window.
411 <a name="SXTREE">SXTREE</a> chtree
414 <DD><P>Selects the Root trees that are written onto the Root output file. One letter
417 <p><table align=center border=yes>
419 <th> Letter <th> Tree
421 <td> E <td> Event Header Tree
423 <td> K <td> Event Kinematic Tree
425 <td> H <td> Hits Tree
427 <td> D <td> Digits Tree
434 <DD><P>Selects the material of the Alice mother volume (1 vacuum, 0 air).
440 <DD><P>Tracking stops if the radius is larger than SXRMA or the absolute value
441 of z is larger than SXZMA.
445 <P>Module specific control cards can be defined via the <A
446 HREF="#DETMOD">nnn_FKEY</A> routines.
449 <!===================================================================================>
454 <A NAME="2">2. The Cut file
457 <!======================================================================>
458 <H3><IMG src=gif/act.gif> page under construction </H3>
460 please send comments to: <A HREF="mailto:Yiota.Foka@cern.ch">Yiota Foka</A>
463 <!======================================================================>
465 <P>In the simulation of the transport of radiation in matter it is
466 important to be able to change the energy cuts of the different particles
467 and the physic processes
468 for each tracking medium. In GEANT 3.21 this is done by setting the <A
469 HREF="http://wwwcn.cern.ch/asdoc/geant_html3/node68.html">parameters</A>
470 directly in the code. To allow changing these parameters without
471 recompiling, a file, if it exists, is read in at initialisation time, where
472 the energy thresholds and the flags for the different physics processes
473 can be specified for each tracking medium.
475 <P>The format of the file is the following:
478 ITMED GAM ELE NH CH MU EBR MBR EDEL MUDEL MUPA ANNI BREM COMP DRAY
479 LOSS MULS PAIR PHOT RAYL
484 <P><TABLE ALIGN=CENTER BORDER WIDTH=80%>
486 <TH>Field <TH>Meaning
489 <TD>user tracking medium number, i.e. the position in the array
490 <A HREF="#SCXDB">IDTMED</A> where the actual tracking medium number
491 has been returned by the routine <A HREF="#SXSTME">SXSTME</A>.
494 <TD>(REAL) Photon transport threshold
497 <TD>(REAL) Electron/positron transport threshold
500 <TD>(REAL) Neutral hadrons transport threshold
503 <TD>(REAL) Charged hadrons transport threshold
506 <TD>(REAL) Muon transport threshold
509 <TD>(REAL) Electron/positron energy threshold for bremstrahlung production
512 <TD>(REAL) Muon energy threshold for bremstrahlung
515 <TD>(REAL) Electron/positron energy threshold for delta rays production
518 <TD>(REAL) Muon energy threshold for delta rays production
521 <TD>(REAL) Muon energy threshold for direct pair production
524 <TD>(INTEGER) Positron annihilation flag
527 <TD>(INTEGER) Bremstrahlung flag
530 <TD>(INTEGER) Compton scattering flag
533 <TD>(INTEGER) Delta Ray flag
536 <TD>(INTEGER) Energy loss flag
539 <TD>(INTEGER) Multiple scattering flag
542 <TD>(INTEGER) Pair production flag
545 <TD>(INTEGER) Photelectric effect flag
548 <TD>(INTEGER) Rayleigh scattering flag
551 <P>The first 10 paremeters are energy cuts, and should be entered as
552 floating point numbers. Energies are kinetic, and should be entered in GeV.
553 The remaining 9 numbers are integers. A negative value is ignored. The
554 file name is fixed: <B>galice.cuts</B>.
556 <P><EM>Please note</EM>: when reading the initialisation data structure
557 from disk (triggered when the rdb parameter in <A HREF="#SXLUN">SXLUN</A>
558 data card is negative) the galice.cuts file is not read. So any change
559 will remain ineffective. If cuts need to be changed, then the
560 initialisation data structure needs to be recreated.
562 <!===================================================================================>
565 <H2><FONT COLOR=BLUE>
566 <A NAME="3">3. The LEGO Option
569 <!======================================================================>
570 <H3><IMG src=gif/act.gif> page under construction </H3>
572 please send comments to: <A HREF="mailto:Yiota.Foka@cern.ch">Yiota Foka</A>
575 <!======================================================================>
577 <P>This transport option allows to evaluate the material budget from a
578 given radius to the surface of an arbitrary cylinder along radial
579 directions from the centre. When the <A HREF="#SXLEGO"><B>SXLEGO</B></A>
580 data card is specified, the normal event generation and transport cycle is
581 altered. In this case Galice will produce only nthe times nphi
582 events. Each event is composed by a single primary track, a <A
583 HREF="http://wwwcn.cern.ch/asdoc/geant_html3/node72.html">geantino</A>,
584 corresponding to GEANT particle code 48, with unit momentum and angle at
585 regular intervals between phimin and phimax and themin and
588 <P>Geantinos are produced at the origin and then moved at the surface
589 of a cylinder of radius rmin, where they start being transported. If rmin=0
590 geantinos start from the origin. Geantinos are stopped when they reach the
591 surface of a cylinder of radius rmax and half length in z zmax.
593 <P> At the beginning of the job, three double
594 dimensional plots are created with nphi times nthe bins:
596 <P><TABLE WIDTH=50% ALIGN=CENTER>
598 <TD>-100<TD>Radiation length map
600 <TD>-101<TD>Interaction length map
602 <TD>-102<TD>g/cm2 length map
605 <!===================================================================================>
608 <H2><FONT COLOR=BLUE>
609 <A NAME="4">4. Code description
612 <!======================================================================>
613 <H3><IMG src=gif/act.gif> page under construction </H3>
615 please send comments to: <A HREF="mailto:Yiota.Foka@cern.ch">Yiota Foka</A>
618 <!======================================================================>
619 <P>The code of GALICE is composed by two parts. One is a set of FORTRAN routines
620 in the framework of GEANT and the other is a set of C++ routines that constitute
621 the interface with ROOT. The FORTRAN code is contained in a single
622 <A HREF="http://wwwcn.cern.ch/cmz/index.html">cmz</A> file called
623 galice.cmz, while the C++ code is contained in a set of file and headers
624 that are managed by a makefile.
626 <H3><FONT COLOR="#FF8050"><A NAME="4.1">4.1 Content of galice.cmz</A></FONT></H3>
628 <H4><FONT COLOR="#008800">4.1.1 cmz flags</FONT></H4>
632 <TH>ROOTIO<TD> Activates the ROOT interface.
635 <H4><FONT COLOR="#008800"><A NAME="4.1.2">4.1.2 Patches in GALICE</A></FONT></H4>
637 <P>The code is divided in modules, each one describing a part of the
638 experiment. The code relevant to each module is kept in a dedicated cmz
639 directory, called PATCH. Each module is composed by one or more routines,
640 which are called at different times during the execution of the program and
641 perform different actions related to the module. They are contained in
642 dedicated to the module DECKs which compose the corresponding PATCH, as can
643 be seen for the <A HREF="gif/cmzdirectories.gif">TPC</A>.
645 <P>The code contains the following patches:
647 <P><TABLE WIDTH=80% ALIGN=CENTER>
649 <TH ALIGN=LEFT> Patch <TH ALIGN=LEFT>Content
651 <TH ALIGN=LEFT>$VERSION
652 <TD>Standard cmz PATCH containing version control information.
654 <TH ALIGN=LEFT>WRITEUP
655 <TD>Description of the program (this file).
657 <TH ALIGN=LEFT>HISTORY
658 <TD>The modification log.
660 <TH ALIGN=LEFT>$KUMACS
661 <TD>The macros needed to install the program.
664 <TD>Examples of data cards and cut files.
666 <TH ALIGN=LEFT>EXAMPLES
667 <TD>Examples of run decks.
669 <TH ALIGN=LEFT>*GALICE
670 <TD>Pilot patch for the standalone version of GALICE.
672 <TH ALIGN=LEFT>*ALIROOT
673 <TD>Pilot patch for the ROOT I/O version of GALICE.
676 <TD>GEANT common blocks
678 <TH ALIGN=LEFT>GALICE
681 <TH ALIGN=LEFT>GUCODE
682 <TD>GEANT user routines.
685 <TD>Steering routines for GALICE.
688 <TD>Description of the Inner Tracking System
691 <TD>Description of the L3 magnet.
694 <TD>Description of the Time Projection Chamber
697 <TD>Description of the Time Of Flight apparatus
700 <TD>Description of the Photon Multiplicity Detector
703 <TD>Description of the Photon Detector
706 <TD>Description of the HMPID Rich detector
708 <TH ALIGN=LEFT ALIGN=LEFT>MUON
709 <TD>Description of the Muon Chambers in the Muon Arm
712 <TD>Description of the Support Frame for the TPC
714 <TH ALIGN=LEFT>CASTOR
715 <TD>Description of the Castor detector
718 <TD>Description of the Forward Multiplicity Detector
720 <TH ALIGN=LEFT>SUCODE
721 <TD>Dummy user routines
724 <TD>Description of the experimental hall
727 <TD>Description of the Muon Absorber
730 <TD>Description of the Muon Arm Shield
733 <TD>Description of the Dipole Magnet
736 <TD>Description of the Transition Radiation Detector
739 <TD>Description of the Beam Pipe
742 <TD>Routines needed for the LEGO option
745 <TD>Miscellaneous routines
747 <TH ALIGN=LEFT>DUMMIES
750 <TH ALIGN=LEFT>GPATCH
751 <TD>Corrections for GEANT 3.21
753 <TH ALIGN=LEFT>GDEBUG
754 <TD>Debug version of GEANT 3.21 routines
756 <TH ALIGN=LEFT>ROOTIO
757 <TD>Code specific for ROOT I/O
763 <!====================================================================================>
765 <H3><FONT COLOR="#FF8050"><A NAME="4.2">4.2 FORTRAN Coding Conventions</A></FONT></H3>
766 <!======================================================================>
767 <H3><IMG src=gif/act.gif> page under construction </H3>
769 please send comments to: <A HREF="mailto:Yiota.Foka@cern.ch">Yiota Foka</A>
772 <!======================================================================>
774 <P>Some simple coding conventions have been adopted. Only standard ANSI
775 Fortran 77 is accepted with the following Fortran 90 compatible extensions:
777 <LI> Names of SUBROUTINES and VARIABLES with a maximum of 20 characters.</LI>
778 <LI> Names of COMMON blocks with a maximum of 8 characters.</LI>
779 <LI> Use of DO WHILE ... ENDDO structures.</LI>
780 <LI> The use of IMPLICIT NONE.</LI>
783 <P>FORTRAN statements are written in CAPITALS. Comment lines start with a
784 CAPITAL C or * while the rest of the comment line can be written in mixed
785 case. The use of explicit type defintion in combination with <CODE>IMPLICIT
786 NONE</CODE> is recommended but not enforced. In any case variable names
787 should follow the implicit typing of FORTRAN:
789 <P><TABLE ALIGN=CENTER WIDTH=80%>
791 <TH ALIGN=LEFT>Type <TH ALIGN=LEFT>Coding
793 <TH ALIGN=LEFT>INTEGER <TD>Variable name starts with I-N
795 <TH ALIGN=LEFT>REAL <TD>Variable names starts with A-H or O-Z
797 <TH ALIGN=LEFT>CHARACTER <TD>Variable name starts with CH
799 <TH ALIGN=LEFT> LOGICAL <TD>Variable name starts with L
801 <TH ALIGN=LEFT>DOUBLE PRECISION <TD>Variable name starts with D
804 <P>This allows the detector space point data to be directly entered into
805 the SPC data CWN and also the type of routines/functions arguments can be
806 checked directly from the variable names by compiler utilities and/or CMZ.
808 <P> We strongly encourage the users developing code to follow these rules.
812 <!================================================================================>
814 <H3><FONT COLOR="#FF8050"><A NAME="4.3">4.3 Numbering and Names</A></FONT></H3>
815 <!======================================================================>
816 <H3><IMG src=gif/act.gif> page under construction </H3>
818 please send comments to: <A HREF="mailto:Yiota.Foka@cern.ch">Yiota Foka</A>
821 <!======================================================================>
822 <P>Each module has a name, a number and a one letter code:
824 <P><TABLE ALIGN=CENTER WIDTH=80%>
826 <TH ALIGN=LEFT>Description <TH ALIGN=LEFT>Name <TH ALIGN=LEFT>Number <TH ALIGN=LEFT>Code
828 <TH ALIGN=LEFT>Inner Tracking System <TD>ITS <TD>2 <TD>I
830 <TH ALIGN=LEFT>L3 magnet <TD>MAG <TD>3 <TD>M
832 <TH ALIGN=LEFT>Time Projection Chamber <TD>TPC <TD>4 <TD>T
834 <TH ALIGN=LEFT>Time Of Flight apparatus <TD>TOF <TD>5 <TD>F
836 <TH ALIGN=LEFT>Photon Multiplicity Detector <TD>PMD <TD>6 <TD>W
838 <TH ALIGN=LEFT>Photon Detector <TD>PHOS <TD>7 <TD>P
840 <TH ALIGN=LEFT>Zero Degree Calorimeter <TD>ZDC <TD>8 <TD>Z
842 <TH ALIGN=LEFT>Forward Multiplicity Detector <TD>FMD <TD>9 <TD>G
844 <TH ALIGN=LEFT>HMPID Rich detector <TD>RICH <TD>10 <TD>R
846 <TH ALIGN=LEFT>Muon Chambers in the Muon Arm <TD>MUON <TD>11 <TD>C
848 <TH ALIGN=LEFT>Support Frame for the TPC <TD>FRAME <TD>12 <TD>B
850 <TH ALIGN=LEFT>Transition Radiation Detector <TD>TRD <TD>13 <TD>U
852 <TH ALIGN=LEFT>Castor detector <TD>CASTOR <TD>15 <TD>S
854 <TH ALIGN=LEFT>Muon Absorber <TD>ABSO <TD>16 <TD>A
856 <TH ALIGN=LEFT>Muon Arm Shield <TD>SHIL <TD>17 <TD>Y
858 <TH ALIGN=LEFT>Dipole Magnet <TD>DIPO <TD>18 <TD>D
860 <TH ALIGN=LEFT>Experimental hall <TD>HALL <TD>19 <TD>H
862 <TH ALIGN=LEFT>Beam Pipe <TD>PIPE <TD>20 <TD>Q
865 <P>The detector module numbers are contained in PARAMETERs called <VAR>
866 ID_nnn</VAR> in sequence <A HREF="#SCXDB">SCXDB</A>.
868 <P>To each module is assigned a range of integers:
870 <P><CENTER><CODE>ID_nnn*100->ID_nnn*100+99</CODE></CENTER>
872 <P>thad is used throughout the program every time a detector identifier is
873 needed. We will refer to this range as the <EM>module range</EM>. The
874 modules specific letter will be hereon indicated with <I>char</I>.
876 <P>The ROUTINES in the different modules are called <VAR>nnn_fff</VAR>,
877 where <VAR>nnn</VAR> is the name of the module:
878 ITS, MAG, TPC, TOF, PMD, PHOS, RICH, MUON, FRAME, CASTOR, FMD, HALL,
879 ABSO, SHIL, DIPO, TRD, PIPE.
881 <P>When several version of a given module are present, a routine may act as
882 a switchyard, to version-specific routines where the last letter is
883 replaced by a digit. So if there are 2 version of the TPC, the routine
884 TPC_GEOM would just call TPC_GEO0 or TPC_GEO1 according to the version
887 <P>The complete code referring to a certain detector has to be contained in
888 1 patch with the structure:
891 +PATCH,name. Contains the code related to module 'nnn'
892 +DECK,CDES. Contains the private KEEP sequences
893 +DECK,nnn_fff. Contains the code of routine 'nnn_fff'
904 COMMON /S_START/ JCOUNT,MOD_FIRST
907 PARAMETER (MAX6=1000)
908 COMMON /SCXSCR/ NHIT6,IROW6(MAX6),ICOL6(MAX6),IADC6(MAX6)
928 <P>These patches are in the <B>galice.cmz</B> file as described in the <A
929 HREF="#4.1.2"> layout </A> of the galice.cmz file.
931 <P>Any printout message should contain the name of the routine which produced
932 it. The recommended way to produce printouts is the FORTRAN WRITE
933 instruction. The nnn_INIT and nnn_END routines must printout a message with
934 the name of the detector.
936 <P>The dummy SU <A HREF="#SUCODE">routines</A> may be used to test out new
937 component simulation packages. Note that these routines are always called,
938 irrespective of the FFREAD data cards selections.
940 <P>Each module can create private histograms and/or ntuples to investigate
941 its performance. All this HBOOK/PAW activity must be under the control of
942 the flags related to the <A HREF="#SXnnn">SXnnn</A> FFREAD data cards.
944 <P>Examples of actions in the module routines are:
947 <LI>Book the histograms/ntuples in the nnn_INIT routines into the //GALICE
948 HBOOK directory with a unique identifier, e.g.:
950 <P><CENTER>CALL HBOOKN(IDN,'...',...,'//GALICE',...,...)</CENTER>
952 <P>where IDN stands for the HBOOK identifier with the convention:
954 <P><TABLE ALIGN=CENTER>
956 <TH ALIGN=LEFT>IDN <TD> 1000*J+N
958 <TH ALIGN=LEFT>J <TD> detector identification number (0 for steerings)
960 <TH ALIGN=LEFT>N <TD> histogram number (0 <= N <= 99)
965 <TD VALIGN=TOP>Notes:
968 <LI>IDN=999 is reserved for the output SPC data CWN.
969 <LI>IDN=888 is reserved for the input EVTGEN data CWN.
973 <LI>Fill the histograms/ntuples in the nnn_STEP, nnn_TRKE, nnn_EVE routines
974 or whatever is the most convenient.
977 <P>PAW file opening, directory setting and writing out of the ntuples
978 etc... is done by the general steering routines.
982 <!================================================================================>
984 <H3><FONT COLOR="#FF8050"><A NAME="4.4">4.4 Common Block Description</A></FONT></H3>
985 <!======================================================================>
986 <H3><IMG src=gif/act.gif> page under construction </H3>
988 please send comments to: <A HREF="mailto:Yiota.Foka@cern.ch">Yiota Foka</A>
991 <!======================================================================>
992 <P>The COMMONS of the various detectors are called <B>char_uuuuuu</B>,
993 uuuuuu = Left free to the user. An exception on this are the STEERING
994 commons which are called <B>SCXuuuuu</B>
1002 <LI>The KEEP sequence MUST have the same name as the (first)
1003 COMMON in that sequence and the use of BLOCKDATA must be
1004 omitted (all initialisation in name_INIT).
1005 <LI>Executable statements or DATA statements are NOT allowed
1011 <H4><FONT COLOR="#cc5050"><A NAME="SCXIO">SCXIO</A></FONT></H4>
1013 +KEEP,SCXIO.------------------------------------------------------------------------
1014 C --- Common which contains the units for the various I/O streams ---
1015 INTEGER LUNIN,LUNZEB,LUNSPC,LUNPAW,LUNDRW,LUNRDB,LUNRAW
1018 COMMON /SCXIO/ LUNIN,LUNZEB,LUNSPC,LUNPAW,LUNDRW,LUNRDB,LUNRAW
1021 COMMON /SCXIO2/ KEYS(4)
1024 LUNIN Logical input unit for the generator data file in case
1025 IKINE=3 (see card KINE).
1026 LUNZEB Logical input unit for writing ZEBRA data structures.
1027 LUNSPC Logical unit for writing Alice space point Column Wise
1029 LUNPAW Logical unit for PAW Ntuple output
1030 LUNDRW Logical unit for graphic metafil
1031 LUNRDB Logical unit for initial data structure file
1032 NKEYS Number of structures to save every event on LUNZEB
1033 KEYS Name of the structures to save every event on LUNZEB
1036 <H4><FONT COLOR="#cc5050"><A NAME="SCXDB">SCXDB</A></FONT></H4>
1038 +KEEP,SCXDB.------------------------------------------------------------------------
1039 C --- Common which contains debug flags for the various detectors ---
1040 C IDBUGF(J) = Debug level (0,1,2) for detector "J"
1041 C --- Also control flags (JPAWF,JVERF,JOUTF) for each detector added ---
1043 PARAMETER (NDBMAX=20)
1045 INTEGER ID_ITS,ID_MAG,ID_TPC,ID_TOF,ID_PMD,ID_PHOS
1046 $, ID_ZDC,ID_FMD,ID_RICH,ID_STEE,ID_MUON,ID_FRAME,ID_TRD
1047 $, ID_CASTOR,ID_ABSO,ID_SHIL,ID_DIPO,ID_HALL,ID_PIPE
1050 PARAMETER (ID_ALICE=0, ID_ITS=2,ID_MAG=3,ID_TPC=4,ID_TOF=5
1051 $, ID_PMD=6,ID_PHOS=7,ID_ZDC=8,ID_FMD=9,ID_RICH=10
1052 $, ID_MUON=11,ID_FRAME=12,ID_TRD=13,ID_CASTOR=15
1053 $, ID_ABSO=16,ID_SHIL=17,ID_DIPO=18,ID_HALL=19,ID_PIPE=20
1054 $, ID_STEE=NDBMAX+1)
1056 INTEGER IDBUGF,JPAWF,JVERF,JOUTF,IDTMED,ILTMED
1060 PARAMETER (MMEDIA=1000)
1061 COMMON /SCXDB/ IDBUGF(NDBMAX+1),JPAWF(NDBMAX+1),JVERF(NDBMAX+1)
1063 $, IDTMED(100*(NDBMAX+1))
1064 $, ILTMED(2,0:NDBMAX)
1065 $, IMEDIA(MMEDIA),CHNVOL(0:NDBMAX)
1068 IDBUGF Debug flag for all modules (0->2). The storing of the hits
1069 requires a value >0 of this flag.
1070 JPAWF PAW flag for all modules (0->2). This flag triggers
1071 booking and filling of histograms.
1072 JVERF Version chosen for all modules.
1073 JOUTF Raw data (digits) output flag for modules (0, 1).
1074 IDTMED Translation array between tracking media codes and
1076 ILTMED Tracking media id ranges for different modules. The
1077 tracking media identifiers (ID) of module I are such
1078 that ILTMED(1,I)<ID<ILTMED(2,I)
1079 IMEDIA Correspondence between tracking media number and
1080 module identifier. A particle in tracking media II
1081 is in the module whose ID is IMEDIA(II)
1082 CHNVOL Names of the different modules.
1086 <H4><FONT COLOR="#cc5050"><A NAME="SCXFF">SCXFF</A></FONT></H4>
1088 +KEEP,SCXFF.------------------------------------------------------------------------
1089 C --- Common which contains FFREAD stuff for the GALICE package ---
1090 C --- as well as the total processed event counter ---
1091 INTEGER NSXDET,NLUNS,NPARS
1092 $, JDETF,JTRAF,JDRGF,JDRTF,IFDRAT,ISXDCH,JDCHM,JDCHN,JDCHP
1093 $, ISXWKS,ISXVAC,NSXEVT,IFPART,IFVOLU,IFMATE
1094 $, IFTMED,IFVERT,IFKINE,IFSETS,IFHITS,IFDIGI,IFSECS
1095 $, IFXSEC,IFLOSS,ISXEVT,ISXHID,ISXFLD,ISXFMAP
1096 $, ISXITS,ISXMAG,ISXTPC,ISXTOF,ISXPMD,ISXPHOS
1097 $, ISXZDC,ISXFMD,ISXRICH,ISXMUON,ISXFRAME,ISXTRD,ISXCASTOR
1098 $, ISXSTEE,ISXABSO,ISXSHIL,ISXDIPO,ISXHALL,ISXPIPE
1100 REAL SXGATE,SXMAGN,SXIPXS,SXMGMX,SXRMAX,SXZMAX
1102 PARAMETER (NSXDET=20,NLUNS=7,NPARS=9)
1103 COMMON /SCXFF/ JDETF(NSXDET+1),JTRAF(NSXDET+1)
1104 $, JDRGF(NSXDET+1),JDRTF(NSXDET+1),IFDRAT
1105 $, ISXDCH,JDCHM,JDCHN,JDCHP
1107 $, ISXWKS,ISXVAC,NSXEVT
1108 $, IFPART,IFVOLU,IFMATE,IFTMED,IFVERT,IFKINE
1109 $, IFSETS,IFHITS,IFDIGI,IFSECS
1111 $, ISXEVT,SXIPXS(3),ISXHID
1112 $, ISXFLD,ISXFMAP,SXMAGN,SXMGMX
1113 $, ISXITS(NPARS),ISXMAG(NPARS)
1114 $, ISXTPC(NPARS),ISXTOF(NPARS),ISXPMD(NPARS)
1115 $, ISXPHOS(NPARS),ISXZDC(NPARS),ISXFMD(NPARS)
1116 $, ISXRICH(NPARS),ISXMUON(NPARS),ISXFRAME(NPARS)
1117 $, ISXTRD(NPARS),ISXCASTOR(NPARS)
1118 $, ISXABSO(NPARS),ISXSHIL(NPARS),ISXDIPO(NPARS)
1119 $, ISXHALL(NPARS),ISXPIPE(NPARS)
1120 $, ISXSTEE(NPARS),SXRMAX,SXZMAX
1123 JDETF 0 if the module does not exist, 1 otherwise
1124 JTRAF Step by step printing for the module if not 0
1125 JDRGF Draw in the view bank for the module if not 0
1126 JDRTF Store the track points in memory for the module
1128 IFDRAT Not 0 if at least one module is drawn. Then every
1129 event is drawn superinposed to the modules in the view
1131 ISXDCH Charge of particles drawn (100*NEG+10*NEUT+ICHAR,
1132 where NEG, NEUT and ICHAR can be 0 or 1)
1133 JDCHM 1 if negative particles are drawn
1134 JDCHN 1 if neutral particles are drawn
1135 JDCHP 1 if positive particles are drawn
1136 SXGATE Time gate for the each module
1137 ISXWKS Graphics metafile code
1138 ISXVAC If 1 Alice will be filled with vacuum, if 0 with air
1139 NSXEVT Global event counter
1140 IFPART If 1 PART data structure is printed
1141 IFVOLU If 1 VOLU data structure is printed
1142 IFMATE If 1 MATE data structure is printed
1143 IFTMED If 1 TMED data structure is printed
1144 IFVERT If 1 VERT data structure is printed
1145 IFKINE If 1 KINE data structure is printed
1146 IFSETS If 1 SETS data structure is printed
1147 IFHITS If 1 HITS data structure is printed
1148 IFDIGI If 1 DIGI data structure is printed
1149 IFSECS If 1 Secondary statistic is printed
1150 IFXSEC If 1 hadronic cross section is printed
1151 IFLOSS If 1 energy loss information is printed
1152 ISXEVT Start event number when reading from a file
1153 SXIPXS Interaction point
1154 ISXHID If 1 turns on HIDE option for drawing
1155 ISXFLD Magnetic field transport flag 0=no field, 2=helix, 3=Runge Kutta
1156 ISXFMAP Magnetic field map version (1, 2 see <a href="#7">later</a>)
1157 SXMAGN Scale factor for the magnetic field
1158 SXMGMX Maximum value for the magnetic field
1159 ISXITS Input array of flags for ITS
1160 ISXMAG Input array of flags for MAG
1161 ISXTPC Input array of flags for TPC
1162 ISXTOF Input array of flags for TOF
1163 ISXPMD Input array of flags for PMD
1164 ISXPHOS Input array of flags for PHOS
1165 ISXZDC Input array of flags for ZDC
1166 ISXFMD Input array of flags for FMD
1167 ISXRICH Input array of flags for RICH
1168 ISXMUON Input array of flags for MUON
1169 ISXFRAME Input array of flags for FRAME
1170 ISXTRD Input array of flags for TRD
1171 ISXCASTOR Input array of flags for CASTOR
1172 ISXABSO Input array of flags for ABSO
1173 ISXSHIL Input array of flags for SHIL
1174 ISXDIPO Input array of flags for DIPO
1175 ISXHALL Input array of flags for HALL
1176 ISXPIPE Input array of flags for PIPE
1177 ISXSTEE Input array of flags for STEE
1178 SXRMAX Maximum radius for transport
1179 SXZMAX Maximum value of z for transport
1180 ISXHACC Accept heavy particle decays within mu-chambers acceptance
1184 <H4><FONT COLOR="#cc5050"><A NAME="SCXGOE">SCXGEO</A></FONT></H4>
1186 +KEEP,SCXGEO.-----------------------------------------------------------------------
1187 C --- Common which contains some general geometry parameters ---
1190 COMMON /SCXGEO/ DALIC(3)
1193 DALIC Dimension of the Alice mother volume
1197 <H4><FONT COLOR="#cc5050"><A NAME="SCXPAW">SCXPAW</A></FONT></H4>
1199 +KEEP,SCXPAW.-----------------------------------------------------------------------
1200 C --- Common which contains the NTUPLE info for the steerings ---
1206 COMMON /SCXPAW/ VALS1(NVRS1)
1207 COMMON /SCXPW2/ VARS1(NVRS1)
1210 VALS1 Names of the NTUPLE variables for the steering
1211 VARS1 Values of the NTUPLE variables for the steering
1215 <H4><FONT COLOR="#cc5050"><A NAME="SCXPST">SCXPST</A></FONT></H4>
1217 +KEEP,SCXPST.-----------------------------------------------------------------------
1218 C --- Common which contains secondary particle statistics ---
1221 COMMON /SCXPST/ IPCNT(100)
1222 CHARACTER*20 NAME,NAMES
1223 COMMON /SCXPS2/ NAME,NAMES(100)
1229 IPCNT Number of secondaries for each particle species
1230 NAME Temporary storage for the name of the particle
1231 NAMES Names of the particles
1235 <H4><FONT COLOR="#cc5050"><A NAME="SCXEVT">SCXEVT</A></FONT></H4>
1237 +KEEP,SCXEVT.-----------------------------------------------------------------------
1238 C --- Common which contains standard event parameters ---
1239 INTEGER JSXRUN,JSXEVT,JSXNPA,JSXZB,JSXZT,NSXPIN,IPX,IPY,IPZ
1240 REAL RSXIMP,RSXPNU,RSXECM
1242 COMMON /SCXEVT/ JSXRUN,JSXEVT,JSXNPA,JSXZB,JSXZT
1243 $, RSXIMP,RSXPNU,RSXECM,NSXPIN(48)
1261 <H4><FONT COLOR="#cc5050"><A NAME="SCXSCR">SCXSCR</A></FONT></H4>
1263 +KEEP,SCXSCR.-----------------------------------------------------------------------
1264 C --- Common containing scratch space for detector SPC/RAW arrays ---
1267 PARAMETER (NSCR=100000)
1268 COMMON /SCXSCR/ IARR(NSCR)
1272 <H4><FONT COLOR="#cc5050"><A NAME="SLATE">SLATE</A></FONT></H4>
1275 C --- CERNLIB common with additional info for the DATIME package ---
1279 COMMON /SLATE/ ISL(6),DUMMY(34)
1283 <H4><FONT COLOR="#cc5050"><A NAME="QUEST">QUEST</A></FONT></H4>
1286 C --- CERNLIB common for communication with the ZEBRA package ---
1289 COMMON /QUEST/ IQUEST(100)
1293 <H4><FONT COLOR="#cc5050"><A NAME="SCXGEN">SCXGEN</A></FONT></H4>
1296 C --- Common containing event generator data ---
1297 INTEGER NIHMAX,NRHMAX,NRGEN,JRGEN,JTKGEN,NIHEAD,IHEAD,NRHEAD,IPAR
1298 REAL RHEAD,THETA,PHI,PMOM,E
1300 PARAMETER (NIHMAX=12,NRHMAX=6)
1301 COMMON /SCXGEN/ NRGEN,JRGEN,JTKGEN
1302 $, NIHEAD,IHEAD(NIHMAX),NRHEAD,RHEAD(NRHMAX)
1303 $, IPAR,THETA,PHI,PMOM,E
1307 <H4><FONT COLOR="#cc5050"><A NAME="SCXZLN">SCXZLN</A></FONT></H4>
1310 C --- Alice permanent links for ZEBRA banks
1311 INTEGER NALINK, JALINK, JLEDEP
1312 PARAMETER (NALINK=1)
1313 COMMON / SCXZLN / JALINK(NALINK)
1314 EQUIVALENCE (JLEDEP,JALINK(1))
1318 <H4><FONT COLOR="#cc5050"><A NAME="SCKINE">SCKINE</A></FONT></H4>
1320 +KEEP,SCKINE,IF=ROOTIO
1322 COMMON / SCKINE / MTRACK, MPRIMA
1325 C MTRACK Track number in the Root stack
1326 C MPRIMA Number of primaries generated
1327 C CHTREE Root trees to be created in memory
1331 <H4><FONT COLOR="#cc5050"><A NAME="SCXMFD">SCXMFD</A></FONT></H4>
1333 +KEEP,SCXMFD,IF=-ROOTIO.
1334 C --- Common containing magnetic field map data
1335 REAL DZ,DX,DY,UDX,UDY,UDZ
1336 $,XMBEG,YMBEG,ZMBEG,XMEND,YMEND,ZMEND
1340 PARAMETER(MAXFLD=250000)
1341 COMMON /SCXMFD/ NX,NY,NZ,DZ,DX,DY,UDX,UDY,UDZ
1342 $,XMBEG,YMBEG,ZMBEG,XMEND,YMEND,ZMEND
1345 C NX, NY, NZ Number of map points
1346 C DX, DY, DZ Map cell side
1347 C XMBEG, XMEND Map extension in X
1348 C YMBEG, YMEND Map extension in Y
1349 C ZMBEG, ZMEND Map extension in Z
1350 C BV Array of field values (BX,BY,BZ)(IX,IY,IZ)
1355 <H4><FONT COLOR="#cc5050"><A NAME="SCXLEGO">SCXLEGO</A></FONT></H4>
1358 C --- LEGO option for calculating material traversed
1360 C THEMIN Minimum generation theta
1361 C THEMAX Maximum generation theta
1362 C PHIMIN Minimum generation phi
1363 C PHIMAX Maximum generation phi
1364 C RLMIN Generation radius
1365 C RLMAX Maximum tracking radius
1366 C ZLMAX Maximum tracking Z
1367 C NLTHE Number of bins in Theta
1368 C NLPHI Numner of bins in Phi
1370 C ICTHE Current theta bin
1371 C ICPHI Current phi bin
1372 C CURTHE Current theta of track
1373 C CURPHI Current phi of track
1374 C TOTRADL Total Radiation length
1375 C TOTABSO Total absorption length
1376 C TOTGCM2 Total G/CM2 traversed
1378 COMMON / SCXLEGO / THEMIN, THEMAX, PHIMIN, PHIMAX, RLMIN, RLMAX,
1379 $ZLMAX, NLTHE, NLPHI, IFLEGO, ICTHE, ICPHI, TOTRADL, TOTABSO,
1380 $TOTGCM2, CURPHI, CURTHE
1384 <H4><FONT COLOR="#cc5050"><A NAME="SCCPROTO">SCCPROTO</A></FONT></H4>
1386 +KEEP,SCCPROTO,IF=ROOTIO
1388 // Prototypes for Galice
1391 #define sxsrot SXSROT
1392 #define type_of_call _stdcall
1394 #define sxsrot sxsrot_
1395 #define type_of_call
1398 extern "C" void type_of_call
1399 sxsrot(int &nmat, const float &theta1, const float &phi1,
1400 const float &theta2, const float &phi2,
1401 const float &theta3, const float &phi3);
1406 <!================================================================================>
1408 <H3><A NAME="4.5">4.5 Routine Description</A></H3>
1409 <!======================================================================>
1410 <H3><IMG src=gif/act.gif> page under construction </H3>
1412 please send comments to: <A HREF="mailto:Yiota.Foka@cern.ch">Yiota Foka</A>
1415 <!======================================================================>
1416 <H4><A NAME="GALICE">PATCH GALICE</A></H4>
1417 <P>Contains the main programs for the standalone FORTRAN version:
1421 <TH ALIGN=LEFT>$GALIBAT <TD> Batch main program.
1423 <TH ALIGN=LEFT>$GALINT <TD> Interactive main program.
1426 <P>These are obsolete.
1428 <H4><A NAME="DUMMIES">PATCH DUMMIES</A></H4>
1429 <P>Contains dummy routines needed to satisfy all externals. These are called
1430 internally from CERNLIB routines.
1432 <H4><A NAME="LEGO">PATCH LEGO</A></H4>
1433 <P>Contains the routines to calculate the material budget maps when the
1434 <A HREF="#3">LEGO</A> option is activated by the <A HREF="#SXLEGO">SXLEGO</A>
1438 <P><DT><A NAME="SXLGCY"><B>SXLGCY(X,V,R,Z,T)</B></A>
1439 <DD>Routine to propagate a track to the boundary of a cylinder from the
1440 inside. The cylinder is centered in the origin and has the axis along z.
1446 <TD>Current position
1449 <TD>Current direction (unnormalised)
1452 <TD>Radius of the cylinder
1455 <TD>half length of the cylinder
1458 <TD>distance to the boundary
1461 <P><DT><A NAME="SXLGIN"><B>SXLGIN</B></A>
1462 <DD>Initialises LEGO calculations. Called by UGINIT.
1464 <P><DT><A NAME="SXLGKI"><B>SXLGKI</B></A>
1465 <DD>Generates kinematic for lego calculation. Called by GUKINE.
1467 <P><DT><A NAME="SXLGOU"><B>SXLGOU</B></A>
1468 <DD>End of event routine for LEGO option. Called by GUOUT.
1470 <P><DT><A NAME="SXLGST"><B>SXLGST</B></A>
1471 <DD>Step routine for the LEGO option. Called by GUSTEP.
1474 <H4><A NAME="MISC">PATCH MISC</A></H4>
1476 <DT><A NAME="fpe"><B>fpe</B></A>
1477 <DD>Thanks to <A HREF="mailto:billm@suburbia.net"> W. Metzenthen</A>, 22
1478 Parker St, Ormond, Vic 3163, Australia, This code implements floating point
1479 trap for the Linux g77/egcs FORTRAN compilers.
1482 <H4><A NAME="GPATCH">PATCH GPATCH</A></H4>
1483 <P>Contains corrections for GEANT 3.21
1486 <P><DT><A NAME="CGHPLA"><B>CGHPLA</B></A>
1487 <DD>Precision problem corrected in case of volumes with very disuniform
1490 <P><DT><A NAME="GGPERP"><B>GGPERP</B></A>
1491 <DD>Correction in error message.
1493 <P><DT><A NAME="GGPPAR"><B>GGPPAR</B></A>
1494 <DD>Modified to support TRD1 in TRD1 with negative parameters.
1496 <P><DT><A NAME="GRFILE"><B>GRFILE</B></A>
1497 Modified to support I/O of ZEBRA linear structures.
1499 <P><DT><A NAME="GROUT"><B>GROUT</B></A>
1500 <DD>Modified to support I/O of ZEBRA linear structures.
1503 <H4><A NAME="ROOTIO">PATCH ROOTIO</A></H4>
1506 <P><DT><A NAME="GTREVE"><B>GTREVE</B></A>
1507 <DD>Modified version of the original GEANT routine. Particles are fetched from
1508 the ROOT stack by the routine RXGTRAK and loaded into the JKINE/JVERT
1509 structure as track N 1 and vertex N 1. From there on the
1511 <P><DT><A NAME="GTRIGI"><B>GTRIGI</B></A>
1512 <DD>Modified version of the original GEANT routine. It calls a RXSTIN to
1513 initialise the ROOT stack.
1516 <H4><A NAME="DETMOD">Routines for Detector Modules</A></H4>
1518 The routines in the different modules are called nnn_fff, where nnn is
1519 the name of the module, which can be:
1522 ITS, MAG, TPC, TOF, PMD, PHOS, RICH, MUON, FRAME, CASTOR, FMD, HALL,
1523 ABSO, SHIL, DIPO, TRD, PIPE</CENTER>
1527 <P><TABLE ALIGN=CENTER WIDTH=80%>
1529 <TH ALIGN=LEFT>nnn_FKEY
1530 <TD>Definition of the FFREAD data cards specific for a given module.
1532 <TH ALIGN=LEFT>nnn_INIT
1533 <TD>Initialisation routine for a given module.
1535 <TH ALIGN=LEFT>nnn_MEDIA
1536 <TD> Definition of materials and tracking media
1538 <TH ALIGN=LEFT>nnn_GEOM
1539 <TD> Definition of geometry
1541 <TH ALIGN=LEFT>nnn_SENS
1542 <TD> Definition of hits and digit structure
1544 <TH ALIGN=LEFT>nnn_DRAW
1545 <TD> Drawing routine
1547 <TH ALIGN=LEFT>nnn_STEP
1548 <TD> Specific routine called at each step
1550 <TH ALIGN=LEFT>nnn_TRKI
1551 <TD> Routine called at the beginning of each new track
1553 <TH ALIGN=LEFT>nnn_TRKE
1554 <TD> Routine called at the end of each new track
1556 <TH ALIGN=LEFT>nnn_DIGT
1557 <TD> Digitisation routine called at the end of each track
1559 <TH ALIGN=LEFT>nnn_DIGE
1560 <TD> Digitisation routine called after each event
1562 <TH ALIGN=LEFT>nnn_EVE
1563 <TD> Termination routine called after each event
1565 <TH ALIGN=LEFT>nnn_END
1566 <TD> Termination routine called at the end of the run
1569 <P>When several version of a given module are present, a routine may act as
1570 a switchyard, to version-specific routines where the last letter is
1571 replaced by a digit. So if there are 2 version of the TPC, the routine
1572 TPC_GEOM would just call TPC_GEO0 or TPC_GEO1 according to the version
1575 <H4><A NAME="STEER">PATCH STEER</A></H4>
1576 <P>This patch contains the GALICE Steering Routines
1579 <P><DT><A NAME="SXACCUT"><B>SXACCUT</B></A>
1580 <DD>Selects the particles from heavy resonances decay that are within
1581 the acceptance of the muon chambers (2-9 degrees).
1583 <P><DT><A NAME="SXCOLOR"><B>SXCOLOR</B></A>
1584 <DD>Defines the color attribute for the different elements of the setup. Only
1585 the first seven colors are used to allow the possibility to make drawing
1586 with shading. The algorithm assigns the same color to volumes that are
1587 filled with the same tracking medium (modulo 6).
1589 <P><DT><A NAME="SXCUTS"><B>SXCUTS</B></A>
1590 <DD>Reads the file <A HREF="#2"><B>galice.cuts</B></A> and sets the cuts
1591 for a specific tracking medium. Called by UGINIT.
1593 <P><DT><A NAME="SXDIGT"><B>SXDIGT</B></A>
1594 <DD>Digitising and recording of hits after each track. This routine is
1595 called from SXTRKE for tracks saved in the JKINE bank after the calls to
1596 the nnn_TRKE routines. This routine in turn calls the nnn_DIGT routines for
1597 each module, but ONLY in case that the detector <A HREF="#SXLUN">spc</A>
1598 flag has been selected.
1600 <P>In the nnn_DIGT routines the detector specific SPC data arrays contained
1601 in the <char>_SPC KEEP sequence are filled and written onto the SPC data
1602 CWN by a call to HFNTB with the corresponding block name. <char>_SPC should
1603 contain the common /SCXSCR/ which serves as a scratch space buffer for all
1604 detector raw data. Note that all SPC data consist of INTEGER values. As an
1605 example consider the PHOS SPC data structure.
1607 <P><EM><FONT COLOR="RED">Note that this code has not yet been developed for
1608 all detectors and it implies that the CWN I/O instead that the ROOT I/O is
1609 used. CWN output is not supported and will be discontinued soon. When
1610 using the ROOT I/O, the digitisation is performed after the simulation in a
1611 separate pass with a ROOT macro or a C++ program.</FONT></EM>
1613 <P><DT><A NAME="SXDRAW"><B>SXDRAW</B></A>
1614 <DD>Drawing of the layout of the various detectors. Called from UGINIT.
1615 This routine calls the nnn_DRAW routines of the various detectors. In case
1616 view banks are used in the nnn_xxxx routines, then the identifiers of these
1617 view banks have to be in the module range. Actual drawing (GDRAW, GDSHOW
1618 etc...) may only take place in the SuDRAW routines, and the view banks
1619 created have to be deleted (GDELET) at the end of the name_DRAW routines.
1621 <P><DT><A NAME="SXEDIN"><B>SXEDIN</B></A>
1622 <DD>Initialises the recording of the deposited energy in all
1623 volumes. Called by GUKINE.
1625 <P><DT><A NAME="SXEDOU"><B>SXEDOU</B></A>
1626 <DD>Updates the statistics for the deposited energy at the end of each
1627 event. Called by GUOUT.
1629 <P><DT><A NAME="SXEDSU"><B>SXEDSU</B></A>
1630 <DD>Prints the summary of the energy deposited in all volumes. Called by
1633 <P><DT><A NAME="SXFMAP"><B>SXFMAP</B></A>
1634 <DD>Routine to read the field map in case the map 2 is chosen. This
1635 routine is called by <a href="#UGINIT">UGINIT</a> and it stores the
1636 field map either in the common block <a href="#SCXMFD">SCXMFD</a>
1637 for the standalone Galice, or in the class AliMagFCM in the
1638 version interfaced with Root.
1640 <P><DT><A NAME="SXGEOM"><B>SXGEOM</B></A>
1641 <DD>Defines the geometry of the complete setup. Called from UGINIT. This
1642 routine calls the nnn_GEOM routines of the various modules. SXGEOM defines
1643 the Alice mother volume, ALIC, which is a rectangular box filled with air
1644 containing the various detectors. All the volumes defined by a module
1645 should start with the letter specific to the detector to avoid name
1646 clashes. Unfortunately this rule has not been followed entirely, and we
1647 reserve the possibility to enforce it in a future version of the program.
1649 <P><DT><A NAME="SXKEY"><B>SXKEY</B></A>
1651 HREF="http://wwwcn.cern.ch/asdoc/WWW/ffread/ffmain/ffmain.html">FFREAD</A>
1652 data cards. Called by UGINIT.
1654 <P><DT><A NAME="SXMECA"><B>SXMECA(MEC,CHMECA)</B></A>
1655 <DD>Returns the name of a GEANT interaction mechanism.
1657 <P><TABLE WIDTH=80%>
1662 <TH ALIGN=LEFT>CHMECA
1663 <TD>(CHARACTER*4) Mechanism name.
1667 <P><DT><A NAME="SXMEDIA"><B>SXMEDIA</B></A>
1668 <DD>Steers the definition of materials and tracking media for the whole
1669 setup. Called by UGINIT. The routines acts as a switchyard calling all
1670 the nnn_MEDIA routines for each module. Tracking media identifiers are
1671 stored into the IDTMED array in common <A HREF="#SCXDB">SCXDB</A>
1673 appropriate module range. For instance, all tracking media of the TPC
1674 are stored in IDTMED(400:499). They do not need to be stored contiguously.
1676 <P><DT><A NAME="SXMULO"><B>SXMULO</B></A>
1677 <DD>Routine to save and restore information that is needed when reading the
1678 initialisation structures from disk. Called by UGINIT.
1680 <P>For a detector complex as Alice the creation of the permanent ZEBRA data
1681 structures (DRAW, MATE, PART, ROTM, RUNG, SETS, TMED, VOLU and SCAN) can be
1682 quite a long process. This is not disturbing in long production runs, but
1683 can hit badly a debug cycle. The structures can be saved on disk and
1684 reread, but in the standard version of GEANT the common /GCMULO/ is not
1685 saved and restored. This implies that a call to the GPHYSI routine is
1686 always needed, which can be very time-consuming. The routine SXMULO save
1687 and restores this common together with the arrays IDTMED and IMEDIA in
1688 common <A HREF="#SCXDB"> SCXDB</A>.
1690 <P>Not to alter the generality of the standard GEANT I/O routines this
1691 information is attached as a next bank to the JRUNG bank, that in the
1692 original version of GEANT does not have a next bank. Unfortunately the
1693 standard I/O routines of GEANT do not read or write linear structures, so
1694 we had to introduce modified I/O routines in <A HREF="#GPATCH">GPATCH</A>.
1696 <P><DT><A NAME="SXOUT"><B>SXOUT</B></A>
1697 <DD>Termination routine called by GUOUT. It perform various I/O operations
1700 <P><DT><A NAME="SXPART"><B>SXPART</B></A>
1701 <DD>Defines additional particles and their decay modes. Called by
1702 UGINIT. The particles defined are: OMEGA(783), PHI(1020), D+, D-, D0, ANTI
1703 D0 RHO+, RHO- and RHO0 and the related decay modes. This routine has mainly
1704 been kept for backward compatibility. GEANT 3.21 decays particles according
1705 to phase space, which is not correct for these particles. The decay of
1706 heavy particles should be performed via some specialised routine such as
1707 the ones found in the LUND MonteCarlo library.
1709 <P><DT><A NAME="SXPMAT"><B>SXPMAT(IMATE,IPART,MECA)</B></A>
1710 <DD>Called by UGLAST, it provides material and particle information for
1711 phyisics mechanisms in GEANT. Arguments:
1713 <P><TABLE WIDTH=80%>
1715 <TH ALIGN=LEFT>IMATE
1716 <TD>Material number. 0 means all materials.
1718 <TH ALIGN=LEFT VALIGN=TOP>IPART
1719 <TD>Particle number. 0 means Electron, Positron, Gamma,
1720 Pi+, Pi-, Neutron, Proton, Alpha.
1722 <TH ALIGN=LEFT VALIGN=TOP>MECHA
1723 <TD>(CHARACTER*4) the mechanism for which the information is
1724 requested. It can be 'LOSS', 'PHOT', 'ANNI', 'COMP',
1725 'MUNU', 'BREM', 'PAIR', 'DRAY', 'PFIS', 'HADT', 'HADG',
1730 <P><DT><A NAME="SXPSTA"><B>SXPSTA(IPAR)</B></A>
1731 <DD>Secondary particle statistics called by GUSTEP, UGINIT, UGLAST.
1733 <P><TABLE WIDTH=60%>
1735 <TH ALIGN=LEFT VALIGN=TOP>IPAR
1736 <TD VALIGN=TOP>Action flag:
1744 <TD>updating statistics
1747 <TD>printout of statistics.
1752 <P><DT><A NAME="SXSATS"><B>SXSATS(EDEP,DEDX,RKB,C)</B></A>
1753 <DD>Apply Birk's saturation law to energy deposition. Called by the
1754 user. This routine does practically the same as GBIRK but it returns the
1755 parameters used instead the visible energy alone.
1757 <P><TABLE WIDTH=80%>
1759 <TH ALIGN=LEFT VALIGN=TOP>MODE
1760 <TD VALIGN=TOP> Attenuation mode.
1761 <TD VALIGN=TOP><TABLE>
1762 <TR><TD>1 <TD>organic scintillator
1763 <TR><TD>2 <TD>Liquid (Not yet implemented)
1764 <TR><TD>3 <TD>for Gas (Not yet implemented).
1768 <P>The material is assumed ideal, which means that impurities and aging
1769 effects are not taken into account. The algorithm for MODE=1, the only one
1772 <P><CENTER>EDEP = DESTEP / (1. + RKB*DE/DX +C*(DE/DX)**2)</CENTER>
1774 <P>The values of MODE, RKB and C can be entered via
1775 <A HREF="http://wwwcn.cern.ch/asdoc/geant_html3/node71.html">GSTPAR</A>:
1777 <P><CODE>CALL GSTPAR(IMATE,'BIRK1',VALUE)</CODE> to set MODE
1778 <BR><CODE>CALL GSTPAR(IMATE,'BIRK2',VALUE)</CODE> to set RKB
1779 <BR><CODE>CALL GSTPAR(IMATE,'BIRK3',VALUE)</CODE> to set C
1781 <P>The basic units of the coefficient are g/(MeV*cm<SUP>2</SUP>) because the DE/DX
1782 is expressed in MeV/cm Exp. values from NIM 80 (1970) 239-244 are:
1785 <P>RKB = 0.013 g/MeV*cm<SUP>2</SUB>
1786 <BR>C = 9.6 10<SUP>-6</SUP> g<SUP>2</SUP>/(MeV<SUP>2</SUP>)(cm<SUP>4</SUP>)
1788 <P><DT><A NAME="SXSENS"><B>SXSENS</B></A>
1789 <DD>Steers the definition of the sensitive module elements. Called from
1790 UGINIT. This routine calls the nnn_SENS routines of the various modules.
1791 The nnn_SENS routines don't have any arguments. The names used in the
1792 nnn_SENS routines to define (sets of) sensitive module elements have to
1793 start with the pre-defined character as specified for the geometry
1794 volumes. Again this use has been lost during evolution of the program and
1795 it should probably be reinforced. In case user identifiers (IDTYPE) are
1796 used for various module elements (GSDET), these identifiers have to
1797 be in the module range.
1799 <P><DT><A NAME="SXSMAT"><B>SXSMAT(IMAT,NAMATE,A,Z,DENS,RADL,ABSL,UBUF,NWBUF)</B></A>
1800 <DD>Defines a material. This routine is the same as
1801 <A HREF="http://wwwcn.cern.ch/asdoc/geant_html3/node50.html">GSMATE</A>
1803 that the material identifier IMAT is an output parameter. The next free
1804 material identifier is returned.
1806 <P><DT><A NAME="SXSMIX"><B>SXSMIX(IMAT,NAMATE,A,Z,DENS,NLMAT,WMAT)</B></A>
1807 <DD>Defines a mixture or a compound. This routine is the same as
1808 <A HREF="http://wwwcn.cern.ch/asdoc/geant/H2GEANTCONS110.html">GSMIXT</A>
1810 that the material identifier IMAT is an output parameter. The next free
1811 material identifier is returned.
1813 <P><DT><A NAME="SXSROT"><B>SXSROT(NMAT,THETA1,PHI1,THETA2,PHI2,THETA3,PHI3)</B></A>
1814 <DD>Defines a rotation matrix. This routine is the same as
1815 <A HREF="http://wwwcn.cern.ch/asdoc/geant_html3/node118.html"> GSROTM </A>
1817 that the matrix identifier NMAT is an output parameter. The next free
1818 matrix identifier is returned.
1820 <P><DT><A NAME="SXSTME"><B>
1821 SXSTME(KTMED,NATMED,NMAT,ISVOL,IFIELD,FIELDM,TMAXFD,
1822 <BR> + STEMAX,DEEMAX,EPSIL,STMIN,UBUF,NWBUF)
1824 <DD>Defines a tracking media. This routine is the same as GSTMED
1825 <A HREF="<http://wwwcn.cern.ch/asdoc/geant/H2GEANTCONS200.html#GSTMED">
1828 difference that the tracking medium identifier KTMED is an output
1829 parameter. The next free matrix identifier is returned.
1831 <P><DT><A NAME="SXTRKE"><B>SXTRKE</B></A>
1832 <DD>End statistics after tracking for each track. Called from GUTRAK. This
1833 routine calls the nnn_TRKE routines of the various detectors. The
1834 nnn_TRKE routines have 1 argument (IFLAG) to denote primary (1) and
1835 secondary (2) tracks.
1837 <P><DT><A NAME="SXTRKI"><B>SXTRKI</B></A>
1838 <DD>Initialisation before tracking for each track. Called from GUTRAK. This
1839 routine calls the nnn_TRKI routines of the various detectors. The
1840 nnn_TRKI routines have 1 argument (IFLAG) to denote primary (1) and
1841 secondary (2) tracks. Note : The name_TRKI routines are THE location to
1842 reset the detector specific hit statistics arrays for a certain track.
1844 <P><DT><A NAME="SXWSIM"><B>SXWSIM(X,Y,Z,PX,PY,PZ,JTK,IPA,JSTACK)</B></A>
1845 <DD>Handles track information for pattern recognition development. Called by
1848 <P><TABLE WIDTH=80%>
1850 <TH ALIGN=LEFT>X,Y,Z<TD> Position of the particle;
1852 <TH ALIGN=LEFT>PX,PY,PZ<TD> Momentum of the particle;
1854 <TH ALIGN=LEFT>JTK<TD> Track number;
1856 <TH ALIGN=LEFT>IPA<TD> Particle code;
1858 <TH ALIGN=LEFT>JSTACK<TD> Stack number;
1861 <P><DT><A NAME="SXZINI"><B>SXZINI</B></A>
1862 <DD>Initialises the Alice Zebra structure. Called by UGINIT. The Alice Zebra
1863 structure contains the scratch space for recording the energy deposition
1864 in all volumes, and it depends on the link JLEDEP in common /SCXZLN/.
1867 <H4><A NAME="SUCODE">PATCH SUCODE</A></H4>
1868 <P>User Steering Routines
1871 <P><DT><A NAME="SUDIGE"><B>SUDIGE</B></A>
1872 <DD>User entry to digitise and record raw data after each event. Called by
1875 <P><DT><A NAME="SUDIGT"><B>SUDIGT</B></A>
1876 <DD>User entry to digitise and record hits after each track. Called by SXDIGT.
1878 <P><DT><A NAME="SUDRAW"><B>SUDRAW</B></A>
1879 <DD>User entry to draw detector layout. Called by SXDRAW.
1881 <P><DT><A NAME="SUEND"><B>SUEND</B></A>
1882 <DD>User entry for a termination routine at end of a run. Called by SXEND.
1884 <P><DT><A NAME="SUEVE"><B>SUEVE</B></A>
1885 <DD>User entry called at the end of each event. Called by SXEVE.
1887 <P><DT><A NAME="SUGEOM"><B>SUGEOM</B></A>
1888 <DD>User entry for geometry definition. Called SXGEOM.
1890 <P><DT><A NAME="SUINIT"><B>SUINIT</B></A>
1891 <DD>User entry for initialisation. Called UGINIT.
1893 <P><DT><A NAME="SUMEDIA"><B>SUMEDIA</B></A>
1894 <DD>User entry for material and tracking media definition. Called by SXMEDIA.
1896 <P><DT><A NAME="SUSENS"><B>SUSENS</B></A>
1897 <DD>User entry for sensitive detector definition. Called by SXSENS.
1899 <P><DT><A NAME="SUSTEP"><B>SUSTEP</B></A>
1900 <DD>User entry at each step. Called by GUSTEP.
1902 <P><DT><A NAME="SUTRKE"><B>SUTRKE</B></A>
1903 <DD>User entry called at the end of eack track. Called by SXTRKE.
1905 <P><DT><A NAME="SUTRKI"><B>SUTRKI</B></A>
1906 <DD>User entry called at the beginning of eack track. Called by SXTRKI.
1910 <H4><A NAME="GUCODE">PATCH GUCODE</A></H4>
1911 <P>Description of Geant User Routines
1914 <P><DT><A NAME="GUDIGI"><B>GUDIGI</B></A>
1915 <DD>Digitising and recording of raw data after each event. This routine calls
1916 the nnn_DIGE routines of the various detectors ONLY in case that detector
1917 has been selected for writing out the RAW data. In the nnn_DIGE routines
1918 the detector specific RAW data arrays as specified in +KEEP,char_RAW is
1919 filled and written onto the RAW data output stream. Here char stands for
1920 the detector specific identification character as specified above. The
1921 sequence +KEEP,char_RAW however should actually contain the common /SCXSCR/
1922 which serves as a scratch space buffer for all detector raw data. Note
1923 that all RAW data consist of INTEGER values. However, the RAW format still
1924 has to be defined at the moment.
1926 <P><DT><A NAME="GUFLD"><B>GUFLD(VECT,B)</B></A>
1927 <DD>User routine to return the magnetic field. The field model is controlled
1928 by the FFREAD card <A HREF="#SXFLD">SXFLD</A>. This routine has a FORTRAN
1929 version, selected when the standalone version of GALICE is compiled, and a
1930 C++ version to be used with the version of GALICE interfaced with ROOT.
1933 <P><DT><A NAME="GUPHAD"></A><A NAME="GUHADR"><B>GUHADR and GUPHAD</B></A>
1934 <DD>User routines to steer the hadronic package used. If the IHADR flag (FFKEY
1935 card or tracking media parameter) is 4, the GEANT FLUKA92 interface is
1936 called, while if IHADR is 1 GHEISHA is called.
1938 <P><DT><A NAME="GUKINE"><B>GUKINE</B></A>
1939 <DD>Event generation routine. It is steered by the <A HREF="#KINE">KINE</A> card.
1940 See <A HREF="gif/galice1cards.gif">galice data cards</A> as an example.
1942 <P><DT><A NAME="GUOUT"><B>GUOUT</B></A>
1943 <DD>Termination routine after each event. This routine calls the nnn_EVE
1944 routines of the various detectors.
1946 <P><DT><A NAME="GUSTEP"><B>GUSTEP</B></A>
1947 <DD>Records possible hits after each step. This routine calls the nnn_STEP
1948 routines of the various detectors.
1950 <P><DT><A NAME="GUTRAK"><B>GUTRAK</B></A>
1951 <DD>User routine called for each primary track.
1953 <P><DT><A NAME="GUTREV"><B>GUTREV</B></A>
1954 <DD>User routine called for each event.
1956 <P><DT><A NAME="UGINIT"><B>UGINIT</B></A>
1957 <DD>Initialisation at the beginning of a simulation run called from the main
1958 program GALICE. This routine calls the nnn_INIT routines of the various
1959 modules. For example the initialization of the PHOS is in PHOS_INIT
1960 These nnn_INIT routines perform module specific initialisations (if
1961 needed) and also specify the content of the module SPC data block in case
1962 the SPC data CWN is used. The name of the SPC data block should be the same
1963 as the module name (i.e. PHOS, ZDC etc.). As the names of the variables
1964 within the SPC data block have to be unique, each variable has to have as
1965 the last character the module specific identification number (see before).
1966 Each nnn_INIT should to produce a short printout indicating the routine
1967 name, so that from the log file of a certain run it can be directly seen
1968 which detectors were invoked and correctly initialised.
1970 <P><DT><A NAME="UGLAST"><B>UGLAST</B></A>
1971 <DD>Termination at the end of a simulation run. This routine calls the
1972 nnn_END routines of the various detectors. The nnn_END routines don't have
1978 <!=======================================================================>
1983 <A NAME="5">5. Output Format
1986 <!======================================================================>
1987 <H3><IMG src=gif/act.gif> page under construction </H3>
1989 please send comments to: <A HREF="mailto:Yiota.Foka@cern.ch">Yiota Foka</A>
1992 <!======================================================================>
1993 <P>There are currently two options for the output format of GALICE:
1995 <LI> HBOOK CWN, GEANT HITS and DIGI structures all based on ZEBRA
1996 <LI> ROOT Object I/O
1999 <P>The FORTRAN/ZEBRA output format has been kept for backward compatiblity
2000 and may be removed in the near future if there are no requests to maintain
2001 it. It is described in the galice.cmz file in the DECK FORMAT of the different
2002 patches, and the reader is referred to the code for more information.
2004 <P>The ROOT Object I/O is described together with the rest of the ROOT interface
2005 to Galice in the next chapter.
2010 <A NAME="6">6. ROOT Interface to Galice
2013 <!======================================================================>
2014 <H3><IMG src=gif/act.gif> page under construction </H3>
2016 please send comments to: <A HREF="mailto:Yiota.Foka@cern.ch">Yiota Foka</A>
2019 <!======================================================================>
2021 <P> During 1998 GALICE has been upgraded and modified to provide
2022 a simulation tool for the Technical Design
2023 Reports. Those <A HREF="history.html"> upgrades</A> lead to two releases
2024 of the package in June 1998 and are detailed <A HREF="history.html">
2025 elsewhere</A>. <B>Version 2.02</B> of GALICE is the first version of the
2026 package that includes the ROOT interface.
2029 <B>The main reasons for that were to: </B>
2031 <LI> Provide a particle stack within GEANT which is capable to hold
2032 the complete particle
2033 history without inherent limitations. The current GEANT stack
2034 does not save full particle history and is limited to 65K tracks
2035 which is not enough for the process of an ALICE event.</LI>
2037 <LI> Provide output services more advanced than the traditional GEANT
2038 HITS structure based on ZEBRA
2039 and more flexible than the
2040 <A HREF="http://wwwcn.cern.ch/asdoc/hbook_html3/hboomain.html">
2041 Column Wise Ntuple (CWN)</A> and which can hold the amount of data
2044 can accomodate complex hit structures without inherent space
2045 limitations. The standard CWN are limited to 50,000 events per
2048 <LI> Provide an evolutive framework, where reconstruction and analysis
2049 programs can be prototyped via ROOT macros, which are nothing else
2050 than C++ fragments. The advantage of the fact that the coding and
2051 scripting language are the same is that these macros can evolve into
2053 and later reconstruction and analysis packages seamlessly. At the
2054 moment of writing the Alice Offline framework is being defined,
2055 but we already know it will be based on OO technology. This approach
2056 avoids the creation of legacy code, and allow us to reuse whatever
2057 work is done for the TDR's in the final Alice Offline framework.</LI>
2061 <H3>6.1 The traditional GEANT3.21 </H3>
2063 <P>The old galice 1.05 program uses GEANT3.21 in the standard way, with
2064 KUIP as the interactive interface and the FFREAD cards to specify at run
2065 time the source of primary tracks in one event, to select the detectors
2066 taking part in the simulation and to switch on or off the sensitive media
2067 of the detectors that produce hits that are written out as PAW ntuples. The
2068 user routine UGINIT initializes the package and calls UGEOM that sets up
2073 <TABLE BORDER="0" CELLSPACING="1" WIDTH="100%">
2075 <TD ALIGN=left ROWSPAN="2">
2076 <IMG ALT="Logical Diagram of OLD GALICE" ALIGN=left
2077 SRC="htmlgif/oldg.gif"
2078 width="750" height="630" VSPACE="5" HSPACE="2.5" BORDER="0">
2083 <P>To process an event GUKINE takes an event from the event generator or
2084 generates the primary tracks internally, creating the Geant stacks JVERTEX
2085 and JKINE. These stacks are too small to contain a full ALICE event, then
2086 secondary tracks are added to them as the tracks are followed though the
2087 setup and produce secondaries, overflowing at 65K tracks.
2089 <P> The Geometry of the setup and the Hits in the sensitive parts of the
2090 detectors are coded by the users in FORTRAN.
2094 <H3><A NAME="6.2">6.2 The ROOT interface in GALICE</A></H3>
2095 <!======================================================================>
2096 <H3><IMG src=gif/act.gif> page under construction </H3>
2098 please send comments to: <A HREF="mailto:Yiota.Foka@cern.ch">Yiota Foka</A>
2101 <!======================================================================>
2102 <P> To move to the Object Oriented world and to be able to handle
2103 simulations of the ALICE detectors in an efficient way for the work being
2104 done for the Technical Design Reports (TDRs), it was decided to provide
2105 GALICE with a ROOT output. This was done in a way almost transparent to the
2106 galice users, keeping the KUIP and FFCARDS steering and the definition of
2107 the Geometry and Hits with the same user routines in FORTRAN. A future
2108 version in which the steering is done within ROOT and the Geometry and Hits
2109 can be defined by users in C++ is in preparation.
2111 <P>The code of this C++ interface is entirely documented <A
2112 HREF="html/USER_Index.html">here</A>.
2117 <TD ALIGN=left ROWSPAN="2">
2118 <IMG ALT="Logical Diagram of NEW GALICE" ALIGN=left
2119 SRC="htmlgif/newg.gif"
2120 width="750" height="630" VSPACE="5" HSPACE="2.5" BORDER="0">
2125 <P> The GEANT routines GUKINE, GTREVE and GUSTEP have been modified so that
2126 the GEANT engine only follows one particle at a time and the output objects
2127 of the kinematics and hits are stored in ROOT Tree structures. The
2128 advantage of treating one particle at a time is that even if in one full
2129 ALICE event hundred of thousands of particles are followed, the program
2130 runs in less than 20 MBytes of memory.
2132 <P> GUKINE when given an event to simulate, sets up a ROOT stack:
2133 fParticles, in which all particles are inserted, which will not overflow
2134 and which also keeps all the history of all the particles so that if in a
2135 later generation a particle crosses a sensitive detector and the hit is
2136 written out, one can know from what type of primary it originates and which
2137 processes and in which materials gave rise to it.
2139 <P> When simulating one event, GUKINE takes one particle at a time and
2140 inserts it in the GEANT stack JKINE which is taken by GTREVE and followed
2141 through the setup. If in a given tracking step new particles are produced,
2142 GUSTEP inserts in the ROOT stack the kinematics of the secondary vertex and
2143 all the produced particles which will be fed eventually one by one to the
2146 <P> An ALICE <A HREF="html/USER_Index.html">class library</A> has been
2147 created that contains classes corresponding to the Hits defined for each
2148 detector in the Fortran routines.
2150 <P> The Hits are written out after each track in a ROOT Tree structure
2151 TreeH, of the file galice.root. There is one such tree per event. The
2152 kinematics of all the particles that produce hits, together with their
2153 genealogy up to the primary tracks is stared in the galice.root file in an
2154 other tree TreeK of which exists one per event. An additional tree of
2155 digits called TreeD is written out at each event. This tree contains
2156 information which is relative to the whole event and not track per track,
2157 as for instance the energy clusters in the TPC and PHOS. Finally the
2158 information of the events in the run is stored in the same file in the tree
2159 TreeE, containing the run and event number, the number of vertices, tracks
2160 and primary tracks in the event.
2164 <H3>The class AliRun</H3>
2166 <P>Control class for Alice C++
2167 Only one single instance of this class exists.
2168 The object is created in main program aliroot
2169 and is pointed by the global gAlice.
2172 <LI>Supports the list of all Alice Detectors (fDetectors).
2173 <LI>Supports the list of particles (fParticles).
2174 <LI>Supports the Trees.
2175 <LI>Supports the geometry.
2176 <LI>Supports the event display.
2181 <TD ALIGN=left ROWSPAN="2">
2182 <IMG ALT="Logical Diagram of OLD GALICE" ALIGN=left
2183 SRC="htmlgif/alirun.gif"
2184 width="750" height="900" VSPACE="5" HSPACE="2.5" BORDER="0">
2189 <H3>FORTRAN / C++ Interface routines</H3>
2191 <P>To be able to communicate between the FORTRAN code of GEANT and the ROOT
2192 data structure, a number of interface routines have been developed. These
2193 are in the source file <A
2194 HREF="html/examples/aliroot.cxx.html">aliroot.cxx</A>.
2196 <!=============================================================================>
2200 <P><DT><A NAME="RXSTMG"><B>RXSTMG</B></A>
2201 <DD>C++ step manager dispatcher. This is a direct interface to the <A
2202 HREF="html/AliRun.html">AliRun</A> step manager routine. It is called
2203 by the default version of GUSTEP and allows the user to handle directly the
2204 data structures from C++ instead that via the FORTRAN interface.
2206 <P><DT><A NAME="RXAHIT"><B>RXAHIT(IDET, MTRACK, NUMBV, HITS)</B></A>
2208 <DD>Stores a hit in the ROOT structure. This routine is supposed to be called
2209 by the nnn_step routines.
2211 <P><TABLE WIDTH=80%>
2214 <TD>detector number as found in GEANT common block
2215 <A HREF="http://wwwcn.cern.ch/asdoc/geant_html3/node384.html#SECTION0138000000000000000000000">GCSETS</A>.
2217 <TH ALIGN=LEFT>MTRACK
2218 <TD>Number of the track generting the hit. The ROOT stack track number is found
2219 in common block <A HREF="#SCKINE">SCKINE</A>
2221 <TH ALIGN=LEFT>NUMBV
2222 <TD>Array of voume numbers as found in common block
2223 <A HREF="http://wwwcn.cern.ch/asdoc/geant_html3/node384.html#SECTION0138000000000000000000000">GCSETS</A>.
2226 <TD>Array of user defined hits.
2229 <P><DT><A NAME="RXDINI"><B>RXDINI</B></A>
2230 <DD>Initialises all detectors. This routine is called by UGINIT.
2232 <P><DT><A NAME="RXGTRAK"><B>RXGTRAK (MTRACK, IPART, PMOM, E, VPOS, TOF)</B></A>
2233 <DD>Fetches next track from the ROOT stack for transport. Called by the modified
2234 version of <A HREF="#GTREVE">GTREVE</A>.
2236 <P><TABLE WIDTH=80%>
2238 <TH ALIGN=LEFT>MTRACK
2239 <TD>Track number in the ROOT stack. If MTRACK=0 no more tracks are left in the
2240 stack to be transported.
2242 <TH ALIGN=LEFT>IPART
2243 <TD>Particle code in the
2244 <A HREF="http://wwwcn.cern.ch/asdoc/geant_html3/node72.html#SECTION024000000000000000000000">GEANT conventions</A>.
2246 <TH ALIGN=LEFT>PMOM(3)
2247 <TD>Particle momentum in GeV/c
2250 <TD>Particle energy in GeV
2252 <TH ALIGN=LEFT>VPOS(3)
2253 <TD>Particle position
2256 <TD>Particle time of flight in seconds
2259 <P><DT><A NAME="RXSTRAK"><B>RXSTRAK (IDONE, IPARENT, IPART, PMOM, VPOS, TOF, CHMECA, NT)</B></A>
2260 <DD>Fetches next track from the ROOT stack for transport. Called by <A HREF="#GUKINE">
2261 GUKINE</A> and <A HREF="#GUSTEP">GUSTEP</A>.
2263 <P><TABLE WIDTH=80%>
2265 <TH ALIGN=LEFT>IDONE
2266 <TD>Status of the track. If IDONE=0 the track is put on the ROOT stack but it
2267 is not fetched for transport.
2269 <TH ALIGN=LEFT VALIGN=TOP>IPARENT
2270 <TD>Parent track. If IPARENT=0 the track is a primary. In GUSTEP the routine
2271 is normally called to store secondaries generated by the current track whose
2272 ROOT stack number is MTRACK (common <A HREF="#SCKINE">SCKINE</A>.
2274 <TH ALIGN=LEFT>IPART
2275 <TD>Particle code in the
2276 <A HREF="http://wwwcn.cern.ch/asdoc/geant_html3/node72.html#SECTION024000000000000000000000">GEANT conventions</A>.
2278 <TH ALIGN=LEFT>PMOM(3)
2279 <TD>Particle momentum in GeV/c
2281 <TH ALIGN=LEFT>VPOS(3)
2282 <TD>Particle position
2285 <TD>Particle time of flight in seconds
2287 <TH ALIGN=LEFT>CHMECA
2288 <TD>(CHARACTER*10) Particle origin. This field is user defined and it is
2289 not used inside the GALICE code.
2292 <TD>Number assigned to the particle in the ROOT stack.
2295 <P><DT><A NAME="RXSTIN"><B>RXSTIN(IRUN,IDEVT)</B></A>
2296 <DD> Called by GTRIGI at the beginning of each event.
2298 <P><TABLE WIDTH=80%>
2301 <TD>Current run number
2304 <TD>Current user event number
2307 <P><DT><A NAME="RXFILE"><B>RXFILE (CHFILE)</B></A>
2308 <DD>Opens the ROOT output file. Called by UGINIT.
2310 <P><TABLE WIDTH=80%>
2312 <TH ALIGN=TOP>CHFILE
2313 <TD>(CHARACTER*(*)) file name to be opened.
2316 <P><DT><A NAME="RXOUTH"><B>RXOUTH</B></A>
2317 <DD>Called by GTREVE at the end of each primary track.
2319 <P><DT><A NAME="RXOUTK"><B>RXOUTK(IEVENT)</B></A>
2320 <DD>Called by GUOUT to write out kinematics at the end of the event:
2322 <P><TABLE WIDTH=80%>
2324 <TH ALIGN=TOP>IEVENT
2325 <TD>Number of the current event.
2328 <P><DT><A NAME="RXFEND"><B>RXFEND</B></A>
2329 <DD>Called by UGLAST to write out everything and close down.
2335 <A NAME="7">7. Magnetic Field
2338 <!======================================================================>
2339 <H3><IMG src=gif/act.gif> page under construction </H3>
2341 please send comments to: <A HREF="mailto:Yiota.Foka@cern.ch">Yiota Foka</A>
2344 <!======================================================================>
2345 <P>At the moment there are two magnetic field maps supported.
2349 <br>This is a constant field map for the L3 magnet and a parametrised
2350 dipole field with the following features:
2353 <P><TABLE WIDTH=80%>
2355 <TH ALIGN=LEFT>position <TH ALIGN=LEFT>field
2357 <TD>z (725,1225) <TD> {7*(1-1E-5*(975-z)**2), 0, 0)
2359 <TD>z (-700,700) and sqrt(x**2+(y+30)**2)<560 <TD> {0,0,2)
2361 <TD> elsewhere <TD> {0,0,0}
2366 <br>This is a constant field map for the L3 magnet and a field map for
2367 the dipole. The data are contained in the file field01.dat in the same
2368 directory than the rest of the files.
2373 <A NAME="8">8. Version history
2376 <!======================================================================>
2377 <H3><IMG src=gif/act.gif> page under construction </H3>
2379 please send comments to: <A HREF="mailto:Yiota.Foka@cern.ch">Yiota Foka</A>
2382 <!======================================================================>
2383 <P>The detailed history of the changes to the fortran code can be found in
2384 the CMZ <A HREF="history.html">history file</A>. A general description of
2385 the modifications including those in the C++ code can be found in the <A
2386 HREF="Introduction.html">introduction</A>.
2388 <!=============================================================================>
2389 <!======================================================================>
2390 <H3><IMG src=gif/act.gif> page under construction </H3>
2392 please send comments to: <A HREF="mailto:Yiota.Foka@cern.ch">Yiota Foka</A>
2395 <!======================================================================>
2398 page maintained by :
2399 <A HREF="mailto:Yiota.Foka@cern.ch">Yiota Foka</A>
2402 <A HREF="http://www1.cern.ch/ALICE/welcome.html"> ALICE home, </A>
2403 <A HREF="http://www1.cern.ch/ALICE/Projects/offline/AliceOffLineHomePage.html">