7/19/2002 3:34:15 PM
E907MC is a version of GEANT 3.21 that is data driven. The program contains no hard-coded geometry constants. The Geometry and Detectors systems are fed to the program usingRCP files that are structured text files. The main routine is called hanuman.F. The program works on SGI/UNIX and LINUX. The program is built using Makefiles. All fortran routines are in the style of CERNLIB (i.e. *.F). They can contain compile time switches and common blocks are introduced via the #include construction.
·· RCP files
··Declaring RCP and RCPE files to the program
··Building
the needed libraries
··Building
and running the E907MC executable
··Library
Linking Order and the lddum routines
··Analyzing and Playing Back events
\array real_nums
0.7 3.9 5.5 ! This line contains an array of 3 real numbers
\end
This file has an array called
\ARRAY DETECTOR_SYSTEMS
'JGGIANT'!idtype
1000-1999
'BEAM'!idtype
2000-2999
'TARGET'!idtype
3000-3999
'TPC'!idtype
4000-4999
'CHAMBERS'!idtype
5000-5999
'CKOV'!idtype
6000-6999
'ROSY'!idtype
7000-7999
'TOF'!idtype
8000-8999
'RICH'!idtype
9000-9999
'CALORIMETER'!idtype
10000-10999
\END
GEANT geometry is defined using shapes made up of tracking media and placed in the mother volumes using translations and rotations defined in terms of rotation matrices. The rotation matrices and media are known to GEANT using integer numbers. In order to avoid conflicts in media and rotation matrix definitions, we define numerical ranges for these for each detector system as illustrated in the comment fields in the above \ARRAY definition.
\ARRAY ROTATION_MATRICES !Interrupt here to read more about this structure
\ARRAY MATERIAL_LIST !Interrupt here to read more about this structure
\ARRAY MIXTURE_LIST !Interrupt here to read more about this structure
\ARRAY MEDIA_LIST !Interrupt here to read more about this structure
\ARRAY VOLUME_LIST !Interrupt here to read more about this structure
\ARRAY DETECTOR_LIST !Interrupt here to read more about this structure
\ARRAY CERENKOV_LIST !Interrupt here to read more about this structure
setenv
BETA $cwd
ln
-sf$BETA/hanuman.rcphanuman_rcp
ln
-sf$BETA/hanuman_generate.rcpehanuman_rcpe
The
above declarations are done in setup.e907mc.rel. The important thing is
to note is that an RCP file XXX.rcp is read in by the system as XXX_RCP.
This is an old D0 convention
logical
first
data
first/.true.
save
first
----------------
if(first)then
first
= .false.
endif
Is
encouraged when wanting to initialize things in routines.
#include
“geant321/gcdraw.inc” !from the directory $GEANT_DIR/src/geant321/geant321
These
paths are defined in the files Makefile and config.mk
An
example of the code is as below. Only part of the routine is shown to illustrate
the main points.
SUBROUTINE
UGINIT
C----------------------------------------------------------------------
C-
C-Purpose
and Methods : Initialisation
C-include
standard GEANT3 init.;
C-Reading
and initialisation of Run-time switches
C-Initialization
and filling of ZEBSTP structure
C-for
each detector
C-
C-
C-Inputs:
None
C-Outputs
: None
C-
C-Created27-APR-1998Rajendran
Raja
C-
C----------------------------------------------------------------------
IMPLICIT
NONE
C
#include
"inc/gcunit.inc"
#include
"inc/gcphys.inc"
#include
"listvol.inc"
#include
"end_kick.inc"
#include
"maps.inc"
C
LOGICAL
FIRST
DATA
FIRST/.TRUE./
SAVE
FIRST
C----------------------------------------------------------------------
IF(FIRST)THEN
CALL
EZPICK('HANUMAN_RCP')
CALL
EZGET('PRINT_MATERIALS',PRMAT,IER)
CALL
EZGET('DO_INTERACTION_LENGTHS',DLAM,IER)
CALL
EZRSET
ENDIF
Conly
part of the routine shown.
CCALL
SVSWCH! Save switches into RUNG
bank; LQ(-1)
CCALL
FLD0RG(9,72,ENTRY)! Fill version
numbers
C
C
C****Print
out various GEANT banks.
C
IF
(PRMAT) THEN
CALL
GPMATE(0)
CALL
GPTMED(0)
CALL
GPVOLU(0)
CALL
GPROTM(0)
CALL
GPSETS('*','*')
ENDIF
999RETURN
END
setenv
CVSROOT e907cvs@cdcvs.fnal.gov:/cvs/e907
setenv
CVS_RSH /usr/krb5/bin/rsh #(path to kerberized rsh)
Alternative means for accessing this cvs repository are described here.
The
code resides in 3 libraries.
1.mipp/simulation/trim_d0lib
containsthe
RCP system and other routines in a trimmed down version of the RUN I D0library.
2.mipp/simulation/dd_geant
contains the data-driven code that is experiment independent.
3.mipp/simulation/e907mccontains
the E907 specific RCP files and magnetic field routines etc.
In
order to fetch the modules from CVS, perform in your work area
cvs
co mipp/simulation/trim_d0lib
cvs
co mipp/simulation/dd_geant
cvs
co mipp/simulation/e907mc
These
commands should fetch the modules belonging to the 3 libraries.
cd
trim_d0lib#gets to the root directory
of trim_d0library
source
setup.trim_d0lib# This sets up environment
variables such as $d0library and $d0debug and $d0platform
#
edit setup.trim_d0lib--setenv d0debug
DEBUG for debug version,setenv d0debug
NODEBUG for nodebug version.
gmake
-f Makefile clean#will
clean out all *.o and *.a files
gmake
-f Makefile lib#will build all the
sublibraries such as calor_util, srcp_util as well as a master library
called trim_d0lib.a
To
build dd_geant, perform
cd
dd_geant#gets to the root directory
of dd_geant
source
setup.dd_geant#This sets up environment
variables such as $d0library and $d0debug and $d0platform
#edit
setup.dd_geant -- setenv d0debug DEBUG for debug version,setenv
d0debug NODEBUG for nodebug version.
gmake
-f Makefile clean#will clean out
all *.o and *.a files
gmake
-f Makefile lib#will build dd_geant.a
To
build e907mc, perform
cd
e907mc#gets to the root directory
of e907mc
source
setup.e907mc#This sets up environment
variables such as $d0library and $d0debug and $d0platform
#edit
setup.e907mc -- setenv d0debug DEBUG for debug version,setenv
d0debug NODEBUG for nodebug version.
gmake
-f Makefile clean#will clean out
all *.o and *.a files
gmake
-f Makefile lib#will build e907mc.a
gmake
-f Makefile bin#will build the executable
e907mc.x
Before
one builds the executable, it is necessary to have executed the command
“Source setup.e907mc to setup the environment variables such as $d0library.
Before executing e907mc.x , it is necessary to setup the links to the RCP
files etc. This is done by
source
setup.e907.rel#This has to be done
only once.
Further,
source
setup.interactive.rel#will run program
in an interactive mode
source
setup.generate.rel#will run program
in a batch mode to generate events and record them on fort.2
source
setup.analyze.rel#will run program
in a playback mode to analyze generate events.
There
exist a number of routines that are present in dummy or duplicate form
in all three or any two of the libraries.
In
order to link things correctly the following technique is used with lddum
routines.
The
main routine hanuman.Fin /e907mc
is structured as follows.
PROGRAM HANUMAN
C----------------------------------------------------------------------
C-
C- Purpose and Methods : MAIN program for
C- "HADRON NUCLEUS MEASUREMENTS ARE NECESSARY EXPERIMENT"
C-
C- Created 27-APR-1998 Rajendran Raja
C-
C----------------------------------------------------------------------
IMPLICIT NONE
LOGICAL LNKINC
DATA LNKINC/.TRUE./
C----------------------------------------------------------------------
C
CALL HNMAIN
C
C The following call to lddum is a dummy call just to get geant routines
C loaded that are only called from geant and reside in geant.olb.
C the call must never actually be executed.......
C
IF(.NOT.LNKINC) CALL LDDUM_E907MC
C
C LDDUM_XXX is a subroutine that calls all the E907mc specific routines that are
C different version of routines in either dd_geant, trim_d0lib/d0geant or GEANT321.
C this technique ensures that the proper routines get loaded.
C
STOP
END