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.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]
1 -------------------------------------------------------------------
2
3 =========================================================
4 Geant4 - an Object-Oriented Toolkit for Simulation in HEP
5 =========================================================
6
7 scavenger
8 ---------
9
10 CORRESPONDING AUTHORS
11 F. Chappuis (a), L. Desorgher (b), H. Tran (c)
12 (a) flore.chappuis@chuv.ch
13 (b) laurent.desorgher@chuv.ch
14 (c) tran@cenbg.in2p3.fr
15
16 (a,b) Institute of Radiation Physics (IRA), Lausanne University Hospital
17 and University of Lausanne, CH-1007 Lausanne, Switzerland
18 (c) CNRS, CENBG, UMR 5797, Université de Bordeaux, F-33170 Gradignan, France
19
20 Funding: FNS Synergia grant MAGIC-FNS CRSII5_186369.
21
22 This example is provided by the Geant4-DNA collaboration
23 (http://geant4-dna.org).
24
25 Any report or published results obtained using the Geant4-DNA software
26 shall cite the following Geant4-DNA collaboration publications:
27 Med. Phys. 45 (2018) e722-e739
28 Phys. Med. 31 (2015) 861-874
29 Med. Phys. 37 (2010) 4692-4708
30 Int. J. Model. Simul. Sci. Comput. 1 (2010) 157–178
31
32 0 - INTRODUCTION
33
34 This example shows how to activate the scavenging process in chemistry
35 using the deterministic treatment of the IRT model (see chem6 example).
36 It allows to define chemical reactions and the concentration of
37 scavengers by means of a user text file (see section 10). The
38 concentration of scavengers is assumed to be constant over time.
39
40 To run the example:
41 mkdir scavenger-build
42 cd scavenger-build
43 cmake ../pathToExamples/scavenger
44 make
45
46 In interactive mode, run:
47 ./scavenger
48 (Note: the interactive mode only allows the visualisation of the
49 physical stage and does not work for the chemical stage)
50
51 In batch mode, the macro beam.in can be used as follows:
52 ./scavenger beam.in
53 or
54 ./scavenger beam.in 123
55 # 123 is the user's seed number
56
57 1 - GEOMETRY DEFINITION
58
59 The world volume is a simple water box which represents a 'pseudo infinite'
60 homogeneous medium.
61
62 Two parameters define the geometry :
63 - the material of the box for the physical stage is water.
64 - for the chemistry stage, the concentration of scavengers in [mole/l]
65 is added. This concentration is supposed to have no effect on the
66 physical stage.
67
68 The default geometry is constructed in DetectorConstruction class.
69
70 2 - PHYSICS LIST
71
72 PhysicsList is Geant4 modular physics list using G4EmDNAPhysics_option2
73 and EmDNAChemistry constructors (the chemistry constructor uses the
74 independent reaction time method).
75
76 3 - ACTION INITIALIZATION
77
78 The class ActionInitialization instantiates and registers
79 to Geant4 kernel all user action classes.
80
81 While in sequential mode the action classes are instantiated just
82 once, via invoking the method: ActionInitialization::Build()
83 in multi-threading mode the same method is invoked for each thread
84 worker and so all user action classes are defined thread-local.
85
86 A run action class is instantiated both thread-local and global
87 that's why its instance is created also in the method:
88 ActionInitialization::BuildForMaster()
89 which is invoked only in multi-threading mode.
90
91 To not register a molecule, add this command:
92 G4MoleculeCounter::Instance()->DontRegister(G4O2::Definition());
93
94 4 - AN EVENT: THE PRIMARY GENERATOR
95
96 The primary kinematic consists of a single particle starting at the
97 center of the box. The type of the particle and its energy are set
98 in the PrimaryGeneratorAction class, and can be changed via the G4
99 build-in commands of G4GeneralParticleSource class.
100 The chemistry module is triggered in the StackingAction class when
101 all physical tracks have been processed.
102
103 5 - DETECTOR RESPONSE: Scorers
104
105 5.1 - Species scorer
106
107 Scorers are defined in DetectorConstruction::ConstructSDandField().
108 There is one G4MultiFunctionalDetector object which computes the
109 energy deposition and the number of species along time in order to
110 extract the radiochemical yields:
111 (Number of species X) / (100 eV of deposited energy).
112
113 Run::RecordEvent(), called at end of event, collects information
114 event per event from the hits collections, and accumulates statistic
115 for RunAction::EndOfRunAction().
116
117 In multi-threading mode the accumulated statistics per workers is
118 merged to the master in Run::Merge().
119
120 These two macro commands can be used to control the scoring time:
121 /scorer/species/addTimeToRecord 1 ps
122 # user can select time bin to score G values.
123 /scorer/species/nOfTimeBins
124 # or user can automatically select time bin logarithmically.
125
126 The information about all the molecular species is scored in a ROOT
127 ntuple file, the name of which can be given by the user through the
128 macro command: /scoreSpecies/setRootFileName scorer.root.
129 The ROOT program plotG.C can be used to plot the G values vs time
130 for each species.
131
132 5.2 - Primary killer
133
134 The G values are computed for a range of deposited energy. We are
135 in an infinite volume. Therefore the energy lost by the primary
136 equals the deposited energy since all secondary particles will
137 finally slow down to the thermal energy.
138 The primary is killed once it has deposited more energy than a
139 minimum threshold.
140
141 **IMPORTANT**: However, when the primary particle loses more energy
142 in few interaction steps than the maximum allowed threshold, the
143 event is disregarded (= aborted).
144
145 These two macro commands can be used to control the energy loss by
146 the primary:
147 /primaryKiller/eLossMin 10 keV
148 # after 10 keV of energy loss by the primary particle, the primary is killed
149 /primaryKiller/eLossMax 10.1 keV
150 # if the primary particle loses more than 10.1 keV, the event is aborted
151
152 The G values are then computed for a deposited energy in the range
153 [10 keV; 10.1 keV].
154
155 Note that if the upper boundary of the energy lost by the primary
156 is not set, the chemistry may take a lot of time to compute.
157 This set of macros is embedded in the PrimaryKiller class.
158 The species scorer must check whether the event was aborted before
159 taking it or not into account for the computation of the results.
160
161 The size of detector can be controlled by this class using user
162 macro command:
163 /primaryKiller/setSize 5 5 5 um
164 # kill the particles (primary and secondary) outside of the virtual volume
165
166 6 - STACKING ACTION
167
168 StackingAction::NewStage is called when a stack of tracks has been
169 processed (for more details, look at the Geant4 documentation).
170 A verification on whether physical tracks remain to be processed
171 is done. If no tracks remain to be processed, the chemical module
172 is then triggered.
173
174 7 - VISUALIZATION
175
176 The visualization manager is set via the G4VisExecutive class in the
177 main() function in scavenger.cc.
178 The initialization of the drawing is done via a set of /vis/ commands
179 in the macro vis.mac. To activate the visualization mode, run:
180 ./scavenger
181
182 8 - OUTPUT
183
184 Physics initialization and the defined reaction table are printed.
185 G4Scheduler processes the chemical stage after the physical stage
186 has been completed
187
188 9 - RELEVANT MACRO COMMANDS AND MACRO FILE
189
190 /primaryKiller/eLossMin 10 keV
191 # after 10 keV of energy loss by the primary particle, the primary is killed
192 /primaryKiller/eLossMax 10.1 keV
193 # if the primary particle loses more than 10.1 keV, the event is aborted
194 /scheduler/verbose 1
195 # set the verbose level of the G4Scheduler class (time steps, reactions ...)
196 /scheduler/endTime 1 microsecond
197 # set the time at which the simulation stops
198 /scheduler/whyDoYouStop
199 # for advanced users: print information at the end of the chemical stage
200 # to know why the simulation has stopped
201
202 The user macro file is: beam.in
203 (electron simulations with primary killer method)
204
205 10 - REACTION PARSER FILE
206
207 This file is used to define chemical reactions and the concentration
208 of scavengers for the EmDNAChemistry constructor.
209
210 Definition of scavengers:
211 scavenger: NAME CONCENTRATION
212 # concentration in [mole/l]
213
214 Definition of chemical reactions:
215 REACTANTS -> PRODUCTS , RATE TYPE
216 # reaction rate in [1/s/(mole/l)], for first order reaction in [1/s]
217 # reaction type based on Frongillo et al., Rad. Phys. Chem., 1998
218
219 In any reaction, the molecules surrounded by square brackets [] are
220 scavengers. In the products of a reaction, the user can also use []
221 to prevent a molecule from being produced.
222
223 In this example, we provide 2 reaction tables for 2 different scavengers:
224 one with O2 and another with NO2-/NO3-. We encourage the user to add
225 chemical reactions and/or scavengers. However, the parser does not allow
226 the addition of molecules not defined in the model. This aspect will be
227 improved in future releases. In the meantime, please refer to the NO2-
228 or NO3- ions defined in EmDNAChemistry::ConstructMolecule() to add new
229 molecules.
230
231 11 - PLOT
232
233 The information about all the molecular species is scored in a ROOT
234 (https://root.cern) ntuple file scorer.root. The ROOT program plotG
235 can be used to plot the G values vs time for each species.
236 Execute plotG as:
237 root plotG.C
238 or print G values to scorer.txt
239 root plotG.C > scorer.txt
240
241
242 The results show the molecular species (G values) as a function of
243 time (ns). Please ignore the O_2^0 molecule.
244 The function (plotG()) should have the same name as the
245 file without file extension (plotG).
246
247 12 - OTHER
248
249 In physics:
250 How can I display the tracking information?
251 /tracking/verbose 1
252
253 In chemistry:
254 How can I display the reaction information?
255 /scheduler/verbose 1
256 How can I display the step by step information?
257 /scheduler/verbose 3