Geant4 Cross Reference |
>> 1 $Id: README,v 1.12 2004/12/08 10:47:07 gcosmo Exp $ 1 ---------------------------------------------- 2 ------------------------------------------------------------------- 2 3 3 ========================================= 4 ========================================================= 4 Geant4 - an Object-Oriented Toolkit for S 5 Geant4 - an Object-Oriented Toolkit for Simulation in HEP 5 ========================================= 6 ========================================================= 6 7 7 xray_fluorescence 8 xray_fluorescence 8 ----------------- 9 ----------------- 9 XrayFluo is an advanced Geant4 example reprodu << 10 XrayFluo is an advanced Geant4 example based on a realistic simulation of >> 11 a test beam. >> 12 The aim of the test beam was to characterize the response function of various >> 13 X-Rays detectors used to measure fluorescence emissions from samples composed >> 14 of different materials irradiated with a monochromatic beam of photons. >> 15 In this example the geometry of the detector is simplified: >> 16 one single pixel is used, since the test beams has used monolithic detectors. >> 17 The response function is tabulated for different values of incident >> 18 energy and stored in the file response.dat and SILIresponse.dat. >> 19 At the moment, two kinds of detectors are available: HPGe and Si(Li). >> 20 The sample, a simple box whose material can be selected, can be irradiated >> 21 with different particles, with different spectra for the incident energy and >> 22 with different shapes of the primary generator. >> 23 Apart from the sample and the detector there are two diaphragm reproducing >> 24 those used to collimate the incident beam during the test beam. >> 25 >> 26 Other two geometries are present for the user: an infinte-plane geometry and >> 27 a planetary one, with the status of "beta release". The user must select, >> 28 at the moment of the execution, which geometry wants to use. >> 29 If the program is executed in batch mode, it is possible to specify >> 30 geometry from command line. Example: >> 31 /path/XrayFluo macro.mac 1 (for test beam Geometry) >> 32 /path/XrayFluo macro.mac 2 (for infinite plane Geometry) >> 33 >> 34 The aim of this advanced example is to illustrate the use of particle >> 35 generation and analysis schemes available in Geant4: >> 36 >> 37 - the generation of particles is done via the G4ParticleGun: the example >> 38 shows how to use it in order to obtain a beam of circular section or >> 39 a particle source isotropic in space >> 40 >> 41 - the example includes the possibility to shoot particles according to a >> 42 given energy spectrum: the files B_flare.dat, C_Flare.dat and M_flare.dat >> 43 store the spectra of photons during solar flares, the files >> 44 mercury2_flx_solmax.dat and mercury_flx_solmin.dat contain the spectra of >> 45 protons respectively during solar maximum and solar minimum conditions, and >> 46 merc2_flx_alp_max.dat merc_flx_alp_min.dat contain the spectra of alpha >> 47 particles again respectively during solar maximum and solar minimum >> 48 conditions. >> 49 >> 50 - histograming facilities are presently provided for the Linux environment >> 51 by using the AIDA3 interfaces. >> 52 The AIDA compliant version has not been tested by the developers and is >> 53 here as a example of "forward compatibility" on how to use analysis. >> 54 >> 55 In order to be able to use any of these packages, prior installation is >> 56 necessary and a number of environment variables will have to be set. >> 57 >> 58 #set up VRMLview >> 59 setenv G4VRMLFILE_MAX_FILE_NUM 100 >> 60 setenv G4VRMLFILE_VIEWER vrmlview #if installed >> 61 >> 62 Then define the in PATH the path where the 'vrmlview' binary application >> 63 is installed. >> 64 >> 65 #set up OpenGL or Mesa >> 66 setenv G4VIS_BUILD_OPENGLX_DRIVER 1 >> 67 setenv G4VIS_USE_OPENGLX 1 >> 68 >> 69 #set up DAWN >> 70 setenv G4VIS_BUILD_DAWN_DRIVER 1 >> 71 setenv G4VIS_USE_DAWN 1 >> 72 >> 73 Then define the in PATH the path where the 'dawn' binary application >> 74 is installed. >> 75 >> 76 # flag that we want to use analysis: >> 77 setenv G4ANALYSIS_USE 1 >> 78 >> 79 #select AIDA implementation: for instance, PI (http://cern.ch/pi) >> 80 >> 81 Define in PATH/LD_LIBRARY_PATH the paths where the your analysis tool >> 82 and libs are installed. >> 83 e.g., for PI-1.2.1: >> 84 >> 85 setenv PATH ${PATH}:[your-PI-installation-path]/PI/1.2.1/app/releases/PI_1_2_1/rh73_gcc32/bin >> 86 setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:[your-PI-installation-path]/PI/1.2.1/app/releases/PI_1_2_1/rh73_gcc32/lib >> 87 setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:[your-PI-installation-path]/PI/1.2.1/app/releases/SEAL/SEAL_1_3_4/rh73_gcc32/lib 10 88 11 A sample macro (livermore.mac) is provided. << 89 eval `aida-config -r csh` 12 << 13 The detector is a monolitic Si(Li) or HPGe det << 14 << 15 The sample, a simple box whose material can be << 16 << 17 Two diaphragms reproducing those used to colli << 18 << 19 The aim of this advanced example is to illustr << 20 << 21 Generation of particles is done via the G4Part << 22 << 23 The example includes the possibility to shoot << 24 << 25 Histogramming facilities are provided using th << 26 << 27 In order to be able to use any of these packag << 28 90 29 #path to the lowEnergy data base 91 #path to the lowEnergy data base 30 92 31 setenv G4LEDATA /your/path/to/geant4/data/G4EM << 93 setenv G4LEDATA [your-data-path]:/G4EMLOW2.3 32 94 33 #path to Xray_Fluorescence data files, if not 95 #path to Xray_Fluorescence data files, if not set, PWD is assumed: 34 96 35 setenv XRAYDATA /path/to/detector/and/input/sp << 97 setenv XRAYDATA $G4INSTALL/examples/advanced/xray_fluorescence 36 98 37 1. Run 99 1. Run 38 After the compilation of the program, to execu << 100 To execute a sample simulation with visualisation of tracks >> 101 reaching the detector run: 39 102 40 $G4WORKDIR/bin/Linux-g++/XrayFluo << 103 XrayFluo 41 104 42 The program gives, at tis point,the user 4 opt << 105 execute command "/control/execute xxxxx.mac" 43 106 44 Please Select Simulation Geometrical Set-Up: << 45 1 - Test Beam << 46 2 - Infinite Plane << 47 3 - Planet and Sun << 48 4 - Phase-Space Production << 49 107 50 The first three choices are to choose differen << 108 If the analysis options are set, histograms will >> 109 automatically stored in the corresponding files (hbook or XML) 51 110 52 In order to run a macro, type the following co << 111 2. Detector description 53 112 54 idle> execute command "/control/execute xxxxx. << 113 The telescope and detector geometry is defined in >> 114 XrayFluoDetectorConstruction.cc 55 115 56 If the analysis options are set, histograms wi << 116 3. Detector peculiar properties are described in XrayFluoSiLiDetectorType and 57 << 117 XrayFluoHPGeDetectorType, both derived from XrayFluoVDetectorType. Other 58 In order to launch the application in batch mo << 118 detector types can be added, creating other implementations of 59 << 119 XrayFluoVDetectorType objects. 60 $G4WORKDIR/bin/Linux-g++/XrayFluo xxxxx.mac 1 << 120 Detector type selection is made in XrayFluoDetectorConstruction, and can be 61 << 121 modified trough /apparate/detector command of the UI. 62 2. Detector description << 122 Other commands (apparate/sample /apparate/sampleGranularity 63 The telescope and detector geometry is defined << 123 /apparate/GrainDiameter) are present to simulate sample granulosity: 64 << 124 grains are spheres, disposed in a compact cubic structure, i.e superipmposition 65 3. Detector peculiar properties are described << 125 of planes of maximum density with ABC ABC path. The fundamental cell is of type 66 Other commands (apparate/sample /apparate/samp << 126 cubic with centered-faces. 67 127 68 4. Physics processes 128 4. Physics processes 69 129 70 Tha user can select the preferred physics list << 130 The physics processes are in XrayFluoPhysicsList.cc >> 131 The main process in this example is fluorescence emission from the sample. 71 132 72 5. Event generation 133 5. Event generation 73 134 74 This is done using the G4ParticleGun with some << 135 This is done using the G4ParticleGun with some modifications. See 75 << 136 XrayFluoParticleGeneratorAction.cc 76 Event generation is controlled by commands in << 77 << 78 - /gun/loadGunData <filename>: to be used with << 79 << 80 - /gun/loadRayleighFlag <true/false> This is u << 81 137 >> 138 6. Analysis 82 139 >> 140 At present the analisys is provided by any AIDA-3.2.1 compliant analysis system. >> 141 In the example the PI toolkit is used. 83 142 >> 143 AIDA / PI configuration for compilation and link are in GNUmakefile, once >> 144 is set the environmente as above: >> 145 >> 146 ifdef G4ANALYSIS_USE >> 147 CPPFLAGS += `aida-config --include` >> 148 LDFLAGS += `aida-config --lib` >> 149 endif >> 150 >> 151 To build and execute the example on platforms where there is no >> 152 implementation of the analysis system, the environment variables >> 153 must not be set. >> 154 >> 155 It is possible to visualize the output of the simulation. In order to do this >> 156 is necessary to uncomment all lines in XrayFluoAnalysisManager.cc / .hh regarding plotting; >> 157 and the same must be done for plotting refernces in XrayFluoRunManager.cc and XrayFluoEventAction.cc. >> 158 And link against other AIDA compliant analysis sistems, such as PI or JAS. >> 159 >> 160 Finally, by setting visPlotter variable in XrayFluoAnalysisManager to true, >> 161 it is possible to display the simulated output of the detector while >> 162 simulation is in progress. Graph window is updated every 100000 events. >> 163 >> 164 The example provides also a simple Python file used to display histograms. >> 165 >> 166 Various commads, with help, are available for Geant4 UI. >> 167 /analysis/outputFile and /analysis/fileType respectively for >> 168 changing the name and the type (xml or Hbook) of the file in wich results >> 169 are saved. >> 170 If these commends are used, to make the changes effective, another >> 171 command, /anaysis/update, must be executed. >> 172 >> 173 NOTE: if a file named xrayfluo.hbk (default name) is present, it >> 174 will be deleted, even if /analysis/outputFile command is issued >> 175 before any run.