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10.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 src/       2024-12-05 15:16:16
File CMakeLists.txt 2081 bytes       2024-12-05 15:16:16
File GNUmakefile 359 bytes       2024-12-05 15:16:16
File History 4412 bytes       2024-12-05 15:16:16
C++ file RE02.cc 3906 bytes       2024-12-05 15:16:16
File README 10748 bytes       2024-12-05 15:16:16
File run.mac 834 bytes       2024-12-05 15:16:16
File run.out 118185 bytes       2024-12-05 15:16:16
File run1.log 72678 bytes       2024-12-05 15:16:16
File run1.mac 797 bytes       2024-12-05 15:16:16
File run1water.log 71935 bytes       2024-12-05 15:16:16
File run2.log 59887 bytes       2024-12-05 15:16:16
File run2.mac 853 bytes       2024-12-05 15:16:16
File run3.log 88837 bytes       2024-12-05 15:16:16
File run3.mac 788 bytes       2024-12-05 15:16:16
File run3.out 93249 bytes       2024-12-05 15:16:16
File run4.log 88768 bytes       2024-12-05 15:16:16
File run4.mac 838 bytes       2024-12-05 15:16:16
File run4.out 93184 bytes       2024-12-05 15:16:16
File vis.mac 2203 bytes       2024-12-05 15:16:16

  1 -------------------------------------------------------------------
  2 
  3      =========================================================
  4      Geant4 - an Object-Oriented Toolkit for Simulation in HEP
  5      =========================================================
  6 
  7                             ExampleRE02
  8                             -----------
  9 
 10 
 11       This example simulates a simplified water phantom measurement
 12      in medical application with demonstration of primitive scorers.
 13      This example also demonstrates nested parameterised volume which
 14      realizes segmented boxes using a combination of replicated volumes
 15      and a parameterised volume.
 16 
 17     (Tips)
 18       This example creates 100 x 100 x 200 boxes using Nested Parameterised
 19      Volume for realistic situation of medical application. 
 20       This is very memory consumption if normal Parameterised Volume is used, 
 21      and needs roughly more than 1 GB memory for execution. However, 
 22      NestedParameterised volume effectively works to reduce the memory consumption,
 23      and it only needs less than 100 MB memory for execution.
 24 
 25  1- GEOMETRY DEFINITION
 26  
 27        The setup contains a water phantom as target by default. The world volume
 28      is 200 cm x 200 cm x 200 cm box filled with air. The water phantom is box shape 
 29      and the size of 200 mm x 200 mm x 400 mm. The volume of water phantom is divided
 30      into 100 x 100 x 1 towers using replicated volume,(RE02DetectorConstruction), 
 31      and then those towers are segmented into 200 boxes with respect to z axis 
 32      using nested parameterized volume,(RE02NestedPhantomParameterisation).
 33       e.g. The volume of water phantom is divided into 100 x 100 x 200 boxes,
 34       and a voxel size is 2.0 mm x 2.0 mm x 2.0 mm.
 35 
 36        For demonstration purpose of the nested parameterised volume,
 37      (RE02NestedPhantomParameterisation), materials are assigned as water (lead) 
 38      in even (odd) order segments, alternately. 
 39      The simulation for homogeneous water phantom is also possible using an option.
 40 
 41      ---- Tips(1)
 42      *If you want to reduce number of segments of water phantom,
 43      please change following numbers which represent number of segments
 44      in x, y, z axis, respectively.The following code can be found in
 45      exampleRE02.cc.
 46 
 47      RE02DetectorConstruction* detector = new RE02DetectorConstruction;
 48      detector->SetNumberOfSegmentsInPhantom(100,100,200);
 49                                              Nx, Ny, Nz
 50      ---- Tips(2)
 51      *If you want to set all materials to water,
 52       please use the following method. The following code can be found in
 53      exampleRE02.cc.
 54 
 55      detector->SetLeadSegment(FALSE); // Homogeneous water phantom
 56      ----
 57 
 58      The geometry and sensitive detector are constructed in 
 59      RE02DetectorConstruction class.
 60      (See "4- SCORER " for detail descriptions about sensitive detector.)
 61          
 62  2- PHYSICS LIST
 63  
 64      The particle's type and the physic processes which is available
 65      in this example are set in PhysicsList class.
 66 
 67      The PhysicsList is originally copied from extended example,
 68      (example/extended/analysis/A01).
 69      Full set of particles (baryons, bosons and mesons) are created, and
 70      Standard EM Physics and Low/High Energy parameterized models 
 71      for hadrons are applied. The detail description will be found in 
 72      example/extended/analysis/A01/README.
 73       Specially, the PhysicsList was modified in this example, 
 74      to use Binary cascade model for hadron physics at low energy (<4GeV)
 75      and inelastic process for generic ions with BinaryLightIonReaction.
 76      The data files for physics processes have to be assigned using 
 77      environment variables.
 78 
 79      RE02PhysicsList is optimized for robustness and is not optimized for
 80      any particular cases. If you will do precise calculation for your
 81      use-case, please consider utilizing hadronic_lists, and defines the 
 82      production cut properly.
 83       The default CutValue defines the production threshold of secondary 
 84      particles (mainly Ionisation and Bremsstrahlung processes are 
 85      concerned by this CutValue).
 86   
 87  3- RUNS and EVENTS
 88  
 89      - Primary particles.
 90      The primary kinematics consists of a single particle which hits the
 91      target perpendicular to the input face. The default type of the particle
 92      and its energy are set in the RE02PrimaryGeneratorAction class.
 93      However it can be changed via the G4 build-in commands of ParticleGun 
 94      class. 
 95       The RE02PrimaryGeneratorAction class introduces a beam spot size 
 96      that makes initial particle position of x,y randomized using a Gaussian
 97      random function, where the center position is fixed to (0,0). 
 98      The standard deviation of the beam spot size is given in 
 99      RE02PrimaryGeneratorAction as 10 mm.
100 
101      An EVENT represents a simulation of one primary particle.
102      A RUN is a set of events.
103      
104      The user has control:
105         -at Begin and End of each run   (class RunAction)
106         -at Begin and End of each event (class EventAction)
107         -at Begin and End of each track (class TrackingAction, not used here)
108   -at End of each step (class SteppingAction, not used here)
109   
110  4- SCORER
111 
112      - Concrete Scorer
113       This example introduces concrete primitive scorer (PS) and filter 
114      classes for easy scoring. Those primitive scorers are registered to
115      MultiFunctionalDetector which is a concrete class of sensitive 
116      detector(SD). Then the MultiFunctionalDetector is attached to 
117      the logical volume of sensitive geometry.
118       A MultiFunctionalDetector, PrimitiveScorers, and SDFilters are
119      created and assigned to the logical volume of water phantom in 
120      DetectorConstruction.
121 
122       A primitive scorer can score one kind of physical quantity, and
123      creates one hits collection per event. The quantity is collected in
124      G4THitsMap with the copy number of geometry. Here collection name is 
125      given as <MultiFunctionalDetector Name>/<PrimitiveScorer Name>.
126      A primitive scorer can have one filter (SDFilter) for selecting hits 
127      to be used for the quantity.
128 
129       Since the geometry is constructed using nested parameterisation,
130      the copy number of geometry is defined as follows,
131 
132   copy number of geometry =  iy*Nx*Ny+ix*Nz+iz,
133 
134      where Nx,Ny,Nz is total number of segmentation in x, y, and z axis,respectively,
135      and ix,iy,iz is a copy number of the mother volume, the grand mother volume, 
136      and this volume, respectively.
137       This conversion is described in GetIndex() method in PrimitiveScorer.
138 
139      The physical quantities scored in this example are:
140      ----------------------------------------------------
141      - Total energy deposit
142   unit: Energy,       collName: totalEDep
143      - Energy deposit by protons
144         unit: Energy,       collName: protonEDep
145      - Number of steps of protons
146         unit: - ,         collName: protonNStep 
147      - Cell Flux of charged tracks which pass through the geometry
148         unit: Length/Volume,    collName:  chargedPassCellFlux
149      - Cell Flux of all charged tracks  
150         unit: Length/Volume,      collName:  chargedCellFlux  
151      - Flux of charged particle at -Z surface of the BOX geometry,
152        where incident angle at the surface is taken into account.
153         unit: Surface^(-1),        collName:  chargedSurfFlux 
154      - Surface current of gamma at -Z surface of the BOX geometry. 
155        The energy of gammas are from    1. keV  to   10. keV.
156        The incident angle is not taken into account.
157         unit: Surface^(-1),        collName:  gammaSurfCurr000
158      - Same as previous one, but different energy bin.
159        The energy of gammas are from   10. keV  to  100. keV.
160         unit: Surface^(-1),         collName:  gammaSurfCurr001
161      - Same as previous one, but different energy bin.
162        The energy of gammas are from  100. keV  to    1. MeV.
163         unit: Surface^(-1),         collName:  gammaSurfCurr002
164      - Same as previous one, except for energy bin.
165        The energy of gammas are from    1. MeV  to   10. MeV.
166         unit: Surface^(-1),        collName:  gammaSurfCurr003
167      -------------------------------------------------
168 
169      - Accumulating quantities during a RUN 
170      A PrimitiveScorer creates one hits collection per event.
171      The physical quantity in the hits collection need to be accumulated
172      into another G4THitsMap object during a RUN, in order to obtain
173      integrated flux or dose in a RUN. The accumulation of quantities 
174      are done at RE02Run class.
175  
176      RE02Run class can automatically generate G4THitsMap objects for a RUN,
177      and accumulate physical quantities of an event into it. The accumulation
178      is done at RE02Run::RecordEvent(G4Event* aEvent).
179   
180      - Generate a Run object, and print results
181       The RE02Run object is generated at RE02RunAction::GenerateRun().      
182      The accumulated physical quantities are printed at the end of RUN
183      ( RE02RunAction::EndOfEvent() ). This example prints only selected
184      physical quantities.
185 
186         
187  5- VISUALIZATION
188  
189      The Visualization Manager is set in the main().
190      The initialization of the drawing is done via a set of /vis/ commands
191      in the macro vis.mac. This macro is automatically read from 
192      the main when running in interactive mode.
193   
194      The tracks are automatically drawn at the end of event and erased at 
195      the beginning of the next run.
196   
197      The visualization (with OpenGL driver) assumes two things:
198   1- the visualization & interfaces categories have been compiled
199          with the environment variable G4VIS_BUILD_OPENGLX_DRIVER.
200   2- exampleRE02.cc has been compiled with G4VIS_USE_OPENGLX.   
201 
202      (The same with DAWNFILE instead of OPENGLX)
203      
204      
205  6- USER INTERFACES
206   
207       The default command interface, called G4UIterminal, is done via
208       standard G4cin/G4cout.
209       On Linux and Sun-cc on can use a smarter command interface G4UItcsh.
210       It is enough to set the environment variable G4UI_USE_TCSH before
211       compiling exampleRE02.cc
212  
213         
214  7- HOW TO START ?
215  
216       - execute RE02 in 'batch' mode from macro files (without visualization)
217         % exampleRE02   run1.mac
218     
219       - execute RE02 in 'interactive mode' with visualization
220         % exampleRE02
221         ....
222         Idle> type your commands. For instance:
223         Idle> /run/beamOn 10
224         ....
225         Idle> /control/execute run2.mac
226               ....
227         Idle> exit
228      
229       - macros are for different primary particles.
230             vis.mac  :  200 MeV proton with visualization
231             run1.mac :  150 MeV proton
232             run2.mac :  195 MeV/u Carbon ion
233             run3.mac :   30 MeV electron
234             run4.mac :   60 keV gamma
235 
236   
237       
238