Geant4 Cross Reference |
1 ---------------------------------------------- 1 ------------------------------------------------------------------- 2 2 3 ========================================= 3 ========================================================= 4 Geant4 - an Object-Oriented Toolkit for S 4 Geant4 - an Object-Oriented Toolkit for Simulation in HEP 5 ========================================= 5 ========================================================= 6 6 7 gammaray_telescope 7 gammaray_telescope 8 ------------------ 8 ------------------ 9 F. Longo, R. Giannitrapan << 9 F.Longo, R.Giannitrapani & G.Santin 10 June 2003 10 June 2003 11 11 12 ---------------------------------------------- << 12 -------------------------------------------------------------- 13 Acknowledgments to GEANT4 people, in particula << 13 Acknowledgments to GEANT4 people, in particular to R.Nartallo, 14 A. Pfeiffer, M. G. Pia and G. Cosmo << 14 A.Pfeiffer, M.G.Pia and G.Cosmo 15 ---------------------------------------------- << 15 -------------------------------------------------------------- 16 16 17 GammaRayTel is an example of application of Ge 17 GammaRayTel is an example of application of Geant4 in a space 18 environment. It simulates a typical telescope << 18 envinronment. It simulates a typical telescope for gamma ray analysis; 19 the detector setup is composed by a tracker ma 19 the detector setup is composed by a tracker made with silicon planes, 20 subdivided in ladders and strips, a CsI calori 20 subdivided in ladders and strips, a CsI calorimeter and an 21 anticoincidence system. In this version, the t 21 anticoincidence system. In this version, the three detectors are made 22 sensitive but only the hits on the tracker str << 22 sensitive but only the hits on the tracker strips are registered and relevant 23 information (energy deposition, position etc.) << 23 information (energy deposition, position etc) are dumped to an external 24 ASCII file for subsequent analysis. << 24 ASCII file for subsequent analysis. 25 25 26 Relevant information from the simulation is pr 26 Relevant information from the simulation is processed in the GammarayTelAnalysis 27 class and saved, through the G4AnalysisManager << 27 class and saved, through the G4AnalysisManager interface, to Histograms and 28 Tuples. << 28 Tuples. 29 29 30 a) Macros for the visualization of geometry << 30 a) Macros for the visualization of geometry and tracks with 31 OpenGL, VRML and DAWN drivers << 31 OpenGL, VRML and DAWN drivers 32 32 33 b) Implementation of messengers to change so << 33 b) Implementation of messengers to change some parameters of 34 the detector geometry, the particle gener << 34 the detector geometry, the particle generator and the analysis 35 manager (if present) runtime 35 manager (if present) runtime 36 36 37 c) Readout geometry mechanism to describe an << 37 c) Readout geometry mechanism to describe an high number of 38 subdivisions of the planes of the tracker 38 subdivisions of the planes of the tracker (strips) without 39 affecting in a relevant way the simulatio 39 affecting in a relevant way the simulation performances 40 40 41 d) Histogramming facilities are presently pr 41 d) Histogramming facilities are presently provided through the G4AnalysisManager class. 42 42 43 e) User interfaces via Xmotif or normal term 43 e) User interfaces via Xmotif or normal terminal provided 44 44 45 << 45 46 1. Setting up the environment variables 46 1. Setting up the environment variables 47 --------------------------------------- 47 --------------------------------------- 48 48 49 - Setup for storing ASCII data << 49 - Setup for storing ASCII data 50 50 51 If you want to store the output data in an A 51 If you want to store the output data in an ASCII file 'Tracks_x.dat' 52 where x stays for the run number. You should << 52 where x stays for the run number. You should specify the environment 53 variable: 53 variable: 54 54 55 setenv G4STORE_DATA 1 55 setenv G4STORE_DATA 1 56 56 57 - Setup for Visualization << 57 - Setup for Visualization 58 58 59 IMPORTANT: be sure that your Geant4 installa << 59 IMPORTANT: be sure that your Geant4 installation has been done 60 with the proper visualization drivers; for d << 60 with the proper visualization drivers; for details please see the 61 file geant4/source/visualization/README. << 61 file geant4/source/visualization/README. 62 << 62 63 To use the visualization drivers set the fol << 63 To use the visualization drivers set the following variables in 64 your local environment: << 64 your local environment: 65 << 65 66 setenv G4VIS_USE_OPENGLX 1 # OpenGL visuali << 66 setenv G4VIS_USE_OPENGLX 1 # OpenGL visualization 67 setenv G4VIS_USE_DAWNFILE 1 # DAWN file << 67 setenv G4VIS_USE_DAWNFILE 1 # DAWN file 68 setenv G4VIS_USE_VRMLFILE 1 # VRML file << 68 setenv G4VIS_USE_VRMLFILE 1 # VRML file 69 setenv G4VRMLFILE_VIEWER vrmlview # If inst << 69 setenv G4VRMLFILE_VIEWER vrmlview # If installed 70 70 71 - Setup for Xmotif user interface 71 - Setup for Xmotif user interface >> 72 >> 73 setenv G4UI_USE_XM 1 72 74 73 setenv G4UI_USE_XM 1 << 75 - Set up for analysis 74 << 75 - Set up for analysis << 76 76 77 To compile the GammaRayTel example with the << 77 To compile the GammaRayTel example with the analysis tools activated, 78 set the following variables << 78 set the following variables 79 79 80 setenv G4ANALYSIS_USE 1 # Use the analysis t << 80 setenv G4ANALYSIS_USE 1 # Use the analysis tools 81 81 82 2. Sample run 82 2. Sample run 83 ------------- 83 ------------- 84 84 85 To run a sample simulation with gamma tracks << 85 To run a sample simulation with gamma tracks interacting with 86 the detector in its standard configuration an 86 the detector in its standard configuration and without any 87 visualization, execute the following command << 87 visualization, execute the following command in the example main 88 directory: 88 directory: 89 89 90 $G4WORKDIR/bin/$G4SYSTEM/GammaRayTel << 90 $G4WORKDIR/bin/$G4SYSTEM/GammaRayTel 91 91 92 It is possible also to run three different co << 92 It is possible also to run three different configuration defined in 93 macro1.mac, macro2.mac and macro3.mac for vis << 93 macro1.mac, macro2.mac and macro3.mac for visualization (OpenGL, VRML 94 and DAWN respectively) with the following com 94 and DAWN respectively) with the following command 95 95 96 $G4WORKDIR/bin/$G4SYSTEM/GammaRayTel macroX.m 96 $G4WORKDIR/bin/$G4SYSTEM/GammaRayTel macroX.mac 97 97 98 where X can be 1, 2 or 3. Be sure to have the 98 where X can be 1, 2 or 3. Be sure to have the right environment (see 99 the preceding section) and the proper visuali 99 the preceding section) and the proper visualization driver enabled in 100 your local G4 installation (see geant4/source 100 your local G4 installation (see geant4/source/visualization/README for 101 more information). 101 more information). 102 102 103 << 103 104 3. Detector description 104 3. Detector description 105 ----------------------- 105 ----------------------- 106 106 107 The detector is defined in GammaRayTelDetecto 107 The detector is defined in GammaRayTelDetectorConstruction.cc 108 It is composed of a Payload with three main d 108 It is composed of a Payload with three main detectors, a Tracker (TKR), a 109 Calorimeter (CAL) and an Anticoincidence syst << 109 Calorimeter (CAL) and an Anticoincidence system (ACD). 110 110 111 The standard configuration is made of a TKR o 111 The standard configuration is made of a TKR of 15 Layers of 2 views made of 112 4 * 4 Si single sided silicon detectors with << 112 4*4 Si single sided silicon detectors with Lead converter, and a CAL of 113 5 layers of CsI, each made of 2 views of 12 C 113 5 layers of CsI, each made of 2 views of 12 CsI bars orthogonally posed. 114 4 lateral panels and a top layer of plastic s << 114 4 lateral panels and a top layer of plastic scintillator (ACL and ACT) 115 complete the configuration. 115 complete the configuration. 116 The Si detectors are composed of two silicon 116 The Si detectors are composed of two silicon planes subdivided in strips 117 aligned along the X axis in one plane and alo 117 aligned along the X axis in one plane and along the Y axis for the other. 118 118 119 The following baseline configuration is adopt 119 The following baseline configuration is adopted: >> 120 >> 121 GEOMETRICAL PARAMETER VALUE 120 122 121 GEOMETRICAL PARAMETER VALUE << 123 Converter thickness 300 microns 122 << 124 Silicon Thickness 400 microns 123 Converter Thickness 300 micron << 125 Silicon Tile Size XY 9 cm 124 Silicon Thickness 400 micron << 126 Silicon Pitch 200.micrometer 125 Silicon Tile Size XY 9 cm << 127 Views Distance 1. mm 126 Silicon Pitch 200. micrometer << 128 CAL Bar Thickness 1.5 cm 127 Views Distance 1. mm << 129 ACD Thickness 1. cm 128 CAL Bar Thickness 1.5 cm << 130 129 ACD Thickness 1. cm << 131 It is possible to modify in some way this configuration using the 130 << 132 commands defined in GammaRayTelDetectorMessenger. 131 It is possible to modify in some way this con << 133 This feature is available in the UI throught the commands subtree 132 commands defined in GammaRayTelDetectorMessen << 133 This feature is available in the UI through t << 134 "/payload/" (see the help command in the UI f 134 "/payload/" (see the help command in the UI for more information). 135 135 136 4. Physics processes 136 4. Physics processes 137 -------------------- 137 -------------------- 138 138 139 This example uses a modular physics list, wit << 139 This example uses a modular physics list, with a sample of Hadronic processes 140 (see the web page http://cmsdoc.cern.ch/~hpw/ 140 (see the web page http://cmsdoc.cern.ch/~hpw/GHAD/HomePage/ for more adeguate 141 physics lists), the Standard or the LowEnergy 141 physics lists), the Standard or the LowEnergy Electromagnetic processes. 142 142 143 5. Particle Generator 143 5. Particle Generator 144 --------------------- 144 --------------------- 145 145 146 The GammaRayTelParticleGenerationAction and i 146 The GammaRayTelParticleGenerationAction and its Messenger let the user define 147 the incident flux of particles, from a specif << 147 the incident flux of particles, from a specific direction or from an 148 isotropic background. In the first case parti << 148 isotropic background. In the first case particles are generated on a spherical 149 surface which diameter is perpendicular to th 149 surface which diameter is perpendicular to the arrival direction. In the second 150 case the arrival directions are isotropic. 150 case the arrival directions are isotropic. 151 151 152 The user can define also between two spectral 152 The user can define also between two spectral options: 153 monochromatic or with a power-law dependence. 153 monochromatic or with a power-law dependence. The particle 154 generator parameters are accessible through t << 154 generator parameters are accessible throught the UI tree "/gun/" (use the 155 UI help for more information). We are plannin 155 UI help for more information). We are planning to include, in the next 156 releases of this example, the General Particl 156 releases of this example, the General Particle Source module of G4. 157 << 157 158 6. Hit 158 6. Hit 159 ------ 159 ------ 160 160 161 In this version the hits from the TKR the CAL << 161 In this version the hits from the TKR the CAL and the ACD are generated. 162 Only the hit from the TRK are saved. Each TKR << 162 Only the hit from the TRK are saved. Each TKR hit contains the following 163 information 163 information 164 164 165 a) ID of the event (this is important for mu 165 a) ID of the event (this is important for multiple events run) 166 b) Energy deposition of the particle in the 166 b) Energy deposition of the particle in the strip (keV) 167 c) Number of the strip << 167 c) Number of the strip 168 d) Number of the plane 168 d) Number of the plane 169 e) Type of the plane (1=X 0=Y) 169 e) Type of the plane (1=X 0=Y) 170 f) Position of the hit (x, y, z) in the refe << 170 f) Position of the hit (x,y,z) in the reference frame of the payload 171 171 172 The hit information are saved on an ASCII fil << 172 The hit information are saved on an ASCII file named Tracks_N.dat, where 173 N is the progressive ID number associated to << 173 N is the progressive ID number associated to the run. 174 174 175 7. Analysis 175 7. Analysis 176 ----------- << 176 ---------------- 177 << 177 178 Relevant information from the simulation is pr 178 Relevant information from the simulation is processed in the GammarayTelAnalysis 179 class and saved, through the G4AnalysisManager << 179 class and saved, through the G4AnalysisManager interface, to Histograms and 180 Tuples. The output file is written in ROOT for << 180 Tuples. The output file is written in ROOT format, but one can easily switch to 181 XML (or Hbook) by changing the appropriate #in 181 XML (or Hbook) by changing the appropriate #include in GammarayTelAnalysis.hh 182 No external software is required (apart from t << 182 No external software is required (apart from the hbook case, in which the CERNLIB 183 must be installed and a FORTRAN compiler must 183 must be installed and a FORTRAN compiler must be present) 184 184 185 Keep in mind that the actual implementation o 185 Keep in mind that the actual implementation of the analysis tools in GammaRayTel 186 is of a pedagogical nature, so we kept it as << 186 is of a pedagogical nature, so we kept it as simple as possible. 187 187 188 The actual analysis produces some histograms << 188 The actual analysis produces some histograms (see next section) and an ntuple. 189 Both the histograms and the ntuple are saved << 189 Both the histograms and the ntuple are saved at the end of the run in the file 190 "gammaraytel.root". Please note that in a mul << 190 "gammaraytel.root". Please note that in a multiple run session, 191 the last run always override the root file. 191 the last run always override the root file. 192 192 193 8. Histogramming 193 8. Histogramming 194 ---------------- 194 ---------------- 195 195 196 The 1D histograms contain the energy depositi << 196 The 1D histograms contain the energy deposition in the last X plane of 197 the TKR and the hits distribution along the X << 197 the TKR and the hits distribution along the X planes of the TKR 198 (note again that these histograms have been c << 198 (note again that these histograms have been chosen more for pedagogical 199 motivation than for physical one). 199 motivation than for physical one). 200 200 201 These histograms are filled and updated at ev << 201 These histograms are filled and updated at every event and are initialized 202 with each new run; the scale of the histogram << 202 with each new run; the scale of the histograms is automatically derived from 203 the detector geometry. << 203 the detector geometry. 204 204 205 Through a messenger it is possible to set som << 205 Throught a messenger it is possible to set some options with 206 the UI subtree "/analysis/" (use the UI help << 206 the UI subtree "/analysis/" (use the UI help for more info); 207 207 208 In this example we only show the use of very << 208 In this example we only show the use of very basic feature of this new 209 simulation/analysis framework. 209 simulation/analysis framework. 210 210 211 9. Digi 211 9. Digi 212 ------- << 212 -------- 213 213 214 For the TKR also the digits corresponding to << 214 For the TKR also the digits corresponding to the Hits are generated. 215 A digi is generated when the hit energy depos << 215 A digi is generated when the hit energy deposit is greater than a threshold 216 (in this example setted at 120 keV). << 216 (in this example setted at 120 keV). 217 The TKR digi information are stored on the sa 217 The TKR digi information are stored on the same file Tracks_N.dat and contain: 218 218 219 a) ID of the event (this is important for mu 219 a) ID of the event (this is important for multiple events run) 220 b) Number of the strip << 220 b) Number of the strip 221 c) Number of the plane 221 c) Number of the plane 222 d) Type of the plane (1=X 0=Y) 222 d) Type of the plane (1=X 0=Y) 223 223 224 10. Classes Overview 224 10. Classes Overview 225 -------------------- << 225 ------------------- 226 226 227 This is the overview of the classes defined i 227 This is the overview of the classes defined in this example 228 << 228 229 GammaRayTelPrimaryGeneratorAction << 229 GammaRayTelPrimaryGeneratorAction 230 User action for primaries generator << 230 User action for primaries generator 231 231 232 GammaRayTelPrimaryGeneratorMessenger 232 GammaRayTelPrimaryGeneratorMessenger 233 Messenger for interactive particle generat << 233 Messenger for interactive particle generator 234 parameters modification via the User Inter << 234 parameters modification via the User Interface 235 << 235 236 GammaRayTelPhysicsList 236 GammaRayTelPhysicsList 237 Determination of modular physics classes << 237 Determination of modular physics classes 238 238 239 GammaRayTelDetectorConstruction << 239 GammaRayTelGeneralPhysics 240 Geometry and material definitions for the << 240 Decay processes 241 241 242 GammaRayTelDetectorMessenger << 242 GammaRayTelEMPhysics 243 Messenger for interactive geometry paramet << 243 Std and LowE physics processes (for gamma & e-/e+) 244 modification via the User Interface << 244 >> 245 GammaRayTelMuonPhysics >> 246 Muon & its processes >> 247 >> 248 GammaRayTelIonPhysics >> 249 Ions and their processes 245 250 >> 251 GammaRayTelHadronPhysics >> 252 Sample of hadronic processes >> 253 >> 254 GammaRayTelTelVisManager >> 255 Visualization manager class >> 256 >> 257 GammaRayTelDetectorConstruction >> 258 Geometry and material definitions for the detector >> 259 >> 260 GammaRayTelDetectorMessenger >> 261 Messenger for interactive geometry parameters >> 262 modification via the User Interface >> 263 246 GammaRayTelAnalysis 264 GammaRayTelAnalysis 247 Analysis manager class (experimental) << 265 Analysis manager class (experimental) 248 266 249 GammaRayTelAnalysisMessenger 267 GammaRayTelAnalysisMessenger 250 Messenger for interactive analysis options << 268 Messenger for interactive analysis options modification 251 via the User Interface << 269 via the User Interface 252 270 253 GammaRayTelRunAction 271 GammaRayTelRunAction 254 User run action class << 272 User run action class 255 273 256 GammaRayTelEventAction 274 GammaRayTelEventAction 257 User event action class << 275 User event action class 258 276 259 GammaRayTelTrackerHit 277 GammaRayTelTrackerHit 260 Description of the hits on the tracker << 278 Description of the hits on the tracker 261 279 262 GammaRayTelDigi 280 GammaRayTelDigi 263 Description of the digi on the tracker << 281 Description of the digi on the tracker 264 282 265 GammaRayTelDigitizer 283 GammaRayTelDigitizer 266 Description of the digitizer for the track << 284 Description of the digitizer for the tracker 267 285 268 GammaRayTelTrackerSD 286 GammaRayTelTrackerSD 269 Description of the TKR sensitive detector << 287 Description of the TKR sensitive detector 270 288 271 GammaRayTelAnticoincidenceHit 289 GammaRayTelAnticoincidenceHit 272 Description of the hits on the anticoincid << 290 Description of the hits on the anticoincidence 273 291 274 GammaRayTelAnticoincidenceSD 292 GammaRayTelAnticoincidenceSD 275 Description of the ACD sensitive detector << 293 Description of the ACD sensitive detector 276 294 277 GammaRayTelCalorimeterHit 295 GammaRayTelCalorimeterHit 278 Description of the hits on the calorimeter << 296 Description of the hits on the calorimeter 279 297 280 GammaRayTelCalorimeterSD 298 GammaRayTelCalorimeterSD 281 Description of the CAL sensitive detector << 299 Description of the CAL sensitive detector >> 300 >> 301 >> 302 >> 303 >> 304 >> 305 >> 306 >> 307 >> 308 >> 309