Warning, /geant4/examples/extended/medical/dna/chem5/README.md is written in an unsupported language. File is not indexed.
0001 \page ExampleChem5 Example chem5
0002
0003 \author Ramos-Mendez (a) based on initial implementation of chem5 from \n
0004 P. Piersimoni (b), M. Karamitros (c) \n
0005 (a) joserm84 _ gmail _ com \n
0006
0007 This example is provided by the Geant4-DNA collaboration.
0008 (http://geant4-dna.org)
0009
0010 Any report or published results obtained using the Geant4-DNA software shall
0011 cite the following Geant4-DNA collaboration publications: \n
0012 Phys. Med. 31 (2015) 861-874 \n
0013 Med. Phys. 37 (2010) 4692-4708 \n
0014 Phys. Med. Biol. 63(10) (2018) 105014-12pp\n
0015
0016 The example is a variation of the chem4 example, it shows how to activate
0017 the chemistry code and score the radiochemical yield G using the constructors
0018 G4EmDNAPhysics_option8 and G4EmDNAChemistry_option1\n
0019
0020 ## GEOMETRY DEFINITION
0021 The world volume is a simple box which represents a 'pseudo infinite'
0022 homogeneous medium.
0023
0024 Two parameters define the geometry :
0025 - the material of the box -- for Geant4-DNA it has to be water.
0026 - the full size of the box.
0027
0028 The default geometry is constructed in DetectorConstruction class.
0029
0030 ## PHYSICS LIST
0031
0032 PhysicsList is Geant4 modular physics list using G4EmDNAPhysics_option8 &
0033 G4EmDNAChemistry_option1 constructors.
0034
0035 ## ACTION INITALIZATION
0036
0037 The class ActionInitialization instantiates and registers
0038 to Geant4 kernel all user action classes.
0039
0040 While in sequential mode the action classes are instantiated just once,
0041 via invoking the method
0042 ActionInitialization::Build()
0043 in multi-threading mode the same method is invoked for each thread worker
0044 and so all user action classes are defined thread-local.
0045
0046 A run action class is instantiated both thread-local
0047 and global that's why its instance is created also in the method
0048 ActionInitialization::BuildForMaster()
0049 which is invoked only in multi-threading mode.
0050
0051 ## AN EVENT: PRIMARY GENERATOR
0052
0053 The primary kinematic consists of a single particle starting at the center
0054 of the box. The type of the particle and its energy are set in the
0055 PrimaryGeneratorAction class, and can be changed via the G4 build-in
0056 commands of G4ParticleGun class.
0057 The chemistry module is triggered in the StackingAction class when all
0058 physical tracks have been processed.
0059
0060 ## DETECTOR RESPONSE : Scorers
0061
0062 ### Species scorer
0063
0064 Scorers are defined in DetectorConstruction::ConstructSDandField(). There is
0065 one G4MultiFunctionalDetector object which computes the energy deposition and
0066 the number of species along time in order to extract
0067 the radiochemical yields:
0068 ```
0069 (Number of species X) / (100 eV of deposited energy).
0070 ```
0071
0072 Run::RecordEvent(), called at end of event, collects informations
0073 event per event from the hits collections, and accumulates statistic for
0074 RunAction::EndOfRunAction().
0075
0076 In multi-threading mode the statistics accumulated per workers is merged
0077 to the master in Run::Merge().
0078
0079 The information about G-value as a function of the time for each
0080 molecular specie is scored in ASCII format.
0081
0082 ### Primary Killer
0083 The G-values are computing for a range of deposited energy.
0084 An infinite volume is assumed as the geometrical scenario. Therefore the energy lost by the
0085 primary particle equals the deposited energy from all secondary particles.
0086
0087 The primary is killed once it has deposited more energy than a
0088 minimum threshold.
0089 IMPORTANT: However, when the primary particle looses more energy in
0090 few interaction steps than the maximum allowed thresold, the event is
0091 disregarded (=aborted). \n
0092
0093 These two macro commands can be used to control the energy loss by the primary:
0094
0095 ```
0096 /primaryKiller/eLossMin 10 keV
0097 # after 10 keV of energy loss by the primary particle, the primary is killed
0098
0099 /primaryKiller/eLossMax 10.1 keV
0100 # if the primary particle losses more than 10.1 keV, the event is aborted
0101 ```
0102
0103 The G-values are then computed for a deposited energy in the range [10 keV;10.1 keV].
0104
0105 Note that if the upper boundary of the energy lost by the primary is not set, the chemistry may
0106 take a lot of time to compute as the number of secondaries may be huge.
0107 This set of macros is embedded in the PrimaryKiller class.
0108 The species scorer must check whether the event was aborted before taking it or not into
0109 account for the computation of the results.
0110
0111 ## STACKING ACTION
0112
0113 StackingAction::NewStage is called when a stack of tracks has been processed
0114 (for more details, look at the Geant4 documentation).
0115 A verification on whether physical tracks remain to be processed is done.
0116 If no tracks remain to be processed, the chemical module is then triggered.
0117
0118 ## VISUALISATION
0119
0120 The visualization manager is set via the G4VisExecutive class
0121 in the main() function in chem5.cc.
0122 The initialisation of the drawing is done via a set of /vis/ commands
0123 in the macro vis.mac. To activate the visualization mode run:
0124 ```
0125 ./chem5 -vis
0126 ```
0127
0128 ## OUTPUT
0129
0130 Physics initialization and the defined reaction table are printed.
0131 G4Scheduler processes the chemical stage time step after time step.
0132 Chemical reactions are printed.
0133 The molecular reaction as a function of the elapsed time can be displayed
0134 setting the macro command /scheduler/verbose 1
0135
0136 ## RELEVANT MACRO COMMANDS
0137 ```
0138 /primaryKiller/eLossMax 10 keV # after 10 keV of energy loss by the primary particle, the primary is killed
0139 /scheduler/verbose 1 # set the verbose level of the G4Scheduler class (time steps, reactions ...)
0140 /scheduler/endTime 1 microsecond # set the time at which the simulation stops
0141 /scheduler/whyDoYouStop # for advanced users: print information at the end of the chemical stage
0142 # to know why the simulation has stopped
0143 ```
0144
0145 ## PLOT
0146 The information about all the molecular species is scored in a ASCII
0147 tuple, each value corresponding to the G-value per time. This format is friendly
0148 with a wide variety of plotting software.
0149 Experimental data of G-values for solvated electron and hydroxil radical (as a function of the time)
0150 from the literature is available in data subdirectory, the references are provided
0151 in the header of each file. Further information is available in Phys. Med. Biol. 63(10) (2018) 105014-12pp.
0152
0153
0154 A gnuplot script (plot.gp) or python script (plot.py) files are provided to display the output data with the experimental data
0155
0156 ## HOW TO START
0157
0158 To run the example in batch mode
0159
0160 ./chem5 -mac beam.in
0161
0162 or
0163
0164 ./chem5
0165
0166 then the macro beam.in is processed by default
0167
0168 In interactive mode, run:
0169
0170 ./chem5 -gui
0171
0172 or
0173
0174 ./chem5 -gui gui.mac