| 1 | $Id: README,v 1.22 2007/11/12 15:48:58 maire Exp $
|
|---|
| 2 | -------------------------------------------------------------------
|
|---|
| 3 |
|
|---|
| 4 | =========================================================
|
|---|
| 5 | Geant4 - an Object-Oriented Toolkit for Simulation in HEP
|
|---|
| 6 | =========================================================
|
|---|
| 7 |
|
|---|
| 8 | TestEm1
|
|---|
| 9 | -------
|
|---|
| 10 | How to count processes.
|
|---|
| 11 | How to activate/inactivate processes.
|
|---|
| 12 | How to survey the tracking, in perticular the range of charged particles.
|
|---|
| 13 | How to define a maximum step size.
|
|---|
| 14 |
|
|---|
| 15 | 1 - GEOMETRY DEFINITION
|
|---|
| 16 |
|
|---|
| 17 | It is a simple box which represente an 'semi infinite' homogeneous medium.
|
|---|
| 18 |
|
|---|
| 19 | Two parameters define the geometry :
|
|---|
| 20 | - the material of the box,
|
|---|
| 21 | - the full size of the box.
|
|---|
| 22 |
|
|---|
| 23 | In addition a transverse uniform magnetic field can be applied.
|
|---|
| 24 |
|
|---|
| 25 | The default geometry is constructed in DetectorConstruction class, but all of
|
|---|
| 26 | the above parameters can be changed interactively via the commands defined in
|
|---|
| 27 | the DetectorMessenger class.
|
|---|
| 28 |
|
|---|
| 29 | 2 - PHYSICS LIST
|
|---|
| 30 |
|
|---|
| 31 | The particle list is the one of novice/exampleN03.
|
|---|
| 32 | The physics list contains the 'standard' electromagnetic processes, and decay.
|
|---|
| 33 |
|
|---|
| 34 | Few commands have been added to PhysicsList, in order to set the production
|
|---|
| 35 | threshold for secondaries for gamma and e-/e+.
|
|---|
| 36 |
|
|---|
| 37 | 3 - AN EVENT : THE PRIMARY GENERATOR
|
|---|
| 38 |
|
|---|
| 39 | The primary kinematic consists of a single particle starting at the left face
|
|---|
| 40 | of the box. The type of the particle and its energy are set in the
|
|---|
| 41 | PrimaryGeneratorAction class, and can be changed via the G4 build-in commands
|
|---|
| 42 | of ParticleGun class (see the macros provided with this example).
|
|---|
| 43 |
|
|---|
| 44 | In addition one can choose randomly the impact point of the incident particle.
|
|---|
| 45 | The corresponding interactive command is built in PrimaryGeneratorMessenger.
|
|---|
| 46 |
|
|---|
| 47 | 4 - VISUALIZATION
|
|---|
| 48 |
|
|---|
| 49 | The Visualization Manager is set in the main().
|
|---|
| 50 | The initialisation of the drawing is done via the commands /vis/... in the
|
|---|
| 51 | macro vis.mac. To get visualisation:
|
|---|
| 52 | > /control/execute vis.mac
|
|---|
| 53 |
|
|---|
| 54 | The detector has a default view which is a longitudinal view of the box.
|
|---|
| 55 |
|
|---|
| 56 | The tracks are drawn at the end of event, and erased at the end of run.
|
|---|
| 57 | Optionaly one can choose to draw all particles, only the charged, or none.
|
|---|
| 58 | This command is defined in EventActionMessenger class.
|
|---|
| 59 |
|
|---|
| 60 | 5 - PHYSICS SURVEY
|
|---|
| 61 |
|
|---|
| 62 | The particle's type and the physic processes which will be available in this
|
|---|
| 63 | example are set in PhysicsList class.
|
|---|
| 64 |
|
|---|
| 65 | A set of macros defining various run conditions are provided. The processes
|
|---|
| 66 | are actived/inactived together with differents cuts, in order to survey the
|
|---|
| 67 | processes one by one.
|
|---|
| 68 |
|
|---|
| 69 | The number of produced secondaries are counted, the number of steps, and the
|
|---|
| 70 | number of process calls responsible of the step.
|
|---|
| 71 |
|
|---|
| 72 | 6 - HOW TO START ?
|
|---|
| 73 |
|
|---|
| 74 | - compile and link to generate an executable
|
|---|
| 75 | % cd geant4/examples/extended/electromagnetic/TestEm1
|
|---|
| 76 | % gmake
|
|---|
| 77 |
|
|---|
| 78 | - execute TestEm1 in 'batch' mode from macro files
|
|---|
| 79 | % TestEm1 run10.mac
|
|---|
| 80 |
|
|---|
| 81 | - execute TestEm1 in 'interactive mode' with visualization
|
|---|
| 82 | % TestEm1
|
|---|
| 83 | ....
|
|---|
| 84 | Idle> type your commands
|
|---|
| 85 | ....
|
|---|
| 86 | Idle> exit
|
|---|
| 87 |
|
|---|
| 88 | 7 - TRACKING : StepMax
|
|---|
| 89 |
|
|---|
| 90 | In order to control the accuracy of the deposition, the user can limit
|
|---|
| 91 | 'by hand' the maximum step size of charged particles.
|
|---|
| 92 | As an example, this limitation is implemented as a 'full' process :
|
|---|
| 93 | see StepMax class and its Messenger. The 'StepMax process' is registered
|
|---|
| 94 | in the Physics List.
|
|---|
| 95 |
|
|---|
| 96 | 8 - HISTOGRAMS
|
|---|
| 97 |
|
|---|
| 98 | Testem1 produces several histo which are saved as testem1.hbook by default.
|
|---|
| 99 | Content of these histo:
|
|---|
| 100 | 1 : track length of primary particle
|
|---|
| 101 | 2 : number of steps primary particle
|
|---|
| 102 | 3 : step size of primary particle
|
|---|
| 103 |
|
|---|
| 104 | The histograms are managed by the HistoManager class and its Messenger.
|
|---|
| 105 | The histos can be individually activated with the command :
|
|---|
| 106 | /testem/histo/setHisto id nbBins valMin valMax unit
|
|---|
| 107 | where unit is the desired unit for the histo (MeV or keV, deg or mrad, etc..)
|
|---|
| 108 |
|
|---|
| 109 | One can control the name of the histograms file with the command:
|
|---|
| 110 | /testem/histo/setFileName name (default testem1)
|
|---|
| 111 |
|
|---|
| 112 | It is possible to choose the format of the histogram file (hbook, root, XML)
|
|---|
| 113 | with the command /testem/histo/setFileType (hbook by default)
|
|---|
| 114 |
|
|---|
| 115 | It is also possible to print selected histograms on an ascii file:
|
|---|
| 116 | /testem/histo/printHisto id
|
|---|
| 117 | All selected histos will be written on a file name.ascii (default testem1)
|
|---|
| 118 |
|
|---|
| 119 | Note that, by default, histograms are disabled. To activate them, uncomment
|
|---|
| 120 | the flag G4ANALYSIS_USE in GNUmakefile.
|
|---|
| 121 |
|
|---|
| 122 | Before compilation of the example it is optimal to clean up old files:
|
|---|
| 123 | gmake histclean
|
|---|
| 124 | gmake
|
|---|
| 125 |
|
|---|
| 126 | 9 - USING HISTOGRAMS
|
|---|
| 127 |
|
|---|
| 128 | To use histograms, at least one of the AIDA implementations should be
|
|---|
| 129 | available (see http://aida.freehep.org).
|
|---|
| 130 |
|
|---|
| 131 | 9a - PI
|
|---|
| 132 |
|
|---|
| 133 | A package including AIDA and extended interfaces also using Python is PI,
|
|---|
| 134 | available from: http://cern.ch/pi
|
|---|
| 135 |
|
|---|
| 136 | Once installed PI or PI-Lite in a specified local area $MYPY, it is required
|
|---|
| 137 | to add the installation path to $PATH, i.e. for example, for release 1.2.1 of
|
|---|
| 138 | PI:
|
|---|
| 139 | setenv PATH ${PATH}:$MYPI/1.2.1/app/releases/PI/PI_1_2_1/rh73_gcc32/bin
|
|---|
| 140 |
|
|---|
| 141 | CERN users can use the PATH to the LCG area on AFS.
|
|---|
| 142 | Before running the example the command should be issued:
|
|---|
| 143 | eval `aida-config --runtime csh`
|
|---|
| 144 |
|
|---|
| 145 | 9b - OpenScientist
|
|---|
| 146 |
|
|---|
| 147 | OpenScientist is available at http://OpenScientist.lal.in2p3.fr.
|
|---|
| 148 |
|
|---|
| 149 | You have to "setup" the OpenScientist AIDA implementation before compiling
|
|---|
| 150 | (then with G4ANALYSIS_USE set) and running your Geant4 application.
|
|---|
| 151 |
|
|---|
| 152 | On UNIX you setup, with a csh flavoured shell :
|
|---|
| 153 | csh> source <<OpenScientist install path>/aida-setup.csh
|
|---|
| 154 | or with a sh flavoured shell :
|
|---|
| 155 | sh> . <<OpenScientist install path>/aida-setup.sh
|
|---|
| 156 | On Windows :
|
|---|
| 157 | DOS> call <<OpenScientist install path>/aida-setup.bat
|
|---|
| 158 |
|
|---|
| 159 | You can use various file formats for writing (AIDA-XML, hbook, root).
|
|---|
| 160 | These formats are readable by the Lab onx interactive program
|
|---|
| 161 | or the OpenPAW application. See the web pages.
|
|---|
| 162 |
|
|---|
| 163 |
|
|---|
| 164 | With OpenPAW, on a run.hbook file, one can view the histograms
|
|---|
| 165 | with something like :
|
|---|
| 166 | OS> opaw
|
|---|
| 167 | opaw> h/file 1 run.hbook ( or opaw> h/file 1 run.aida or run.root)
|
|---|
| 168 | opaw> zone 2 2
|
|---|
| 169 | opaw> h/plot 1
|
|---|
| 170 | opaw> h/plot 2
|
|---|