Back to home page

EIC code displayed by LXR

 
 

    


Warning, /geant4/examples/extended/medical/dna/chem4/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                             Chem4
0008                             -------
0009 
0010 CORRESPONDING AUTHORS
0011 P. Piersimoni (a), M. Karamitros (b)
0012 (a) pierluigi.piersimoni _ gmail _ com
0013 (b) matkara _ gmail _ com
0014 
0015 This example is provided by the Geant4-DNA collaboration.
0016 (http://geant4-dna.org)
0017 
0018 Any report or published results obtained using the Geant4-DNA software shall 
0019 cite the following Geant4-DNA collaboration publications:
0020 Phys. Med. 31 (2015) 861-874
0021 Med. Phys. 37 (2010) 4692-4708
0022 
0023 The example shows how to activate chemistry code and score the radiochemical yield G
0024 defined as
0025     (Number of species X) / (100 eV of deposited energy).
0026 in a range of deposited energy [X;Y] chosen by the user.
0027 
0028  1 - GEOMETRY DEFINITION
0029 
0030     The world volume is a simple box which represents a 'pseudo infinite'
0031     homogeneous medium.
0032 
0033     Two parameters define the geometry :
0034     - the material of the box -- for Geant4-DNA it has to be water.
0035     - the full size of the box.
0036 
0037     The default geometry is constructed in DetectorConstruction class.
0038 
0039  2 - PHYSICS LIST
0040 
0041     PhysicsList is Geant4 modular physics list using G4EmDNAPhysics &
0042     G4EmDNAChemistry constructors.
0043     It will later be updated to use the G4EmDNAModelActivator constructor
0044 
0045  3 - CHEMISTRY MODEL AND CHEMICAL REACTION LIST
0046 
0047     ## UI species are defined by format :
0048     username [ molecule | charge | D(m2/s) | Radius(nm) ]
0049     where : *username* is decided by users, *molecule* is used by Geant4,
0050     *D* is diffusion constant, *Radius* is reaction radius.
0051     Spaces between characters are needed.
0052 
0053     ## UI reactions are defined by format :
0054     /chem/reaction/add H + H -> H2  | Fix |  1.2e10 | 0
0055     where : *H* is username, *1.2e10* is reaction rate, *0* is reaction type.
0056     Spaces between characters are needed.
0057 
0058     (parameters can be found in Prog. Nucl. Sci. Tec. 2 (2011))
0059 
0060  4 - ACTION INITALIZATION
0061 
0062     The class ActionInitialization instantiates and registers
0063     to Geant4 kernel all user action classes.
0064 
0065     While in sequential mode the action classes are instantiated just once,
0066     via invoking the method:
0067        ActionInitialization::Build()
0068     in multi-threading mode the same method is invoked for each thread worker
0069     and so all user action classes are defined thread-local.
0070 
0071     A run action class is instantiated both thread-local
0072     and global that's why its instance is created also in the method:
0073     ActionInitialization::BuildForMaster()
0074     which is invoked only in multi-threading mode.
0075 
0076  5 - AN EVENT: THE PRIMARY GENERATOR
0077 
0078     The primary kinematic consists of a single particle starting at the center
0079     of the box. The type of the particle and its energy are set in the
0080     PrimaryGeneratorAction class, and can be changed via the G4 build-in
0081     commands of G4ParticleGun class.
0082     The chemistry module is triggered in the StackingAction class when all
0083     physical tracks have been processed.
0084 
0085  6 - DETECTOR RESPONSE: Scorers
0086  
0087             6.1 - Species scorer
0088 
0089     Scorers are defined in DetectorConstruction::ConstructSDandField(). There is
0090     one G4MultiFunctionalDetector object which computes the energy deposition and
0091     the number of species along time in order to extract
0092     the radiochemical yields:
0093     (Number of species X) / (100 eV of deposited energy).
0094 
0095     Run::RecordEvent(), called at end of event, collects informations
0096     event per event from the hits collections, and accumulates statistic for
0097     RunAction::EndOfRunAction().
0098 
0099     In multi-threading mode the statistics accumulated per workers is merged
0100     to the master in Run::Merge().
0101     The information about all the molecular species is scored in a ROOT
0102     ntuple file Species.root. The root macro program PlotNtuple.C can be used to
0103     plot the G values vs time, for each species.
0104     
0105         6.2 - Primary killer
0106 
0107     The G-values are computing for a range of deposited energy. 
0108     We are in an infinite volume. Therefore the energy lost by the 
0109     primary equals the deposited energy since all secondary particles 
0110     will finally slow down to the thermal energy. 
0111     The primary is killed once it has deposited more energy than a 
0112     minimum threshold. 
0113     
0114     **IMPORTANT**: However, when the primary particle looses more energy 
0115     in few interaction steps than the maximum allowed thresold, 
0116     the event is disregarded (=aborted). 
0117     
0118     These two macro commands can be used to control the energy loss by 
0119     the primary:
0120     
0121     /primaryKiller/eLossMin 1 keV 
0122     # after 1 keV of energy loss by the primary particle, the primary is killed
0123     
0124     /primaryKiller/eLossMax 2 keV 
0125     # if the primary particle losses more than 2 keV, the event is aborted
0126     
0127     The G-values are then computed for a deposited energy in the range [1 keV;2 keV].
0128  
0129     Note that if the upper boundary of the energy lost by the primary is 
0130     not set, the chemistry may take a lot of time to compute. 
0131     This set of macros is embedded in the PrimaryKiller class.
0132     The species scorer must check whether the event was aborted before taking it or not into
0133     account for the computation of the results. 
0134 
0135  7 - STACKING ACTION
0136 
0137      StackingAction::NewStage is called when a stack of tracks has been processed
0138      (for more details, look at the Geant4 documentation).
0139      A verification on whether physical tracks remain to be processed is done.
0140      If no tracks remain to be processed, the chemical module is then triggered.
0141 
0142  8 - VISUALISATION
0143 
0144     The visualization manager is set via the G4VisExecutive class
0145     in the main() function in chem4.cc.
0146     The initialisation of the drawing is done via a set of /vis/ commands
0147     in the macro vis.mac. To activate the visualization mode run:
0148      ./chem4 -vis
0149 
0150  9 - OUTPUT
0151 
0152     Physics initialization and the defined reaction table are printed.
0153     G4Scheduler processes the chemical stage time step after time step.
0154     Chemical reactions are printed.
0155     The molecular reaction as a function of the elapsed time can be displayed
0156     setting the macro command /scheduler/verbose 1
0157 
0158 10 - RELEVANT MACRO COMMANDS
0159     /primaryKiller/eLossMin 1 keV # after 1 keV of energy loss by the primary particle, the primary is killed
0160     /primaryKiller/eLossMax 2 keV # if the primary particle losses more than 2 keV, the event is aborted
0161     /scheduler/verbose 1 # set the verbose level of the G4Scheduler class (time steps, reactions ...)
0162     /scheduler/endTime 1 microsecond # set the time at which the simulation stops
0163     /scheduler/whyDoYouStop # for advanced users: print information at the end of the chemical stage to know why the simulation has stopped
0164     
0165 11 - PLOT
0166     The information about all the molecular species is scored in a ROOT
0167     ntuple file Species.root during the run of chem4.
0168     The ROOT program plotG can be used to plot the G values vs time, 
0169     for each species. It must be launched after 
0170     chem4 has run. When "plotG" is executed, select the root file output by the 
0171     chem4 application.
0172     You can also execute plotG as: 
0173       .plot/plotG Species.root 
0174     where Species.root is the file output by the chem4 application.
0175     
0176 12 - OTHER INFORMATION
0177     I have access to a track. How do I access to its molecular information?
0178      #include "G4Molecule.hh"
0179      G4Track* thisIsMytrack = ...
0180      G4Molecule* thisIsMyMolecule = GetMolecule(thisIsMyTrack);
0181      If the pointer thisIsMyMolecule is null, then this is NOT a chemical species 
0182     
0183     How do I get the molecule's name?
0184      G4Molecule* thisIsMyMolecule = ...
0185      const G4String& moleculeName = thisIsMyMolecule->GetName();
0186     
0187     How can I display the reaction information?
0188      - Use this macro command: /scheduler/verbose 1
0189     
0190     How can I display the step by step information?
0191      1. Add ITTrackingInteraction to the G4Scheduler singleton (cf. chem3)
0192      2. Use /chem/tracking/verbose 1