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.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.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 ]

Name Size       Last modified (GMT) Description
Back Parent directory       2024-12-05 15:16:16
Folder include/       2024-12-05 15:16:16
Folder plot/       2024-12-05 15:16:16
Folder src/       2024-12-05 15:16:16
File CMakeLists.txt 2989 bytes       2024-12-05 15:16:16
File GNUmakefile 416 bytes       2024-12-05 15:16:16
File History 4289 bytes       2024-12-05 15:16:16
File README 8339 bytes       2024-12-05 15:16:16
File beam.in 2106 bytes       2024-12-05 15:16:16
C++ file chem4.cc 10539 bytes       2024-12-05 15:16:16
File chem4.out 36783 bytes       2024-12-05 15:16:16
File vis.mac 2328 bytes       2024-12-05 15:16:16

  1 -------------------------------------------------------------------
  2 
  3      =========================================================
  4      Geant4 - an Object-Oriented Toolkit for Simulation in HEP
  5      =========================================================
  6 
  7                             Chem4
  8                             -------
  9 
 10 CORRESPONDING AUTHORS
 11 P. Piersimoni (a), M. Karamitros (b)
 12 (a) pierluigi.piersimoni _ gmail _ com
 13 (b) matkara _ gmail _ com
 14 
 15 This example is provided by the Geant4-DNA collaboration.
 16 (http://geant4-dna.org)
 17 
 18 Any report or published results obtained using the Geant4-DNA software shall 
 19 cite the following Geant4-DNA collaboration publications:
 20 Phys. Med. 31 (2015) 861-874
 21 Med. Phys. 37 (2010) 4692-4708
 22 
 23 The example shows how to activate chemistry code and score the radiochemical yield G
 24 defined as
 25     (Number of species X) / (100 eV of deposited energy).
 26 in a range of deposited energy [X;Y] chosen by the user.
 27 
 28  1 - GEOMETRY DEFINITION
 29 
 30     The world volume is a simple box which represents a 'pseudo infinite'
 31     homogeneous medium.
 32 
 33     Two parameters define the geometry :
 34     - the material of the box -- for Geant4-DNA it has to be water.
 35     - the full size of the box.
 36 
 37     The default geometry is constructed in DetectorConstruction class.
 38 
 39  2 - PHYSICS LIST
 40 
 41     PhysicsList is Geant4 modular physics list using G4EmDNAPhysics &
 42     G4EmDNAChemistry constructors.
 43     It will later be updated to use the G4EmDNAModelActivator constructor
 44 
 45  3 - CHEMISTRY MODEL AND CHEMICAL REACTION LIST
 46 
 47     ## UI species are defined by format :
 48     username [ molecule | charge | D(m2/s) | Radius(nm) ]
 49     where : *username* is decided by users, *molecule* is used by Geant4,
 50     *D* is diffusion constant, *Radius* is reaction radius.
 51     Spaces between characters are needed.
 52 
 53     ## UI reactions are defined by format :
 54     /chem/reaction/add H + H -> H2  | Fix |  1.2e10 | 0
 55     where : *H* is username, *1.2e10* is reaction rate, *0* is reaction type.
 56     Spaces between characters are needed.
 57 
 58     (parameters can be found in Prog. Nucl. Sci. Tec. 2 (2011))
 59 
 60  4 - ACTION INITALIZATION
 61 
 62     The class ActionInitialization instantiates and registers
 63     to Geant4 kernel all user action classes.
 64 
 65     While in sequential mode the action classes are instantiated just once,
 66     via invoking the method:
 67        ActionInitialization::Build()
 68     in multi-threading mode the same method is invoked for each thread worker
 69     and so all user action classes are defined thread-local.
 70 
 71     A run action class is instantiated both thread-local
 72     and global that's why its instance is created also in the method:
 73     ActionInitialization::BuildForMaster()
 74     which is invoked only in multi-threading mode.
 75 
 76  5 - AN EVENT: THE PRIMARY GENERATOR
 77 
 78     The primary kinematic consists of a single particle starting at the center
 79     of the box. The type of the particle and its energy are set in the
 80     PrimaryGeneratorAction class, and can be changed via the G4 build-in
 81     commands of G4ParticleGun class.
 82     The chemistry module is triggered in the StackingAction class when all
 83     physical tracks have been processed.
 84 
 85  6 - DETECTOR RESPONSE: Scorers
 86  
 87       6.1 - Species scorer
 88 
 89     Scorers are defined in DetectorConstruction::ConstructSDandField(). There is
 90     one G4MultiFunctionalDetector object which computes the energy deposition and
 91     the number of species along time in order to extract
 92     the radiochemical yields:
 93     (Number of species X) / (100 eV of deposited energy).
 94 
 95     Run::RecordEvent(), called at end of event, collects informations
 96     event per event from the hits collections, and accumulates statistic for
 97     RunAction::EndOfRunAction().
 98 
 99     In multi-threading mode the statistics accumulated per workers is merged
100     to the master in Run::Merge().
101     The information about all the molecular species is scored in a ROOT
102     ntuple file Species.root. The root macro program PlotNtuple.C can be used to
103     plot the G values vs time, for each species.
104     
105         6.2 - Primary killer
106 
107     The G-values are computing for a range of deposited energy. 
108     We are in an infinite volume. Therefore the energy lost by the 
109     primary equals the deposited energy since all secondary particles 
110     will finally slow down to the thermal energy. 
111     The primary is killed once it has deposited more energy than a 
112     minimum threshold. 
113     
114     **IMPORTANT**: However, when the primary particle looses more energy 
115     in few interaction steps than the maximum allowed thresold, 
116     the event is disregarded (=aborted). 
117     
118     These two macro commands can be used to control the energy loss by 
119     the primary:
120     
121     /primaryKiller/eLossMin 1 keV 
122     # after 1 keV of energy loss by the primary particle, the primary is killed
123     
124     /primaryKiller/eLossMax 2 keV 
125     # if the primary particle losses more than 2 keV, the event is aborted
126     
127     The G-values are then computed for a deposited energy in the range [1 keV;2 keV].
128  
129     Note that if the upper boundary of the energy lost by the primary is 
130     not set, the chemistry may take a lot of time to compute. 
131     This set of macros is embedded in the PrimaryKiller class.
132     The species scorer must check whether the event was aborted before taking it or not into
133     account for the computation of the results. 
134 
135  7 - STACKING ACTION
136 
137      StackingAction::NewStage is called when a stack of tracks has been processed
138      (for more details, look at the Geant4 documentation).
139      A verification on whether physical tracks remain to be processed is done.
140      If no tracks remain to be processed, the chemical module is then triggered.
141 
142  8 - VISUALISATION
143 
144     The visualization manager is set via the G4VisExecutive class
145     in the main() function in chem4.cc.
146     The initialisation of the drawing is done via a set of /vis/ commands
147     in the macro vis.mac. To activate the visualization mode run:
148      ./chem4 -vis
149 
150  9 - OUTPUT
151 
152     Physics initialization and the defined reaction table are printed.
153     G4Scheduler processes the chemical stage time step after time step.
154     Chemical reactions are printed.
155     The molecular reaction as a function of the elapsed time can be displayed
156     setting the macro command /scheduler/verbose 1
157 
158 10 - RELEVANT MACRO COMMANDS
159     /primaryKiller/eLossMin 1 keV # after 1 keV of energy loss by the primary particle, the primary is killed
160     /primaryKiller/eLossMax 2 keV # if the primary particle losses more than 2 keV, the event is aborted
161     /scheduler/verbose 1 # set the verbose level of the G4Scheduler class (time steps, reactions ...)
162     /scheduler/endTime 1 microsecond # set the time at which the simulation stops
163     /scheduler/whyDoYouStop # for advanced users: print information at the end of the chemical stage to know why the simulation has stopped
164     
165 11 - PLOT
166     The information about all the molecular species is scored in a ROOT
167     ntuple file Species.root during the run of chem4.
168     The ROOT program plotG can be used to plot the G values vs time, 
169     for each species. It must be launched after 
170     chem4 has run. When "plotG" is executed, select the root file output by the 
171     chem4 application.
172     You can also execute plotG as: 
173       .plot/plotG Species.root 
174     where Species.root is the file output by the chem4 application.
175     
176 12 - OTHER INFORMATION
177     I have access to a track. How do I access to its molecular information?
178      #include "G4Molecule.hh"
179      G4Track* thisIsMytrack = ...
180      G4Molecule* thisIsMyMolecule = GetMolecule(thisIsMyTrack);
181      If the pointer thisIsMyMolecule is null, then this is NOT a chemical species 
182     
183     How do I get the molecule's name?
184      G4Molecule* thisIsMyMolecule = ...
185      const G4String& moleculeName = thisIsMyMolecule->GetName();
186     
187     How can I display the reaction information?
188      - Use this macro command: /scheduler/verbose 1
189     
190     How can I display the step by step information?
191      1. Add ITTrackingInteraction to the G4Scheduler singleton (cf. chem3)
192      2. Use /chem/tracking/verbose 1
193 
194  13 - HOW TO START ?
195 
196      To run the example in batch mode:
197        ./chem4 -mac beam.in
198      or
199        ./chem4
200      then the macro beam.in is processed by default
201 
202      In interactive mode, run:
203        ./chem4 -gui
204      or
205        ./chem4 -gui gui.mac