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