[807] | 1 | $Id: README,v 1.14 2005/12/09 22:15:52 mantero Exp $ |
---|
| 2 | ------------------------------------------------------------------- |
---|
| 3 | |
---|
| 4 | ========================================================= |
---|
| 5 | Geant4 - an Object-Oriented Toolkit for Simulation in HEP |
---|
| 6 | ========================================================= |
---|
| 7 | |
---|
| 8 | xray_fluorescence |
---|
| 9 | ----------------- |
---|
| 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 | The aim of this advanced example is to illustrate the use of particle |
---|
| 27 | generation and analysis schemes available in Geant4: |
---|
| 28 | |
---|
| 29 | - the generation of particles is done via the G4ParticleGun: the example |
---|
| 30 | shows how to use it in order to obtain a beam of circular section or |
---|
| 31 | a particle source isotropic in space |
---|
| 32 | |
---|
| 33 | - the example includes the possibility to shoot particles according to a |
---|
| 34 | given energy spectrum: the files B_flare.dat, C_Flare.dat and M_flare.dat |
---|
| 35 | store the spectra of photons during solar flares, the files |
---|
| 36 | mercury2_flx_solmax.dat and mercury_flx_solmin.dat contain the spectra of |
---|
| 37 | protons respectively during solar maximum and solar minimum conditions, and |
---|
| 38 | merc2_flx_alp_max.dat merc_flx_alp_min.dat contain the spectra of alpha |
---|
| 39 | particles again respectively during solar maximum and solar minimum |
---|
| 40 | conditions. |
---|
| 41 | |
---|
| 42 | - histograming facilities are presently provided for the Linux environment |
---|
| 43 | by using the AIDA3 interfaces. |
---|
| 44 | The AIDA compliant version has not been tested by the developers and is |
---|
| 45 | here as a example of "forward compatibility" on how to use analysis. |
---|
| 46 | |
---|
| 47 | In order to be able to use any of these packages, prior installation is |
---|
| 48 | necessary to configure you environment to get visulaization, as described in geant4 manual. |
---|
| 49 | If we want to use analisys, we provide an example for the use of PI: |
---|
| 50 | |
---|
| 51 | # flag that we want to use analysis: |
---|
| 52 | setenv G4ANALYSIS_USE 1 |
---|
| 53 | |
---|
| 54 | #select AIDA implementation: PI 1.3.3 |
---|
| 55 | |
---|
| 56 | setenv G4ANALYSIS_BUILD 1 |
---|
| 57 | |
---|
| 58 | setenv PI_VERSION 1_3_3 |
---|
| 59 | setenv PATH /your/path/to/PI/app/releases/PI/PI_1_3_0/slc3_ia32_gcc323/bin/:${PATH} |
---|
| 60 | eval `aida-config -r csh` |
---|
| 61 | |
---|
| 62 | #path to the lowEnergy data base |
---|
| 63 | |
---|
| 64 | setenv G4LEDATA /your/path/to/geant4/data/G4EMLOW3.0 |
---|
| 65 | |
---|
| 66 | #path to Xray_Fluorescence data files, if not set, PWD is assumed: |
---|
| 67 | |
---|
| 68 | setenv XRAYDATA /path/to/detector/and/input/spctra/files |
---|
| 69 | |
---|
| 70 | 1. Run |
---|
| 71 | After the compilation of the program, to execute a sample simulation type (for example): |
---|
| 72 | |
---|
| 73 | $G4WORKDIR/bin/Linux-g++/XrayFluo |
---|
| 74 | |
---|
| 75 | The program gives, at tis point,the user 4 options: |
---|
| 76 | |
---|
| 77 | Please Select Simulation Geometrical Set-Up: |
---|
| 78 | 1 - Test Beam |
---|
| 79 | 2 - Infinite Plane |
---|
| 80 | 3 - Planet and Sun |
---|
| 81 | 4 - Phase-Space Production |
---|
| 82 | |
---|
| 83 | The first three choices are to choose different experimental set-ups |
---|
| 84 | (a test beam one, an infite plane and a planetary geometry), while |
---|
| 85 | the fourth is a simplified version of the first, without a detector, |
---|
| 86 | only to generate a tuple with particles genereted or exiting the sample. |
---|
| 87 | |
---|
| 88 | In order to run a macro, type the following command: |
---|
| 89 | |
---|
| 90 | idle> execute command "/control/execute xxxxx.mac" |
---|
| 91 | |
---|
| 92 | If the analysis options are set, histograms will |
---|
| 93 | automatically stored in the corresponding files (hbook or XML) |
---|
| 94 | |
---|
| 95 | In order to launch the application in batch mode, it is necessary to specify, |
---|
| 96 | after the executable file name, the name of the macro file and the number of the choice: |
---|
| 97 | |
---|
| 98 | $G4WORKDIR/bin/Linux-g++/XrayFluo xxxxx.mac 1 |
---|
| 99 | |
---|
| 100 | 2. Detector description |
---|
| 101 | The telescope and detector geometry is defined in |
---|
| 102 | XrayFluoDetectorConstruction.cc |
---|
| 103 | |
---|
| 104 | 3. Detector peculiar properties are described in XrayFluoSiLiDetectorType and |
---|
| 105 | XrayFluoHPGeDetectorType, both derived from XrayFluoVDetectorType. Other |
---|
| 106 | detector types can be added, creating other implementations of |
---|
| 107 | XrayFluoVDetectorType objects. |
---|
| 108 | Detector type selection is made in XrayFluoDetectorConstruction, and can be |
---|
| 109 | modified trough /apparate/detector command of the UI. |
---|
| 110 | Other commands (apparate/sample /apparate/sampleGranularity |
---|
| 111 | /apparate/GrainDiameter) are present to simulate sample granulosity: |
---|
| 112 | grains are spheres, disposed in a compact cubic structure, i.e superipmposition |
---|
| 113 | of planes of maximum density with ABC ABC path. The fundamental cell is of type |
---|
| 114 | cubic with centered-faces. |
---|
| 115 | |
---|
| 116 | 4. Physics processes |
---|
| 117 | |
---|
| 118 | The physics processes are in XrayFluoPhysicsList.cc |
---|
| 119 | The main process in this example is fluorescence emission from the sample. |
---|
| 120 | |
---|
| 121 | 5. Event generation |
---|
| 122 | |
---|
| 123 | This is done using the G4ParticleGun with some modifications. See |
---|
| 124 | XrayFluoParticleGeneratorAction.cc |
---|
| 125 | |
---|
| 126 | Event generation is controlled by commands in the /gun/category (see help for further details). |
---|
| 127 | In this readme only two commands are undrlined: |
---|
| 128 | |
---|
| 129 | - /gun/loadGunData <filename>: to be used with the setup #1, loads the ntuple created |
---|
| 130 | in the setup #4. The loaded particles will be generated and will be directed |
---|
| 131 | ALL OF THEM to the detector. This can be useful to perform detector studies |
---|
| 132 | with encreased efiiciency. |
---|
| 133 | |
---|
| 134 | - /gun/loadRayleighFlag <true/false> This is used to let the user decide if backscattered |
---|
| 135 | primary particles should be loaded and directed toward the detector. This command, |
---|
| 136 | in order to be useful, must be used BEFORE the previous one. |
---|
| 137 | |
---|
| 138 | 6. Analysis |
---|
| 139 | |
---|
| 140 | At present the analisys is provided by any AIDA-3.2.1 compliant analysis system. |
---|
| 141 | In the example the Anaphe toolkit is used. |
---|
| 142 | |
---|
| 143 | AIDA implementation 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 | LOADLIBS += `aida-config --lib` |
---|
| 150 | endif |
---|
| 151 | |
---|
| 152 | To build and execute the example on platforms where there is no |
---|
| 153 | implementation of the analysis system, the environment variable |
---|
| 154 | G4ANALYSIS_USE must not be set. |
---|
| 155 | |
---|
| 156 | By setting visPlotter variable in XrayFluoAnalysisManager to true, |
---|
| 157 | it is possible to display the simulated output of the detector while |
---|
| 158 | simulation is in progress. Graph window is updated every 1000 events. |
---|
| 159 | |
---|
| 160 | The example provides also a simple Python file (readPY) used to display |
---|
| 161 | histograms with the python interface of PI. This must be run after the |
---|
| 162 | configuration script config.csh and the python interpreter. |
---|
| 163 | |
---|
| 164 | Various commads, with help, are available for Geant4 UI. |
---|
| 165 | /analysis/outputFile and /analysis/fileType respectively for |
---|
| 166 | changing the name and the type (xml or Hbook) of the file in wich results |
---|
| 167 | are saved. |
---|
| 168 | If these commends are used, to make the changes effective, another |
---|
| 169 | command, /anaysis/update, must be executed. |
---|
| 170 | |
---|
| 171 | NOTE: if a file named xrayfluo.hbk (default name) is present, it |
---|
| 172 | will be deleted, even if /analysis/outputFile command is issued |
---|
| 173 | before any run. |
---|