source: trunk/examples/advanced/xray_fluorescence/README @ 1354

Last change on this file since 1354 was 807, checked in by garnier, 16 years ago

update

File size: 7.3 KB
Line 
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                            -----------------
10XrayFluo is an advanced Geant4 example based on a realistic simulation of
11a test beam.
12The aim of the test beam was to characterize the response function of various
13X-Rays detectors used to measure fluorescence emissions from samples composed
14of different materials irradiated with a monochromatic beam of photons.
15In this example the geometry of the detector is simplified:
16one single pixel is used, since the test beams has used monolithic detectors.
17The response function is tabulated for different values of incident
18energy and stored in the file response.dat and SILIresponse.dat.
19At the moment, two kinds of detectors are available: HPGe and Si(Li).
20The sample, a simple box whose material can be selected, can be irradiated
21with different particles, with different spectra for the incident energy and
22with different shapes of the primary generator.
23Apart from the sample and the detector there are two diaphragm reproducing
24those used to collimate the incident beam during the test beam.
25
26The aim of this advanced example is to illustrate the use of particle
27generation 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
47In order to be able to use any of these packages, prior installation is
48necessary to configure you environment to get visulaization, as described in geant4 manual.
49If we want to use analisys, we provide an example for the use of PI:
50
51# flag that we want to use analysis:
52setenv G4ANALYSIS_USE               1
53
54#select AIDA implementation: PI 1.3.3
55
56setenv G4ANALYSIS_BUILD  1
57
58setenv PI_VERSION 1_3_3
59setenv PATH /your/path/to/PI/app/releases/PI/PI_1_3_0/slc3_ia32_gcc323/bin/:${PATH}
60eval `aida-config -r csh`
61
62#path to the lowEnergy data base
63
64setenv G4LEDATA /your/path/to/geant4/data/G4EMLOW3.0
65
66#path to Xray_Fluorescence data files, if not set, PWD is assumed:
67
68setenv XRAYDATA /path/to/detector/and/input/spctra/files
69
701. Run
71After the compilation of the program, to execute a sample simulation type (for example):
72
73$G4WORKDIR/bin/Linux-g++/XrayFluo
74
75The program gives, at tis point,the user 4 options:
76
77Please Select Simulation Geometrical Set-Up:
781 - Test Beam
792 - Infinite Plane
803 - Planet and Sun
814 - Phase-Space Production
82
83The first three choices are to choose different experimental set-ups
84(a test beam one, an infite plane and a planetary geometry), while
85the fourth is a simplified version of the first, without a detector,
86only to generate a tuple with particles genereted or exiting the sample.
87
88In order to run a macro, type the following command:
89
90idle> execute command "/control/execute xxxxx.mac"
91
92If the analysis options are set, histograms will
93automatically stored in the corresponding files (hbook or XML)
94
95In order to launch the application in batch mode, it is necessary to specify,
96after 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
1002. Detector description
101The telescope and detector geometry is defined in
102XrayFluoDetectorConstruction.cc
103
1043. Detector peculiar properties are described in XrayFluoSiLiDetectorType and
105XrayFluoHPGeDetectorType, both derived from XrayFluoVDetectorType. Other
106detector types can be added, creating other implementations of
107XrayFluoVDetectorType objects.
108Detector type selection is made in  XrayFluoDetectorConstruction, and can be
109modified trough /apparate/detector command of the UI. 
110Other 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
113of planes of maximum density with ABC ABC path. The fundamental cell is of type
114cubic with centered-faces.
115
1164. Physics processes
117
118The physics processes are in XrayFluoPhysicsList.cc
119The main process in this example is fluorescence emission from the sample.
120
1215. Event generation
122
123This is done using the G4ParticleGun with some modifications. See
124XrayFluoParticleGeneratorAction.cc
125
126Event generation is controlled by commands in the /gun/category (see help for further details).
127In 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
1386. Analysis
139
140At present the analisys is provided by any AIDA-3.2.1 compliant analysis system.
141In the example the Anaphe toolkit is used.
142
143AIDA implementation configuration for compilation and link are in GNUmakefile, once
144is set the environmente as above:
145
146ifdef G4ANALYSIS_USE
147 CPPFLAGS += `aida-config --include`
148 LDFLAGS  += `aida-config --lib`
149 LOADLIBS += `aida-config --lib`
150endif
151
152To build and execute the example on platforms where there is no
153implementation of the analysis system, the environment variable
154G4ANALYSIS_USE must not be set.
155
156By setting visPlotter variable in XrayFluoAnalysisManager to true,
157it is possible to display the simulated output of the detector while
158simulation is in progress. Graph window is updated every 1000 events.
159
160The example provides also a simple Python file (readPY) used to display
161histograms with the python interface of PI. This must be run after the
162configuration script config.csh and the python interpreter.
163
164Various commads, with help,  are available for Geant4 UI.
165/analysis/outputFile and /analysis/fileType respectively for
166changing the name and the type (xml or Hbook) of the file in wich results
167are saved.
168If these commends are used, to make the changes effective, another
169command, /anaysis/update, must be executed.
170
171NOTE: if a file named xrayfluo.hbk (default name) is present, it
172will be deleted, even if /analysis/outputFile command is issued
173before any run.
Note: See TracBrowser for help on using the repository browser.