Warning, /geant4/examples/extended/runAndEvent/RE02/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 ExampleRE02
0008 -----------
0009
0010
0011 This example simulates a simplified water phantom measurement
0012 in medical application with demonstration of primitive scorers.
0013 This example also demonstrates nested parameterised volume which
0014 realizes segmented boxes using a combination of replicated volumes
0015 and a parameterised volume.
0016
0017 (Tips)
0018 This example creates 100 x 100 x 200 boxes using Nested Parameterised
0019 Volume for realistic situation of medical application.
0020 This is very memory consumption if normal Parameterised Volume is used,
0021 and needs roughly more than 1 GB memory for execution. However,
0022 NestedParameterised volume effectively works to reduce the memory consumption,
0023 and it only needs less than 100 MB memory for execution.
0024
0025 1- GEOMETRY DEFINITION
0026
0027 The setup contains a water phantom as target by default. The world volume
0028 is 200 cm x 200 cm x 200 cm box filled with air. The water phantom is box shape
0029 and the size of 200 mm x 200 mm x 400 mm. The volume of water phantom is divided
0030 into 100 x 100 x 1 towers using replicated volume,(RE02DetectorConstruction),
0031 and then those towers are segmented into 200 boxes with respect to z axis
0032 using nested parameterized volume,(RE02NestedPhantomParameterisation).
0033 e.g. The volume of water phantom is divided into 100 x 100 x 200 boxes,
0034 and a voxel size is 2.0 mm x 2.0 mm x 2.0 mm.
0035
0036 For demonstration purpose of the nested parameterised volume,
0037 (RE02NestedPhantomParameterisation), materials are assigned as water (lead)
0038 in even (odd) order segments, alternately.
0039 The simulation for homogeneous water phantom is also possible using an option.
0040
0041 ---- Tips(1)
0042 *If you want to reduce number of segments of water phantom,
0043 please change following numbers which represent number of segments
0044 in x, y, z axis, respectively.The following code can be found in
0045 exampleRE02.cc.
0046
0047 RE02DetectorConstruction* detector = new RE02DetectorConstruction;
0048 detector->SetNumberOfSegmentsInPhantom(100,100,200);
0049 Nx, Ny, Nz
0050 ---- Tips(2)
0051 *If you want to set all materials to water,
0052 please use the following method. The following code can be found in
0053 exampleRE02.cc.
0054
0055 detector->SetLeadSegment(FALSE); // Homogeneous water phantom
0056 ----
0057
0058 The geometry and sensitive detector are constructed in
0059 RE02DetectorConstruction class.
0060 (See "4- SCORER " for detail descriptions about sensitive detector.)
0061
0062 2- PHYSICS LIST
0063
0064 The particle's type and the physic processes which is available
0065 in this example are set in PhysicsList class.
0066
0067 The PhysicsList is originally copied from extended example,
0068 (example/extended/analysis/A01).
0069 Full set of particles (baryons, bosons and mesons) are created, and
0070 Standard EM Physics and Low/High Energy parameterized models
0071 for hadrons are applied. The detail description will be found in
0072 example/extended/analysis/A01/README.
0073 Specially, the PhysicsList was modified in this example,
0074 to use Binary cascade model for hadron physics at low energy (<4GeV)
0075 and inelastic process for generic ions with BinaryLightIonReaction.
0076 The data files for physics processes have to be assigned using
0077 environment variables.
0078
0079 RE02PhysicsList is optimized for robustness and is not optimized for
0080 any particular cases. If you will do precise calculation for your
0081 use-case, please consider utilizing hadronic_lists, and defines the
0082 production cut properly.
0083 The default CutValue defines the production threshold of secondary
0084 particles (mainly Ionisation and Bremsstrahlung processes are
0085 concerned by this CutValue).
0086
0087 3- RUNS and EVENTS
0088
0089 - Primary particles.
0090 The primary kinematics consists of a single particle which hits the
0091 target perpendicular to the input face. The default type of the particle
0092 and its energy are set in the RE02PrimaryGeneratorAction class.
0093 However it can be changed via the G4 build-in commands of ParticleGun
0094 class.
0095 The RE02PrimaryGeneratorAction class introduces a beam spot size
0096 that makes initial particle position of x,y randomized using a Gaussian
0097 random function, where the center position is fixed to (0,0).
0098 The standard deviation of the beam spot size is given in
0099 RE02PrimaryGeneratorAction as 10 mm.
0100
0101 An EVENT represents a simulation of one primary particle.
0102 A RUN is a set of events.
0103
0104 The user has control:
0105 -at Begin and End of each run (class RunAction)
0106 -at Begin and End of each event (class EventAction)
0107 -at Begin and End of each track (class TrackingAction, not used here)
0108 -at End of each step (class SteppingAction, not used here)
0109
0110 4- SCORER
0111
0112 - Concrete Scorer
0113 This example introduces concrete primitive scorer (PS) and filter
0114 classes for easy scoring. Those primitive scorers are registered to
0115 MultiFunctionalDetector which is a concrete class of sensitive
0116 detector(SD). Then the MultiFunctionalDetector is attached to
0117 the logical volume of sensitive geometry.
0118 A MultiFunctionalDetector, PrimitiveScorers, and SDFilters are
0119 created and assigned to the logical volume of water phantom in
0120 DetectorConstruction.
0121
0122 A primitive scorer can score one kind of physical quantity, and
0123 creates one hits collection per event. The quantity is collected in
0124 G4THitsMap with the copy number of geometry. Here collection name is
0125 given as <MultiFunctionalDetector Name>/<PrimitiveScorer Name>.
0126 A primitive scorer can have one filter (SDFilter) for selecting hits
0127 to be used for the quantity.
0128
0129 Since the geometry is constructed using nested parameterisation,
0130 the copy number of geometry is defined as follows,
0131
0132 copy number of geometry = iy*Nx*Ny+ix*Nz+iz,
0133
0134 where Nx,Ny,Nz is total number of segmentation in x, y, and z axis,respectively,
0135 and ix,iy,iz is a copy number of the mother volume, the grand mother volume,
0136 and this volume, respectively.
0137 This conversion is described in GetIndex() method in PrimitiveScorer.
0138
0139 The physical quantities scored in this example are:
0140 ----------------------------------------------------
0141 - Total energy deposit
0142 unit: Energy, collName: totalEDep
0143 - Energy deposit by protons
0144 unit: Energy, collName: protonEDep
0145 - Number of steps of protons
0146 unit: - , collName: protonNStep
0147 - Cell Flux of charged tracks which pass through the geometry
0148 unit: Length/Volume, collName: chargedPassCellFlux
0149 - Cell Flux of all charged tracks
0150 unit: Length/Volume, collName: chargedCellFlux
0151 - Flux of charged particle at -Z surface of the BOX geometry,
0152 where incident angle at the surface is taken into account.
0153 unit: Surface^(-1), collName: chargedSurfFlux
0154 - Surface current of gamma at -Z surface of the BOX geometry.
0155 The energy of gammas are from 1. keV to 10. keV.
0156 The incident angle is not taken into account.
0157 unit: Surface^(-1), collName: gammaSurfCurr000
0158 - Same as previous one, but different energy bin.
0159 The energy of gammas are from 10. keV to 100. keV.
0160 unit: Surface^(-1), collName: gammaSurfCurr001
0161 - Same as previous one, but different energy bin.
0162 The energy of gammas are from 100. keV to 1. MeV.
0163 unit: Surface^(-1), collName: gammaSurfCurr002
0164 - Same as previous one, except for energy bin.
0165 The energy of gammas are from 1. MeV to 10. MeV.
0166 unit: Surface^(-1), collName: gammaSurfCurr003
0167 -------------------------------------------------
0168
0169 - Accumulating quantities during a RUN
0170 A PrimitiveScorer creates one hits collection per event.
0171 The physical quantity in the hits collection need to be accumulated
0172 into another G4THitsMap object during a RUN, in order to obtain
0173 integrated flux or dose in a RUN. The accumulation of quantities
0174 are done at RE02Run class.
0175
0176 RE02Run class can automatically generate G4THitsMap objects for a RUN,
0177 and accumulate physical quantities of an event into it. The accumulation
0178 is done at RE02Run::RecordEvent(G4Event* aEvent).
0179
0180 - Generate a Run object, and print results
0181 The RE02Run object is generated at RE02RunAction::GenerateRun().
0182 The accumulated physical quantities are printed at the end of RUN
0183 ( RE02RunAction::EndOfEvent() ). This example prints only selected
0184 physical quantities.
0185
0186
0187 5- VISUALIZATION
0188
0189 The Visualization Manager is set in the main().
0190 The initialization of the drawing is done via a set of /vis/ commands
0191 in the macro vis.mac. This macro is automatically read from
0192 the main when running in interactive mode.
0193
0194 The tracks are automatically drawn at the end of event and erased at
0195 the beginning of the next run.
0196
0197 The visualization (with OpenGL driver) assumes two things:
0198 1- the visualization & interfaces categories have been compiled
0199 with the environment variable G4VIS_BUILD_OPENGLX_DRIVER.
0200 2- exampleRE02.cc has been compiled with G4VIS_USE_OPENGLX.
0201
0202 (The same with DAWNFILE instead of OPENGLX)
0203
0204
0205 6- USER INTERFACES
0206
0207 The default command interface, called G4UIterminal, is done via
0208 standard G4cin/G4cout.
0209 On Linux and Sun-cc on can use a smarter command interface G4UItcsh.
0210 It is enough to set the environment variable G4UI_USE_TCSH before
0211 compiling exampleRE02.cc
0212
0213
0214 7- HOW TO START ?
0215
0216 - execute RE02 in 'batch' mode from macro files (without visualization)
0217 % exampleRE02 run1.mac
0218
0219 - execute RE02 in 'interactive mode' with visualization
0220 % exampleRE02
0221 ....
0222 Idle> type your commands. For instance:
0223 Idle> /run/beamOn 10
0224 ....
0225 Idle> /control/execute run2.mac
0226 ....
0227 Idle> exit
0228
0229 - macros are for different primary particles.
0230 vis.mac : 200 MeV proton with visualization
0231 run1.mac : 150 MeV proton
0232 run2.mac : 195 MeV/u Carbon ion
0233 run3.mac : 30 MeV electron
0234 run4.mac : 60 keV gamma
0235
0236
0237
0238