Warning, /geant4/examples/extended/medical/dna/scavenger/README is written in an unsupported language. File is not indexed.
0001 -------------------------------------------------------------------
0002
0003 =========================================================
0004 Geant4 - an Object-Oriented Toolkit for Simulation in HEP
0005 =========================================================
0006
0007 scavenger
0008 ---------
0009
0010 CORRESPONDING AUTHORS
0011 F. Chappuis (a), L. Desorgher (b), H. Tran (c)
0012 (a) flore.chappuis@chuv.ch
0013 (b) laurent.desorgher@chuv.ch
0014 (c) tran@cenbg.in2p3.fr
0015
0016 (a,b) Institute of Radiation Physics (IRA), Lausanne University Hospital
0017 and University of Lausanne, CH-1007 Lausanne, Switzerland
0018 (c) CNRS, CENBG, UMR 5797, Université de Bordeaux, F-33170 Gradignan, France
0019
0020 Funding: FNS Synergia grant MAGIC-FNS CRSII5_186369.
0021
0022 This example is provided by the Geant4-DNA collaboration
0023 (http://geant4-dna.org).
0024
0025 Any report or published results obtained using the Geant4-DNA software
0026 shall cite the following Geant4-DNA collaboration publications:
0027 Med. Phys. 45 (2018) e722-e739
0028 Phys. Med. 31 (2015) 861-874
0029 Med. Phys. 37 (2010) 4692-4708
0030 Int. J. Model. Simul. Sci. Comput. 1 (2010) 157–178
0031
0032 0 - INTRODUCTION
0033
0034 This example shows how to activate the scavenging process in chemistry
0035 using the deterministic treatment of the IRT model (see chem6 example).
0036 It allows to define chemical reactions and the concentration of
0037 scavengers by means of a user text file (see section 10). The
0038 concentration of scavengers is assumed to be constant over time.
0039
0040 To run the example:
0041 mkdir scavenger-build
0042 cd scavenger-build
0043 cmake ../pathToExamples/scavenger
0044 make
0045
0046 In interactive mode, run:
0047 ./scavenger
0048 (Note: the interactive mode only allows the visualisation of the
0049 physical stage and does not work for the chemical stage)
0050
0051 In batch mode, the macro beam.in can be used as follows:
0052 ./scavenger beam.in
0053 or
0054 ./scavenger beam.in 123
0055 # 123 is the user's seed number
0056
0057 1 - GEOMETRY DEFINITION
0058
0059 The world volume is a simple water box which represents a 'pseudo infinite'
0060 homogeneous medium.
0061
0062 Two parameters define the geometry :
0063 - the material of the box for the physical stage is water.
0064 - for the chemistry stage, the concentration of scavengers in [mole/l]
0065 is added. This concentration is supposed to have no effect on the
0066 physical stage.
0067
0068 The default geometry is constructed in DetectorConstruction class.
0069
0070 2 - PHYSICS LIST
0071
0072 PhysicsList is Geant4 modular physics list using G4EmDNAPhysics_option2
0073 and EmDNAChemistry constructors (the chemistry constructor uses the
0074 independent reaction time method).
0075
0076 3 - ACTION INITIALIZATION
0077
0078 The class ActionInitialization instantiates and registers
0079 to Geant4 kernel all user action classes.
0080
0081 While in sequential mode the action classes are instantiated just
0082 once, via invoking the method: ActionInitialization::Build()
0083 in multi-threading mode the same method is invoked for each thread
0084 worker and so all user action classes are defined thread-local.
0085
0086 A run action class is instantiated both thread-local and global
0087 that's why its instance is created also in the method:
0088 ActionInitialization::BuildForMaster()
0089 which is invoked only in multi-threading mode.
0090
0091 To not register a molecule, add this command:
0092 G4MoleculeCounter::Instance()->DontRegister(G4O2::Definition());
0093
0094 4 - AN EVENT: THE PRIMARY GENERATOR
0095
0096 The primary kinematic consists of a single particle starting at the
0097 center of the box. The type of the particle and its energy are set
0098 in the PrimaryGeneratorAction class, and can be changed via the G4
0099 build-in commands of G4GeneralParticleSource class.
0100 The chemistry module is triggered in the StackingAction class when
0101 all physical tracks have been processed.
0102
0103 5 - DETECTOR RESPONSE: Scorers
0104
0105 5.1 - Species scorer
0106
0107 Scorers are defined in DetectorConstruction::ConstructSDandField().
0108 There is one G4MultiFunctionalDetector object which computes the
0109 energy deposition and the number of species along time in order to
0110 extract the radiochemical yields:
0111 (Number of species X) / (100 eV of deposited energy).
0112
0113 Run::RecordEvent(), called at end of event, collects information
0114 event per event from the hits collections, and accumulates statistic
0115 for RunAction::EndOfRunAction().
0116
0117 In multi-threading mode the accumulated statistics per workers is
0118 merged to the master in Run::Merge().
0119
0120 These two macro commands can be used to control the scoring time:
0121 /scorer/species/addTimeToRecord 1 ps
0122 # user can select time bin to score G values.
0123 /scorer/species/nOfTimeBins
0124 # or user can automatically select time bin logarithmically.
0125
0126 The information about all the molecular species is scored in a ROOT
0127 ntuple file, the name of which can be given by the user through the
0128 macro command: /scoreSpecies/setRootFileName scorer.root.
0129 The ROOT program plotG.C can be used to plot the G values vs time
0130 for each species.
0131
0132 5.2 - Primary killer
0133
0134 The G values are computed for a range of deposited energy. We are
0135 in an infinite volume. Therefore the energy lost by the primary
0136 equals the deposited energy since all secondary particles will
0137 finally slow down to the thermal energy.
0138 The primary is killed once it has deposited more energy than a
0139 minimum threshold.
0140
0141 **IMPORTANT**: However, when the primary particle loses more energy
0142 in few interaction steps than the maximum allowed threshold, the
0143 event is disregarded (= aborted).
0144
0145 These two macro commands can be used to control the energy loss by
0146 the primary:
0147 /primaryKiller/eLossMin 10 keV
0148 # after 10 keV of energy loss by the primary particle, the primary is killed
0149 /primaryKiller/eLossMax 10.1 keV
0150 # if the primary particle loses more than 10.1 keV, the event is aborted
0151
0152 The G values are then computed for a deposited energy in the range
0153 [10 keV; 10.1 keV].
0154
0155 Note that if the upper boundary of the energy lost by the primary
0156 is not set, the chemistry may take a lot of time to compute.
0157 This set of macros is embedded in the PrimaryKiller class.
0158 The species scorer must check whether the event was aborted before
0159 taking it or not into account for the computation of the results.
0160
0161 The size of detector can be controlled by this class using user
0162 macro command:
0163 /primaryKiller/setSize 5 5 5 um
0164 # kill the particles (primary and secondary) outside of the virtual volume
0165
0166 6 - STACKING ACTION
0167
0168 StackingAction::NewStage is called when a stack of tracks has been
0169 processed (for more details, look at the Geant4 documentation).
0170 A verification on whether physical tracks remain to be processed
0171 is done. If no tracks remain to be processed, the chemical module
0172 is then triggered.
0173
0174 7 - VISUALIZATION
0175
0176 The visualization manager is set via the G4VisExecutive class in the
0177 main() function in scavenger.cc.
0178 The initialization of the drawing is done via a set of /vis/ commands
0179 in the macro vis.mac. To activate the visualization mode, run:
0180 ./scavenger
0181
0182 8 - OUTPUT
0183
0184 Physics initialization and the defined reaction table are printed.
0185 G4Scheduler processes the chemical stage after the physical stage
0186 has been completed
0187
0188 9 - RELEVANT MACRO COMMANDS AND MACRO FILE
0189
0190 /primaryKiller/eLossMin 10 keV
0191 # after 10 keV of energy loss by the primary particle, the primary is killed
0192 /primaryKiller/eLossMax 10.1 keV
0193 # if the primary particle loses more than 10.1 keV, the event is aborted
0194 /scheduler/verbose 1
0195 # set the verbose level of the G4Scheduler class (time steps, reactions ...)
0196 /scheduler/endTime 1 microsecond
0197 # set the time at which the simulation stops
0198 /scheduler/whyDoYouStop
0199 # for advanced users: print information at the end of the chemical stage
0200 # to know why the simulation has stopped
0201
0202 The user macro file is: beam.in
0203 (electron simulations with primary killer method)
0204
0205 10 - REACTION PARSER FILE
0206
0207 This file is used to define chemical reactions and the concentration
0208 of scavengers for the EmDNAChemistry constructor.
0209
0210 Definition of scavengers:
0211 scavenger: NAME CONCENTRATION
0212 # concentration in [mole/l]
0213
0214 Definition of chemical reactions:
0215 REACTANTS -> PRODUCTS , RATE TYPE
0216 # reaction rate in [1/s/(mole/l)], for first order reaction in [1/s]
0217 # reaction type based on Frongillo et al., Rad. Phys. Chem., 1998
0218
0219 In any reaction, the molecules surrounded by square brackets [] are
0220 scavengers. In the products of a reaction, the user can also use []
0221 to prevent a molecule from being produced.
0222
0223 In this example, we provide 2 reaction tables for 2 different scavengers:
0224 one with O2 and another with NO2-/NO3-. We encourage the user to add
0225 chemical reactions and/or scavengers. However, the parser does not allow
0226 the addition of molecules not defined in the model. This aspect will be
0227 improved in future releases. In the meantime, please refer to the NO2-
0228 or NO3- ions defined in EmDNAChemistry::ConstructMolecule() to add new
0229 molecules.
0230
0231 11 - PLOT
0232
0233 The information about all the molecular species is scored in a ROOT
0234 (https://root.cern) ntuple file scorer.root. The ROOT program plotG
0235 can be used to plot the G values vs time for each species.
0236 Execute plotG as:
0237 root plotG.C
0238 or print G values to scorer.txt
0239 root plotG.C > scorer.txt
0240
0241
0242 The results show the molecular species (G values) as a function of
0243 time (ns). Please ignore the O_2^0 molecule.
0244 The function (plotG()) should have the same name as the
0245 file without file extension (plotG).
0246
0247 12 - OTHER
0248
0249 In physics:
0250 How can I display the tracking information?
0251 /tracking/verbose 1
0252
0253 In chemistry:
0254 How can I display the reaction information?
0255 /scheduler/verbose 1
0256 How can I display the step by step information?
0257 /scheduler/verbose 3