Geant4 Cross Reference |
>> 1 $Id: README,v 1.14 2005/12/09 22:15:52 mantero 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 reproducing various setups for PIXE or XRF experiments. 10 11 11 A sample macro (livermore.mac) is provided. 12 A sample macro (livermore.mac) is provided. 12 13 13 The detector is a monolitic Si(Li) or HPGe det 14 The detector is a monolitic Si(Li) or HPGe detector, with real response functions, stored in response.dat and SILIresponse.dat. 14 15 15 The sample, a simple box whose material can be 16 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 17 17 Two diaphragms reproducing those used to colli 18 Two diaphragms reproducing those used to collimate the incident beam on sample and detector during the test beam are simulated as well 18 19 19 The aim of this advanced example is to illustr 20 The aim of this advanced example is to illustrate Deexcitation products generation and analysis schemes available in Geant4. 20 21 21 Generation of particles is done via the G4Part 22 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 23 23 The example includes the possibility to shoot 24 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 25 25 Histogramming facilities are provided using th << 26 Histogramming facilities are presently provided for the Linux environment by using the AIDA interfaces.The AIDA compliant version has not been tested by the developers and is here as a example of "forward compatibility" on how to use analysis. 26 27 27 In order to be able to use any of these packag 28 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 29 29 #path to the lowEnergy data base 30 #path to the lowEnergy data base 30 31 31 setenv G4LEDATA /your/path/to/geant4/data/G4EM 32 setenv G4LEDATA /your/path/to/geant4/data/G4EMLOWXX.XX 32 33 33 #path to Xray_Fluorescence data files, if not 34 #path to Xray_Fluorescence data files, if not set, PWD is assumed: 34 35 35 setenv XRAYDATA /path/to/detector/and/input/sp 36 setenv XRAYDATA /path/to/detector/and/input/spctra/files 36 37 37 1. Run 38 1. Run 38 After the compilation of the program, to execu 39 After the compilation of the program, to execute a sample simulation type (for example): 39 40 40 $G4WORKDIR/bin/Linux-g++/XrayFluo 41 $G4WORKDIR/bin/Linux-g++/XrayFluo 41 42 42 The program gives, at tis point,the user 4 opt 43 The program gives, at tis point,the user 4 options: 43 44 44 Please Select Simulation Geometrical Set-Up: 45 Please Select Simulation Geometrical Set-Up: 45 1 - Test Beam 46 1 - Test Beam 46 2 - Infinite Plane 47 2 - Infinite Plane 47 3 - Planet and Sun 48 3 - Planet and Sun 48 4 - Phase-Space Production 49 4 - Phase-Space Production 49 50 50 The first three choices are to choose differen 51 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 52 52 In order to run a macro, type the following co 53 In order to run a macro, type the following command: 53 54 54 idle> execute command "/control/execute xxxxx. 55 idle> execute command "/control/execute xxxxx.mac" 55 56 56 If the analysis options are set, histograms wi << 57 If the analysis options are set, histograms will automatically stored in the corresponding files (hbook or XML) 57 58 58 In order to launch the application in batch mo 59 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 60 60 $G4WORKDIR/bin/Linux-g++/XrayFluo xxxxx.mac 1 61 $G4WORKDIR/bin/Linux-g++/XrayFluo xxxxx.mac 1 61 62 62 2. Detector description 63 2. Detector description 63 The telescope and detector geometry is defined 64 The telescope and detector geometry is defined in XrayFluoDetectorConstruction.cc and similar 64 65 65 3. Detector peculiar properties are described 66 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 67 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 68 68 4. Physics processes 69 4. Physics processes 69 70 70 Tha user can select the preferred physics list 71 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 72 72 5. Event generation 73 5. Event generation 73 74 74 This is done using the G4ParticleGun with some 75 This is done using the G4ParticleGun with some modifications. See XrayFluoParticleGeneratorAction.cc 75 76 76 Event generation is controlled by commands in 77 Event generation is controlled by commands in the /gun/category (see help for further details). In this readme only two commands are undrlined: 77 78 78 - /gun/loadGunData <filename>: to be used with << 79 - /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 eficiency. 79 80 80 - /gun/loadRayleighFlag <true/false> This is u 81 - /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 82 >> 83 6. Analysis 82 84 >> 85 At present the analisys is provided by any AIDA-3.2.1 compliant analysis system. 83 86 >> 87 To build and execute the example on platforms where there is no implementation of the analysis system, the environment variable G4ANALYSIS_USE must not be set. >> 88 >> 89 By setting visPlotter variable in XrayFluoAnalysisManager to true, it is possible to display the simulated output of the detector while simulation is in progress. Graph window is updated every 1000 events. >> 90 >> 91 Various commads, with help, are available for Geant4 UI. /analysis/outputFile and /analysis/fileType respectively for changing the name and the type (xml or Hbook) of the file in wich results are saved. >> 92 >> 93 If these commands are used, to make the changes effective, another command, /anaysis/update, must be executed. >> 94 >> 95 NOTE: if a file named xrayfluo.hbk (default name) is present, it will be deleted, even if /analysis/outputFile command is issued before every run.