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 xray_fluorescence 7 xray_fluorescence 8 ----------------- 8 ----------------- 9 XrayFluo is an advanced Geant4 example reprodu 9 XrayFluo is an advanced Geant4 example reproducing various setups for PIXE or XRF experiments. 10 10 11 A sample macro (livermore.mac) is provided. 11 A sample macro (livermore.mac) is provided. 12 12 13 The detector is a monolitic Si(Li) or HPGe det 13 The detector is a monolitic Si(Li) or HPGe detector, with real response functions, stored in response.dat and SILIresponse.dat. 14 14 15 The sample, a simple box whose material can be 15 The sample, a simple box whose material can be selected, can be irradiated with different particles, with different spectra for the incident energy and with different shapes of the primary generator. 16 16 17 Two diaphragms reproducing those used to colli 17 Two diaphragms reproducing those used to collimate the incident beam on sample and detector during the test beam are simulated as well 18 18 19 The aim of this advanced example is to illustr 19 The aim of this advanced example is to illustrate Deexcitation products generation and analysis schemes available in Geant4. 20 20 21 Generation of particles is done via the G4Part 21 Generation of particles is done via the G4ParticleGun: the example shows how to use it in order to obtain a beam of circular section or a particle source isotropic in space 22 22 23 The example includes the possibility to shoot 23 The example includes the possibility to shoot particles according to a given energy spectrum: the files B_flare.dat, C_Flare.dat and M_flare.dat store the spectra of photons during solar flares, the files mercury2_flx_solmax.dat and mercury_flx_solmin.dat contain the spectra of protons respectively during solar maximum and solar minimum conditions, and merc2_flx_alp_max.dat merc_flx_alp_min.dat contain the spectra of alpha particles again respectively during solar maximum and solar minimum conditions. These features are available by changing hard-doced values in XrayFluoRunAction.cc 24 24 25 Histogramming facilities are provided using th 25 Histogramming facilities are provided using the built-it g4analysis tools of Geant4. 26 26 27 In order to be able to use any of these packag 27 In order to be able to use any of these packages, prior installation is necessary to configure you environment to get visulaization, as described in geant4 manual. 28 28 29 #path to the lowEnergy data base 29 #path to the lowEnergy data base 30 30 31 setenv G4LEDATA /your/path/to/geant4/data/G4EM 31 setenv G4LEDATA /your/path/to/geant4/data/G4EMLOWXX.XX 32 32 33 #path to Xray_Fluorescence data files, if not 33 #path to Xray_Fluorescence data files, if not set, PWD is assumed: 34 34 35 setenv XRAYDATA /path/to/detector/and/input/sp 35 setenv XRAYDATA /path/to/detector/and/input/spctra/files 36 36 37 1. Run 37 1. Run 38 After the compilation of the program, to execu 38 After the compilation of the program, to execute a sample simulation type (for example): 39 39 40 $G4WORKDIR/bin/Linux-g++/XrayFluo 40 $G4WORKDIR/bin/Linux-g++/XrayFluo 41 41 42 The program gives, at tis point,the user 4 opt 42 The program gives, at tis point,the user 4 options: 43 43 44 Please Select Simulation Geometrical Set-Up: 44 Please Select Simulation Geometrical Set-Up: 45 1 - Test Beam 45 1 - Test Beam 46 2 - Infinite Plane 46 2 - Infinite Plane 47 3 - Planet and Sun 47 3 - Planet and Sun 48 4 - Phase-Space Production 48 4 - Phase-Space Production 49 49 50 The first three choices are to choose differen 50 The first three choices are to choose different experimental set-ups (a test beam one, an infite plane and a planetary geometry), while the fourth is a simplified version of the first, without a detector, only to generate a tuple with particles genereted or exiting the sample. 51 51 52 In order to run a macro, type the following co 52 In order to run a macro, type the following command: 53 53 54 idle> execute command "/control/execute xxxxx. 54 idle> execute command "/control/execute xxxxx.mac" 55 55 56 If the analysis options are set, histograms wi 56 If the analysis options are set, histograms will automatically stored in the corresponding files (root, by default) 57 57 58 In order to launch the application in batch mo 58 In order to launch the application in batch mode, it is necessary to specify, after the executable file name, the name of the macro file and the number of the choice: 59 59 60 $G4WORKDIR/bin/Linux-g++/XrayFluo xxxxx.mac 1 60 $G4WORKDIR/bin/Linux-g++/XrayFluo xxxxx.mac 1 61 61 62 2. Detector description 62 2. Detector description 63 The telescope and detector geometry is defined 63 The telescope and detector geometry is defined in XrayFluoDetectorConstruction.cc and similar 64 64 65 3. Detector peculiar properties are described 65 3. Detector peculiar properties are described in XrayFluoSiLiDetectorType and XrayFluoHPGeDetectorType, both derived from XrayFluoVDetectorType. Other detector types can be added, creating other implementations of XrayFluoVDetectorType objects. Detector type selection is made in XrayFluoDetectorConstruction, and can be modified trough /apparate/detector command of the UI. 66 Other commands (apparate/sample /apparate/samp 66 Other commands (apparate/sample /apparate/sampleGranularity /apparate/GrainDiameter) are present to simulate sample granulosity: grains are spheres, disposed in a compact cubic structure, i.e superipmposition of planes of maximum density with ABC ABC path. The fundamental cell is of type cubic with centered-faces. 67 67 68 4. Physics processes 68 4. Physics processes 69 69 70 Tha user can select the preferred physics list 70 Tha user can select the preferred physics list form the pre-built ones producin atomic deexcitation products: livermore, standard (opt 0, 1, 2, 3) and penelope. 71 71 72 5. Event generation 72 5. Event generation 73 73 74 This is done using the G4ParticleGun with some 74 This is done using the G4ParticleGun with some modifications. See XrayFluoParticleGeneratorAction.cc 75 75 76 Event generation is controlled by commands in 76 Event generation is controlled by commands in the /gun/category (see help for further details). In this readme only two commands are undrlined: 77 77 78 - /gun/loadGunData <filename>: to be used with 78 - /gun/loadGunData <filename>: to be used with the setup #1, loads the ntuple created in the setup #4. The loaded particles will be generated and will be directed ALL OF THEM to the detector. This can be useful to perform detector studies with encreased efficiency. 79 79 80 - /gun/loadRayleighFlag <true/false> This is u 80 - /gun/loadRayleighFlag <true/false> This is used to let the user decide if backscattered primary particles should be loaded and directed toward the detector. This command, in order to be useful, must be used BEFORE the previous one. 81 81 82 82 83 83