source: trunk/examples/novice/N07/README@ 1191

Last change on this file since 1191 was 807, checked in by garnier, 17 years ago

update

File size: 9.7 KB
RevLine 
[807]1$Id: README,v 1.5 2007/05/04 01:49:28 asaim Exp $
2-------------------------------------------------------------------
3
4 =========================================================
5 Geant4 - an Object-Oriented Toolkit for Simulation in HEP
6 =========================================================
7
8 ExampleN07
9 ----------
10
11
12 This example simulates three simplified sandwitch calorimeters.
13 The main features demonstrated in this example are :
14
15 1. Utilizing a concrete run class derived from G4Run base class for
16 accumulating physics quantities for a run
17 2. Changing calorimeter geometries without re-building a world volume
18 3. Defining geometrical regions and setting production thresholds
19 for each region
20 4. Demonstrating the use of primitive scorer and filter classes without
21 implementing sensitive detector class
22 5. Demonstrating the use of parallel scoring geometry and associating
23 parallel world scoring process
24 6. Measuring the timing spent for each region, both for all particle
25 types and for e+/e-
26
27 **********************************************************************
28 Note: Since this example utilizes its own ExN07SteppingVerbose for the
29 timing measurement, the user cannot get the ordinary verbosity with
30 /tracking/verbose.
31 **********************************************************************
32
33 1- Utilizing a concrete run class derived from G4Run base class for
34 accumulating physics quantities for a run
35
36 G4Run is a class the user can inherit and create his/her own concrete
37 class for accumulating information useful to him/her. It has a virtual
38 method RecordEvent(const G4Event*), which will be invoked by G4RunManager
39 at the end of processing each event. By implemeting this method in the
40 user'r concrete run class, he/she can store information associating with
41 G4Event class itself and hits collections attached with G4Event. In this
42 example, ExN07Run is the class derived from G4Run. In the method
43 ExN07Run::RecordEvent(const G4Event*), in addition to counting the
44 number of events, all hits collections are accessed to accumulate
45 energy depositions, step lengths and number of steps.
46
47 In case the user create his/her own run class, an object of this class
48 must be instantiated in the method GenerateRun() of his/her concrete
49 class derived from G4UserRunAction base class. The pointer to this run
50 object must be returned by this method. In this example, ExN07RunAction
51 is the class which instantiating ExN07Run class object. In
52 ExN07RunAction::EndOfRunAction(const G4Run*) method, ExN07Run object
53 is analized to output the run summary.
54
55 It should be noted that some information about generated secondaries
56 are collected in ExN07StackinAction instead of sensitive detector class.
57 ExN07StackingAction::ClassifyNewTrack(const G4Track*) method is used
58 not for classifying tracks sent to the stack, but for accessing to all
59 secondaries generated in an event.
60
61 2- Changing calorimeter geometries without re-building a world volume
62
63 In ExN07DetectorConstruction, all solids, logical and physical volumes
64 are constructed only once at the first invocation of Constuct() method.
65 Positions and number of slices are changed not by re-constructing another
66 objects but by modifying data members of already existing objects as
67 it is implemented in ExN07DetectorConstruction::SetNumberOfLayers(G4int)
68 for changing the number of parameterized volumes, and also
69 ExN07DetectorConstruction::SetSerialGeometry(G4bool) for changing the
70 position of placed volumes.
71
72 3- Defining geometrical regions and setting production thresholds
73 for each region
74
75 Setting production thresholds (so-called production cuts) to individual
76 region of a detector geometry is the new feature provided by Geant4 5.1
77 release. This feature is also called as "Cuts per region".
78
79 Please note that this new feature is supporsed to be used only by the
80 users,
81 a) who is simulating most complex geometry such as an LHC detector,
82 b) and who has enough experience of simulating EM showers in matter.
83 We strongly recommend to compare the simulated results of this new
84 feature with the results of the same geometry but having uniform
85 production thresholds. Setting completely different cut values for
86 individual region may break the coherent and comprehensive accuracy
87 of the simulation. Thus such cut values should be carefully optimized
88 by the user with comparison with results of uniform cuts.
89
90 In ExN07DetectorConstruction::Construct(), Three objects of G4Region
91 class are instantiated and set to the logical volumes of each of three
92 calorimeter modules. Also, these individual logical volumes are
93 registered as "root logical volume" so that all daghter volumes in
94 these logical volumes are also affected by the corresponding regions.
95
96 In ExN07PhysicsList::SetCuts(), in addition to set the default threshold
97 values for the world volume, three threshold values are set to three
98 calorimeter regions respectively. By setting production thresholds to
99 a region, gamma, electron or positron will not be generated as a
100 secondary if its range is shorter than the production threshold of that
101 particular region. Please note that some EM processes still generate
102 such secondary below threshold.
103
104 4- Demonstrating the use of primitive scorer and filter classes without
105 implementing sensitive detector class
106
107 In ExN07DetectorConstruction::SetupDetector() method, concrete classes
108 G4PSEnergyDeposit, G4PSNofSecondary, G4PSTrackLength, G4PSNofStep and
109 G4PSMinKinEAtGeneration, all of thich are derivalable of G4VPrimitiveScorer,
110 are used to define the sensitivity of the calorimeter. All of them are
111 registered to G4MultiFunctionalDetector and this detector object is set
112 to the logical volume. G4SDParticleFilter is used to define the particle
113 type(s) to be scored.
114
115 In ExN07Run::RecordEvent() method, the way of retreiving G4THitsMap
116 from each primitive scorer via G4HCofThisEvent is demonstrated.
117 In ExN07RunAction::EndOfRunAction(), Run is summarized with data kept
118 in ExN07Run class object.
119
120 5- Demonstrating the use of parallel scoring geometry and associating
121 parallel world scoring process
122
123 In ExN07PhysicsList::ConstructGeneral(), G4ParallelWorldScoringProcess is
124 assigned to all the particle types. This process invokes sensitive detectors
125 (and scorers) defined in the parallel world "ParallelScoringWorld", the
126 name of the parallel world which is defined in main() (exampleN07.cc) as
127 an argument of ExN07ParallelWorld constructor.
128
129 As implemented in ExN07ParallelWorld::SetupGeometry(), the world volume of
130 the parallel world is obtained by GetWorld() method as a clone copy of the
131 world volume of the mass geometry. The user should not create the world volume.
132
133 ExN07ParallelWorld defines three cylindrical volumes, each of them is
134 located at the same position as three sandwitch calorimeters defined
135 in the mass geometry (ExN07DetectorConstruction). Each cylinder is replicated
136 in Rho to define 20 layers, and scores the same quantities as the mass geometry.
137 These three cylinders are relocated accordingly when the mass geometry is
138 modified by ExN07DetectorConstruction::SetSerialGeometry().
139
140 6- Measuring the timing spent for each region, both for all particle
141 types and for e+/e-
142
143 ExN07SteppingVerbose class has two G4SliceTimer class objects for each
144 detector region. One G4SliceTimer is measuring the time spent by a step
145 in a region for all types of particles, and another is measuring for
146 e+/e- only.
147
148 ExN07SteppingVerbose::InitializeTimers() is invoked by ExN07RunAction::
149 BeginOfRunAction(), and checks the number of regions appear in the
150 geometry and instantiates the necessary number of timers. Thus, this
151 ExN07SteppingVerbose class can be used for any kind of geometry the user
152 defines without any modification. Given G4VSteppingVerbose is not invoked
153 if the verbosity of G4SteppingManager is 0, this verbosity is set to 1.
154
155 NewStep() and StepInfo() are the methods defined in G4VSteppingVerbose
156 base class, and they are invoked at the beginning and the end of every
157 step, respectively, from G4SteppingManager. Thus, these methods are
158 utilized in ExN07SteppingVerbose to start/resume and pause the timer.
159
160 ExN07SteppingVerbose::Report() method is used by ExN07RunAction::
161 EndOfRunAction() to get the timing measured.
162
163 7- Macro files
164
165 exampleN07.in
166 To be used for batch mode. The reference output file is made by this
167 macro file.
168
169 sample.mac
170 To be used for interactive mode. Issue "/control/execute sample.mac"
171 when "Idle>" prompt appears.
172
173 vis.mac
174 Setting visualization parameters. This macro file will be called
175 automatically when interactive execution starts.
176
177 8- UI commands defined in this example
178
179Command /N07/setAbsMat
180Guidance :
181Select Material of the Absorber.
182
183Parameter : choice
184 Parameter type : s
185 Omittable : False
186 Candidates : Aluminium liquidArgon Lead Water Scintillator Air Galactic
187
188
189
190Command /N07/setGapMat
191Guidance :
192Select Material of the Gap.
193
194Parameter : choice
195 Parameter type : s
196 Omittable : False
197 Candidates : Aluminium liquidArgon Lead Water Scintillator Air Galactic
198
199
200
201Command /N07/numberOfLayers
202Guidance :
203Set number of layers.
204 Range of parameters : nl>0
205
206Parameter : nl
207 Parameter type : i
208 Omittable : False
209
210
211
212Command /N07/serialGeometry
213Guidance :
214Select calorimeters to be placed in serial or parallel.
215
216Parameter : serialize
217 Parameter type : b
218 Omittable : False
219
220
Note: See TracBrowser for help on using the repository browser.