[904] | 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> |
---|
| 16 | Production Threshold versus Tracking Cut |
---|
| 17 | </title> |
---|
| 18 | |
---|
| 19 | |
---|
| 20 | <!-- ******************* Section (Level#2) ****************** --> |
---|
| 21 | <sect2 id="sect.ProThres.Gen"> |
---|
| 22 | <title> |
---|
| 23 | General considerations |
---|
| 24 | </title> |
---|
| 25 | |
---|
| 26 | <para> |
---|
| 27 | We have to fulfill two contradictory requirements. It is the |
---|
| 28 | responsibility of each individual <emphasis role="bold">process</emphasis> |
---|
| 29 | to produce secondary particles according to its own capabilities. On |
---|
| 30 | the other hand, it is only the Geant4 kernel (i.e., tracking) which can |
---|
| 31 | ensure an overall coherence of the simulation. |
---|
| 32 | </para> |
---|
| 33 | |
---|
| 34 | <para> |
---|
| 35 | The 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> |
---|
| 56 | Points 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> |
---|
| 66 | Set production threshold (<literal>SetCut</literal> methods) |
---|
| 67 | </title> |
---|
| 68 | |
---|
| 69 | <para> |
---|
| 70 | As already mentioned, each kind of particle has a suggested |
---|
| 71 | production threshold. Some of the processes will not use this |
---|
| 72 | threshold (e.g., decay), while other processes will use it as a |
---|
| 73 | default value for their intrinsic limits (e.g., ionisation and |
---|
| 74 | bremsstrahlung). |
---|
| 75 | </para> |
---|
| 76 | |
---|
| 77 | <para>See |
---|
| 78 | <xref linkend="sect.HowToSpecParti.RangeCuts" /> to see how to set |
---|
| 79 | the production threshold. |
---|
| 80 | </para> |
---|
| 81 | |
---|
| 82 | </sect2> |
---|
| 83 | |
---|
| 84 | |
---|
| 85 | <!-- ******************* Section (Level#2) ****************** --> |
---|
| 86 | <sect2 id="sect.ProThres.Apply"> |
---|
| 87 | <title> |
---|
| 88 | Apply cut |
---|
| 89 | </title> |
---|
| 90 | |
---|
| 91 | <para> |
---|
| 92 | The <literal>DoIt</literal> methods of each process can produce secondary |
---|
| 93 | particles. 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> |
---|
| 109 | The list of secondaries is sent to the <emphasis>SteppingManager</emphasis> |
---|
| 110 | via a <emphasis>ParticleChange</emphasis> object. |
---|
| 111 | </para> |
---|
| 112 | |
---|
| 113 | <para> |
---|
| 114 | <emphasis>Before</emphasis> being recopied to the temporary stack for later |
---|
| 115 | tracking, the particles below the production threshold will be kept or |
---|
| 116 | deleted 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 > |
---|
| 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> |
---|
| 159 | With this sophisticated mechanism we have the global cut that we |
---|
| 160 | wanted, but with energy conservation, and we respect boundary |
---|
| 161 | constraint (safety) and the wishes of the processes (via ``good for |
---|
| 162 | tracking''). |
---|
| 163 | </para> |
---|
| 164 | |
---|
| 165 | </sect2> |
---|
| 166 | |
---|
| 167 | |
---|
| 168 | <!-- ******************* Section (Level#2) ****************** --> |
---|
| 169 | <sect2 id="sect.ProThres.WhyProd"> |
---|
| 170 | <title> |
---|
| 171 | Why produce secondaries below threshold? |
---|
| 172 | </title> |
---|
| 173 | |
---|
| 174 | <para> |
---|
| 175 | A process may have good reasons to produce particles below the |
---|
| 176 | recommended 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> |
---|
| 193 | These secondary particles are sent to the ``Stepping Manager'' |
---|
| 194 | with a flag <literal>GoodForTracking</literal> to pass the filter explained |
---|
| 195 | in 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> |
---|
| 204 | Cuts in stopping range or in energy? |
---|
| 205 | </title> |
---|
| 206 | |
---|
| 207 | <para> |
---|
| 208 | The cuts in stopping range allow one to say that the energy has |
---|
| 209 | been released at the correct space position, limiting the |
---|
| 210 | approximation within a given distance. On the contrary, cuts in |
---|
| 211 | energy imply accuracies of the energy depositions which depend on |
---|
| 212 | the material. |
---|
| 213 | </para> |
---|
| 214 | |
---|
| 215 | </sect2> |
---|
| 216 | |
---|
| 217 | |
---|
| 218 | <!-- ******************* Section (Level#2) ****************** --> |
---|
| 219 | <sect2 id="sect.ProThres.Sum"> |
---|
| 220 | <title> |
---|
| 221 | Summary |
---|
| 222 | </title> |
---|
| 223 | |
---|
| 224 | <para> |
---|
| 225 | In summary, we do not have tracking cuts; we only have production |
---|
| 226 | thresholds in range. All particles produced and accepted are |
---|
| 227 | tracked up to zero range. |
---|
| 228 | </para> |
---|
| 229 | |
---|
| 230 | <para> |
---|
| 231 | It must be clear that the overall coherency that we provide |
---|
| 232 | cannot go beyond the capability of processes to produce particles |
---|
| 233 | down to the recommended threshold. |
---|
| 234 | </para> |
---|
| 235 | |
---|
| 236 | <para> |
---|
| 237 | In other words a process can produce the secondaries down to the |
---|
| 238 | recommended threshold, and by interrogating the geometry, or by |
---|
| 239 | realizing when mass-to-energy conversion can occur, recognize when |
---|
| 240 | particles 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> |
---|
| 249 | Special tracking cuts |
---|
| 250 | </title> |
---|
| 251 | |
---|
| 252 | <para> |
---|
| 253 | One may need to cut given particle types in given volumes for |
---|
| 254 | optimisation reasons. This decision is under user control, and can |
---|
| 255 | happen for particles during tracking as well. |
---|
| 256 | </para> |
---|
| 257 | |
---|
| 258 | <para> |
---|
| 259 | The user must be able to apply these special cuts only for the |
---|
| 260 | desired particles and in the desired volumes, without introducing |
---|
| 261 | an overhead for all the rest. |
---|
| 262 | </para> |
---|
| 263 | |
---|
| 264 | <para> |
---|
| 265 | The 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->SetUserLimits(new G4UserLimits(maxStep)); |
---|
| 310 | </programlisting> |
---|
| 311 | </informalexample> |
---|
| 312 | </para> |
---|
| 313 | <para> |
---|
| 314 | The <emphasis>G4UserLimits</emphasis> class is in |
---|
| 315 | <literal>source/global/management</literal>. |
---|
| 316 | </para> |
---|
| 317 | </para></listitem> |
---|
| 318 | <listitem><para> |
---|
| 319 | Concerning the others cuts, the user must define |
---|
| 320 | dedicaced process(es). He registers this process (or its descendant) |
---|
| 321 | only for the desired particles in their process manager. He can apply |
---|
| 322 | his cuts in the <literal>DoIt</literal> of this process, since, via |
---|
| 323 | <emphasis>G4Track</emphasis>, he can access the logical volume and |
---|
| 324 | <emphasis>UserLimits</emphasis>. |
---|
| 325 | |
---|
| 326 | <para> |
---|
| 327 | An example of such process (called <emphasis>UserSpecialCuts</emphasis>) is |
---|
| 328 | provided in the repository, but not inserted in any process manager |
---|
| 329 | of any particle. |
---|
| 330 | </para> |
---|
| 331 | <para> |
---|
| 332 | <emphasis role="bold">Example: neutrons.</emphasis> One may need to abandon |
---|
| 333 | the tracking of neutrons after a given time of flight (or a charged |
---|
| 334 | particle in a magnetic field after a given total track length ... etc ...). |
---|
| 335 | </para> |
---|
| 336 | <para> |
---|
| 337 | Example(see novice/N02): in the Tracker region, in order to |
---|
| 338 | force the total time of flight of the neutrons not to exceed 10 |
---|
| 339 | milliseconds, put the following code in |
---|
| 340 | <literal>DetectorConstruction::Construct()</literal>: |
---|
| 341 | |
---|
| 342 | <informalexample> |
---|
| 343 | <programlisting> |
---|
| 344 | G4double maxTime = 10*ms; |
---|
| 345 | logicTracker->SetUserLimits(new G4UserLimits(DBL_MAX,DBL_MAX,maxTime)); |
---|
| 346 | </programlisting> |
---|
| 347 | </informalexample> |
---|
| 348 | |
---|
| 349 | and put the following code in <literal>N02PhysicsList</literal>: |
---|
| 350 | |
---|
| 351 | <informalexample> |
---|
| 352 | <programlisting> |
---|
| 353 | G4ProcessManager* pmanager = G4Neutron::Neutron->GetProcessManager(); |
---|
| 354 | pmanager->AddProcess(new G4UserSpecialCuts(),-1,-1,1); |
---|
| 355 | </programlisting> |
---|
| 356 | </informalexample> |
---|
| 357 | </para> |
---|
| 358 | <para> |
---|
| 359 | (The default <emphasis>G4UserSpecialCuts</emphasis> class is in |
---|
| 360 | <literal>source/processes/transportation</literal>.) |
---|
| 361 | </para> |
---|
| 362 | </para></listitem> |
---|
| 363 | </itemizedlist> |
---|
| 364 | </para> |
---|
| 365 | |
---|
| 366 | </sect2> |
---|
| 367 | </sect1> |
---|