Geant4 Cross Reference |
>> 1 $Id: README,v 1.12 2004/05/28 15:56:58 guatelli Exp $ 1 ---------------------------------------------- 2 ------------------------------------------------------------------- 2 3 3 ========================================= 4 ========================================================= 4 Geant4 - X-Ray Telescope Exampl 5 Geant4 - X-Ray Telescope Example 5 ========================================= 6 ========================================================= 6 7 7 8 >> 9 NEW: May 2004: Migration to AIDA 3.2.1 - see below >> 10 >> 11 8 Introduction 12 Introduction 9 ------------ 13 ------------ 10 XrayTel is an advanced Geant4 example based on 14 XrayTel is an advanced Geant4 example based on a realistic simulation of 11 an X-ray Telescope. It is based on work carri 15 an X-ray Telescope. It is based on work carried out by a team of Geant4 12 experts to simulate the interaction between X- 16 experts to simulate the interaction between X-ray Telescopes XMM-Newton 13 and Chandra with low energy protons present in 17 and Chandra with low energy protons present in the orbital radiation 14 background. The X-ray mirrors are designed to 18 background. The X-ray mirrors are designed to collect x-ray photons at 15 grazing-incidence angles and focus them onto d 19 grazing-incidence angles and focus them onto detectors at the focal plane. 16 However, this mechanism also seems to work for 20 However, this mechanism also seems to work for low energy protons which, 17 if they reach the detectors in sufficient numb 21 if they reach the detectors in sufficient numbers, can cause damage. 18 In this example, the geometry has been simplif 22 In this example, the geometry has been simplified by using a single mirror 19 shell and no baffles, but all the dimensions a 23 shell and no baffles, but all the dimensions and materials are realistic. 20 24 21 The aim of this advanced example is to illustr 25 The aim of this advanced example is to illustrate the use advanced 22 GUI, visualisation, particle generation and an 26 GUI, visualisation, particle generation and analysis schemes available 23 in Geant4: 27 in Geant4: 24 28 >> 29 - the simulation can be run from GAG or the command prompt >> 30 25 - macros are provided to display the geometry 31 - macros are provided to display the geometry and particle tracks with 26 OpenGL, DAWN Postscript or VRML visualisati 32 OpenGL, DAWN Postscript or VRML visualisation 27 33 28 - the generation of particles is done via the 34 - the generation of particles is done via the new General Particle Source 29 35 30 - histograming facilities are available throu << 36 - histograming facilities are available through the AIDA 3.0 interfaces. >> 37 >> 38 - on-line visualisation of histograms is provided through the AIDA 3.0 interface. 31 39 32 In order to be able to use any of these packag 40 In order to be able to use any of these packages, prior installation is 33 necessary and a number of environment variable 41 necessary and a number of environment variables will have to be set. 34 42 35 43 >> 44 1. Setting up the environment variables for GAG, Visualisation and >> 45 Analysis options (example based on Linux at CERN) >> 46 >> 47 #set up GAG >> 48 setenv G4UI_BUILD_GAG_SESSION 1 >> 49 setenv G4UI_USE_GAG 1 >> 50 >> 51 #set up VRMLview >> 52 setenv G4VIS_USE_VRML 1 >> 53 setenv G4VRMLFILE_MAX_FILE_NUM 100 >> 54 setenv G4VRMLFILE_VIEWER vrmlview #if installed >> 55 setenv G4VIS_USE_VRML 1 >> 56 setenv PATH ${PATH}:"/afs/cern.ch/sw/contrib/VRML/bin/Linux" # example at CERN >> 57 >> 58 #set up OpenGL or Mesa >> 59 setenv G4VIS_BUILD_OPENGLX_DRIVER 1 >> 60 setenv G4VIS_USE_OPENGLX 1 >> 61 >> 62 #set up DAWN >> 63 setenv G4VIS_BUILD_DAWN_DRIVER 1 >> 64 setenv G4VIS_USE_DAWN 1 >> 65 36 NOTE: The geometry is refreshed on the viewer 66 NOTE: The geometry is refreshed on the viewer at the beginning of each run, 37 but the tracks are plotted only in case 67 but the tracks are plotted only in case an interesting event occurs. 38 This is the case only for about 1 every 68 This is the case only for about 1 every 10**4 events. 39 69 40 70 41 71 42 2. Run << 72 Analysis >> 73 -------- >> 74 Set up for the AIDA 3.2.1, PI 1.2.1 interface: >> 75 In case the variable G4ANALYSIS_USE is set: >> 76 setenv G4ANALYSIS_USE 1 >> 77 relevant information from the simulation is processed in the XrayTelAnalysis >> 78 class and saved, through the AIDA interface, to Histograms and Tuples. >> 79 Compilation and link flags to hook any AIDA compliant system >> 80 are passed to the Geant4 GNUmakefile system by using the "aida-config" tool >> 81 that should come with any AIDA compliant system. >> 82 Specifically in the GNUmakefile you find the 2 lines: >> 83 CPPFLAGS += `aida-config --include` >> 84 LDFLAGS += `aida-config --lib` >> 85 >> 86 For more information about AIDA and PI please look at: >> 87 > http://aida.freehep.org/ >> 88 > http://www.cern.ch/PI >> 89 Sources >> 90 ------- >> 91 >> 92 GAG can be found in: >> 93 >> 94 geant4/environments/MOMO >> 95 >> 96 OpenGL Mesa needs to be installed prior to building Geant4 and can be >> 97 downloaded from: >> 98 >> 99 http://www.mesa3d.org >> 100 >> 101 DAWN can be obtained from: >> 102 >> 103 http://geant4.kek.jp/~tanaka/ 43 104 >> 105 VRMLview for Linux can be obtained from: >> 106 >> 107 http://www.sim.no >> 108 >> 109 2. Run 44 To execute a sample simulation with visualisat 110 To execute a sample simulation with visualisation of proton tracks 45 reaching the detector run: 111 reaching the detector run: 46 112 47 XrayTel 113 XrayTel 48 114 49 execute command "/control/execute test.mac" << 115 execute command "/control/execute xxxxx.mac" >> 116 >> 117 visualisation macros provided are >> 118 - opengl.mac for OpenGL display >> 119 - vrml.mac for VRML display and output file >> 120 - dawn.mac for dawn display and PS output file >> 121 >> 122 To execute a run without visualisation use >> 123 - test.mac 50 124 51 To enable visualisation, uncomment one line fr << 52 /control/execute vis.mac << 53 125 54 If the analysis options are set, histograms wi << 126 If the analysis options are set, histograming windows will 55 automatically created and the corresponding fi << 127 automatically open and the corresponding files will be created. 56 A 1D histogram will display the energy distrib 128 A 1D histogram will display the energy distribution of the protons 57 that reach the detector at the end of the run. 129 that reach the detector at the end of the run. 58 130 59 << 60 3. Detector description 131 3. Detector description 61 132 62 The telescope and detector geometry is defined 133 The telescope and detector geometry is defined in 63 XrayTelDetectorConstruction.cc 134 XrayTelDetectorConstruction.cc 64 135 65 << 66 4. Physics processes 136 4. Physics processes 67 137 68 The physics processes are in XrayTelPhysicsLis 138 The physics processes are in XrayTelPhysicsList.cc 69 The main process in this example is G4hMultipl << 139 The main process in this example is MultipleScattering of the protons 70 off the mirror surfaces. << 140 on the mirror surfaces. 71 << 72 141 73 5. Event generation 142 5. Event generation 74 143 75 This is done using the new General Particle So 144 This is done using the new General Particle Source. Documentation for 76 this can be found in: << 145 this can be found in 77 << 78 http://reat.space.qinetiq.com/gps/ << 79 146 >> 147 http://www.space.qinetiq.com/geant4/gspm.html 80 148 81 6. Analysis 149 6. Analysis 82 150 83 Relevant information from the simulation is pr << 151 Presently, the Anaphe tool (http://cern.ch/anaphe) 84 class and saved, through the G4AnalysisManager << 152 (version 5) provides an implementation of AIDA 3, 85 Tuples. The output file is written in Root for << 153 other packages as JAS will follow soon. 86 No external software is required (apart from t << 154 >> 155 To build and execute the example on platforms where there is no >> 156 implementation of the analysis system, the environment variables >> 157 must not be set. 87 158