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