| 1 | $Id: README,v 1.29 2007/11/12 17:04:55 maire Exp $
|
|---|
| 2 | -------------------------------------------------------------------
|
|---|
| 3 |
|
|---|
| 4 | =========================================================
|
|---|
| 5 | Geant4 - an Object-Oriented Toolkit for Simulation in HEP
|
|---|
| 6 | =========================================================
|
|---|
| 7 |
|
|---|
| 8 | TestEm3
|
|---|
| 9 | -------
|
|---|
| 10 |
|
|---|
| 11 | How to collect energy deposition in a sampling calorimeter.
|
|---|
| 12 | How to survey energy flow.
|
|---|
| 13 | how to print stopping power.
|
|---|
| 14 |
|
|---|
| 15 | 1- GEOMETRY DEFINITION
|
|---|
| 16 |
|
|---|
| 17 | The calorimeter is a box made of a given number of layers.
|
|---|
| 18 | A layer consists of a sequence of various absorbers (maximum MaxAbsor=9).
|
|---|
| 19 | The layer is replicated.
|
|---|
| 20 |
|
|---|
| 21 | Parameters defining the calorimeter :
|
|---|
| 22 | - the number of layers,
|
|---|
| 23 | - the number of absorbers within a layer,
|
|---|
| 24 | - the material of the absorbers,
|
|---|
| 25 | - the thickness of the absorbers,
|
|---|
| 26 | - the transverse size of the calorimeter (the input face is a square).
|
|---|
| 27 |
|
|---|
| 28 | In addition a transverse uniform magnetic field can be applied.
|
|---|
| 29 |
|
|---|
| 30 | The default geometry is constructed in DetectorConstruction class, but all
|
|---|
| 31 | of the above parameters can be modified interactively via the commands
|
|---|
| 32 | defined in the DetectorMessenger class.
|
|---|
| 33 |
|
|---|
| 34 |
|
|---|
| 35 | |<----layer 0---------->|<----layer 1---------->|<----layer 2---------->|
|
|---|
| 36 | | | | |
|
|---|
| 37 | ==========================================================================
|
|---|
| 38 | || | || | || | ||
|
|---|
| 39 | || | || | || | ||
|
|---|
| 40 | || abs 1 | abs 2 || abs 1 | abs 2 || abs 1 | abs 2 ||
|
|---|
| 41 | || | || | || | ||
|
|---|
| 42 | || | || | || | ||
|
|---|
| 43 | beam || | || | || | ||
|
|---|
| 44 | ======> || | || | || | ||
|
|---|
| 45 | || | || | || | ||
|
|---|
| 46 | || | || | || | ||
|
|---|
| 47 | || | || | || | ||
|
|---|
| 48 | || | || | || | ||
|
|---|
| 49 | || cell 1 | cell 2|| cell 3 | cell 4|| cell 5 | cell 6||
|
|---|
| 50 | ==========================================================================
|
|---|
| 51 | ^ ^ ^ ^ ^ ^ ^
|
|---|
| 52 | pln1 pln2 pln3 pln4 pln5 pln6 pln7
|
|---|
| 53 |
|
|---|
| 54 | NB. The number of absorbers and the number of layers can be set to 1.
|
|---|
| 55 | In this case we have a unique homogeneous block of matter, which looks like
|
|---|
| 56 | a bubble chamber rather than a calorimeter ...
|
|---|
| 57 | (see the macro of commands: newgeom.mac)
|
|---|
| 58 |
|
|---|
| 59 | 2- PHYSICS LISTS
|
|---|
| 60 |
|
|---|
| 61 | The following options for EM physics are available:
|
|---|
| 62 | - "standard" the best standard EM physics (default)
|
|---|
| 63 | - "G4standard" recommended standard EM physics for LHC
|
|---|
| 64 | - "G4standard_fast" the best CPU performance standard physics for LHC
|
|---|
| 65 | - "Livermore" low-energy EM physics using Livermore data
|
|---|
| 66 | - "Penelope" low-energy EM physics implementing Penelope models
|
|---|
| 67 |
|
|---|
| 68 | 3- AN EVENT : THE PRIMARY GENERATOR
|
|---|
| 69 |
|
|---|
| 70 | The primary kinematic consists of a single particle which hits the calorimeter
|
|---|
| 71 | perpendicular to the input face. The type of the particle and its energy are
|
|---|
| 72 | set in the PrimaryGeneratorAction class, and can be changed via the
|
|---|
| 73 | G4 build-in commands of ParticleGun class (see the macros provided with this
|
|---|
| 74 | example).
|
|---|
| 75 |
|
|---|
| 76 | In addition one can choose randomly the impact point of the incident particle.
|
|---|
| 77 | The corresponding interactive command is built in PrimaryGeneratorMessenger.
|
|---|
| 78 |
|
|---|
| 79 | A RUN is a set of events.
|
|---|
| 80 |
|
|---|
| 81 | TestEm3 computes the energy deposited per absorber and the energy flow through
|
|---|
| 82 | the calorimeter
|
|---|
| 83 |
|
|---|
| 84 | 4- VISUALIZATION
|
|---|
| 85 |
|
|---|
| 86 | The Visualization Manager is set in the main().
|
|---|
| 87 | The initialisation of the drawing is done via the commands :
|
|---|
| 88 | /vis/... in the macro vis.mac. In interactive session:
|
|---|
| 89 | PreInit or Idle > /control/execute vis.mac
|
|---|
| 90 |
|
|---|
| 91 | The default view is a longitudinal view of the calorimeter.
|
|---|
| 92 |
|
|---|
| 93 | The tracks are drawn at the end of event, and erased at the end of run.
|
|---|
| 94 | Optionaly one can choose to draw all particles, only the charged one, or none.
|
|---|
| 95 | This command is defined in EventActionMessenger class.
|
|---|
| 96 |
|
|---|
| 97 | 5- PHYSICS DEMO
|
|---|
| 98 |
|
|---|
| 99 | The particle's type and the physic processes which will be available
|
|---|
| 100 | in this example are set in PhysicsList class.
|
|---|
| 101 |
|
|---|
| 102 | In addition a build-in interactive command (/process/inactivate processName)
|
|---|
| 103 | allows to activate/inactivate the processes one by one.
|
|---|
| 104 | Then one can well visualize the processes one by one, especially
|
|---|
| 105 | in the bubble chamber setup with a transverse magnetic field.
|
|---|
| 106 |
|
|---|
| 107 | As a homework try to visualize a gamma conversion alone,
|
|---|
| 108 | or the effect of the multiple scattering.
|
|---|
| 109 |
|
|---|
| 110 | Notice that one can control the maximum step size in each absorber, via the
|
|---|
| 111 | StepMax process and the command /testem/stepMax/absorber
|
|---|
| 112 | (see StepMax and PhysicsList classes)
|
|---|
| 113 |
|
|---|
| 114 | 6- HOW TO START ?
|
|---|
| 115 |
|
|---|
| 116 | - compile and link to generate an executable
|
|---|
| 117 | % cd TestEm3
|
|---|
| 118 | % gmake
|
|---|
| 119 |
|
|---|
| 120 | - execute TestEm3 in 'batch' mode from macro files
|
|---|
| 121 | % TestEm3 run01.mac
|
|---|
| 122 |
|
|---|
| 123 | - execute TestEm3 in 'interactive mode' with visualization
|
|---|
| 124 | % TestEm3
|
|---|
| 125 | ....
|
|---|
| 126 | Idle> type your commands. For instance:
|
|---|
| 127 | Idle> /control/execute run01.mac
|
|---|
| 128 | ....
|
|---|
| 129 | Idle> exit
|
|---|
| 130 |
|
|---|
| 131 | 7- HISTOGRAMS
|
|---|
| 132 |
|
|---|
| 133 | Testem3 can produce histograms :
|
|---|
| 134 | histo 1 : energy deposit in absorber 1
|
|---|
| 135 | histo 2 : energy deposit in absorber 2
|
|---|
| 136 | ...etc...........
|
|---|
| 137 |
|
|---|
| 138 | One can control the binning of the histo with the command:
|
|---|
| 139 | /testem/histo/setHisto idAbsor nbin Emin Emax unit
|
|---|
| 140 | ...etc...........
|
|---|
| 141 | where unit is the desired energy unit for that histo (see TestEm3.in).
|
|---|
| 142 |
|
|---|
| 143 | histo 11 : longitudinal profile of energy deposit in absorber 1 (MeV/event)
|
|---|
| 144 | histo 12 : longitudinal profile of energy deposit in absorber 2 (MeV/event)
|
|---|
| 145 | ...etc...........
|
|---|
| 146 |
|
|---|
| 147 | histo 21 : energy flow (MeV/event)
|
|---|
| 148 | histo 22 : lateral energy leak (MeV/event)
|
|---|
| 149 |
|
|---|
| 150 | One can control the name of the histograms file with the command:
|
|---|
| 151 | /testem/histo/setFileName name (default testem3.hbook)
|
|---|
| 152 |
|
|---|
| 153 | NB. Numbering scheme for histograms:
|
|---|
| 154 | layer : from 1 to NbOfLayers (inclued)
|
|---|
| 155 | absorbers : from 1 to NbOfAbsor (inclued)
|
|---|
| 156 | planes : from 1 to NbOfLayers*NbOfAbsor + 1 (inclued)
|
|---|
| 157 |
|
|---|
| 158 | It is also possible to print selected histograms on an ascii file:
|
|---|
| 159 | /testem/histo/printHisto id
|
|---|
| 160 | All selected histos will be written on a file name.ascii (default testem3)
|
|---|
| 161 |
|
|---|
| 162 | Note that, by default, histograms are disabled. To activate them, uncomment
|
|---|
| 163 | the flag G4ANALYSIS_USE in GNUmakefile.
|
|---|
| 164 |
|
|---|
| 165 | Before compilation of the example it is optimal to clean up old files:
|
|---|
| 166 | gmake histclean
|
|---|
| 167 | gmake
|
|---|
| 168 |
|
|---|
| 169 |
|
|---|
| 170 | 8- USING HISTOGRAMS
|
|---|
| 171 |
|
|---|
| 172 | To use histograms, at least one of the AIDA implementations should be
|
|---|
| 173 | available (see http://aida.freehep.org).
|
|---|
| 174 |
|
|---|
| 175 | 8a - PI
|
|---|
| 176 |
|
|---|
| 177 | A package including AIDA and extended interfaces also using Python is PI,
|
|---|
| 178 | available from: http://cern.ch/pi
|
|---|
| 179 |
|
|---|
| 180 | Once installed PI or PI-Lite in a specified local area $MYPY, it is required
|
|---|
| 181 | to add the installation path to $PATH, i.e. for example, for release 1.2.1 of
|
|---|
| 182 | PI:
|
|---|
| 183 | setenv PATH ${PATH}:$MYPI/1.2.1/app/releases/PI/PI_1_2_1/rh73_gcc32/bin
|
|---|
| 184 |
|
|---|
| 185 | CERN users can use the PATH to the LCG area on AFS.
|
|---|
| 186 | Before running the example the command should be issued:
|
|---|
| 187 | eval `aida-config --runtime csh`
|
|---|
| 188 |
|
|---|
| 189 | 8b - OpenScientist
|
|---|
| 190 |
|
|---|
| 191 | OpenScientist is available at http://OpenScientist.lal.in2p3.fr.
|
|---|
| 192 |
|
|---|
| 193 | You have to "setup" the OpenScientist AIDA implementation before compiling
|
|---|
| 194 | (then with G4ANALYSIS_USE set) and running your Geant4 application.
|
|---|
| 195 |
|
|---|
| 196 | On UNIX you setup, with a csh flavoured shell :
|
|---|
| 197 | csh> source <<OpenScientist install path>/aida-setup.csh
|
|---|
| 198 | or with a sh flavoured shell :
|
|---|
| 199 | sh> . <<OpenScientist install path>/aida-setup.sh
|
|---|
| 200 | On Windows :
|
|---|
| 201 | DOS> call <<OpenScientist install path>/aida-setup.bat
|
|---|
| 202 |
|
|---|
| 203 | You can use various file formats for writing (AIDA-XML, hbook, root).
|
|---|
| 204 | These formats are readable by the Lab onx interactive program
|
|---|
| 205 | or the OpenPAW application. See the web pages.
|
|---|
| 206 |
|
|---|
| 207 |
|
|---|
| 208 | With OpenPAW, on a run.hbook file, one can view the histograms
|
|---|
| 209 | with something like :
|
|---|
| 210 | OS> opaw
|
|---|
| 211 | opaw> h/file 1 run.hbook ( or opaw> h/file 1 run.aida or run.root)
|
|---|
| 212 | opaw> zone 2 2
|
|---|
| 213 | opaw> h/plot 1
|
|---|
| 214 | opaw> h/plot 2
|
|---|