source: trunk/documents/UserDoc/DocBookUsersGuides/ForApplicationDeveloper/xml/TrackingAndPhysics/thresholdVScut.xml @ 1345

Last change on this file since 1345 was 1208, checked in by garnier, 15 years ago

CVS update

File size: 12.4 KB
Line 
1<!-- ******************************************************** -->
2<!--                                                          -->
3<!--  [History]                                               -->
4<!--    Changed by: Katsuya Amako,       4-Aug-1998           -->
5<!--    Changed by: Katsuya Amako,       9-Jul-1998           -->
6<!--    Proof read by: Joe Chuma,        2-Jul-1999           -->
7<!--    few corrections in 3.18.7: mma, 11-Jan-2001           -->
8<!--    Converted to DocBook: Katsuya Amako, Aug-2006         -->
9<!--                                                          -->
10<!-- ******************************************************** -->
11
12
13<!-- ******************* Section (Level#1) ****************** -->
14<sect1 id="sect.ProThres">
15<title>
16Production Threshold versus Tracking Cut
17</title>
18
19
20<!-- ******************* Section (Level#2) ****************** -->
21<sect2 id="sect.ProThres.Gen">
22<title>
23General considerations
24</title>
25
26<para>
27We have to fulfill two contradictory requirements. It is the
28responsibility of each individual <emphasis role="bold">process</emphasis> 
29to produce secondary particles according to its own capabilities. On
30the other hand, it is only the Geant4 kernel (i.e., tracking) which can
31ensure an overall coherence of the simulation.
32</para>
33
34<para>
35The general principles in Geant4 are the following:
36
37<orderedlist spacing="compact">
38  <listitem><para>
39    Each <emphasis role="bold">process</emphasis> has its intrinsic limit(s)
40    to produce secondary particles.
41  </para></listitem>
42  <listitem><para>
43    All particles produced (and accepted) will be tracked up to
44    <emphasis role="bold">zero range</emphasis>.
45  </para></listitem>
46  <listitem><para>
47    Each <emphasis role="bold">particle</emphasis> has a suggested cut in range
48    (which is converted to energy for all materials), and defined via a
49    <literal>SetCut()</literal> method (see
50    <xref linkend="sect.HowToSpecParti.RangeCuts" />).
51  </para></listitem>
52</orderedlist>
53</para>
54
55<para>
56Points 1 and 2 imply that the cut associated with the
57<emphasis role="bold">particle</emphasis> is a (recommended)
58<emphasis role="bold">production</emphasis> threshold of secondary particles.
59</para>
60
61</sect2>
62
63<!-- ******************* Section (Level#2) ****************** -->
64<sect2 id="sect.ProThres.Set">
65<title>
66Set production threshold (<literal>SetCut</literal> methods)
67</title>
68
69<para>
70As already mentioned, each kind of particle has a suggested
71production threshold. Some of the processes will not use this
72threshold (e.g., decay), while other processes will use it as a
73default value for their intrinsic limits (e.g., ionisation and
74bremsstrahlung).
75</para>
76
77<para>See
78<xref linkend="sect.HowToSpecParti.RangeCuts" /> to see how to set
79the production threshold.
80</para>
81
82</sect2>
83
84
85<!-- ******************* Section (Level#2) ****************** -->
86<sect2 id="sect.ProThres.Apply">
87<title>
88Apply cut
89</title>
90
91<para>
92The <literal>DoIt</literal> methods of each process can produce secondary
93particles. Two cases can happen:
94
95<itemizedlist spacing="compact">
96  <listitem><para>
97    a process sets its intrinsic limit greater than or equal to the
98    recommended production threshold. OK. Nothing has to be done
99    (nothing can be done !).
100  </para></listitem>
101  <listitem><para>
102    a process sets its intrinsic limit smaller than the production
103    threshold (for instance 0).
104  </para></listitem>
105</itemizedlist>
106</para>
107
108<para>
109The list of secondaries is sent to the <emphasis>SteppingManager</emphasis>
110via a <emphasis>ParticleChange</emphasis> object.
111</para>
112
113<para>
114<emphasis>Before</emphasis> being recopied to the temporary stack for later
115tracking, the particles below the production threshold will be kept or
116deleted according to the safe mechanism explained hereafter.
117
118<itemizedlist spacing="compact">
119  <listitem><para>
120    The <emphasis>ParticleDefinition</emphasis> 
121    (or <emphasis>ParticleWithCuts</emphasis>) has a boolean data member:
122    <literal>ApplyCut</literal>.</para></listitem>
123    <listitem><para><literal>ApplyCut</literal> is OFF: do nothing.
124    All the secondaries are stacked (and then tracked later on), regardless
125    of their initial energy. The Geant4 kernel respects the best that the
126    physics can do, but neglects the overall coherence and the efficiency.
127    Energy conservation is respected as far as the processes know how to
128    handle correctly the particles they produced!
129  </para></listitem>
130  <listitem><para>
131    <literal>ApplyCut</literal> in ON: the <emphasis>TrackingManager</emphasis> 
132    checks the range of each secondary against the production threshold and
133    against the safety. The particle is stacked if <literal>range &gt;
134    min(cut,safety).</literal>
135    <itemizedlist spacing="compact">
136      <listitem><para>
137        If not, check if the process has nevertheless set the flag
138        ``good for tracking'' and then stack it (see
139        <xref linkend="sect.ProThres.WhyProd" />
140        below for the explanation of the <literal>GoodForTracking</literal> flag).
141      </para></listitem>
142      <listitem><para>
143        If not, recuperate its kinetic energy in the
144        <literal>localEnergyDeposit</literal>, and set
145        <literal>tkin=0</literal>.
146      </para></listitem>
147      <listitem><para>
148        Then check in the <emphasis>ProcessManager</emphasis> if the vector of
149        <emphasis>ProcessAtRest</emphasis> is not empty. If yes, stack the
150        particle for performing the ``Action At Rest'' later. If not, and only
151        in this case, abandon this secondary.
152      </para></listitem>
153    </itemizedlist>
154  </para></listitem>
155</itemizedlist>
156</para>
157
158<para>
159With this sophisticated mechanism we have the global cut that we
160wanted, but with energy conservation, and we respect boundary
161constraint (safety) and the wishes of the processes (via ``good for
162tracking'').
163</para>
164
165</sect2>
166
167
168<!-- ******************* Section (Level#2) ****************** -->
169<sect2 id="sect.ProThres.WhyProd">
170<title>
171Why produce secondaries below threshold?
172</title>
173
174<para>
175A process may have good reasons to produce particles below the
176recommended threshold:
177
178<itemizedlist spacing="compact">
179  <listitem><para>
180    checking the range of the secondary versus geometrical
181    quantities like safety may allow one to realize the possibility
182    that the produced particle, even below threshold, will reach a
183    sensitive part of the detector;
184  </para></listitem>
185  <listitem><para>
186    another example is the gamma conversion: the positron is always
187    produced, even at zero energy, for further annihilation.
188  </para></listitem>
189</itemizedlist>
190</para>
191
192<para>
193These secondary particles are sent to the ``Stepping Manager''
194with a flag <literal>GoodForTracking</literal> to pass the filter explained
195in the previous section (even when <literal>ApplyCut</literal> is ON).
196</para>
197
198</sect2>
199
200
201<!-- ******************* Section (Level#2) ****************** -->
202<sect2 id="sect.ProThres.RangOrEner">
203<title>
204Cuts in stopping range or in energy?
205</title>
206
207<para>
208The cuts in stopping range allow one to say that the energy has
209been released at the correct space position, limiting the
210approximation within a given distance. On the contrary, cuts in
211energy imply accuracies of the energy depositions which depend on
212the material.
213</para>
214
215</sect2>
216
217
218<!-- ******************* Section (Level#2) ****************** -->
219<sect2 id="sect.ProThres.Sum">
220<title>
221Summary
222</title>
223
224<para>
225In summary, we do not have tracking cuts; we only have production
226thresholds in range. All particles produced and accepted are
227tracked up to zero range.
228</para>
229
230<para>
231It must be clear that the overall coherency that we provide
232cannot go beyond the capability of processes to produce particles
233down to the recommended threshold.
234</para>
235
236<para>
237In other words a process can produce the secondaries down to the
238recommended threshold, and by interrogating the geometry, or by
239realizing when mass-to-energy conversion can occur, recognize when
240particles below the threshold have to be produced.
241</para>
242
243</sect2>
244
245
246<!-- ******************* Section (Level#2) ****************** -->
247<sect2 id="sect.ProThres.Spe">
248<title>
249Special tracking cuts
250</title>
251
252<para>
253One may need to cut given particle types in given volumes for
254optimisation reasons. This decision is under user control, and can
255happen for particles during tracking as well.
256</para>
257
258<para>
259The user must be able to apply these special cuts only for the
260desired particles and in the desired volumes, without introducing
261an overhead for all the rest.
262</para>
263
264<para>
265The approach is as follows:
266
267<itemizedlist spacing="compact">
268  <listitem><para>
269    special user cuts are registered in the <emphasis>UserLimits</emphasis> 
270    class (or its descendant), which is associated with the logical volume
271    class.
272    <para>
273    The current default list is:
274    <itemizedlist spacing="compact">
275      <listitem><para>
276        max allowed step size
277      </para></listitem>
278      <listitem><para>
279        max total track length
280      </para></listitem>
281      <listitem><para>
282        max total time of flight
283      </para></listitem>
284      <listitem><para>
285        min kinetic energy
286      </para></listitem>
287      <listitem><para>
288        min remaining range
289      </para></listitem>
290    </itemizedlist>
291    </para>
292    <para>
293    The user can instantiate a <emphasis>UserLimits</emphasis> object only
294    for the desired logical volumes and do the association.
295    </para>
296    <para>
297    The first item (max step size) is automatically taken into
298    account by the G4 kernel while the others items must be managed by
299    the user, as explained below.
300    </para>
301    <para>
302    <emphasis role="bold">Example</emphasis>(see novice/N02):
303    in the Tracker region, in order to force the step size not to exceed
304    1/10 of the Tracker thickness, it is enough to put the following code in
305    <literal>DetectorConstruction::Construct()</literal>:
306    <informalexample>
307    <programlisting>
308       G4double maxStep = 0.1*TrackerLength;
309       logicTracker-&gt;SetUserLimits(new G4UserLimits(maxStep));
310    </programlisting>
311    </informalexample>
312    and in <literal>PhysicsList</literal>, the process
313    <literal>G4StepLimiter</literal> needs to be attached to each
314    particle's process manager where step limitation in the Tracker region
315    is required:
316    <informalexample>
317    <programlisting>
318       // Step limitation seen as a process
319       G4StepLimiter* stepLimiter = new G4StepLimiter();
320       pmanager-&gt;AddDiscreteProcess(StepLimiter);
321    </programlisting>
322    </informalexample>
323    </para>
324    <para>
325    The <emphasis>G4UserLimits</emphasis> class is in
326    <literal>source/global/management</literal>.
327    </para>
328  </para></listitem>
329  <listitem><para>
330    Concerning the others cuts, the user must define
331    dedicaced process(es). He registers this process (or its descendant)
332    only for the desired particles in their process manager. He can apply
333    his cuts in the <literal>DoIt</literal> of this process, since, via
334    <emphasis>G4Track</emphasis>, he can access the logical volume and
335    <emphasis>UserLimits</emphasis>.
336
337    <para>
338    An example of such process (called <emphasis>UserSpecialCuts</emphasis>) is
339    provided in the repository, but not inserted in any process manager
340    of any particle.
341    </para>
342    <para>
343    <emphasis role="bold">Example: neutrons.</emphasis> One may need to abandon
344    the tracking of neutrons after a given time of flight (or a charged
345    particle in a magnetic field after a given total track length ... etc ...).
346    </para>
347    <para>
348    Example(see novice/N02): in the Tracker region, in order to
349    force the total time of flight of the neutrons not to exceed 10
350    milliseconds, put the following code in
351    <literal>DetectorConstruction::Construct()</literal>:
352
353    <informalexample>
354    <programlisting>
355        G4double maxTime = 10*ms;
356        logicTracker-&gt;SetUserLimits(new G4UserLimits(DBL_MAX,DBL_MAX,maxTime));
357    </programlisting>
358    </informalexample>     
359
360    and put the following code in <literal>N02PhysicsList</literal>:
361
362    <informalexample>
363    <programlisting>
364        G4ProcessManager* pmanager = G4Neutron::Neutron-&gt;GetProcessManager();
365        pmanager-&gt;AddProcess(new G4UserSpecialCuts(),-1,-1,1);
366    </programlisting>
367    </informalexample>
368    </para>
369    <para>
370    (The default <emphasis>G4UserSpecialCuts</emphasis> class is in
371     <literal>source/processes/transportation</literal>.)
372    </para>
373  </para></listitem>
374</itemizedlist>
375</para>
376
377</sect2>
378</sect1>
Note: See TracBrowser for help on using the repository browser.