source: trunk/Documentation/geant4/UserDocumentation/UsersGuides/ForApplicationDeveloper/html/ch05s02.html @ 902

Last change on this file since 902 was 901, checked in by garnier, 16 years ago

Add Geant4 Documentation at 8.12.2008

File size: 145.6 KB
Line 
1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>5.2.  Physics Processes</title><link rel="stylesheet" href="../xml/XSLCustomizationLayer/G4HTMLStylesheet.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.71.1"><link rel="start" href="index.html" title="Geant4 User's Guide for Application Developers"><link rel="up" href="ch05.html" title="Chapter 5.  Tracking and Physics"><link rel="prev" href="ch05.html" title="Chapter 5.  Tracking and Physics"><link rel="next" href="ch05s03.html" title="5.3.  Particles"><script language="JavaScript">
2function remote_win(fName)
3{
4   var url = "AllResources/Detector/geometry.src/" + fName;
5   RemoteWin=window.open(url,"","resizable=no,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,copyhistory=0,width=520,height=520")
6   RemoteWin.creator=self
7}
8</script></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">5.2. 
9Physics Processes
10</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch05.html"><img src="AllResources/IconsGIF/prev.gif" alt="Prev"></a> </td><th width="60%" align="center">Chapter 5. 
11Tracking and Physics
12</th><td width="20%" align="right"> <a accesskey="n" href="ch05s03.html"><img src="AllResources/IconsGIF/next.gif" alt="Next"></a></td></tr></table><hr></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="sect.PhysProc"></a>5.2. 
13Physics Processes
14</h2></div></div></div><p>
15Physics processes describe how particles interact with a
16material. Seven major categories of processes are provided by
17Geant4:
18
19</p><div class="orderedlist"><ol type="1" compact><li><p>
20    <a href="ch05s02.html#sect.PhysProc.EleMag" title="5.2.1.  Electromagnetic Interactions">
21    electromagnetic
22    </a>
23    ,
24  </p></li><li><p>
25    <a href="ch05s02.html#sect.PhysProc.Had" title="5.2.2.  Hadronic Interactions">
26    hadronic
27    </a>
28    ,
29  </p></li><li><p>
30    <a href="ch05s02.html#sect.PhysProc.Decay" title="5.2.3.  Particle Decay Process">
31    decay
32    </a>
33    ,
34  </p></li><li><p>
35    <a href="ch05s02.html#sect.PhysProc.PhotoHad" title="5.2.4.  Photolepton-hadron Processes">
36    photolepton-hadron
37    </a>
38    ,
39  </p></li><li><p>
40    <a href="ch05s02.html#sect.PhysProc.Photo" title="5.2.5.  Optical Photon Processes">
41    optical
42    </a>
43    ,
44  </p></li><li><p>
45    <a href="ch05s02.html#sect.PhysProc.Param" title="5.2.6.  Parameterization">
46    parameterization
47    </a>
48    and
49  </p></li><li><p>
50    <a href="ch05s02.html#sect.PhysProc.Trans" title="5.2.7.  Transportation Process">
51    transportation
52    </a>
53    .
54  </p></li></ol></div><p>
55</p><p>
56The generalization and abstraction of physics processes is a key
57issue in the design of Geant4. All physics processes are treated in
58the same manner from the tracking point of view. The Geant4
59approach enables anyone to create a process and assign it to a
60particle type. This openness should allow the creation of processes
61for novel, domain-specific or customised purposes by individuals or
62groups of users.
63</p><p>
64Each process has two groups of methods which play an important
65role in tracking, <code class="literal">GetPhysicalInteractionLength</code> (GPIL) and
66<code class="literal">DoIt</code>. The GPIL method gives the step length from the
67current space-time point to the next space-time point. It does this
68by calculating the probability of interaction based on the
69process's cross section information. At the end of this step the
70<code class="literal">DoIt</code> method should be invoked. The <code class="literal">DoIt</code> method
71implements the details of the interaction, changing the particle's
72energy, momentum, direction and position, and producing secondary
73tracks if required. These changes are recorded as
74<span class="emphasis"><em>G4VParticleChange</em></span> objects(see
75<a href="ch05s02.html#brhead.PhysProc.PrtChng">
76Particle Change</a>).
77</p><h5><a name="id456777"></a>
78G4VProcess
79</h5><p>
80<span class="emphasis"><em>G4VProcess</em></span> is the base class for all physics processes.
81Each physics process must implement virtual methods of
82<span class="emphasis"><em>G4VProcess</em></span> which describe the interaction (DoIt) and
83determine when an interaction should occur (GPIL). In order to
84accommodate various types of interactions <span class="emphasis"><em>G4VProcess</em></span>
85provides three <code class="literal">DoIt</code> methods:
86
87</p><div class="itemizedlist"><ul type="disc" compact><li><p>
88    <code class="literal">G4VParticleChange* AlongStepDoIt( const G4Track&amp; track,
89    const G4Step&amp; stepData )</code>
90    </p><p>
91    This method is invoked while <span class="emphasis"><em>G4SteppingManager</em></span> is
92    transporting a particle through one step. The corresponding
93    <code class="literal">AlongStepDoIt</code> for each defined process is applied for
94    every step regardless of which process produces the minimum step
95    length. Each resulting change to the track information is recorded
96    and accumulated in <span class="emphasis"><em>G4Step</em></span>. After all processes have been
97    invoked, changes due to <code class="literal">AlongStepDoIt</code> are applied to
98    <span class="emphasis"><em>G4Track</em></span>, including the particle relocation and the safety
99    update. Note that after the invocation of <code class="literal">AlongStepDoIt</code>,
100    the endpoint of the <span class="emphasis"><em>G4Track</em></span> object is in a new volume if the
101    step was limited by a geometric boundary. In order to obtain
102    information about the old volume, <span class="emphasis"><em>G4Step</em></span> must be accessed,
103    since it contains information about both endpoints of a step.
104    </p><p>
105  </p></li><li><p>
106    <code class="literal">G4VParticleChange* PostStepDoIt( const G4Track&amp; track,
107    const G4Step&amp; stepData )</code>
108    </p><p>
109    This method is invoked at the end point of a step, only if its
110    process has produced the minimum step length, or if the process is
111    forced to occur. <span class="emphasis"><em>G4Track</em></span> will be updated after each
112    invocation of <code class="literal">PostStepDoIt</code>, in contrast to the
113    <code class="literal">AlongStepDoIt</code> method.
114    </p><p>
115  </p></li><li><p>
116    <code class="literal">G4VParticleChange* AtRestDoIt( const G4Track&amp; track,
117    const G4Step&amp; stepData )</code>
118    </p><p>
119    This method is invoked only for stopped particles, and only if
120    its process produced the minimum step length or the process is
121    forced to occur.
122    </p><p>
123  </p></li></ul></div><p>
124</p><p>
125For each of the above <code class="literal">DoIt</code> methods <span class="emphasis"><em>G4VProcess</em></span>
126provides a corresponding pure virtual GPIL method:
127
128</p><div class="itemizedlist"><ul type="disc" compact><li><p>
129    <code class="literal">G4double PostStepGetPhysicalInteractionLength( const
130    G4Track&amp; track, G4double previousStepSize, G4ForceCondition*
131    condition )</code>
132    </p><p>
133    This method generates the step length allowed by its process. It
134    also provides a flag to force the interaction to occur regardless
135    of its step length.
136    </p><p>
137  </p></li><li><p>
138    <code class="literal">G4double AlongStepGetPhysicalInteractionLength( const
139    G4Track&amp; track, G4double previousStepSize, G4double
140    currentMinimumStep, G4double&amp; proposedSafety, G4GPILSelection*
141    selection )</code>
142    </p><p>
143    This method generates the step length allowed by its process.
144    </p><p>
145  </p></li><li><p>
146    <code class="literal">G4double AtRestGetPhysicalInteractionLength( const
147    G4Track&amp; track, G4ForceCondition* condition )</code>
148    </p><p>
149    This method generates the step length in time allowed by its
150    process. It also provides a flag to force the interaction to occur
151    regardless of its step length.
152    </p><p>
153  </p></li></ul></div><p>
154</p><p>
155Other pure virtual methods in <span class="emphasis"><em>G4VProcess</em></span> follow:
156
157</p><div class="itemizedlist"><ul type="disc" compact><li><p>
158    <code class="literal">virtual G4bool IsApplicable(const
159    G4ParticleDefinition&amp;)</code>
160    </p><p>
161    returns true if this process object is applicable to the
162    particle type.
163    </p><p>
164  </p></li><li><p>
165      <code class="literal">virtual void PreparePhysicsTable(const
166      G4ParticleDefinition&amp;)</code> and
167  </p></li><li><p>
168    <code class="literal">virtual void BuildPhysicsTable(const
169    G4ParticleDefinition&amp;)</code>
170    </p><p>
171    is messaged by the process manager, whenever cross section
172    tables should be prepared and rebuilt due to changing cut-off
173    values. It is not mandatory if the process is not affected by
174    cut-off values.
175    </p><p>
176  </p></li><li><p>
177    <code class="literal">virtual void StartTracking()</code> and
178  </p></li><li><p>
179    <code class="literal">virtual void EndTracking()</code>
180    </p><p>
181    are messaged by the tracking manager at the beginning and end of
182    tracking the current track.
183    </p><p>
184  </p></li></ul></div><p>
185</p><h5><a name="id457064"></a>
186Other base classes for processes
187</h5><p>
188Specialized processes may be derived from seven additional
189virtual base classes which are themselves derived from
190<span class="emphasis"><em>G4VProcess</em></span>. Three of these classes are used for simple
191processes:
192
193</p><div class="variablelist"><dl><dt><span class="term"><span class="emphasis"><em>G4VRestProcess</em></span></span></dt><dd><p>
194      Processes using only the <code class="literal">AtRestDoIt</code> method.
195      </p><p>
196      example: neutron capture
197      </p></dd><dt><span class="term"><span class="emphasis"><em>G4VDiscreteProcess</em></span></span></dt><dd><p>
198      Processes using only the <code class="literal">PostStepDoIt</code> method.
199      </p><p>
200      example: compton scattering, hadron inelastic interaction
201      </p></dd></dl></div><p>
202</p><p>
203The other four classes are provided for rather complex
204processes:
205
206</p><div class="variablelist"><dl><dt><span class="term"><span class="emphasis"><em>G4VContinuousDiscreteProcess</em></span></span></dt><dd><p>
207      Processes using both <code class="literal">AlongStepDoIt</code> and
208      <code class="literal">PostStepDoIt</code> methods.
209      </p><p>
210      example: transportation, ionisation(energy loss and delta ray)
211      </p></dd><dt><span class="term"><span class="emphasis"><em>G4VRestDiscreteProcess</em></span></span></dt><dd><p>
212      Processes using both <code class="literal">AtRestDoIt</code> and
213      <code class="literal">PostStepDoIt</code> methods.
214      </p><p>
215      example: positron annihilation, decay (both in flight and at rest)
216      </p></dd><dt><span class="term"><span class="emphasis"><em>G4VRestContinuousProcess</em></span></span></dt><dd><p>
217      Processes using both <code class="literal">AtRestDoIt</code> and
218      <code class="literal">AlongStepDoIt</code> methods.
219      </p></dd><dt><span class="term"><span class="emphasis"><em>G4VRestContinuousDiscreteProcess</em></span></span></dt><dd><p>
220      Processes using <code class="literal">AtRestDoIt</code>,
221      <code class="literal">AlongStepDoIt and</code> PostStepDoIt methods.
222      </p></dd></dl></div><p>
223</p><h5><a name="brhead.PhysProc.PrtChng"></a>
224Particle change
225</h5><p>
226<span class="emphasis"><em>G4VParticleChange</em></span> and its descendants are used to store
227the final state information of the track, including secondary
228tracks, which has been generated by the <code class="literal">DoIt</code> methods. The
229instance of <span class="emphasis"><em>G4VParticleChange</em></span> is the only object whose
230information is updated by the physics processes, hence it is
231responsible for updating the step. The stepping manager collects
232secondary tracks and only sends requests via particle change to
233update <span class="emphasis"><em>G4Step</em></span>.
234</p><p>
235<span class="emphasis"><em>G4VParticleChange</em></span> is introduced as an abstract class. It
236has a minimal set of methods for updating <span class="emphasis"><em>G4Step</em></span> and
237handling secondaries. A physics process can therefore define its
238own particle change derived from <span class="emphasis"><em>G4VParticleChange</em></span>. Three
239pure virtual methods are provided,
240
241</p><div class="itemizedlist"><ul type="disc" compact><li><p>
242    <code class="literal">virtual G4Step* UpdateStepForAtRest( G4Step* step)</code>,
243  </p></li><li><p>
244    <code class="literal">virtual G4Step* UpdateStepForAlongStep( G4Step* step )</code>
245    and
246  </p></li><li><p>
247    <code class="literal">virtual G4Step* UpdateStepForPostStep( G4Step* step)</code>,
248  </p></li></ul></div><p>
249
250which correspond to the three <code class="literal">DoIt</code> methods of
251<span class="emphasis"><em>G4VProcess</em></span>. Each derived class should implement these
252methods.
253</p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="sect.PhysProc.EleMag"></a>5.2.1. 
254Electromagnetic Interactions
255</h3></div></div></div><p>
256This section summarizes the electromagnetic physics processes which
257are installed in Geant4. For details on the implementation of these
258processes please refer to the
259<a href="http://geant4.web.cern.ch/geant4/UserDocumentation/UsersGuides/PhysicsReferenceManual/html/PhysicsReferenceManual.html" target="_top">
260<span class="bold"><strong>Physics Reference Manual</strong></span></a>.
261</p><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="sect.PhysProc.EleMag.Stand"></a>5.2.1.1. 
262"Standard" Electromagnetic Processes
263</h4></div></div></div><p>
264The following is a summary of the standard electromagnetic
265processes available in Geant4.
266
267</p><div class="itemizedlist"><ul type="disc" compact><li><p>
268    Photon processes
269    </p><div class="itemizedlist"><ul type="circle" compact><li><p>
270        Compton scattering (class name <span class="emphasis"><em>G4ComptonScattering</em></span>)
271      </p></li><li><p>
272        Gamma conversion (also called pair production, class name
273        <span class="emphasis"><em>G4GammaConversion</em></span>)
274      </p></li><li><p>
275        Photo-electric effect (class name <span class="emphasis"><em>G4PhotoElectricEffect</em></span>)
276      </p></li><li><p>
277        Muon pair production (class name <span class="emphasis"><em>G4GammaConversionToMuons</em></span>)
278      </p></li></ul></div><p>
279  </p></li><li><p>
280    Electron/positron processes
281    </p><div class="itemizedlist"><ul type="circle" compact><li><p>
282        Ionisation and delta ray production (class name
283        <span class="emphasis"><em>G4eIonisation</em></span>)
284      </p></li><li><p>
285        Bremsstrahlung (class name <span class="emphasis"><em>G4eBremsstrahlung</em></span>)
286      </p></li><li><p>
287        Positron annihilation into two gammas (class name
288        <span class="emphasis"><em>G4eplusAnnihilation</em></span>)
289      </p></li><li><p>
290        Positron annihilation into two muons (class name
291        <span class="emphasis"><em>G4AnnihiToMuPair</em></span>)
292      </p></li><li><p>
293        Positron annihilation into hadrons (class name
294        <span class="emphasis"><em>G4eeToHadrons</em></span>)
295      </p></li></ul></div><p>
296  </p></li><li><p>
297    Muon processes
298    </p><div class="itemizedlist"><ul type="circle" compact><li><p>
299        Ionisation and delta ray production (class name
300        <span class="emphasis"><em>G4MuIonisation</em></span>)
301      </p></li><li><p>
302        Bremsstrahlung (class name <span class="emphasis"><em>G4MuBremsstrahlung</em></span>)
303      </p></li><li><p>
304        e+e- pair production (class name
305        <span class="emphasis"><em>G4MuPairProduction</em></span>)
306      </p></li></ul></div><p>
307  </p></li><li><p>
308    Hadron/ion processes
309    </p><div class="itemizedlist"><ul type="circle" compact><li><p>
310        Ionisation (class name <span class="emphasis"><em>G4hIonisation</em></span>)
311      </p></li><li><p>
312        Ionisation for ions (class name <span class="emphasis"><em>G4ionIonisation</em></span>)
313      </p></li><li><p>
314        Ionisation for ions in low-density media (class name <span class="emphasis"><em>G4ionGasIonisation</em></span>)
315      </p></li><li><p>
316        Ionisation for heavy exotic particles (class name
317        <span class="emphasis"><em>G4hhIonisation</em></span>)
318      </p></li><li><p>
319        Ionisation for classical magnetic monopole (class name
320        <span class="emphasis"><em>G4mplIonisation</em></span>)
321      </p></li></ul></div><p>
322  </p></li><li><p>
323    Coulomb scattering processes
324    </p><div class="itemizedlist"><ul type="circle" compact><li><p>
325        A general process in the sense that the same process/class
326        is used to simulate the multiple scattering of the all charged
327        particles  (class name <span class="emphasis"><em>G4MultipleScattering</em></span>)
328      </p></li><li><p>
329        Specialised process for more fast simulation the multiple scattering
330        of muons and hadrons (class name <span class="emphasis"><em>G4hMultipleScattering</em></span>)
331      </p></li><li><p>
332        Alternative process (beta-version) for the multiple scattering
333        of muons (class name <span class="emphasis"><em>G4MuMultipleScattering</em></span>)
334      </p></li><li><p>
335        Alternative process for simulation of single Coulomb scattering
336        of all charged particles (class name <span class="emphasis"><em>G4CoulombScattering</em></span>)
337      </p></li><li><p>
338        Alternative process for simulation of single Coulomb scattering
339        of ions (class name <span class="emphasis"><em>G4ScreenedNuclearRecoil</em></span>)
340      </p></li></ul></div><p>
341  </p></li><li><p>
342    Processes for simulation of polarized electron and gamma beams
343    </p><div class="itemizedlist"><ul type="circle" compact><li><p>
344        Compton scattering of circularly polarized gamma beam on
345        polarized target (class name <span class="emphasis"><em>G4PolarizedCompton</em></span>)
346      </p></li><li><p>
347        Pair production induced by circularly polarized gamma beam
348        (class name <span class="emphasis"><em>G4PolarizedGammaConversion</em></span>)
349      </p></li><li><p>
350        Photo-electric effect induced by circularly polarized gamma beam
351        (class name <span class="emphasis"><em>G4PolarizedPhotoElectricEffect</em></span>)
352      </p></li><li><p>
353        Bremsstrahlung of polarized electrons and positrons
354        (class name <span class="emphasis"><em>G4ePolarizedBremsstrahlung</em></span>)
355      </p></li><li><p>
356        Ionisation of polarized electron and positron beam
357        (class name <span class="emphasis"><em>G4ePolarizedIonisation</em></span>)
358      </p></li><li><p>
359        Annihilation of polarized positrons
360        (class name <span class="emphasis"><em>G4eplusPolarizedAnnihilation</em></span>)
361      </p></li></ul></div><p>
362  </p></li><li><p>
363    Processes for simulation of X-rays and optical protons production by charged particles
364    </p><div class="itemizedlist"><ul type="circle" compact><li><p>
365        Synchrotron radiation (class name <span class="emphasis"><em>G4SynchrotronRadiation</em></span>)
366      </p></li><li><p>
367        Transition radiation
368        (class name <span class="emphasis"><em>G4TransitionRadiation</em></span>)
369      </p></li><li><p>
370        Cerenkov radiation 
371        (class name <span class="emphasis"><em>G4Cerenkov</em></span>)
372      </p></li><li><p>
373        Scintillations
374        (class name <span class="emphasis"><em>G4Scintillation</em></span>)
375      </p></li></ul></div><p>
376  </p></li><li><p>
377    The processes described above use physics model classes, which
378    may be combined according to particle energy. It is possible to
379    change the energy range over which different models are valid, and
380    to apply other models specific to particle type, energy range, and
381    G4Region. The following alternative models are available:
382    </p><div class="itemizedlist"><ul type="circle" compact><li><p>
383        Ionisation in thin absorbers (class name <span class="emphasis"><em>G4PAIModel</em></span>)
384      </p></li></ul></div><p>
385  </p></li></ul></div><p>
386</p><p>
387An example of the registration of these processes in a physics list
388is given in <a href="ch05s02.html#programlist_PhysProc_1" title="Example 5.1. 
389Registration of standard electromagnetic processes
390">Example 5.1</a>,
391similar method is used in EM-builders of reference physics
392lists ($G4INSTALL/source/physics_lists/builders) and in
393EM examples ($G4INSTALL/examples/extended/electromagnetic).
394
395</p><div class="example"><a name="programlist_PhysProc_1"></a><p class="title"><b>Example 5.1. 
396<code class="literal">Registration of standard electromagnetic processes</code>
397</b></p><div class="example-contents"><pre class="programlisting">
398void PhysicsList::ConstructEM()
399
400{
401
402  theParticleIterator-&gt;reset();
403
404  while( (*theParticleIterator)() ){
405
406    G4ParticleDefinition* particle = theParticleIterator-&gt;value();
407    G4ProcessManager* pmanager = particle-&gt;GetProcessManager();
408    G4String particleName = particle-&gt;GetParticleName();
409
410    if (particleName == "gamma") {
411
412      pmanager-&gt;AddDiscreteProcess(new G4PhotoElectricEffect);
413      pmanager-&gt;AddDiscreteProcess(new G4ComptonScattering);
414      pmanager-&gt;AddDiscreteProcess(new G4GammaConversion);
415
416    } else if (particleName == "e-") {
417
418      pmanager-&gt;AddProcess(new G4MultipleScattering, -1, 1, 1);
419      pmanager-&gt;AddProcess(new G4eIonisation,        -1, 2, 2);
420      pmanager-&gt;AddProcess(new G4eBremsstrahlung,    -1, 3, 3);
421
422    } else if (particleName == "e+") {
423
424      pmanager-&gt;AddProcess(new G4MultipleScattering, -1, 1, 1);
425      pmanager-&gt;AddProcess(new G4eIonisation,        -1, 2, 2);
426      pmanager-&gt;AddProcess(new G4eBremsstrahlung,    -1, 3, 3);
427      pmanager-&gt;AddProcess(new G4eplusAnnihilation,   0,-1, 4);
428     
429    } else if( particleName == "mu+" ||
430               particleName == "mu-"    ) {
431
432      pmanager-&gt;AddProcess(new G4hMultipleScattering,-1, 1, 1);
433      pmanager-&gt;AddProcess(new G4MuIonisation,       -1, 2, 2);
434      pmanager-&gt;AddProcess(new G4MuBremsstrahlung,   -1, 3, 3);
435               pmanager-&gt;AddProcess(new G4MuPairProduction,   -1, 4, 4);       
436
437    } else if (particleName == "alpha" ||
438               particleName == "He3" ||
439               particleName == "GenericIon") {
440      // ions with charge &gt;= +2
441      pmanager-&gt;AddProcess(new G4hMultipleScattering,-1, 1, 1);
442      pmanager-&gt;AddProcess(new G4ionIonisation,      -1, 2, 2);
443     
444    } else if ((!particle-&gt;IsShortLived()) &amp;&amp;
445               (particle-&gt;GetPDGCharge() != 0.0) &amp;&amp; 
446               (particle-&gt;GetParticleName() != "chargedgeantino")) {
447      //all others charged particles except geantino and short-lived
448      pmanager-&gt;AddProcess(new G4hMultipleScattering,-1, 1, 1);
449      pmanager-&gt;AddProcess(new G4hIonisation,        -1, 2, 2);
450           
451    }
452  }
453}
454</pre></div></div><p><br class="example-break">
455</p><p>
456Novice and extended electromagnetic examples illustrating the use
457of electromagnetic processes are available as part of the Geant4
458<a href="http://geant4.web.cern.ch/geant4/support/download.shtml" target="_top">
459release</a>.
460</p><p>
461<span class="bold"><strong>Options</strong></span> are available for steering the standard
462electromagnetic processes. These options may be invoked either by
463UI commands or by the interface class G4EmProcessOptions. This
464class has the following public methods:
465
466</p><div class="itemizedlist"><ul type="disc" compact><li><p>
467     SetLossFluctuations(G4bool)
468   </p></li><li><p>
469     SetSubCutoff(G4bool, const G4Region* r=0)
470   </p></li><li><p>
471     SetIntegral(G4bool)
472   </p></li><li><p>
473     SetMinSubRange(G4double)
474   </p></li><li><p>
475     SetMinEnergy(G4double)
476   </p></li><li><p>
477     SetMaxEnergy(G4double)
478   </p></li><li><p>
479     SetMaxEnergyForCSDARange(G4double)
480   </p></li><li><p>
481     SetMaxEnergyForMuons(G4double)
482   </p></li><li><p>
483     SetDEDXBinning(G4int)
484   </p></li><li><p>
485     SetDEDXBinningForCSDARange(G4int)
486   </p></li><li><p>
487     SetLambdaBinning(G4int)
488   </p></li><li><p>
489     SetStepFunction(G4double, G4double)
490   </p></li><li><p>
491     SetRandomStep(G4bool)
492   </p></li><li><p>
493     SetApplyCuts(G4bool)
494   </p></li><li><p>
495     SetBuildCSDARange(G4bool)
496   </p></li><li><p>
497     SetVerbose(G4int, const G4String name= "all")
498   </p></li><li><p>
499     SetLambdaFactor(G4double) 
500   </p></li><li><p>
501     SetLinearLossLimit(G4double) 
502   </p></li><li><p>
503     ActivateDeexcitation(G4bool val, const G4Region* r = 0) 
504   </p></li><li><p>
505     SetMscStepLimitation(G4MscStepLimitType val) 
506   </p></li><li><p>
507     SetMscLateralDisplacement(G4bool val) 
508   </p></li><li><p>
509     SetSkin(G4double) 
510   </p></li><li><p>
511     SetMscRangeFactor(G4double) 
512   </p></li><li><p>
513     SetMscGeomFactor(G4double) 
514   </p></li><li><p>
515     SetLPMFlag(G4bool)
516   </p></li><li><p>
517     SetBremsstrahlungTh(G4double)
518   </p></li></ul></div><p>
519</p><p>
520The corresponding UI command can be accessed in the UI subdirectory
521"/process/eLoss". The following types of step limitation by multiple scattering
522are available:
523
524</p><div class="itemizedlist"><ul type="disc" compact><li><p>
525     fSimple - step limitation used in g4 7.1 version (used in QGSP_EMV Physics List)
526   </p></li><li><p>
527     fUseSafety - default
528   </p></li><li><p>
529     fUseDistanceToBoundary - advance method of step limitation used in EM examples,
530     required parameter <span class="emphasis"><em>skin &gt; 0</em></span>, should be used for
531     setup without magnetic field
532   </p></li></ul></div><p>
533</p><p>
534<span class="bold"><strong>G4EmCalculator</strong></span> is a class which provides
535access to cross sections and stopping powers. This class can be used
536anywhere in the user code provided the physics list has already been
537initialised (G4State_Idle). G4EmCalculator has "Get" methods which
538can be applied to materials for which physics tables are already
539built, and "Compute" methods which can be applied to any material
540defined in the application or existing in the Geant4 internal
541database. The public methods of this class are:
542
543</p><div class="itemizedlist"><ul type="disc" compact><li><p>
544     GetDEDX(kinEnergy,particle,material,G4Region region=0)
545   </p></li><li><p>
546     GetRangeFromRestrictedDEDX(kinEnergy,particle,material,G4Region* region=0)
547   </p></li><li><p>
548     GetCSDARange(kinEnergy,particle,material,G4Region* region=0)
549   </p></li><li><p>
550     GetRange(kinEnergy,particle,material,G4Region* region=0)
551   </p></li><li><p>
552     GetKinEnergy(range,particle,material,G4Region* region=0)
553   </p></li><li><p>
554     GetCrosSectionPerVolume(kinEnergy,particle,material,G4Region* region=0)
555   </p></li><li><p>
556     GetMeanFreePath(kinEnergy,particle,material,G4Region* region=0)
557   </p></li><li><p>
558     PrintDEDXTable(particle)
559   </p></li><li><p>
560     PrintRangeTable(particle)
561   </p></li><li><p>
562     PrintInverseRangeTable(particle)
563   </p></li><li><p>
564     ComputeDEDX(kinEnergy,particle,process,material,cut=DBL_MAX)
565   </p></li><li><p>
566     ComputeElectronicDEDX(kinEnergy,particle,material,cut=DBL_MAX)
567   </p></li><li><p>
568     ComputeNuclearDEDX(kinEnergy,particle,material,cut=DBL_MAX)
569   </p></li><li><p>
570     ComputeTotalDEDX(kinEnergy,particle,material,cut=DBL_MAX)
571   </p></li><li><p>
572     ComputeCrosSectionPerVolume(kinEnergy,particle,process,material,cut=0)
573   </p></li><li><p>
574     ComputeCrosSectionPerAtom(kinEnergy,particle,process,Z,A,cut=0)
575   </p></li><li><p>
576     ComputeMeanFreePath(kinEnergy,particle,process,material,cut=0)
577   </p></li><li><p>
578     ComputeEnergyCutFromRangeCut(range,particle,material)
579   </p></li><li><p>
580     FindParticle(const G4String&amp;)
581   </p></li><li><p>
582     FindMaterial(const G4String&amp;)
583   </p></li><li><p>
584     FindRegion(const G4String&amp;)
585   </p></li><li><p>
586     FindCouple(const G4Material*, const G4Region* region=0)
587   </p></li><li><p>
588     SetVerbose(G4int)
589   </p></li></ul></div><p>
590</p><p>
591For these interfaces, particles, materials, or processes may be
592pointers or strings with names.
593</p></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="sect.PhysProc.EleMag.LowE"></a>5.2.1.2. 
594Low Energy Electromagnetic Processes
595</h4></div></div></div><p>
596The following is a summary of the Low Energy Electromagnetic
597processes available in Geant4. Further information is available in
598the
599<a href="http://www.ge.infn.it/geant4/lowE/index.html" target="_top">
600homepage
601</a>
602of the Geant4 Low Energy Electromagnetic Physics Working Group.
603The physics content of these processes is documented in Geant4
604<a href="http://geant4.web.cern.ch/geant4/UserDocumentation/UsersGuides/PhysicsReferenceManual/html/PhysicsReferenceManual.html" target="_top">
605Physics Reference Manual
606</a>
607and in other
608<a href="http://www.ge.infn.it/geant4/lowE/papers.html" target="_top">
609papers</a>.
610</p><p>
611</p><div class="itemizedlist"><ul type="disc" compact><li><p>
612    <span class="bold"><strong>Photon processes</strong></span>
613    </p><div class="itemizedlist"><ul type="circle" compact><li><p>
614        Compton scattering (class <span class="emphasis"><em>G4LowEnergyCompton</em></span>)
615      </p></li><li><p>
616        Polarized Compton scattering (class
617        <span class="emphasis"><em>G4LowEnergyPolarizedCompton</em></span>)
618      </p></li><li><p>
619        Rayleigh scattering (class <span class="emphasis"><em>G4LowEnergyRayleigh</em></span>)
620      </p></li><li><p>
621        Gamma conversion (also called pair production, class
622        <span class="emphasis"><em>G4LowEnergyGammaConversion</em></span>)
623      </p></li><li><p>
624        Photo-electric effect (class<span class="emphasis"><em>G4LowEnergyPhotoElectric</em></span>)
625      </p></li></ul></div><p>
626  </p></li><li><p>
627    <span class="bold"><strong>Electron processes</strong></span>
628    </p><div class="itemizedlist"><ul type="circle" compact><li><p>
629        Bremsstrahlung (class <span class="emphasis"><em>G4LowEnergyBremsstrahlung</em></span>)
630      </p></li><li><p>
631        Ionisation and delta ray production (class
632        <span class="emphasis"><em>G4LowEnergyIonisation</em></span>)
633      </p></li></ul></div><p>
634  </p></li><li><p>
635    <span class="bold"><strong>Hadron and ion processes</strong></span>
636    </p><div class="itemizedlist"><ul type="circle" compact><li><p>
637        Ionisation and delta ray production (class
638        <span class="emphasis"><em>G4hLowEnergyIonisation</em></span>)
639      </p></li></ul></div><p>
640  </p></li></ul></div><p>
641</p><p>
642An example of the registration of these processes in a physics list
643is given in <a href="ch05s02.html#programlist_PhysProc_2" title="Example 5.2. 
644Registration of electromagnetic low energy electron/photon processes.
645">Example 5.2</a>.
646
647</p><div class="example"><a name="programlist_PhysProc_2"></a><p class="title"><b>Example 5.2. 
648Registration of electromagnetic low energy electron/photon processes.
649</b></p><div class="example-contents"><pre class="programlisting">
650void LowEnPhysicsList::ConstructEM()
651{
652  theParticleIterator-&gt;reset();
653
654  while( (*theParticleIterator)() ){
655
656    G4ParticleDefinition* particle = theParticleIterator-&gt;value();
657    G4ProcessManager* pmanager = particle-&gt;GetProcessManager();
658    G4String particleName = particle-&gt;GetParticleName();
659
660    if (particleName == "gamma") {
661
662      theLEPhotoElectric   = new G4LowEnergyPhotoElectric();
663      theLECompton         = new G4LowEnergyCompton();
664      theLEGammaConversion = new G4LowEnergyGammaConversion();
665      theLERayleigh        = new G4LowEnergyRayleigh();
666
667      pmanager-&gt;AddDiscreteProcess(theLEPhotoElectric);
668      pmanager-&gt;AddDiscreteProcess(theLECompton);
669      pmanager-&gt;AddDiscreteProcess(theLERayleigh);
670      pmanager-&gt;AddDiscreteProcess(theLEGammaConversion);
671
672    }
673    else if (particleName == "e-") {
674
675      theLEIonisation = new G4LowEnergyIonisation();
676      theLEBremsstrahlung = new G4LowEnergyBremsstrahlung();
677      theeminusMultipleScattering = new G4MultipleScattering();
678
679      pmanager-&gt;AddProcess(theeminusMultipleScattering,-1,1,1);
680      pmanager-&gt;AddProcess(theLEIonisation,-1,2,2);
681      pmanager-&gt;AddProcess(theLEBremsstrahlung,-1,-1,3);
682
683    }
684    else if (particleName == "e+") {
685
686      theeplusMultipleScattering = new G4MultipleScattering();
687      theeplusIonisation = new G4eIonisation();
688      theeplusBremsstrahlung = new G4eBremsstrahlung();
689      theeplusAnnihilation = new G4eplusAnnihilation();
690
691      pmanager-&gt;AddProcess(theeplusMultipleScattering,-1,1,1);
692      pmanager-&gt;AddProcess(theeplusIonisation,-1,2,2);
693      pmanager-&gt;AddProcess(theeplusBremsstrahlung,-1,-1,3);
694      pmanager-&gt;AddProcess(theeplusAnnihilation,0,-1,4);
695    }
696  }
697}
698</pre></div></div><p><br class="example-break">
699</p><p>
700Advanced <span class="bold"><strong>examples</strong></span> illustrating the use of Low Energy
701Electromagnetic processes are available as part of the Geant4
702<a href="http://geant4.web.cern.ch/geant4/support/download.shtml" target="_top">
703release
704</a>
705and are further documented
706<a href="http://www.ge.infn.it/geant4/lowE/examples/index.html" target="_top">
707here</a>.
708</p><p>
709To run the Low Energy code for photon and electron
710electromagnetic processes, <span class="bold"><strong>
711<a href="http://geant4.web.cern.ch/geant4/support/download.shtml" target="_top">
712data files
713</a>
714</strong></span> 
715need to be copied by the user to his/her code
716repository. These files are distributed together with Geant4
717<a href="http://geant4.web.cern.ch/geant4/support/download.shtml" target="_top">
718release</a>.
719</p><p>
720The user should set the environment variable
721<span class="bold"><strong>G4LEDATA</strong></span> to the
722directory where he/she has copied the files.
723</p><p>
724<span class="bold"><strong>Options</strong></span> are available for low energy electromagnetic
725processes for hadrons and ions in terms of public member functions
726of the G4hLowEnergyIonisation class:
727
728</p><div class="itemizedlist"><ul type="disc" compact><li><p>
729     SetHighEnergyForProtonParametrisation(G4double)
730   </p></li><li><p>
731     SetLowEnergyForProtonParametrisation(G4double)
732   </p></li><li><p>
733     SetHighEnergyForAntiProtonParametrisation(G4double)
734   </p></li><li><p>
735     SetLowEnergyForAntiProtonParametrisation(G4double)
736   </p></li><li><p>
737     SetElectronicStoppingPowerModel(const G4ParticleDefinition*,const G4String&amp; )
738   </p></li><li><p>
739     SetNuclearStoppingPowerModel(const G4String&amp;)
740   </p></li><li><p>
741     SetNuclearStoppingOn()
742   </p></li><li><p>
743     SetNuclearStoppingOff()
744   </p></li><li><p>
745     SetBarkasOn()
746   </p></li><li><p>
747     SetBarkasOff()
748   </p></li><li><p>
749     SetFluorescence(const G4bool)
750   </p></li><li><p>
751     ActivateAugerElectronProduction(G4bool)
752   </p></li><li><p>
753     SetCutForSecondaryPhotons(G4double)
754   </p></li><li><p>
755     SetCutForSecondaryElectrons(G4double)
756   </p></li></ul></div><p>
757</p><p>
758The available models for ElectronicStoppingPower and
759NuclearStoppingPower are documented in the
760<a href="http://www.ge.infn.it/geant4/lowE/swprocess/design/" target="_top">
761class diagrams</a>.
762</p><p>
763<span class="bold"><strong>Options</strong></span> are available for low energy electromagnetic
764processes for electrons in the G4LowEnergyIonisation class:
765
766</p><div class="itemizedlist"><ul type="disc" compact><li><p>
767     ActivateAuger(G4bool)
768   </p></li><li><p>
769     SetCutForLowEnSecPhotons(G4double)
770   </p></li><li><p>
771     SetCutForLowEnSecElectrons(G4double)
772   </p></li></ul></div><p>
773</p><p>
774<span class="bold"><strong>Options</strong></span> are available for low energy electromagnetic
775processes for electrons/positrons in the G4LowEnergyBremsstrahlung
776class, that allow the use of alternative bremsstrahlung angular
777generators:
778
779</p><div class="itemizedlist"><ul type="disc" compact><li><p>
780     SetAngularGenerator(G4VBremAngularDistribution* distribution);
781   </p></li><li><p>
782     SetAngularGenerator(const G4String&amp; name);
783   </p></li></ul></div><p>
784</p><p>
785Currently three angular generators are available: G4ModifiedTsai,
7862BNGenerator and 2BSGenerator. G4ModifiedTsai is set by default,
787but it can be forced using the string "tsai". 2BNGenerator and
7882BSGenerator can be set using the strings "2bs" and "2bn".
789Information regarding conditions of use, performance and energy
790limits of different models are available in the
791<a href="http://geant4.web.cern.ch/geant4/UserDocumentation/UsersGuides/PhysicsReferenceManual/html/PhysicsReferenceManual.html" target="_top">
792Physics Reference Manual
793</a> 
794and in the Geant4 Low Energy Electromagnetic Physics Working Group
795<a href="http://www.ge.infn.it/geant4/lowE/index.html" target="_top">
796homepage</a>.
797</p><p>
798Other <span class="bold"><strong>options</strong></span> G4LowEnergyBremsstrahlung class are:
799
800</p><div class="itemizedlist"><ul type="disc" compact><li><p>
801     SetCutForLowEnSecPhotons(G4double)
802   </p></li></ul></div><p>
803</p><p>
804<span class="bold"><strong>Options</strong></span> can also be set in the G4LowEnergyPhotoElectric
805class, that allow the use of alternative photoelectron angular
806generators:
807
808</p><div class="itemizedlist"><ul type="disc" compact><li><p>
809     SetAngularGenerator(G4VPhotoElectricAngularDistribution* distribution);
810   </p></li><li><p>
811     SetAngularGenerator(const G4String&amp; name);
812   </p></li><li><p>
813     
814   </p></li><li><p>
815     
816   </p></li><li><p>
817     
818   </p></li></ul></div><p>
819</p><p>
820Currently three angular generators are available:
821G4PhotoElectricAngularGeneratorSimple,
822G4PhotoElectricAngularGeneratorSauterGavrilla and
823G4PhotoElectricAngularGeneratorPolarized.
824G4PhotoElectricAngularGeneratorSimple is set by default, but it can
825be forced using the string "default".
826G4PhotoElectricAngularGeneratorSauterGavrilla and
827G4PhotoElectricAngularGeneratorPolarized can be set using the
828strings "standard" and "polarized". Information regarding
829conditions of use, performance and energy limits of different
830models are available in the
831<a href="http://geant4.web.cern.ch/geant4/UserDocumentation/UsersGuides/PhysicsReferenceManual/html/PhysicsReferenceManual.html" target="_top">
832Physics Reference Manual
833</a> 
834and in the Geant4 Low Energy Electromagnetic Physics Working Group
835<a href="http://www.ge.infn.it/geant4/lowE/index.html" target="_top">
836homepage</a>.
837</p></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="sect.PhysProc.EleMag.VeryLowE"></a>5.2.1.3. 
838Very Low energy Electromagnetic Processes (Geant4 DNA extension)
839</h4></div></div></div><p>
840Geant4 low energy electromagnetic Physics processes have been extended down
841to energies of a few electronVolts suitable for the simulation of radiation
842effects in liquid water for applications at the cellular and sub-cellular
843level. These developments take place in the framework of the Geant4 DNA
844project
845[
846<a href="http://www.ge.infn.it/geant4/dna" target="_top">
847http://www.ge.infn.it/geant4/dna
848</a>
849] and are fully described in the paper
850[<span class="citation">
851<a href="bi01.html#biblio.chauvie2007">
852    Chauvie2007
853  </a>
854</span>].
855</p><p>
856Their implementation in Geant4 is based on the usage of innovative techniques
857first introduced in Monte Carlo simulation (policy-based class design), to
858ensure openness to future extension and evolution as well as flexibility of
859configuration in user applications. In this new design, a generic Geant4-DNA
860physics process is configured by template specialization in order to acquire
861physical properties (cross section, final state), using policy classes :
862a Cross Section policy class and a Final State policy class.
863</p><p>
864These processes apply to electrons, protons, hydrogen, alpha particles and
865their charge states.
866</p><h5><a name="id456546"></a>
867 Electron processes
868</h5><p>
869</p><div class="itemizedlist"><ul type="disc" compact><li><p>
870    Elastic scattering (two complementary models available depending on energy range)
871    </p><div class="itemizedlist"><ul type="circle" compact><li><p>
872        Cross section policy class name, common to both models :
873        G4CrossSectionElasticScreenedRutherford       
874      </p></li><li><p>
875        Final state policy class names : G4FinalStateElasticScreenedRutherford
876        or  G4FinalStateElasticBrennerZaider     
877      </p></li></ul></div><p>
878  </p></li><li><p>
879    Excitation (one model)
880    </p><div class="itemizedlist"><ul type="circle" compact><li><p>
881        Cross section policy class name : G4CrossSectionExcitationEmfietzoglou 
882      </p></li><li><p>
883        Final state policy class name : G4FinalStateExcitationEmfietzoglou
884      </p></li></ul></div><p>
885  </p></li><li><p>
886    Ionisation (one model)   
887    </p><div class="itemizedlist"><ul type="circle" compact><li><p>
888        Cross section policy class name : G4CrossSectionIonisationBorn 
889      </p></li><li><p>
890        Final state policy class names : G4FinalStateIonisationBorn
891      </p></li></ul></div><p>
892  </p></li></ul></div><p>
893</p><h5><a name="id458868"></a>
894 Proton processes
895</h5><p>
896</p><div class="itemizedlist"><ul type="disc" compact><li><p>
897    Excitation  (two complementary models available depending on energy range)
898    </p><div class="itemizedlist"><ul type="circle" compact><li><p>
899        Cross section policy class name : G4CrossSectionExcitationMillerGreen
900      </p></li><li><p>
901        Final state policy class name : G4FinalStateExcitationMillerGreen
902      </p></li><li><p>
903        Cross section policy class name : G4CrossSectionExcitationBorn
904      </p></li><li><p>
905        Final state policy class name : G4FinalStateExcitationBorn
906      </p></li></ul></div><p>
907  </p></li><li><p>
908    Ionisation (two complementary models available depending on energy range)
909    </p><div class="itemizedlist"><ul type="circle" compact><li><p>
910        Cross section policy class name : G4CrossSectionIonisationRudd
911      </p></li><li><p>
912        Final state policy class name : G4FinalStateIonisationRudd
913      </p></li><li><p>
914        Cross section policy class name : G4CrossSectionIonisationBorn
915      </p></li><li><p>
916        Final state policy class name : G4FinalStateIonisationBorn
917      </p></li></ul></div><p>
918  </p></li><li><p>
919    Charge decrease (one model)
920    </p><div class="itemizedlist"><ul type="circle" compact><li><p>
921        Cross section policy class name : G4CrossSectionChargeDecrease
922      </p></li><li><p>
923        Final state policy class name : G4FinalStateChargeDecrease
924      </p></li></ul></div><p>
925  </p></li></ul></div><p>
926</p><h5><a name="id458967"></a>
927 Hydrogen processes
928</h5><p>
929</p><div class="itemizedlist"><ul type="disc" compact><li><p>
930    Ionisation (one model)
931    </p><div class="itemizedlist"><ul type="circle" compact><li><p>
932        Cross section policy class name : G4CrossSectionIonisationRudd
933      </p></li><li><p>
934        Final state policy class name : G4FinalStateIonisationRudd
935      </p></li></ul></div><p>
936  </p></li><li><p>
937    Charge increase (one model)
938    </p><div class="itemizedlist"><ul type="circle" compact><li><p>
939        Cross section policy class name : G4CrossSectionChargeIncrease
940      </p></li><li><p>
941        Final state policy class name : G4FinalStateChargeIncrease
942      </p></li></ul></div><p>
943  </p></li></ul></div><p>
944</p><h5><a name="id459025"></a>
945 Helium (neutral) processes
946</h5><p>
947</p><div class="itemizedlist"><ul type="disc" compact><li><p>
948    Excitation (one model)
949    </p><div class="itemizedlist"><ul type="circle" compact><li><p>
950        Cross section policy class name : G4CrossSectionExcitationMillerGreen
951      </p></li><li><p>
952        Final state policy class name : G4FinalStateExcitationMillerGreen
953      </p></li></ul></div><p>
954  </p></li><li><p>
955    Ionisation (one model)
956    </p><div class="itemizedlist"><ul type="circle" compact><li><p>
957        Cross section policy class name : G4CrossSectionIonisationRudd
958      </p></li><li><p>
959        Final state policy class name : G4FinalStateIonisationRudd
960      </p></li></ul></div><p>
961  </p></li><li><p>
962    Charge increase (one model)
963    </p><div class="itemizedlist"><ul type="circle" compact><li><p>
964        Cross section policy class name : G4CrossSectionChargeIncrease
965      </p></li><li><p>
966        Final state policy class name : G4FinalStateChargeIncrease
967      </p></li></ul></div><p>
968  </p></li></ul></div><p>
969</p><h5><a name="id459103"></a>
970 Helium+ (ionized once) processes
971</h5><p>
972</p><div class="itemizedlist"><ul type="disc" compact><li><p>
973    Excitation (one model)
974    </p><div class="itemizedlist"><ul type="circle" compact><li><p>
975        Cross section policy class name : G4CrossSectionExcitationMillerGreen
976      </p></li><li><p>
977        Final state policy class name : G4FinalStateExcitationMillerGreen
978      </p></li></ul></div><p>
979  </p></li><li><p>
980    Ionisation (one model)
981    </p><div class="itemizedlist"><ul type="circle" compact><li><p>
982        Cross section policy class name : G4CrossSectionIonisationRudd
983      </p></li><li><p>
984        Final state policy class name : G4FinalStateIonisationRudd
985      </p></li></ul></div><p>
986  </p></li><li><p>
987    Charge increase (one model)
988    </p><div class="itemizedlist"><ul type="circle" compact><li><p>
989        Cross section policy class name : G4CrossSectionChargeIncrease
990      </p></li><li><p>
991        Final state policy class name : G4FinalStateChargeIncrease
992      </p></li></ul></div><p>
993  </p></li><li><p>
994    Charge decrease (one model) 
995    </p><div class="itemizedlist"><ul type="circle" compact><li><p>
996        Cross section policy class name : G4CrossSectionChargeDecrease
997      </p></li><li><p>
998        Final state policy class name : G4FinalStateChargeDecrease
999      </p></li></ul></div><p>
1000  </p></li></ul></div><p>
1001</p><h5><a name="id459202"></a>
1002 Helium++ (ionised twice) processes
1003</h5><p>
1004</p><div class="itemizedlist"><ul type="disc" compact><li><p>
1005    Excitation (one model)
1006    </p><div class="itemizedlist"><ul type="circle" compact><li><p>
1007        Cross section policy class name : G4CrossSectionExcitationMillerGreen
1008      </p></li><li><p>
1009        Final state policy class name : G4FinalStateExcitationMillerGreen
1010      </p></li></ul></div><p>
1011  </p></li><li><p>
1012    Ionisation (one model)
1013    </p><div class="itemizedlist"><ul type="circle" compact><li><p>
1014        Cross section policy class name : G4CrossSectionIonisationRudd
1015      </p></li><li><p>
1016        Final state policy class name : G4FinalStateIonisationRudd
1017      </p></li></ul></div><p>
1018  </p></li><li><p>
1019    Charge decrease (one model)
1020    </p><div class="itemizedlist"><ul type="circle" compact><li><p>
1021        Cross section policy class name : G4CrossSectionChargeDecrease
1022      </p></li><li><p>
1023        Final state policy class name : G4FinalStateChargeDecrease
1024      </p></li></ul></div><p>
1025  </p></li></ul></div><p>
1026</p><p>
1027An example of the registration of these processes in a physics list is given here below :
1028
1029</p><div class="informalexample"><pre class="programlisting">
1030//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
1031
1032// Geant4 DNA header files
1033
1034#include "G4DNAGenericIonsManager.hh"
1035#include "G4FinalStateProduct.hh"
1036#include "G4DNAProcess.hh"
1037
1038#include "G4CrossSectionExcitationEmfietzoglou.hh"
1039#include "G4FinalStateExcitationEmfietzoglou.hh"
1040
1041#include "G4CrossSectionElasticScreenedRutherford.hh"
1042#include "G4FinalStateElasticScreenedRutherford.hh"
1043#include "G4FinalStateElasticBrennerZaider.hh"
1044
1045#include "G4CrossSectionExcitationBorn.hh"
1046#include "G4FinalStateExcitationBorn.hh"
1047
1048#include "G4CrossSectionIonisationBorn.hh"
1049#include "G4FinalStateIonisationBorn.hh"
1050
1051#include "G4CrossSectionIonisationRudd.hh"
1052#include "G4FinalStateIonisationRudd.hh"
1053
1054#include "G4CrossSectionExcitationMillerGreen.hh"
1055#include "G4FinalStateExcitationMillerGreen.hh"
1056
1057#include "G4CrossSectionChargeDecrease.hh"
1058#include "G4FinalStateChargeDecrease.hh"
1059
1060#include "G4CrossSectionChargeIncrease.hh"
1061#include "G4FinalStateChargeIncrease.hh"
1062
1063// Processes definition
1064
1065typedef G4DNAProcess&lt;G4CrossSectionElasticScreenedRutherford,G4FinalStateElasticScreenedRutherford&gt; 
1066  ElasticScreenedRutherford;
1067typedef G4DNAProcess&lt;G4CrossSectionElasticScreenedRutherford,G4FinalStateElasticBrennerZaider&gt; 
1068  ElasticBrennerZaider;
1069typedef G4DNAProcess&lt;G4CrossSectionExcitationEmfietzoglou,G4FinalStateExcitationEmfietzoglou&gt; 
1070  ExcitationEmfietzoglou;
1071typedef G4DNAProcess&lt;G4CrossSectionExcitationBorn,G4FinalStateExcitationBorn&gt; 
1072  ExcitationBorn;
1073typedef G4DNAProcess&lt;G4CrossSectionIonisationBorn,G4FinalStateIonisationBorn&gt; 
1074  IonisationBorn;
1075typedef G4DNAProcess&lt;G4CrossSectionIonisationRudd,G4FinalStateIonisationRudd&gt; 
1076  IonisationRudd;
1077typedef G4DNAProcess&lt;G4CrossSectionExcitationMillerGreen,G4FinalStateExcitationMillerGreen&gt; 
1078  ExcitationMillerGreen;
1079typedef G4DNAProcess&lt;G4CrossSectionChargeDecrease,G4FinalStateChargeDecrease&gt; 
1080  ChargeDecrease;
1081typedef G4DNAProcess&lt;G4CrossSectionChargeIncrease,G4FinalStateChargeIncrease&gt; 
1082  ChargeIncrease;
1083
1084// Processes registration
1085
1086void MicrodosimetryPhysicsList::ConstructEM()
1087{
1088  theParticleIterator-&gt;reset();
1089
1090  while( (*theParticleIterator)() ){
1091
1092    G4ParticleDefinition* particle = theParticleIterator-&gt;value();
1093    G4ProcessManager* processManager = particle-&gt;GetProcessManager();
1094    G4String particleName = particle-&gt;GetParticleName();
1095
1096    if (particleName == "e-") {
1097       processManager-&gt;AddDiscreteProcess(new ExcitationEmfietzoglou);
1098       processManager-&gt;AddDiscreteProcess(new ElasticScreenedRutherford);
1099       processManager-&gt;AddDiscreteProcess(new ElasticBrennerZaider);
1100       processManager-&gt;AddDiscreteProcess(new IonisationBorn);
1101
1102    } else if ( particleName == "proton" ) {
1103       processManager-&gt;AddDiscreteProcess(new ExcitationMillerGreen);
1104       processManager-&gt;AddDiscreteProcess(new ExcitationBorn);
1105       processManager-&gt;AddDiscreteProcess(new IonisationRudd);
1106       processManager-&gt;AddDiscreteProcess(new IonisationBorn);
1107       processManager-&gt;AddDiscreteProcess(new ChargeDecrease);
1108
1109    } else if ( particleName == "hydrogen" ) {
1110       processManager-&gt;AddDiscreteProcess(new IonisationRudd);
1111       processManager-&gt;AddDiscreteProcess(new ChargeIncrease);
1112
1113    } else if ( particleName == "alpha" ) {
1114       processManager-&gt;AddDiscreteProcess(new ExcitationMillerGreen);
1115       processManager-&gt;AddDiscreteProcess(new IonisationRudd);
1116       processManager-&gt;AddDiscreteProcess(new ChargeDecrease);
1117   
1118    } else if ( particleName == "alpha+" ) {
1119       processManager-&gt;AddDiscreteProcess(new ExcitationMillerGreen);
1120       processManager-&gt;AddDiscreteProcess(new IonisationRudd);
1121       processManager-&gt;AddDiscreteProcess(new ChargeDecrease);
1122       processManager-&gt;AddDiscreteProcess(new ChargeIncrease);
1123   
1124    } else if ( particleName == "helium" ) {
1125       processManager-&gt;AddDiscreteProcess(new ExcitationMillerGreen);
1126       processManager-&gt;AddDiscreteProcess(new IonisationRudd);
1127       processManager-&gt;AddDiscreteProcess(new ChargeIncrease);
1128    }
1129
1130  }
1131}
1132
1133//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
1134</pre></div><p>
1135</p><p>
1136Note that in the above example, "alpha"  particles are helium atoms ionised
1137twice and "helium" particles are neutral helium atoms. The definition of
1138particles in the physics list may be for example implemented as follows :
1139
1140</p><div class="informalexample"><pre class="programlisting">
1141//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
1142
1143#include "G4DNAGenericIonsManager.hh"
1144
1145void MicrodosimetryPhysicsList::ConstructBaryons()
1146{
1147  //  construct baryons ---
1148
1149  // Geant4 DNA particles
1150
1151  G4DNAGenericIonsManager * genericIonsManager;
1152  genericIonsManager=G4DNAGenericIonsManager::Instance();
1153  genericIonsManager-&gt;GetIon("alpha++");
1154  genericIonsManager-&gt;GetIon("alpha+");
1155  genericIonsManager-&gt;GetIon("helium");
1156  genericIonsManager-&gt;GetIon("hydrogen");
1157
1158}
1159
1160//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
1161</pre></div><p>
1162</p><p>
1163To run the Geant4 DNA extension, data files need to be copied by the user to
1164his/her code repository. These files are distributed together with the Geant4 release.
1165</p><p>
1166The user should set the environment variable G4LEDATA to the directory where
1167he/she has copied the files.
1168</p></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="sect.PhysProc.Had"></a>5.2.2. 
1169Hadronic Interactions
1170</h3></div></div></div><p>
1171This section briefly introduces the hadronic physics processes
1172installed in Geant4. For details of the implementation of hadronic
1173interactions available in Geant4, please refer to the
1174<a href="http://geant4.web.cern.ch/geant4/UserDocumentation/UsersGuides/PhysicsReferenceManual/html/PhysicsReferenceManual.html" target="_top">
1175<span class="bold"><strong>Physics Reference Manual</strong></span></a>.
1176</p><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="sect.PhysProc.Had.TreatCross"></a>5.2.2.1. 
1177Treatment of Cross Sections
1178</h4></div></div></div><h5><a name="id459402"></a>
1179Cross section data sets
1180</h5><p>
1181Each hadronic process object (derived from
1182<span class="emphasis"><em>G4HadronicProcess</em></span>) may have one or more cross section data
1183sets associated with it. The term "data set" is meant, in a broad
1184sense, to be an object that encapsulates methods and data for
1185calculating total cross sections for a given process. The methods
1186and data may take many forms, from a simple equation using a few
1187hard-wired numbers to a sophisticated parameterisation using large
1188data tables. Cross section data sets are derived from the abstract
1189class <span class="emphasis"><em>G4VCrossSectionDataSet</em></span>, and are required to implement
1190the following methods:
1191
1192</p><div class="informalexample"><pre class="programlisting">
1193    G4bool IsApplicable( const G4DynamicParticle*, const G4Element* )
1194</pre></div><p>
1195</p><p>
1196This method must return <code class="literal">True</code> if the data set is able to
1197calculate a total cross section for the given particle and
1198material, and <code class="literal">False</code> otherwise.
1199
1200</p><div class="informalexample"><pre class="programlisting">
1201    G4double GetCrossSection( const G4DynamicParticle*, const G4Element* )
1202</pre></div><p>
1203</p><p>
1204This method, which will be invoked only if <code class="literal">True</code> was
1205returned by <code class="literal">IsApplicable</code>, must return a cross section, in
1206Geant4 default units, for the given particle and material.
1207
1208</p><div class="informalexample"><pre class="programlisting">
1209    void BuildPhysicsTable( const G4ParticleDefinition&amp; )
1210</pre></div><p>
1211</p><p>
1212This method may be invoked to request the data set to recalculate
1213its internal database or otherwise reset its state after a change
1214in the cuts or other parameters of the given particle type.
1215
1216
1217</p><div class="informalexample"><pre class="programlisting">
1218    void DumpPhysicsTable( const G4ParticleDefinition&amp; ) = 0
1219</pre></div><p>
1220</p><p>
1221This method may be invoked to request the data set to print its
1222internal database and/or other state information, for the given
1223particle type, to the standard output stream.
1224</p><h5><a name="id459505"></a>
1225Cross section data store
1226</h5><p>
1227Cross section data sets are used by the process for the
1228calculation of the physical interaction length. A given cross
1229section data set may only apply to a certain energy range, or may
1230only be able to calculate cross sections for a particular type of
1231particle. The class <span class="emphasis"><em>G4CrossSectionDataStore</em></span> has been
1232provided to allow the user to specify, if desired, a series of data
1233sets for a process, and to arrange the priority of data sets so
1234that the appropriate one is used for a given energy range,
1235particle, and material. It implements the following public
1236methods:
1237
1238</p><div class="informalexample"><pre class="programlisting">
1239    G4CrossSectionDataStore()
1240
1241   ~G4CrossSectionDataStore()
1242</pre></div><p>
1243
1244and
1245
1246</p><div class="informalexample"><pre class="programlisting">
1247    G4double GetCrossSection( const G4DynamicParticle*, const G4Element* )
1248</pre></div><p>
1249</p><p>
1250For a given particle and material, this method returns a cross
1251section value provided by one of the collection of cross section
1252data sets listed in the data store object. If there are no known
1253data sets, a <code class="literal">G4Exception</code> is thrown and <code class="literal">DBL_MIN</code> is
1254returned. Otherwise, each data set in the list is queried, in
1255reverse list order, by invoking its <code class="literal">IsApplicable</code> method
1256for the given particle and material. The first data set object that
1257responds positively will then be asked to return a cross section
1258value via its <code class="literal">GetCrossSection</code> method. If no data set
1259responds positively, a <code class="literal">G4Exception</code> is thrown and
1260<code class="literal">DBL_MIN</code> is returned.
1261</p><p>
1262</p><div class="informalexample"><pre class="programlisting">
1263    void AddDataSet( G4VCrossSectionDataSet* aDataSet )
1264</pre></div><p>
1265
1266This method adds the given cross section data set to the end of the
1267list of data sets in the data store. For the evaluation of cross
1268sections, the list has a LIFO (Last In First Out) priority, meaning
1269that data sets added later to the list will have priority over
1270those added earlier to the list. Another way of saying this, is
1271that the data store, when given a <code class="literal">GetCrossSection</code> request,
1272does the <code class="literal">IsApplicable</code> queries in the reverse list order,
1273starting with the last data set in the list and proceeding to the
1274first, and the first data set that responds positively is used to
1275calculate the cross section.
1276</p><p>
1277</p><div class="informalexample"><pre class="programlisting">
1278    void BuildPhysicsTable( const G4ParticleDefinition&amp; aParticleType )
1279</pre></div><p>
1280
1281This method may be invoked to indicate to the data store that there
1282has been a change in the cuts or other parameters of the given
1283particle type. In response, the data store will invoke the
1284<code class="literal">BuildPhysicsTable</code> of each of its data sets.
1285</p><p>
1286</p><div class="informalexample"><pre class="programlisting">
1287    void DumpPhysicsTable( const G4ParticleDefinition&amp; )
1288</pre></div><p>
1289
1290This method may be used to request the data store to invoke the
1291<code class="literal">DumpPhysicsTable</code> method of each of its data sets.
1292</p><h5><a name="id459658"></a>
1293Default cross sections
1294</h5><p>
1295The defaults for total cross section data and calculations have
1296been encapsulated in the singleton class
1297<span class="emphasis"><em>G4HadronCrossSections</em></span>. Each hadronic process:
1298<span class="emphasis"><em>G4HadronInelasticProcess</em></span>,
1299<span class="emphasis"><em>G4HadronElasticProcess</em></span>,
1300<span class="emphasis"><em>G4HadronFissionProcess</em></span>,
1301and <span class="emphasis"><em>G4HadronCaptureProcess</em></span>,
1302comes already equipped with a cross section data store and a
1303default cross section data set. The data set objects are really
1304just shells that invoke the singleton <span class="emphasis"><em>G4HadronCrossSections</em></span>
1305to do the real work of calculating cross sections.
1306</p><p>
1307The default cross sections can be overridden in whole or in part
1308by the user. To this end, the base class <span class="emphasis"><em>G4HadronicProcess</em></span>
1309has a ``get'' method:
1310
1311</p><div class="informalexample"><pre class="programlisting">
1312    G4CrossSectionDataStore* GetCrossSectionDataStore()
1313</pre></div><p>
1314
1315which gives public access to the data store for each process. The
1316user's cross section data sets can be added to the data store
1317according to the following framework:
1318
1319</p><div class="informalexample"><pre class="programlisting">
1320    G4Hadron...Process aProcess(...)
1321
1322    MyCrossSectionDataSet myDataSet(...)
1323
1324    aProcess.GetCrossSectionDataStore()-&gt;AddDataSet( &amp;MyDataSet )
1325</pre></div><p>
1326</p><p>
1327The added data set will override the default cross section data
1328whenever so indicated by its <code class="literal">IsApplicable</code> method.
1329</p><p>
1330In addition to the ``get'' method, <span class="emphasis"><em>G4HadronicProcess</em></span> also
1331has the method
1332
1333</p><div class="informalexample"><pre class="programlisting">
1334    void SetCrossSectionDataStore( G4CrossSectionDataStore* )
1335</pre></div><p>
1336
1337which allows the user to completely replace the default data
1338store with a new data store.
1339</p><p>
1340It should be noted that a process does not send any information
1341about itself to its associated data store (and hence data set)
1342objects. Thus, each data set is assumed to be formulated to
1343calculate cross sections for one and only one type of process. Of
1344course, this does not prevent different data sets from sharing
1345common data and/or calculation methods, as in the case of the
1346<span class="emphasis"><em>G4HadronCrossSections</em></span> class mentioned above. Indeed,
1347<span class="emphasis"><em>G4VCrossSectionDataSet</em></span> specifies only the abstract interface
1348between physics processes and their data sets, and leaves the user
1349free to implement whatever sort of underlying structure is
1350appropriate.
1351</p><p>
1352The current implementation of the data set
1353<span class="emphasis"><em>G4HadronCrossSections</em></span> reuses the total cross-sections for
1354inelastic and elastic scattering, radiative capture and fission as
1355used with <span class="bold"><strong>GHEISHA</strong></span> to provide cross-sections
1356for calculation
1357of the respective mean free paths of a given particle in a given
1358material.
1359</p><h5><a name="id459782"></a>
1360Cross-sections for low energy neutron transport
1361</h5><p>
1362The cross section data for low energy neutron transport are
1363organized in a set of files that are read in by the corresponding
1364data set classes at time zero. Hereby the file system is used, in
1365order to allow highly granular access to the data. The ``root''
1366directory of the cross-section directory structure is accessed
1367through an environment variable, <code class="literal">NeutronHPCrossSections</code>,
1368which is to be set by the user. The classes accessing the total
1369cross-sections of the individual processes, i.e., the cross-section
1370data set classes for low energy neutron transport, are
1371<span class="emphasis"><em>G4NeutronHPElasticData</em></span>,
1372<span class="emphasis"><em>G4NeutronHPCaptureData</em></span>,
1373<span class="emphasis"><em>G4NeutronHPFissionData</em></span>,
1374and <span class="emphasis"><em>G4NeutronHPInelasticData</em></span>.
1375</p><p>
1376For detailed descriptions of the low energy neutron total
1377cross-sections, they may be registered by the user as described
1378above with the data stores of the corresponding processes for
1379neutron interactions.
1380</p><p>
1381It should be noted that using these total cross section classes
1382does not require that the neutron_hp models also be used. It is up
1383to the user to decide whethee this is desirable or not for his
1384particular problem.
1385</p></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="sect.PhysProc.Had.AtRest"></a>5.2.2.2. 
1386Hadrons at Rest
1387</h4></div></div></div><h5><a name="id459844"></a>
1388List of implemented "Hadron at Rest" processes
1389</h5><p>
1390The following process classes have been implemented:
1391
1392</p><div class="itemizedlist"><ul type="disc" compact><li><p>
1393    pi- absorption (class name <span class="emphasis"><em>G4PionMinusAbsorptionAtRest</em></span>
1394    or <span class="emphasis"><em>G4PiMinusAbsorptionAtRest</em></span>)
1395  </p></li><li><p>
1396    kaon- absorption (class name <span class="emphasis"><em>G4KaonMinusAbsorptionAtRest</em></span>
1397    or <span class="emphasis"><em>G4KaonMinusAbsorption</em></span>)
1398  </p></li><li><p>
1399    neutron capture (class name <span class="emphasis"><em>G4NeutronCaptureAtRest</em></span>)
1400  </p></li><li><p>
1401    anti-proton annihilation (class name
1402    <span class="emphasis"><em>G4AntiProtonAnnihilationAtRest</em></span>)
1403  </p></li><li><p>
1404    anti-neutron annihilation (class name
1405    <span class="emphasis"><em>G4AntiNeutronAnnihilationAtRest</em></span>)
1406  </p></li><li><p>
1407    mu- capture (class name <span class="emphasis"><em>G4MuonMinusCaptureAtRest</em></span>)
1408  </p></li><li><p>
1409    alternative CHIPS model for any negativly charged particle
1410    (class name <span class="emphasis"><em>G4QCaptureAtRest</em></span>)
1411  </p></li></ul></div><p>
1412</p><p>
1413Obviously the last process does not, strictly speaking, deal with a
1414``hadron at rest''. It does, nonetheless, share common features
1415with the others in the above list because of the implementation
1416model chosen. The differences between the alternative
1417implementation for kaon and pion absorption concern the fast part
1418of the emitted particle spectrum. G4PiMinusAbsorptionAtRest, and
1419G4KaonMinusAbsorptionAtRest focus especially on a good description
1420of this part of the spectrum.
1421</p><h5><a name="id459937"></a>
1422Implementation Interface to Geant4
1423</h5><p>
1424All of these classes are derived from the abstract class
1425<span class="emphasis"><em>G4VRestProcess</em></span>. In addition to the constructor and
1426destructor methods, the following public methods of the abstract
1427class have been implemented for each of the above six
1428processes:
1429
1430</p><div class="itemizedlist"><ul type="disc" compact><li><p>
1431    </p><p>
1432    <code class="literal">AtRestGetPhysicalInteractionLength( const G4Track&amp;,
1433    G4ForceCondition* )</code>
1434    </p><p>
1435    </p><p>
1436    This method returns the time taken before the interaction actually
1437    occurs. In all processes listed above, except for muon capture, a
1438    value of zero is returned. For the muon capture process the muon
1439    capture lifetime is returned.
1440    </p><p>
1441  </p></li><li><p>
1442    </p><p>
1443    <code class="literal">AtRestDoIt( const G4Track&amp;, const G4Step&amp;)</code>
1444    </p><p>
1445    </p><p>
1446    This method generates the secondary particles produced by the
1447    process.
1448    </p><p>
1449  </p></li><li><p>
1450    </p><p>
1451    <code class="literal">IsApplicable( const G4ParticleDefinition&amp; )</code>
1452    </p><p>
1453    </p><p>
1454    This method returns the result of a check to see if the process is
1455    possible for a given particle.
1456    </p><p>
1457  </p></li></ul></div><p>
1458</p><h5><a name="id460014"></a>
1459Example of how to use a hadron at rest process
1460</h5><p>
1461Including a ``hadron at rest'' process for a particle, a pi- for
1462example, into the Geant4 system is straightforward and can be done
1463in the following way:
1464
1465</p><div class="itemizedlist"><ul type="disc" compact><li><p>
1466    create a process:
1467    </p><div class="informalexample"><pre class="programlisting">
1468       theProcess = new G4PionMinusAbsorptionAtRest();
1469    </pre></div><p>
1470  </p></li><li><p>
1471    register the process with the particle's process manager:
1472    </p><div class="informalexample"><pre class="programlisting">
1473       theParticleDef = G4PionMinus::PionMinus();
1474       G4ProcessManager* pman = theParticleDef-&gt;GetProcessManager();
1475       pman-&gt;AddRestProcess( theProcess );
1476    </pre></div><p>
1477  </p></li></ul></div><p>
1478</p></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="sect.PhysProc.Had.Flight"></a>5.2.2.3. 
1479Hadrons in Flight
1480</h4></div></div></div><h5><a name="id460076"></a>
1481What processes do you need?
1482</h5><p>
1483For hadrons in motion, there are four physics process classes.
1484<a href="ch05s02.html#table.PhysProc_1" title="Table 5.1. 
1485Hadronic processes and relevant particles.
1486">Table 5.1</a> shows each process and the
1487particles for which it is relevant.
1488
1489</p><div class="table"><a name="table.PhysProc_1"></a><div class="table-contents"><table summary="
1490Hadronic processes and relevant particles.
1491" border="1"><colgroup><col><col></colgroup><tbody><tr><td>
1492      <span class="emphasis"><em>G4HadronElasticProcess</em></span>
1493    </td><td>
1494      pi+, pi-, K<sup>+</sup>,
1495      K<sup>0</sup><sub>S</sub>,
1496      K<sup>0</sup><sub>L</sub>,
1497      K<sup>-</sup>,
1498      p, p-bar, n, n-bar, lambda, lambda-bar,
1499      Sigma<sup>+</sup>, Sigma<sup>-</sup>,
1500      Sigma<sup>+</sup>-bar,
1501      Sigma<sup>-</sup>-bar,
1502      Xi<sup>0</sup>, Xi<sup>-</sup>,
1503      Xi<sup>0</sup>-bar, Xi<sup>-</sup>-bar
1504    </td></tr><tr><td>
1505      <span class="emphasis"><em>G4HadronInelasticProcess</em></span>
1506    </td><td>
1507      pi+, pi-, K<sup>+</sup>,
1508      K<sup>0</sup><sub>S</sub>,
1509      K<sup>0</sup><sub>L</sub>,
1510      K<sup>-</sup>,
1511      p, p-bar, n, n-bar, lambda, lambda-bar,
1512      Sigma<sup>+</sup>, Sigma<sup>-</sup>,
1513      Sigma<sup>+</sup>-bar,
1514      Sigma<sup>-</sup>-bar, Xi<sup>0</sup>,
1515      Xi<sup>-</sup>, Xi<sup>0</sup>-bar,
1516      Xi<sup>-</sup>-bar
1517    </td></tr><tr><td>
1518      <span class="emphasis"><em>G4HadronFissionProcess</em></span>
1519    </td><td>
1520      all
1521    </td></tr><tr><td>
1522      <span class="emphasis"><em>G4CaptureProcess</em></span>
1523    </td><td>
1524      n, n-bar
1525    </td></tr></tbody></table></div><p class="title"><b>Table 5.1. 
1526Hadronic processes and relevant particles.
1527</b></p></div><p><br class="table-break">
1528</p><h5><a name="id460260"></a>
1529How to register Models
1530</h5><p>
1531To register an inelastic process model for a particle, a proton
1532for example, first get the pointer to the particle's process
1533manager:
1534
1535</p><div class="informalexample"><pre class="programlisting">
1536   G4ParticleDefinition *theProton = G4Proton::ProtonDefinition();
1537   G4ProcessManager *theProtonProcMan = theProton-&gt;GetProcessManager();
1538</pre></div><p>
1539</p><p>
1540Create an instance of the particle's inelastic process:
1541
1542</p><div class="informalexample"><pre class="programlisting">
1543   G4ProtonInelasticProcess *theProtonIEProc = new G4ProtonInelasticProcess();
1544</pre></div><p>
1545</p><p>
1546Create an instance of the model which determines the secondaries
1547produced in the interaction, and calculates the momenta of the
1548particles:
1549
1550</p><div class="informalexample"><pre class="programlisting">
1551   G4LEProtonInelastic *theProtonIE = new G4LEProtonInelastic();
1552</pre></div><p>
1553</p><p>
1554Register the model with the particle's inelastic process:
1555
1556</p><div class="informalexample"><pre class="programlisting">
1557   theProtonIEProc-&gt;RegisterMe( theProtonIE );
1558</pre></div><p>
1559</p><p>
1560Finally, add the particle's inelastic process to the list of
1561discrete processes:
1562
1563</p><div class="informalexample"><pre class="programlisting">
1564   theProtonProcMan-&gt;AddDiscreteProcess( theProtonIEProc );
1565</pre></div><p>
1566</p><p>
1567The particle's inelastic process class,
1568<span class="emphasis"><em>G4ProtonInelasticProcess</em></span> in the example above, derives from
1569the <span class="emphasis"><em>G4HadronicInelasticProcess</em></span> class, and simply defines the
1570process name and calls the <span class="emphasis"><em>G4HadronicInelasticProcess</em></span>
1571constructor. All of the specific particle inelastic processes
1572derive from the <span class="emphasis"><em>G4HadronicInelasticProcess</em></span> class, which
1573calls the <code class="literal">PostStepDoIt</code> function, which returns the
1574particle change object from the <span class="emphasis"><em>G4HadronicProcess</em></span> function
1575<code class="literal">GeneralPostStepDoIt</code>. This class also gets the mean free
1576path, builds the physics table, and gets the microscopic cross
1577section. The <span class="emphasis"><em>G4HadronicInelasticProcess</em></span> class derives from
1578the <span class="emphasis"><em>G4HadronicProcess</em></span> class, which is the top level hadronic
1579process class. The <span class="emphasis"><em>G4HadronicProcess</em></span> class derives from the
1580<span class="emphasis"><em>G4VDiscreteProcess</em></span> class. The inelastic, elastic, capture,
1581and fission processes derive from the <span class="emphasis"><em>G4HadronicProcess</em></span>
1582class. This pure virtual class also provides the energy range
1583manager object and the <code class="literal">RegisterMe</code> access function.
1584</p><p>
1585A sample case for the proton's inelastic interaction model class
1586is shown in <a href="ch05s02.html#programlist_PhysProc_3" title="Example 5.3. 
1587An example of a proton inelastic interaction model class.
1588">Example 5.3</a>, where
1589<code class="literal">G4LEProtonInelastic.hh</code> is the name of the include
1590file:
1591
1592</p><div class="example"><a name="programlist_PhysProc_3"></a><p class="title"><b>Example 5.3. 
1593An example of a proton inelastic interaction model class.
1594</b></p><div class="example-contents"><pre class="programlisting">
1595 ----------------------------- include file ------------------------------------------
1596
1597#include "G4InelasticInteraction.hh"
1598 class G4LEProtonInelastic : public G4InelasticInteraction
1599 {
1600 public:
1601    G4LEProtonInelastic() : G4InelasticInteraction()
1602    {
1603      SetMinEnergy( 0.0 );
1604      SetMaxEnergy( 25.*GeV );
1605    }
1606    ~G4LEProtonInelastic() { }
1607    G4ParticleChange *ApplyYourself( const G4Track &amp;aTrack,
1608                                     G4Nucleus &amp;targetNucleus );
1609 private:
1610    void CascadeAndCalculateMomenta( required arguments );
1611 };
1612
1613 ----------------------------- source file ------------------------------------------
1614
1615 #include "G4LEProtonInelastic.hh"
1616 G4ParticleChange *
1617  G4LEProton Inelastic::ApplyYourself( const G4Track &amp;aTrack,
1618                                       G4Nucleus &amp;targetNucleus )
1619  {
1620    theParticleChange.Initialize( aTrack );
1621    const G4DynamicParticle *incidentParticle = aTrack.GetDynamicParticle();
1622    // create the target particle
1623    G4DynamicParticle *targetParticle = targetNucleus.ReturnTargetParticle();
1624    CascadeAndCalculateMomenta( required arguments )
1625    { ... }
1626    return &amp;theParticleChange;
1627  }
1628</pre></div></div><p><br class="example-break">
1629</p><p>
1630The <code class="literal">CascadeAndCalculateMomenta</code> function is the bulk of
1631the model and is to be provided by the model's creator. It should
1632determine what secondary particles are produced in the interaction,
1633calculate the momenta for all the particles, and put this
1634information into the <span class="emphasis"><em>ParticleChange</em></span> object which is
1635returned.
1636</p><p>
1637The <span class="emphasis"><em>G4LEProtonInelastic</em></span> class derives from the
1638<span class="emphasis"><em>G4InelasticInteraction</em></span> class, which is an abstract base
1639class since the pure virtual function <code class="literal">ApplyYourself</code> is not
1640defined there. <span class="emphasis"><em>G4InelasticInteraction</em></span> itself derives from
1641the <span class="emphasis"><em>G4HadronicInteraction</em></span> abstract base class. This class is
1642the base class for all the model classes. It sorts out the energy
1643range for the models and provides class utilities. The
1644<span class="emphasis"><em>G4HadronicInteraction</em></span> class provides the
1645<code class="literal">Set/GetMinEnergy</code> and the <code class="literal">Set/GetMaxEnergy</code>
1646functions which determine the minimum and maximum energy range for
1647the model. An energy range can be set for a specific element, a
1648specific material, or for general applicability:
1649
1650</p><div class="informalexample"><pre class="programlisting">
1651 void SetMinEnergy( G4double anEnergy, G4Element *anElement )
1652 void SetMinEnergy( G4double anEnergy, G4Material *aMaterial )
1653 void SetMinEnergy( const G4double anEnergy )
1654 void SetMaxEnergy( G4double anEnergy, G4Element *anElement )
1655 void SetMaxEnergy( G4double anEnergy, G4Material *aMaterial )
1656 void SetMaxEnergy( const G4double anEnergy )
1657</pre></div><p>
1658</p><h5><a name="id460525"></a>
1659Which models are there, and what are the defaults
1660</h5><p>
1661In Geant4, any model can be run together with any other model
1662without the need for the implementation of a special interface, or
1663batch suite, and the ranges of applicability for the different
1664models can be steered at initialisation time. This way, highly
1665specialised models (valid only for one material and particle, and
1666applicable only in a very restricted energy range) can be used in
1667the same application, together with more general code, in a
1668coherent fashion.
1669</p><p>
1670Each model has an intrinsic range of applicability, and the
1671model chosen for a simulation depends very much on the use-case.
1672Consequently, there are no ``defaults''. However, physics lists are
1673provided which specify sets of models for various purposes.
1674</p><p>
1675Three types of hadronic shower models have been implemented:
1676parametrisation driven models, data driven models, and theory
1677driven models.
1678
1679</p><div class="itemizedlist"><ul type="disc" compact><li><p>
1680    Parametrisation driven models are used for all processes
1681    pertaining to particles coming to rest, and interacting with the
1682    nucleus. For particles in flight, two sets of models exist for
1683    inelastic scattering; low energy, and high energy models. Both sets
1684    are based originally on the <span class="bold"><strong>GHEISHA</strong></span> 
1685    package of Geant3.21,
1686    and the original approaches to primary interaction, nuclear
1687    excitation, intra-nuclear cascade and evaporation is kept. The
1688    models are located in the sub-directories
1689    <code class="literal">hadronics/models/low_energy</code> and
1690    <code class="literal">hadronics/models/high_energy</code>. The low energy models are
1691    targeted towards energies below 20 GeV; the high energy models
1692    cover the energy range from 20 GeV to O(TeV). Fission, capture and
1693    coherent elastic scattering are also modeled through parametrised
1694    models.
1695  </p></li><li><p>
1696    Data driven models are available for the transport of low
1697    energy neutrons in matter in sub-directory
1698    <code class="literal">hadronics/models/neutron_hp</code>. The modeling is based
1699    on the data formats of <span class="bold"><strong>ENDF/B-VI</strong></span>,
1700    and all distributions of this standard data format are implemented.
1701    The data sets used are selected from data libraries that conform to
1702    these standard formats. The file system is used in order to allow granular
1703    access to, and flexibility in, the use of the cross sections for different
1704    isotopes, and channels. The energy coverage of these models is from
1705    thermal energies to 20 MeV.
1706  </p></li><li><p>
1707    Theory driven models are available for inelastic scattering in
1708    a first implementation, covering the full energy range of LHC
1709    experiments. They are located in sub-directory
1710    <code class="literal">hadronics/models/generator</code>. The current philosophy
1711    implies the usage of parton string models at high energies, of
1712    intra-nuclear transport models at intermediate energies, and of
1713    statistical break-up models for de-excitation.
1714  </p></li></ul></div><p>
1715</p></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="sect.PhysProc.Decay"></a>5.2.3. 
1716Particle Decay Process
1717</h3></div></div></div><p>
1718This section briefly introduces decay processes installed in
1719Geant4. For details of the implementation of particle decays,
1720please refer to the
1721<a href="http://geant4.web.cern.ch/geant4/UserDocumentation/UsersGuides/PhysicsReferenceManual/html/PhysicsReferenceManual.html" target="_top">
1722<span class="bold"><strong>Physics Reference Manual</strong></span></a>.
1723</p><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="sect.PhysProc.Decay.Class"></a>5.2.3.1. 
1724Particle Decay Class
1725</h4></div></div></div><p>
1726Geant4 provides a <span class="emphasis"><em>G4Decay</em></span> class for both ``at rest'' and
1727``in flight'' particle decays. <span class="emphasis"><em>G4Decay</em></span> can be applied to all
1728particles except:
1729
1730</p><div class="variablelist"><dl><dt><span class="term">
1731      massless particles, i.e.,
1732    </span></dt><dd><code class="literal">G4ParticleDefinition::thePDGMass &lt;= 0</code></dd><dt><span class="term">
1733      particles with ``negative'' life time, i.e.,
1734    </span></dt><dd><code class="literal">G4ParticleDefinition::thePDGLifeTime &lt; 0</code></dd><dt><span class="term">
1735      shortlived particles, i.e.,
1736    </span></dt><dd><code class="literal">G4ParticleDefinition::fShortLivedFlag = True</code></dd></dl></div><p>
1737</p><p>
1738Decay for some particles may be switched on or off by using
1739<code class="literal">G4ParticleDefinition::SetPDGStable()</code> as well as
1740<code class="literal">ActivateProcess()</code> and <code class="literal">InActivateProcess()</code> 
1741methods of <span class="emphasis"><em>G4ProcessManager</em></span>.
1742</p><p>
1743<span class="emphasis"><em>G4Decay</em></span> proposes the step length (or step time for
1744<code class="literal">AtRest</code>) according to the lifetime of the particle unless
1745<code class="literal">PreAssignedDecayProperTime</code> is defined in
1746<span class="emphasis"><em>G4DynamicParticle</em></span>.
1747</p><p>
1748The <span class="emphasis"><em>G4Decay</em></span> class itself does not define decay modes of
1749the particle. Geant4 provides two ways of doing this:
1750
1751</p><div class="itemizedlist"><ul type="disc" compact><li><p>
1752    using <span class="emphasis"><em>G4DecayChannel</em></span> in <span class="emphasis"><em>G4DecayTable</em></span>,
1753    and
1754  </p></li><li><p>
1755    using <code class="literal">thePreAssignedDecayProducts</code> of
1756    <span class="emphasis"><em>G4DynamicParticle</em></span>
1757  </p></li></ul></div><p>
1758</p><p>
1759The <span class="emphasis"><em>G4Decay</em></span> class calculates the
1760<code class="literal">PhysicalInteractionLength</code> and boosts decay products
1761created by <span class="emphasis"><em>G4VDecayChannel</em></span> or event generators. See below
1762for information on the determination of the decay modes.
1763</p><p>
1764An object of <span class="emphasis"><em>G4Decay</em></span> can be shared by particles.
1765Registration of the decay process to particles in the
1766<code class="literal">ConstructPhysics</code> method of <span class="emphasis"><em>PhysicsList</em></span> 
1767(see <a href="ch02s05.html#sect.HowToSpecPhysProc.SpecPhysProc" title="2.5.3. 
1768Specifying Physics Processes
1769">Section 2.5.3</a>)
1770is shown in <a href="ch05s02.html#programlist_PhysProc_4" title="Example 5.4. 
1771Registration of the decay process to particles in the
1772ConstructPhysics method of PhysicsList.
1773">Example 5.4</a>.
1774
1775</p><div class="example"><a name="programlist_PhysProc_4"></a><p class="title"><b>Example 5.4. 
1776Registration of the decay process to particles in the
1777<code class="literal">ConstructPhysics</code> method of <span class="emphasis"><em>PhysicsList</em></span>.
1778</b></p><div class="example-contents"><pre class="programlisting">
1779#include "G4Decay.hh"
1780void ExN02PhysicsList::ConstructGeneral()
1781{
1782  // Add Decay Process
1783  G4Decay* theDecayProcess = new G4Decay();
1784  theParticleIterator-&gt;reset();
1785  while( (*theParticleIterator)() ){
1786    G4ParticleDefinition* particle = theParticleIterator-&gt;value();
1787    G4ProcessManager* pmanager = particle-&gt;GetProcessManager();
1788    if (theDecayProcess-&gt;IsApplicable(*particle)) {
1789      pmanager -&gt;AddProcess(theDecayProcess);
1790      // set ordering for PostStepDoIt and AtRestDoIt
1791      pmanager -&gt;SetProcessOrdering(theDecayProcess, idxPostStep);
1792      pmanager -&gt;SetProcessOrdering(theDecayProcess, idxAtRest);
1793    }
1794  }
1795}
1796</pre></div></div><p><br class="example-break">
1797</p></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="sect.PhysProc.Decay.Table"></a>5.2.3.2. 
1798Decay Table
1799</h4></div></div></div><p>
1800Each particle has its <span class="emphasis"><em>G4DecayTable</em></span>, which stores information
1801on the decay modes of the particle. Each decay mode, with its
1802branching ratio, corresponds to an object of various ``decay
1803channel'' classes derived from <span class="emphasis"><em>G4VDecayChannel</em></span>. Default
1804decay modes are created in the constructors of particle classes.
1805For example, the decay table of the neutral pion has
1806<span class="emphasis"><em>G4PhaseSpaceDecayChannel</em></span> and
1807<span class="emphasis"><em>G4DalitzDecayChannel</em></span> as follows:
1808
1809</p><div class="informalexample"><pre class="programlisting">
1810  // create a decay channel
1811  G4VDecayChannel* mode;
1812  // pi0 -&gt; gamma + gamma
1813  mode = new G4PhaseSpaceDecayChannel("pi0",0.988,2,"gamma","gamma");
1814  table-&gt;Insert(mode);
1815  // pi0 -&gt; gamma + e+ + e-
1816  mode = new G4DalitzDecayChannel("pi0",0.012,"e-","e+");
1817  table-&gt;Insert(mode);
1818</pre></div><p>
1819</p><p>
1820Decay modes and branching ratios defined in Geant4 are listed in
1821<a href="ch05s03.html#sect.Parti.Def" title="5.3.2. 
1822Definition of a particle
1823">Section 5.3.2</a>.
1824</p></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="sect.PhysProc.Decay.PreAssgn"></a>5.2.3.3. 
1825Pre-assigned Decay Modes by Event Generators
1826</h4></div></div></div><p>
1827Decays of heavy flavor particles such as B mesons are very complex,
1828with many varieties of decay modes and decay mechanisms. There are
1829many models for heavy particle decay provided by various event
1830generators and it is impossible to define all the decay modes of
1831heavy particles by using <span class="emphasis"><em>G4VDecayChannel</em></span>. In other words,
1832decays of heavy particles cannot be defined by the Geant4 decay
1833process, but should be defined by event generators or other
1834external packages. Geant4 provides two ways to do this:
1835<code class="literal">pre-assigned decay mode</code> and <code class="literal">external decayer</code>.
1836</p><p>
1837In the latter approach, the class <span class="emphasis"><em>G4VExtDecayer</em></span> is used
1838for the interface to an external package which defines decay modes
1839for a particle. If an instance of <span class="emphasis"><em>G4VExtDecayer</em></span> is attached
1840to <span class="emphasis"><em>G4Decay</em></span>, daughter particles will be generated by the
1841external decay handler.
1842</p><p>
1843In the former case, decays of heavy particles are simulated by
1844an event generator and the primary event contains the decay
1845information. <span class="emphasis"><em>G4VPrimaryGenerator</em></span> automatically attaches any
1846daughter particles to the parent particle as the
1847PreAssignedDecayProducts member of <span class="emphasis"><em>G4DynamicParticle</em></span>.
1848<span class="emphasis"><em>G4Decay</em></span> adopts these pre-assigned daughter particles instead
1849of asking <span class="emphasis"><em>G4VDecayChannel</em></span> to generate decay products.
1850</p><p>
1851In addition, the user may assign a <code class="literal">pre-assigned</code> decay
1852time for a specific track in its rest frame (i.e. decay time is
1853defined in the proper time) by using the
1854<span class="emphasis"><em>G4PrimaryParticle::SetProperTime()</em></span> method.
1855<span class="emphasis"><em>G4VPrimaryGenerator</em></span> sets the PreAssignedDecayProperTime
1856member of <span class="emphasis"><em>G4DynamicParticle</em></span>. <span class="emphasis"><em>G4Decay</em></span> 
1857uses this decay time instead of the life time of the particle type.
1858</p></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="sect.PhysProc.PhotoHad"></a>5.2.4. 
1859Photolepton-hadron Processes
1860</h3></div></div></div><p>
1861To be delivered.
1862</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="sect.PhysProc.Photo"></a>5.2.5. 
1863Optical Photon Processes
1864</h3></div></div></div><p>
1865A photon is considered to be <span class="emphasis"><em>optical</em></span> when its wavelength
1866is much greater than the typical atomic spacing. In GEANT4 optical
1867photons are treated as a class of particle distinct from their
1868higher energy <span class="emphasis"><em>gamma</em></span> cousins. This implementation allows the
1869wave-like properties of electromagnetic radiation to be
1870incorporated into the optical photon process. Because this
1871theoretical description breaks down at higher energies, there is no
1872smooth transition as a function of energy between the optical
1873photon and gamma particle classes.
1874</p><p>
1875For the simulation of optical photons to work correctly in
1876GEANT4, they must be imputed a linear polarization. This is unlike
1877most other particles in GEANT4 but is automatically and correctly
1878done for optical photons that are generated as secondaries by
1879existing processes in GEANT4. Not so, if the user wishes to start
1880optical photons as primary particles. In this case, the user must
1881set the linear polarization using particle gun methods, the General
1882Particle Source, or his/her PrimaryGeneratorAction. For an
1883unpolarized source, the linear polarization should be sampled
1884randomly for each new primary photon.
1885</p><p>
1886The GEANT4 catalogue of processes at optical wavelengths
1887includes refraction and reflection at medium boundaries, bulk
1888absorption and Rayleigh scattering. Processes which produce optical
1889photons include the Cerenkov effect, transition radiation and
1890scintillation. Optical photons are generated in GEANT4 without
1891energy conservation and their energy must therefore not be tallied
1892as part of the energy balance of an event.
1893</p><p>
1894The optical properties of the medium which are key to the
1895implementation of these types of processes are stored as entries in
1896a <code class="literal">G4MaterialPropertiesTable</code> which is linked to the
1897<code class="literal">G4Material</code> in question. These properties may be constants
1898or they may be expressed as a function of the photon's wavelength.
1899This table is a private data member of the <code class="literal">G4Material</code>
1900class. The <code class="literal">G4MaterialPropertiesTable</code> is implemented as a
1901hash directory, in which each entry consists of a <span class="emphasis"><em>value</em></span> and
1902a <span class="emphasis"><em>key</em></span>. The key is used to quickly and efficiently retrieve
1903the corresponding value. All values in the dictionary are either
1904instantiations of <code class="literal">G4double</code> or the class
1905<code class="literal">G4MaterialPropertyVector</code>, and all keys are of type
1906<code class="literal">G4String</code>.
1907</p><p>
1908A <code class="literal">G4MaterialPropertyVector</code> is composed of
1909instantiations of the class <code class="literal">G4MPVEntry</code>. The
1910<code class="literal">G4MPVEntry</code> is a pair of numbers, which in the case of an
1911optical property, are the photon momentum and corresponding
1912property value. The <code class="literal">G4MaterialPropertyVector</code> is
1913implemented as a <code class="literal">G4std::vector</code>, with the sorting operation
1914defined as
1915MPVEntry<sub>1</sub> &lt; MPVEntry<sub>2</sub> ==
1916photon_momentum<sub>1</sub> &lt; photon_momentum<sub>2</sub>.
1917This results in all <code class="literal">G4MaterialPropertyVector</code>s being sorted in
1918ascending order of photon momenta. It is possible for the user to
1919add as many material (optical) properties to the material as he
1920wishes using the methods supplied by the
1921<code class="literal">G4MaterialPropertiesTable</code> class. An example of this is
1922shown in <a href="ch05s02.html#programlist_PhysProc_5" title="Example 5.5. 
1923Optical properties added to a G4MaterialPropertiesTable
1924and linked to a G4Material
1925">Example 5.5</a>.
1926
1927</p><div class="example"><a name="programlist_PhysProc_5"></a><p class="title"><b>Example 5.5. 
1928Optical properties added to a <code class="literal">G4MaterialPropertiesTable</code> 
1929and linked to a <code class="literal">G4Material</code>
1930</b></p><div class="example-contents"><pre class="programlisting">
1931const G4int NUMENTRIES = 32;
1932
1933G4double ppckov[NUMENTRIES] = {2.034*eV, ......, 4.136*eV};
1934G4double rindex[NUMENTRIES] = {1.3435, ......, 1.3608};
1935G4double absorption[NUMENTRIES] = {344.8*cm, ......, 1450.0*cm];
1936
1937G4MaterialPropertiesTable *MPT = new G4MaterialPropertiesTable();
1938
1939MPT -&gt; AddConstProperty("SCINTILLATIONYIELD",100./MeV);
1940
1941MPT -&gt; AddProperty("RINDEX",ppckov,rindex,NUMENTRIES};
1942MPT -&gt; AddProperty("ABSLENGTH",ppckov,absorption,NUMENTRIES};
1943
1944scintillator -&gt; SetMaterialPropertiesTable(MPT);
1945</pre></div></div><p><br class="example-break">
1946</p><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="sect.PhysProc.Photo.Cerenkov"></a>5.2.5.1. 
1947Generation of Photons in
1948<code class="literal">processes/electromagnetic/xrays</code> - Cerenkov Effect
1949</h4></div></div></div><p>
1950The radiation of Cerenkov light occurs when a charged particle
1951moves through a dispersive medium faster than the group velocity of
1952light in that medium. Photons are emitted on the surface of a cone,
1953whose opening angle with respect to the particle's instantaneous
1954direction decreases as the particle slows down. At the same time,
1955the frequency of the photons emitted increases, and the number
1956produced decreases. When the particle velocity drops below the
1957local speed of light, the radiation ceases and the emission cone
1958angle collapses to zero. The photons produced by this process have
1959an inherent polarization perpendicular to the cone's surface at
1960production.
1961</p><p>
1962The flux, spectrum, polarization and emission of Cerenkov
1963radiation in the <code class="literal">AlongStepDoIt</code> method of the class
1964<code class="literal">G4Cerenkov</code> follow well-known formulae, with two inherent
1965computational limitations. The first arises from step-wise
1966simulation, and the second comes from the requirement that
1967numerical integration calculate the average number of Cerenkov
1968photons per step. The process makes use of a
1969<code class="literal">G4PhysicsTable</code> which contains incremental integrals to
1970expedite this calculation.
1971</p><p>
1972The time and position of Cerenkov photon emission are calculated
1973from quantities known at the beginning of a charged particle's
1974step. The step is assumed to be rectilinear even in the presence of
1975a magnetic field. The user may limit the step size by specifying a
1976maximum (average) number of Cerenkov photons created during the
1977step, using the <code class="literal">SetMaxNumPhotonsPerStep(const G4int
1978NumPhotons)</code> method. The actual number generated will
1979necessarily be different due to the Poissonian nature of the
1980production. In the present implementation, the production density
1981of photons is distributed evenly along the particle's track
1982segment, even if the particle has slowed significantly during the
1983step.
1984</p><p>
1985The frequently very large number of secondaries produced in a
1986single step (about 300/cm in water), compelled the idea in
1987GEANT3.21 of suspending the primary particle until all its progeny
1988have been tracked. Despite the fact that GEANT4 employs dynamic
1989memory allocation and thus does not suffer from the limitations of
1990GEANT3.21 with its fixed large initial ZEBRA store, GEANT4
1991nevertheless provides for an analogous functionality with the
1992public method <code class="literal">SetTrackSecondariesFirst</code>. An example of the
1993registration of the Cerenkov process is given in
1994<a href="ch05s02.html#programlist_PhysProc_6" title="Example 5.6. 
1995Registration of the Cerenkov process in PhysicsList.
1996">Example 5.6</a>.
1997
1998</p><div class="example"><a name="programlist_PhysProc_6"></a><p class="title"><b>Example 5.6. 
1999Registration of the Cerenkov process in <code class="literal">PhysicsList</code>.
2000</b></p><div class="example-contents"><pre class="programlisting">
2001#include "G4Cerenkov.hh"
2002
2003void ExptPhysicsList::ConstructOp(){
2004
2005  G4Cerenkov*   theCerenkovProcess = new G4Cerenkov("Cerenkov");
2006
2007  G4int MaxNumPhotons = 300;
2008
2009  theCerenkovProcess-&gt;SetTrackSecondariesFirst(true);
2010  theCerenkovProcess-&gt;SetMaxNumPhotonsPerStep(MaxNumPhotons);
2011
2012  theParticleIterator-&gt;reset();
2013  while( (*theParticleIterator)() ){
2014    G4ParticleDefinition* particle = theParticleIterator-&gt;value();
2015    G4ProcessManager* pmanager = particle-&gt;GetProcessManager();
2016    G4String particleName = particle-&gt;GetParticleName();
2017    if (theCerenkovProcess-&gt;IsApplicable(*particle)) {
2018      pmanager-&gt;AddContinuousProcess(theCerenkovProcess);
2019    }
2020  }
2021}
2022</pre></div></div><p><br class="example-break">
2023</p></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="sect.PhysProc.Photo.Scinti"></a>5.2.5.2. 
2024Generation of Photons in
2025<code class="literal">processes/electromagnetic/xrays</code> - Scintillation
2026</h4></div></div></div><p>
2027Every scintillating material has a characteristic light yield,
2028<code class="literal">SCINTILLATIONYIELD</code>, and an intrinsic resolution,
2029<code class="literal">RESOLUTIONSCALE</code>, which generally broadens the statistical
2030distribution of generated photons. A wider intrinsic resolution is
2031due to impurities which are typical for doped crystals like NaI(Tl)
2032and CsI(Tl). On the other hand, the intrinsic resolution can also
2033be narrower when the Fano factor plays a role. The actual number of
2034emitted photons during a step fluctuates around the mean number of
2035photons with a width given by
2036<code class="literal">ResolutionScale*sqrt(MeanNumberOfPhotons)</code>. The average
2037light yield, <code class="literal">MeanNumberOfPhotons</code>, has a linear dependence
2038on the local energy deposition, but it may be different for minimum
2039ionizing and non-minimum ionizing particles.
2040</p><p>
2041A scintillator is also characterized by its photon emission
2042spectrum and by the exponential decay of its time spectrum. In
2043GEANT4 the scintillator can have a fast and a slow component. The
2044relative strength of the fast component as a fraction of total
2045scintillation yield is given by the <code class="literal">YIELDRATIO</code>.
2046Scintillation may be simulated by specifying these empirical
2047parameters for each material. It is sufficient to specify in the
2048user's <code class="literal">DetectorConstruction</code> class a relative spectral
2049distribution as a function of photon energy for the scintillating
2050material. An example of this is shown in
2051<a href="ch05s02.html#programlist_PhysProc_7" title="Example 5.7. 
2052Specification of scintillation properties in
2053DetectorConstruction.
2054">Example 5.7</a>
2055
2056</p><div class="example"><a name="programlist_PhysProc_7"></a><p class="title"><b>Example 5.7. 
2057Specification of scintillation properties in
2058<code class="literal">DetectorConstruction</code>.
2059</b></p><div class="example-contents"><pre class="programlisting">
2060  const G4int NUMENTRIES = 9;
2061  G4double Scnt_PP[NUMENTRIES] = { 6.6*eV, 6.7*eV, 6.8*eV, 6.9*eV,
2062                                   7.0*eV, 7.1*eV, 7.2*eV, 7.3*eV, 7.4*eV };
2063
2064  G4double Scnt_FAST[NUMENTRIES] = { 0.000134, 0.004432, 0.053991, 0.241971,
2065                                     0.398942, 0.000134, 0.004432, 0.053991,
2066                                     0.241971 };
2067  G4double Scnt_SLOW[NUMENTRIES] = { 0.000010, 0.000020, 0.000030, 0.004000,
2068                                     0.008000, 0.005000, 0.020000, 0.001000,
2069                                     0.000010 };
2070
2071  G4Material* Scnt;
2072  G4MaterialPropertiesTable* Scnt_MPT = new G4MaterialPropertiesTable();
2073
2074  Scnt_MPT-&gt;AddProperty("FASTCOMPONENT", Scnt_PP, Scnt_FAST, NUMENTRIES);
2075  Scnt_MPT-&gt;AddProperty("SLOWCOMPONENT", Scnt_PP, Scnt_SLOW, NUMENTRIES);
2076
2077  Scnt_MPT-&gt;AddConstProperty("SCINTILLATIONYIELD", 5000./MeV);
2078  Scnt_MPT-&gt;AddConstProperty("RESOLUTIONSCALE", 2.0);
2079  Scnt_MPT-&gt;AddConstProperty("FASTTIMECONSTANT",  1.*ns);
2080  Scnt_MPT-&gt;AddConstProperty("SLOWTIMECONSTANT", 10.*ns);
2081  Scnt_MPT-&gt;AddConstProperty("YIELDRATIO", 0.8);
2082
2083  Scnt-&gt;SetMaterialPropertiesTable(Scnt_MPT);
2084</pre></div></div><p><br class="example-break">
2085</p><p>
2086In cases where the scintillation yield of a scintillator depends
2087on the particle type, different scintillation processes may be
2088defined for them. How this yield scales to the one specified for
2089the material is expressed with the
2090<code class="literal">ScintillationYieldFactor</code> in the user's
2091<code class="literal">PhysicsList</code> as shown in
2092<a href="ch05s02.html#programlist_PhysProc_8" title="Example 5.8. 
2093Implementation of the scintillation process in
2094PhysicsList.
2095">Example 5.8</a>.
2096In those cases where the fast to slow excitation ratio changes with particle
2097type, the method <code class="literal">SetScintillationExcitationRatio</code> can be
2098called for each scintillation process (see the advanced
2099underground_physics example). This overwrites the
2100<code class="literal">YieldRatio</code> obtained from the
2101<code class="literal">G4MaterialPropertiesTable</code>.
2102
2103</p><div class="example"><a name="programlist_PhysProc_8"></a><p class="title"><b>Example 5.8. 
2104Implementation of the scintillation process in
2105<code class="literal">PhysicsList</code>.
2106</b></p><div class="example-contents"><pre class="programlisting">
2107  G4Scintillation* theMuonScintProcess = new G4Scintillation("Scintillation");
2108
2109  theMuonScintProcess-&gt;SetTrackSecondariesFirst(true);
2110  theMuonScintProcess-&gt;SetScintillationYieldFactor(0.8);
2111
2112  theParticleIterator-&gt;reset();
2113  while( (*theParticleIterator)() ){
2114    G4ParticleDefinition* particle = theParticleIterator-&gt;value();
2115    G4ProcessManager* pmanager = particle-&gt;GetProcessManager();
2116    G4String particleName = particle-&gt;GetParticleName();
2117    if (theMuonScintProcess-&gt;IsApplicable(*particle)) {
2118       if (particleName == "mu+") {
2119          pmanager-&gt;AddProcess(theMuonScintProcess);
2120          pmanager-&gt;SetProcessOrderingToLast(theMuonScintProcess, idxAtRest);
2121          pmanager-&gt;SetProcessOrderingToLast(theMuonScintProcess, idxPostStep);
2122       }
2123    }
2124  }
2125</pre></div></div><p><br class="example-break">
2126</p><p>
2127A Gaussian-distributed number of photons is generated according
2128to the energy lost during the step. A resolution scale of 1.0
2129produces a statistical fluctuation around the average yield set
2130with <code class="literal">AddConstProperty("SCINTILLATIONYIELD")</code>, while values
2131&gt; 1 broaden the fluctuation. A value of zero produces no
2132fluctuation. Each photon's frequency is sampled from the empirical
2133spectrum. The photons originate evenly along the track segment and
2134are emitted uniformly into 4&#960; with a random linear polarization
2135and at times characteristic for the scintillation component.
2136</p></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="sect.PhysProc.Photo.WaveShift"></a>5.2.5.3. 
2137Generation of Photons in
2138<code class="literal">processes/optical</code> - Wavelength Shifting
2139</h4></div></div></div><p>
2140Wavelength Shifting (WLS) fibers are used in many high-energy
2141particle physics experiments. They absorb light at one wavelength
2142and re-emit light at a different wavelength and are used for
2143several reasons. For one, they tend to decrease the self-absorption
2144of the detector so that as much light reaches the PMTs as possible.
2145WLS fibers are also used to match the emission spectrum of the
2146detector with the input spectrum of the PMT.
2147</p><p>
2148A WLS material is characterized by its photon absorption and
2149photon emission spectrum and by a possible time delay between the
2150absorption and re-emission of the photon. Wavelength Shifting may
2151be simulated by specifying these empirical parameters for each WLS
2152material in the simulation. It is sufficient to specify in the
2153user's <code class="literal">DetectorConstruction</code> class a relative spectral
2154distribution as a function of photon energy for the WLS material.
2155WLSABSLENGTH is the absorption length of the material as a function
2156of the photon's momentum. WLSCOMPONENT is the relative emission
2157spectrum of the material as a function of the photon's momentum,
2158and WLSTIMECONSTANT accounts for any time delay which may occur
2159between absorption and re-emission of the photon. An example is
2160shown in <a href="ch05s02.html#programlist_PhysProc_9" title="Example 5.9. 
2161Specification of WLS properties in DetectorConstruction.
2162">Example 5.9</a>.
2163
2164</p><div class="example"><a name="programlist_PhysProc_9"></a><p class="title"><b>Example 5.9. 
2165Specification of WLS properties in <code class="literal">DetectorConstruction</code>.
2166</b></p><div class="example-contents"><pre class="programlisting">
2167 const G4int nEntries = 9;
2168
2169 G4double PhotonEnergy[nEntries] = { 6.6*eV, 6.7*eV, 6.8*eV, 6.9*eV,
2170                                   7.0*eV, 7.1*eV, 7.2*eV, 7.3*eV, 7.4*eV };
2171
2172 G4double RIndexFiber[nEntries] =
2173           { 1.60, 1.60, 1.60, 1.60, 1.60, 1.60, 1.60, 1.60, 1.60 };
2174 G4double AbsFiber[nEntries] =
2175           {0.1*mm,0.2*mm,0.3*mm,0.4*cm,1.0*cm,10*cm,1.0*m,10.0*m,10.0*m};
2176 G4double EmissionFiber[nEntries] =
2177           {0.0, 0.0, 0.0, 0.1, 0.5, 1.0, 5.0, 10.0, 10.0 };
2178
2179  G4Material* WLSFiber;
2180  G4MaterialPropertiesTable* MPTFiber = new G4MaterialPropertiesTable();
2181
2182  MPTFiber-&gt;AddProperty("RINDEX",PhotonEnergy,RIndexFiber,nEntries);
2183  MPTFiber-&gt;AddProperty("WLSABSLENGTH",PhotonEnergy,AbsFiber,nEntries);
2184  MPTFiber-&gt;AddProperty("WLSCOMPONENT",PhotonEnergy,EmissionFiber,nEntries);
2185  MPTFiber-&gt;AddConstProperty("WLSTIMECONSTANT", 0.5*ns);
2186
2187  WLSFiber-&gt;SetMaterialPropertiesTable(MPTFiber);
2188</pre></div></div><p><br class="example-break">
2189</p><p>
2190The process is defined in the PhysicsList in the usual way. The
2191process class name is G4OpWLS. It should be instantiated with
2192theWLSProcess = new G4OpWLS("OpWLS") and attached to the process
2193manager of the optical photon as a DiscreteProcess. The way the
2194WLSTIMECONSTANT is used depends on the time profile method chosen
2195by the user. If in the PhysicsList
2196theWLSProcess-&gt;UseTimeGenerator("exponential") option is set,
2197the time delay between absorption and re-emission of the photon is
2198sampled from an exponential distribution, with the decay term equal
2199to WLSTIMECONSTANT. If, on the other hand,
2200theWLSProcess-&gt;UseTimeGenerator("delta") is chosen, the time
2201delay is a delta function and equal to WLSTIMECONSTANT. The default
2202is "delta" in case the G4OpWLS::UseTimeGenerator(const G4String
2203name) method is not used.
2204</p></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="sect.PhysProc.Photo.Track"></a>5.2.5.4. 
2205Tracking of Photons in <code class="literal">processes/optical</code>
2206</h4></div></div></div><h5><a name="id461706"></a>
2207Absorption
2208</h5><p>
2209The implementation of optical photon bulk absorption,
2210<code class="literal">G4OpAbsorption</code>, is trivial in that the process merely
2211kills the particle. The procedure requires the user to fill the
2212relevant <code class="literal">G4MaterialPropertiesTable</code> with empirical data for
2213the absorption length, using <code class="literal">ABSLENGTH</code> as the property key
2214in the public method <code class="literal">AddProperty</code>. The absorption length is
2215the average distance traveled by a photon before being absorpted by
2216the medium; i.e. it is the mean free path returned by the
2217<code class="literal">GetMeanFreePath</code> method.
2218</p><h5><a name="id461751"></a>
2219Rayleigh Scattering
2220</h5><p>
2221The differential cross section in Rayleigh scattering,
2222&#963;/&#969;, is proportional
2223to cos<sup>2</sup>(&#952;),
2224where &#952; is the polar of the new polarization vector with
2225respect to the old polarization vector. The <code class="literal">G4OpRayleigh</code>
2226scattering process samples this angle accordingly and then
2227calculates the scattered photon's new direction by requiring that
2228it be perpendicular to the photon's new polarization in such a way
2229that the final direction, initial and final polarizations are all
2230in one plane. This process thus depends on the particle's
2231polarization (spin). The photon's polarization is a data member of
2232the <code class="literal">G4DynamicParticle</code> class.
2233</p><p>
2234A photon which is not assigned a polarization at production,
2235either via the <code class="literal">SetPolarization</code> method of the
2236<code class="literal">G4PrimaryParticle</code> class, or indirectly with the
2237<code class="literal">SetParticlePolarization</code> method of the
2238<code class="literal">G4ParticleGun</code> class, may not be Rayleigh scattered.
2239Optical photons produced by the <code class="literal">G4Cerenkov</code> process have
2240inherently a polarization perpendicular to the cone's surface at
2241production. Scintillation photons have a random linear polarization
2242perpendicular to their direction.
2243</p><p>
2244The process requires a <code class="literal">G4MaterialPropertiesTable</code> to be
2245filled by the user with Rayleigh scattering length data. The
2246Rayleigh scattering attenuation length is the average distance
2247traveled by a photon before it is Rayleigh scattered in the medium
2248and it is the distance returned by the <code class="literal">GetMeanFreePath</code>
2249method. The <code class="literal">G4OpRayleigh</code> class provides a
2250<code class="literal">RayleighAttenuationLengthGenerator</code> method which calculates
2251the attenuation coefficient of a medium following the
2252Einstein-Smoluchowski formula whose derivation requires the use of
2253statistical mechanics, includes temperature, and depends on the
2254isothermal compressibility of the medium. This generator is
2255convenient when the Rayleigh attenuation length is not known from
2256measurement but may be calculated from first principles using the
2257above material constants. For a medium named <span class="emphasis"><em>Water</em></span> and no
2258Rayleigh scattering attenutation length specified by the user, the
2259program automatically calls the
2260<code class="literal">RayleighAttenuationLengthGenerator</code>
2261which calculates it for 10 degrees Celsius liquid water.
2262</p><h5><a name="id461867"></a>
2263Boundary Process
2264</h5><p>
2265Reference: E. Hecht and A. Zajac, Optics
2266[<span class="citation">
2267<a href="bi01.html#biblio.hecht1974">
2268    Hecht1974
2269  </a>
2270</span>]
2271</p><p>
2272For the simple case of a perfectly smooth interface between two
2273dielectric materials, all the user needs to provide are the
2274refractive indices of the two materials stored in their respective
2275<code class="literal">G4MaterialPropertiesTable</code>. In all other cases, the optical
2276boundary process design relies on the concept of <span class="emphasis"><em>surfaces</em></span>.
2277The information is split into two classes. One class in the
2278material category keeps information about the physical properties
2279of the surface itself, and a second class in the geometry category
2280holds pointers to the relevant physical and logical volumes
2281involved and has an association to the physical class. Surface
2282objects of the second type are stored in a related table and can be
2283retrieved by either specifying the two ordered pairs of physical
2284volumes touching at the surface, or by the logical volume entirely
2285surrounded by this surface. The former is called a <span class="emphasis"><em>border
2286surface</em></span> while the latter is referred to as the <span class="emphasis"><em>skin
2287surface</em></span>. This second type of surface is useful in situations
2288where a volume is coded with a reflector and is placed into many
2289different mother volumes. A limitation is that the skin surface can
2290only have one and the same optical property for all of the enclosed
2291volume's sides. The border surface is an ordered pair of physical
2292volumes, so in principle, the user can choose different optical
2293properties for photons arriving from the reverse side of the same
2294interface. For the optical boundary process to use a border
2295surface, the two volumes must have been positioned with
2296<code class="literal">G4PVPlacement</code>. The ordered combination can exist at many
2297places in the simulation. When the surface concept is not needed,
2298and a perfectly smooth surface exists beteen two dielectic
2299materials, the only relevant property is the index of refraction, a
2300quantity stored with the material, and no restriction exists on how
2301the volumes were positioned.
2302</p><p>
2303The physical surface object also specifies which model the
2304boundary process should use to simulate interactions with that
2305surface. In addition, the physical surface can have a material
2306property table all its own. The usage of this table allows all
2307specular constants to be wavelength dependent. In case the surface
2308is painted or wrapped (but not a cladding), the table may include
2309the thin layer's index of refraction. This allows the simulation of
2310boundary effects at the intersection between the medium and the
2311surface layer, as well as the Lambertian reflection at the far side
2312of the thin layer. This occurs within the process itself and does
2313not invoke the <code class="literal">G4Navigator</code>. Combinations of surface finish
2314properties, such as <span class="emphasis"><em>polished</em></span> or
2315<span class="emphasis"><em>ground</em></span> and <span class="emphasis"><em>front
2316painted</em></span> or <span class="emphasis"><em>back painted</em></span>, enumerate the different
2317situations which can be simulated.
2318</p><p>
2319When a photon arrives at a medium boundary its behavior depends
2320on the nature of the two materials that join at that boundary.
2321Medium boundaries may be formed between two dielectric materials or
2322a dielectric and a metal. In the case of two dielectric materials,
2323the photon can undergo total internal reflection, refraction or
2324reflection, depending on the photon's wavelength, angle of
2325incidence, and the refractive indices on both sides of the
2326boundary. Furthermore, reflection and transmission probabilites are
2327sensitive to the state of linear polarization. In the case of an
2328interface between a dielectric and a metal, the photon can be
2329absorbed by the metal or reflected back into the dielectric. If the
2330photon is absorbed it can be detected according to the
2331photoelectron efficiency of the metal.
2332</p><p>
2333As expressed in Maxwell's equations, Fresnel reflection and
2334refraction are intertwined through their relative probabilities of
2335occurrence. Therefore neither of these processes, nor total
2336internal reflection, are viewed as individual processes deserving
2337separate class implementation. Nonetheless, an attempt was made to
2338adhere to the abstraction of having independent processes by
2339splitting the code into different methods where practicable.
2340</p><p>
2341One implementation of the <code class="literal">G4OpBoundaryProcess</code> class
2342employs the
2343<a href="http://geant4.slac.stanford.edu/UsersWorkshop/G4Lectures/Peter/moisan.ps" target="_top">
2344UNIFIED model</a>
2345 [A. Levin and C. Moisan, A More Physical Approach
2346to Model the Surface Treatment of Scintillation Counters and its
2347Implementation into DETECT, TRIUMF Preprint TRI-PP-96-64, Oct.
23481996] of the DETECT program [G.F. Knoll, T.F. Knoll and T.M.
2349Henderson, Light Collection Scintillation Detector Composites for
2350Neutron Detection, IEEE Trans. Nucl. Sci., 35 (1988) 872.]. It
2351applies to dielectric-dielectric interfaces and tries to provide a
2352realistic simulation, which deals with all aspects of surface
2353finish and reflector coating. The surface may be assumed as smooth
2354and covered with a metallized coating representing a specular
2355reflector with given reflection coefficient, or painted with a
2356diffuse reflecting material where Lambertian reflection occurs. The
2357surfaces may or may not be in optical contact with another
2358component and most importantly, one may consider a surface to be
2359made up of micro-facets with normal vectors that follow given
2360distributions around the nominal normal for the volume at the
2361impact point. For very rough surfaces, it is possible for the
2362photon to inversely aim at the same surface again after reflection
2363of refraction and so multiple interactions with the boundary are
2364possible within the process itself and without the need for
2365relocation by <code class="literal">G4Navigator</code>.
2366</p><p>
2367The UNIFIED model provides for a range of different reflection
2368mechanisms. The specular lobe constant represents the reflection
2369probability about the normal of a micro facet. The specular spike
2370constant, in turn, illustrates the probability of reflection about
2371the average surface normal. The diffuse lobe constant is for the
2372probability of internal Lambertian reflection, and finally the
2373back-scatter spike constant is for the case of several reflections
2374within a deep groove with the ultimate result of exact
2375back-scattering. The four probabilities must add up to one, with
2376the diffuse lobe constant being implicit. The reader may consult
2377the reference for a thorough description of the model.
2378
2379</p><div class="example"><a name="programlist_PhysProc_10"></a><p class="title"><b>Example 5.10. 
2380Dielectric-dielectric surface properties
2381defined via the <span class="emphasis"><em>G4OpticalSurface</em></span>.
2382</b></p><div class="example-contents"><pre class="programlisting">
2383G4VPhysicalVolume* volume1;
2384G4VPhysicalVolume* volume2;
2385
2386G4OpticalSurface* OpSurface = new G4OpticalSurface("name");
2387
2388G4LogicalBorderSurface* Surface = new
2389  G4LogicalBorderSurface("name",volume1,volume2,OpSurface);
2390
2391G4double sigma_alpha = 0.1;
2392
2393OpSurface -&gt; SetType(dielectric_dielectric);
2394OpSurface -&gt; SetModel(unified);
2395OpSurface -&gt; SetFinish(groundbackpainted);
2396OpSurface -&gt; SetSigmaAlpha(sigma_alpha);
2397
2398const G4int NUM = 2;
2399
2400G4double pp[NUM] = {2.038*eV, 4.144*eV};
2401G4double specularlobe[NUM] = {0.3, 0.3};
2402G4double specularspike[NUM] = {0.2, 0.2};
2403G4double backscatter[NUM] = {0.1, 0.1};
2404G4double rindex[NUM] = {1.35, 1.40};
2405G4double reflectivity[NUM] = {0.3, 0.5};
2406G4double efficiency[NUM] = {0.8, 0.1};
2407
2408G4MaterialPropertiesTable* SMPT = new G4MaterialPropertiesTable();
2409
2410SMPT -&gt; AddProperty("RINDEX",pp,rindex,NUM);
2411SMPT -&gt; AddProperty("SPECULARLOBECONSTANT",pp,specularlobe,NUM);
2412SMPT -&gt; AddProperty("SPECULARSPIKECONSTANT",pp,specularspike,NUM);
2413SMPT -&gt; AddProperty("BACKSCATTERCONSTANT",pp,backscatter,NUM);
2414SMPT -&gt; AddProperty("REFLECTIVITY",pp,reflectivity,NUM);
2415SMPT -&gt; AddProperty("EFFICIENCY",pp,efficiency,NUM);
2416
2417OpSurface -&gt; SetMaterialPropertiesTable(SMPT);
2418</pre></div></div><p><br class="example-break">
2419</p><p>
2420The original
2421<a href="http://wwwasdoc.web.cern.ch/wwwasdoc/geant_html3/node231.html" target="_top">
2422GEANT3.21 implementation</a>  of this process is also available via
2423the GLISUR methods flag. [GEANT Detector Description and Simulation
2424Tool, Application Software Group, Computing and Networks Division,
2425CERN, PHYS260-6 tp 260-7.].
2426
2427</p><div class="example"><a name="programlist_PhysProc_11"></a><p class="title"><b>Example 5.11. 
2428Dielectric metal surface properties defined via the
2429<span class="emphasis"><em>G4OpticalSurface</em></span>.
2430</b></p><div class="example-contents"><pre class="programlisting">
2431G4LogicalVolume* volume_log;
2432
2433G4OpticalSurface* OpSurface = new G4OpticalSurface("name");
2434
2435G4LogicalSkinSurface* Surface = new
2436  G4LogicalSkinSurface("name",volume_log,OpSurface);
2437
2438OpSurface -&gt; SetType(dielectric_metal);
2439OpSurface -&gt; SetFinish(ground);
2440OpSurface -&gt; SetModel(glisur);
2441
2442G4double polish = 0.8;
2443
2444G4MaterialPropertiesTable *OpSurfaceProperty = new G4MaterialPropertiesTable();
2445
2446OpSurfaceProperty -&gt; AddProperty("REFLECTIVITY",pp,reflectivity,NUM);
2447OpSurfaceProperty -&gt; AddProperty("EFFICIENCY",pp,efficiency,NUM);
2448
2449OpSurface -&gt; SetMaterialPropertiesTable(OpSurfaceProperty);
2450</pre></div></div><p><br class="example-break">
2451</p><p>
2452The reflectivity off a metal surface can also be calculated by way of a complex
2453index of refraction. Instead of storing the REFLECTIVITY directly, the user
2454stores the real part (REALRINDEX) and the imaginary part (IMAGINARYRINDEX) as
2455a function of photon energy separately in the G4MaterialPropertyTable. Geant4
2456then
2457<a href="./AllResources/TrackingAndPhysics/physicsProcessOptical.src/GetReflectivity.pdf" target="_top">
2458calculates the reflectivity
2459</a>
2460depending on the incident angle, photon energy, degree of TE and TM
2461polarization, and this complex refractive index.
2462</p><p>
2463The program defaults to the GLISUR model and <span class="emphasis"><em>polished</em></span>
2464surface finish when no specific model and surface finish is
2465specified by the user. In the case of a dielectric-metal interface,
2466or when the GLISUR model is specified, the only surface finish
2467options available are <span class="emphasis"><em>polished</em></span> or <span class="emphasis"><em>ground</em></span>. For
2468dielectric-metal surfaces, the <code class="literal">G4OpBoundaryProcess</code> also
2469defaults to unit reflectivity and zero detection efficiency. In
2470cases where the user specifies the UNIFIED model, but does not
2471otherwise specify the model reflection probability constants, the
2472default becomes Lambertian reflection.
2473</p></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="sect.PhysProc.Param"></a>5.2.6. 
2474Parameterization
2475</h3></div></div></div><p>
2476In this section we describe how to use the parameterization or
2477"fast simulation" facilities of GEANT4. Examples are provided in
2478the <span class="bold"><strong>examples/novice/N05 directory</strong></span>.
2479</p><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="sect.PhysProc.Param.Gene"></a>5.2.6.1. 
2480Generalities:
2481</h4></div></div></div><p>
2482The Geant4 parameterization facilities allow you to shortcut the
2483detailed tracking in a given volume and for given particle types in
2484order for you to provide your own implementation of the physics and
2485of the detector response.
2486</p><p>
2487Parameterisations are bound to a
2488<span class="bold"><strong><code class="literal">G4Region</code></strong></span>
2489object, which, in the case of fast simulation is also called an
2490<span class="bold"><strong>envelope</strong></span>. Prior to release 8.0,
2491parameterisations were bound
2492to a <code class="literal">G4LogicalVolume</code>, the root of a volume hierarchy.
2493These root volumes are now attributes of the <code class="literal">G4Region</code>.
2494Envelopes often correspond to the volumes of sub-detectors:
2495electromagnetic calorimeters, tracking chambers, etc. With GEANT4
2496it is also possible to define envelopes by overlaying a parallel or
2497"ghost" geometry as discussed in <a href="ch05s02.html#sect.PhysProc.Param.Ghost" title="5.2.6.7. 
2498Parameterisation Using Ghost Geometries
2499">Section 5.2.6.7</a>.
2500</p><p>
2501In GEANT4, parameterisations have three main features. You must
2502specify:
2503
2504</p><div class="itemizedlist"><ul type="disc" compact><li><p>
2505    the particle types for which your parameterisation is valid;
2506  </p></li><li><p>
2507    the dynamics conditions for which your parameterisation is
2508    valid and must be triggered;
2509  </p></li><li><p>
2510    the parameterisation itself: where the primary will be killed
2511    or moved, whether or not to create it or create secondaries, etc.,
2512    and where the detector response will be computed.
2513  </p></li></ul></div><p>
2514</p><p>
2515GEANT4 will message your parameterisation code for each step
2516starting in any root G4LogicalVolume (including daughters.
2517sub-daughters, etc. of this volume) of the <code class="literal">G4Region</code>.
2518It will proceed by first asking the available parameterisations for
2519the current particle type if one of them (and only one) wants to
2520issue a trigger. If so it will invoke its parameterisation. In this
2521case, the tracking
2522<span class="bold"><strong><span class="emphasis"><em>will not apply physics</em></span></strong></span> 
2523to the particle in the step. Instead, the UserSteppingAction will be
2524invoked.
2525</p><p>
2526Parameterisations look like a "user stepping action" but are more
2527advanced because:
2528
2529</p><div class="itemizedlist"><ul type="disc" compact><li><p>
2530    parameterisation code is messaged only in the
2531    <code class="literal">G4Region</code> to which it is bound;
2532  </p></li><li><p>
2533    parameterisation code is messaged anywhere in the
2534    <code class="literal">G4Region</code>, that is, any volume in which the track is
2535    located;
2536  </p></li><li><p>
2537    GEANT4 will provide information to your parameterisation code
2538    about the current root volume of the <code class="literal">G4Region</code> 
2539    in which the track is travelling.
2540  </p></li></ul></div><p>
2541</p></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="sect.PhysProc.Param.OvComp"></a>5.2.6.2. 
2542Overview of Parameterisation Components
2543</h4></div></div></div><p>
2544The GEANT4 components which allow the implementation and control
2545of parameterisations are:
2546
2547</p><div class="variablelist"><dl><dt><span class="term">
2548      <code class="literal"><span class="bold"><strong>G4VFastSimulationModel</strong></span></code> 
2549    </span></dt><dd><p>
2550      This is the abstract class for the implementation of parameterisations.
2551      You must inherit from it to implement your concrete parameterisation model.
2552    </p></dd><dt><span class="term">
2553      <code class="literal"><span class="bold"><strong>G4FastSimulationManager</strong></span></code>
2554    </span></dt><dd><p>
2555      The G4VFastSimulationModel objects are attached to the
2556      <code class="literal">G4Region</code> through a G4FastSimulationManager.
2557      This object will manage the list of models and will message them at
2558      tracking time.
2559    </p></dd><dt><span class="term">
2560      <code class="literal"><span class="bold"><strong>G4Region/Envelope</strong></span></code>
2561    </span></dt><dd><p>
2562      As mentioned before, an envelope in GEANT4 is a
2563      <code class="literal"><span class="bold"><strong>G4Region</strong></span></code>.
2564      The parameterisation is bound to the <code class="literal">G4Region</code> by
2565      setting a <code class="literal">G4FastSimulationManager</code> pointer to it.
2566      </p><p>
2567      The figure below shows how the <code class="literal">G4VFastSimulationModel</code>
2568      and <code class="literal">G4FastSimulationManager</code> objects are bound to the
2569      <code class="literal">G4Region</code>. Then for all root G4LogicalVolume's held by
2570      the G4Region, the fast simulation code is active.
2571
2572      </p><div class="mediaobject" align="center"><img src="./AllResources/TrackingAndPhysics/physicsProcessPARAM.src/ComponentsWithRegion.gif" align="middle"><div class="caption"></div></div><p>
2573
2574    </p></dd><dt><span class="term">
2575      <code class="literal"><span class="bold"><strong>G4FastSimulationManagerProcess</strong></span></code>
2576    </span></dt><dd><p>
2577      This is a <code class="literal">G4VProcess</code>. It provides the interface
2578      between the tracking and the parameterisation. It must be set in the
2579      process list of the particles you want to parameterise.
2580    </p></dd><dt><span class="term">
2581      <code class="literal"><span class="bold"><strong>G4GlobalFastSimulationManager</strong></span></code>
2582    </span></dt><dd><p>
2583      This a singleton class which provides the management of the
2584      <code class="literal">G4FastSimulationManager</code> objects and some ghost
2585      facilities.
2586    </p></dd></dl></div><p>   
2587</p></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="sect.PhysProc.Param.FastSimModel"></a>5.2.6.3. 
2588The <code class="literal">G4VFastSimulationModel</code> Abstract Class
2589</h4></div></div></div><h5><a name="id462556"></a>
2590Constructors:
2591</h5><p>
2592The <code class="literal">G4VFastSimulationModel</code> class has two constructors.
2593The second one allows you to get started quickly:
2594
2595</p><div class="variablelist"><dl><dt><span class="term">
2596      <span class="bold"><strong><code class="literal">G4VFastSimulationModel(
2597       const G4String&amp; aName)</code></strong></span>:
2598    </span></dt><dd><p>
2599      Here <code class="literal">aName</code> identifies the parameterisation model.
2600    </p></dd><dt><span class="term">
2601      <span class="bold"><strong><code class="literal">G4VFastSimulationModel(const G4String&amp; 
2602       aName, G4Region*, G4bool IsUnique=false):</code></strong></span>
2603    </span></dt><dd><p>
2604      In addition to the model name, this constructor accepts a G4Region pointer.
2605      The needed G4FastSimulationManager object is constructed if necessary,
2606      passing to it the G4Region pointer and the boolean value. If it
2607      already exists, the model is simply added to this manager. Note
2608      that the <span class="emphasis"><em>G4VFastSimulationModel object will not keep track of
2609      the G4Region passed in the constructor</em></span>.
2610      The boolean argument is there for optimization purposes: if you
2611      know that the G4Region has a unique root G4LogicalVolume, uniquely
2612      placed, you can set the boolean value to "true".
2613    </p></dd></dl></div><p>
2614</p><h5><a name="id462636"></a>
2615Virtual methods:
2616</h5><p>
2617The G4VFastSimulationModel has three pure virtual methods which
2618must be overriden in your concrete class:
2619
2620</p><div class="variablelist"><dl><dt><span class="term">
2621      <span class="bold"><strong><code class="literal">G4VFastSimulationModel(
2622      <span class="emphasis"><em>const G4String&amp; aName</em></span>):</code></strong></span>
2623    </span></dt><dd><p>
2624      Here aName identifies the parameterisation model.
2625    </p></dd><dt><span class="term">
2626      <span class="bold"><strong><code class="literal">G4bool ModelTrigger(
2627      <span class="emphasis"><em>const G4FastTrack&amp;</em></span>):</code></strong></span>
2628    </span></dt><dd><p>
2629      You must return "true" when the dynamic conditions to trigger your
2630      parameterisation are fulfilled.
2631      G4FastTrack provides access to the current G4Track, gives simple
2632      access to the current root G4LogicalVolume related features (its
2633      G4VSolid, and G4AffineTransform references between the global and
2634      the root G4LogicalVolume local coordinates systems) and simple
2635      access to the position and momentum expressed in the root
2636      G4LogicalVolume coordinate system. Using these quantities and the
2637      G4VSolid methods, you can for example easily check how far you are
2638      from the root G4LogicalVolume boundary.
2639    </p></dd><dt><span class="term">
2640      <span class="bold"><strong><code class="literal">G4bool IsApplicable(
2641      <span class="emphasis"><em>const G4ParticleDefinition&amp;</em></span>):</code></strong></span>
2642    </span></dt><dd><p>
2643      In your implementation, you must return "true" when your model is
2644      applicable to the G4ParticleDefinition passed to this method. The
2645      G4ParticleDefinition provides all intrinsic particle information
2646      (mass, charge, spin, name ...).
2647      </p><p>
2648      If you want to implement a model which is valid only for certain
2649      particle types, it is recommended for efficiency that you use the
2650      static pointer of the corresponding particle classes.
2651      </p><p>
2652      As an example, in a model valid for <span class="emphasis"><em>gamma</em></span>s only,
2653      the IsApplicable() method should take the form:
2654
2655      </p><div class="informalexample"><pre class="programlisting">
2656      #include "G4Gamma.hh"
2657
2658      G4bool MyGammaModel::IsApplicable(const G4ParticleDefinition&amp; partDef)
2659      {
2660        return &amp;partDef == G4Gamma::GammaDefinition();
2661      }
2662      </pre></div><p>
2663    </p></dd><dt><span class="term">
2664      <span class="bold"><strong><code class="literal">G4bool ModelTrigger(
2665      <span class="emphasis"><em>const G4FastTrack&amp;</em></span>):</code></strong></span> 
2666    </span></dt><dd><p>
2667      You must return "true" when the dynamic conditions to trigger your
2668      parameterisation are fulfilled.
2669      The G4FastTrack provides access to the current G4Track, gives
2670      simple access to envelope related features (G4LogicalVolume,
2671      G4VSolid, and G4AffineTransform references between the global and
2672      the envelope local coordinates systems) and simple access to the
2673      position and momentum expressed in the envelope coordinate system.
2674      Using these quantities and the G4VSolid methods, you can for
2675      example easily check how far you are from the envelope boundary.
2676    </p></dd><dt><span class="term">
2677      <span class="bold"><strong><code class="literal">void DoIt(
2678      <span class="emphasis"><em>const G4FastTrack&amp;, G4FastStep&amp;</em></span>):</code></strong></span>
2679    </span></dt><dd><p>
2680      The details of your parameterisation will be implemented in this method.
2681      The G4FastTrack reference provides the input information, and the final
2682      state of the particles after parameterisation must be returned
2683      through the G4FastStep reference. Tracking for the final state
2684      particles is requested after your parameterisation has been invoked.
2685    </p></dd></dl></div><p>
2686</p></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="sect.PhysProc.Param.FastSimMan"></a>5.2.6.4. 
2687The <code class="literal">G4FastSimulationManager</code> Class:
2688</h4></div></div></div><p>
2689G4FastSimulationManager functionnalities regarding the use of ghost
2690volumes are explained in <a href="ch05s02.html#sect.PhysProc.Param.Ghost" title="5.2.6.7. 
2691Parameterisation Using Ghost Geometries
2692">Section 5.2.6.7</a>.
2693</p><h5><a name="id462839"></a>
2694Constructor:
2695</h5><p>
2696</p><div class="variablelist"><dl><dt><span class="term">
2697      <code class="literal"><span class="bold"><strong>G4FastSimulationManager(
2698      <span class="emphasis"><em>G4Region *anEnvelope, G4bool IsUnique=false</em></span>):
2699      </strong></span></code> 
2700    </span></dt><dd><p>
2701      This is the only constructor. You specify the G4Region by providing
2702      its pointer. The G4FastSimulationManager object will bind itself
2703      to this G4Region. If you know that this G4Region has a single root
2704      G4LogicalVolume, placed only once, you can set the IsUnique boolean
2705      to "true" to allow some optimization.
2706      </p><p>
2707      Note that if you choose to use the G4VFastSimulationModel(const
2708      G4String&amp;, G4Region*, G4bool) constructor for your model, the
2709      G4FastSimulationManager will be constructed using the given
2710      G4Region* and G4bool values of the model constructor.
2711    </p></dd></dl></div><p>
2712</p><h5><a name="id462890"></a>
2713G4VFastSimulationModel object management:
2714</h5><p>
2715The following two methods provide the usual management
2716functions.
2717
2718</p><div class="itemizedlist"><ul type="disc" compact><li><p>
2719    <code class="literal"><span class="bold"><strong>void AddFastSimulationModel(
2720    G4VFastSimulationModel*)</strong></span></code>
2721  </p></li><li><p>
2722    <code class="literal"><span class="bold"><strong>RemoveFastSimulationModel(
2723    G4VFastSimulationModel*)</strong></span></code>
2724  </p></li></ul></div><p>
2725</p><h5><a name="id462935"></a>
2726Interface with the G4FastSimulationManagerProcess:
2727</h5><p>
2728This is described in the User's Guide for Toolkit Developers
2729(
2730
2731section 3.9.6
2732
2733)
2734</p></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="sect.PhysProc.Param.FastSimManProc"></a>5.2.6.5. 
2735The <code class="literal">G4FastSimulationManagerProcess</code> Class
2736</h4></div></div></div><p>
2737This G4VProcess serves as an interface between the tracking and the
2738parameterisation. At tracking time, it collaborates with the
2739G4FastSimulationManager of the current volume, if any, to allow the
2740models to trigger. If no manager exists or if no model issues a
2741trigger, the tracking goes on normally.
2742</p><p>
2743<span class="emphasis"><em>In the present implementation, you must set this process in
2744the G4ProcessManager of the particles you parameterise to enable
2745your parameterisation.</em></span>
2746</p><p>
2747The processes ordering is:
2748
2749</p><div class="informalexample"><pre class="programlisting">
2750    [n-3] ...
2751    [n-2] Multiple Scattering
2752    [n-1] G4FastSimulationManagerProcess
2753    [ n ] G4Transportation
2754</pre></div><p>
2755</p><p>
2756This ordering is important if you use ghost geometries, since the
2757G4FastSimulationManagerProcess will provide navigation in the ghost
2758world to limit the step on ghost boundaries.
2759</p><p>
2760The G4FastSimulationManager must be added to the process list of a
2761particle as a continuous and discrete process if you use ghost
2762geometries for this particle. You can add it as a discrete process
2763if you don't use ghosts.
2764</p><p>
2765The following code registers the G4FastSimulationManagerProcess
2766with all the particles as a discrete and continuous process:
2767
2768</p><div class="informalexample"><pre class="programlisting">
2769void MyPhysicsList::addParameterisation()
2770{
2771  G4FastSimulationManagerProcess*
2772    theFastSimulationManagerProcess = new G4FastSimulationManagerProcess();
2773  theParticleIterator-&gt;reset();
2774  while( (*theParticleIterator)() )
2775    {
2776      G4ParticleDefinition* particle = theParticleIterator-&gt;value();
2777      G4ProcessManager* pmanager = particle-&gt;GetProcessManager();
2778      pmanager-&gt;AddProcess(theFastSimulationManagerProcess, -1, 0, 0);
2779    }
2780}
2781</pre></div><p>
2782</p></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="sect.PhysProc.Param.FastSimManSing"></a>5.2.6.6. 
2783The <code class="literal">G4GlobalFastSimulationManager</code> Singleton Class
2784</h4></div></div></div><p>
2785This class is a singleton which can be accessed as follows:
2786
2787</p><div class="informalexample"><pre class="programlisting">
2788#include "G4GlobalFastSimulationManager.hh"
2789...
2790...
2791G4GlobalFastSimulationManager* globalFSM;
2792globalFSM = G4GlobalFastSimulationManager::getGlobalFastSimulationManager();
2793...
2794...
2795</pre></div><p>
2796</p><p>
2797Presently, you will mainly need to use the
2798GlobalFastSimulationManager if you use ghost geometries.
2799</p></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="sect.PhysProc.Param.Ghost"></a>5.2.6.7. 
2800Parameterisation Using Ghost Geometries
2801</h4></div></div></div><p>
2802In some cases, volumes of the tracking geometry do not allow
2803envelopes to be defined. This may be the case with a geometry
2804coming from a CAD system. Since such a geometry is flat, a parallel
2805geometry must be used to define the envelopes.
2806</p><p>
2807Another interesting case involves defining an envelope which groups
2808the electromagnetic and hadronic calorimeters of a detector into
2809one volume. This may be useful when parameterizing the interaction
2810of charged pions. You will very likely not want electrons to see
2811this envelope, which means that ghost geometries have to be
2812organized by particle flavours.
2813</p><p>
2814Using ghost geometries implies some more overhead in the
2815parameterisation mechanism for the particles sensitive to ghosts,
2816since navigation is provided in the ghost geometry by the
2817G4FastSimulationManagerProcess. Usually, however, only a few
2818volumes will be placed in this ghost world, so that the geometry
2819computations will remain rather cheap.
2820</p><p>
2821In the existing implementation (temporary implementation with
2822G4Region but before parallel geometry implementation), you may only
2823consider ghost G4Regions with just one root G4LogicalVolume. The
2824G4GlobalFastSimulationManager provides the construction of the
2825ghost geometry by making first an empty "clone" of the world for
2826tracking provided by the construct() method of your
2827G4VUserDetectorConstruction concrete class. You provide the
2828placement of the G4Region root G4LogicalVolume relative to the
2829ghost world coordinates in the G4FastSimulationManager objects. A
2830ghost G4Region is recognized by the fact that its associated
2831G4FastSimulationManager retains a non-empty list of placements.
2832</p><p>
2833The G4GlobalFastSimulationManager will then use both those
2834placements and the IsApplicable() methods of the models attached to
2835the G4FastSimulationManager objects to build the flavour-dependant
2836ghost geometries.
2837</p><p>
2838Then at the beginning of the tracking of a particle, the
2839appropriate ghost world, if any, will be selected.
2840</p><p>
2841The steps required to build one ghost G4Region are:
2842
2843</p><div class="orderedlist"><ol type="1" compact><li><p>
2844    built the ghost G4Region : myGhostRegion;
2845  </p></li><li><p>
2846    build the root G4LogicalVolume: myGhostLogical, set it to
2847    myGhostRegion;
2848  </p></li><li><p>
2849    build a G4FastSimulationManager object, myGhostFSManager,
2850    giving myGhostRegion as argument of the constructor;
2851  </p></li><li><p>
2852    </p><p>
2853    give to the G4FastSimulationManager the placement of the
2854    myGhostLogical, by invoking for the G4FastSimulationManager method:
2855    </p><div class="informalexample"><pre class="programlisting">
2856     AddGhostPlacement(G4RotationMatrix*, const G4ThreeVector&amp;);
2857    </pre></div><p>
2858    or:
2859    </p><div class="informalexample"><pre class="programlisting">
2860     AddGhostPlacement(G4Transform3D*);
2861    </pre></div><p>
2862
2863    where the rotation matrix and translation vector of the 3-D
2864    transformation describe the placement relative to the ghost world
2865    coordinates.
2866    </p><p>
2867  </p></li><li><p>
2868    build your G4VFastSimulationModel objects and add them to the
2869    myGhostFSManager.
2870    <span class="emphasis"><em>The IsApplicable() methods of your models will be used by the
2871    G4GlobalFastSimulationManager to build the ghost geometries
2872    corresponding to a given particle type.</em></span>
2873  </p></li><li><p>
2874    </p><p>
2875    Invoke the G4GlobalFastSimulationManager method:
2876
2877    </p><div class="informalexample"><pre class="programlisting">
2878     G4GlobalFastSimulationManager::getGlobalFastSimulationManager()-&gt;
2879
2880          CloseFastSimulation();
2881    </pre></div><p>
2882    </p><p>
2883  </p></li></ol></div><p>
2884</p><p>
2885This last call will cause the G4GlobalFastSimulationManager to
2886build the flavour-dependent ghost geometries. This call must be
2887done before the RunManager closes the geometry. (It is foreseen
2888that the run manager in the future will invoke the
2889CloseFastSimulation() to synchronize properly with the closing of
2890the geometry).
2891</p><p>
2892Visualization facilities are provided for ghosts geometries. After
2893the CloseFastSimulation() invocation, it is possible to ask for the
2894drawing of ghosts in an interactive session. The basic commands
2895are:
2896
2897</p><div class="itemizedlist"><ul type="disc" compact><li><p>
2898    </p><p>
2899    /vis/draw/Ghosts particle_name
2900    </p><p>
2901    </p><p>
2902    which makes the drawing of the ghost geometry associated with the
2903    particle specified by name in the command line.
2904    </p><p>
2905  </p></li><li><p>
2906    /vis/draw/Ghosts
2907    </p><p>
2908    which draws all the ghost geometries.
2909    </p><p>
2910  </p></li></ul></div><p>
2911</p></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="sect.PhysProc.Param.GFlash"></a>5.2.6.8. 
2912Gflash Parameterization
2913</h4></div></div></div><p>
2914This section describes how to use the Gflash library. Gflash is a
2915concrete parameterization which is based on the equations and
2916parameters of the original Gflash package from H1(hep-ex/0001020,
2917Grindhammer &amp; Peters, see physics manual) and uses the "fast
2918simulation" facilities of GEANT4 described above. Briefly, whenever
2919a e-/e+ particle enters the calorimeter, it is parameterized if it
2920has a minimum energy and the shower is expected to be contained in
2921the calorimeter (or " parameterization envelope"). If this is
2922fulfilled the particle is killed, as well as all secondaries, and
2923the energy is deposited according to the Gflash equations. An
2924example, provided in
2925<span class="bold"><strong>examples/extended/parametrisation/gflash/</strong></span>,
2926shows how to interface Gflash to your application. The simulation time is
2927measured, so the user can immediately see the speed increase
2928resulting from the use of Gflash.
2929</p></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="sect.PhysProc.Param.UsingGFlash"></a>5.2.6.9. 
2930Using the Gflash Parameterisation
2931</h4></div></div></div><p>
2932To use Gflash "out of the box" the following steps are necessary:
2933
2934</p><div class="itemizedlist"><ul type="disc" compact><li><p>
2935    The user must add the fast simulation process to his process
2936    manager:
2937
2938    </p><div class="informalexample"><pre class="programlisting">
2939  void MyPhysicsList::addParameterisation()
2940  {
2941    G4FastSimulationManagerProcess*
2942      theFastSimulationManagerProcess = new G4FastSimulationManagerProcess();
2943    theParticleIterator-&gt;reset();
2944    while( (*theParticleIterator)() )
2945      {
2946        G4ParticleDefinition* particle = theParticleIterator-&gt;value();
2947        G4ProcessManager* pmanager = particle-&gt;GetProcessManager();
2948        pmanager-&gt;AddProcess(theFastSimulationManagerProcess, -1, 0, 0);
2949      }
2950  }
2951    </pre></div><p>
2952  </p></li><li><p>
2953    </p><p>
2954    The envelope in which the parameterization should be performed
2955    must be specified (below: G4Region m_calo_region) and the
2956    GFlashShowerModel must be assigned to this region. Furthermore, the
2957    classes GFlashParticleBounds (which provides thresholds for the
2958    parameterization like minimal energy etc.), GflashHitMaker(a helper
2959    class to generate hits in the sensitive detector) and
2960    GFlashHomoShowerParamterisation (which does the computations) must
2961    be constructed (by the user at the moment) and assigned to the
2962    GFlashShowerModel. Please note that at the moment only homogeneous
2963    calorimeters are supported.
2964    </p><p>
2965    </p><p>
2966    </p><div class="informalexample"><pre class="programlisting">
2967  m_theFastShowerModel = new GFlashShowerModel("fastShowerModel",m_calo_region);
2968  m_theParametrisation = new GFlashHomoShowerParamterisation(matManager-&gt;getMaterial(mat));
2969  m_theParticleBounds  = new GFlashParticleBounds();
2970  m_theHMaker          = new GFlashHitMaker();
2971  m_theFastShowerModel-&gt;SetParametrisation(*m_theParametrisation);
2972  m_theFastShowerModel-&gt;SetParticleBounds(*m_theParticleBounds) ;
2973  m_theFastShowerModel-&gt;SetHitMaker(*m_theHMaker);
2974    </pre></div><p>
2975    </p><p>
2976    </p><p>
2977    The user must also set the material of the calorimeter, since the
2978    computation depends on the material.
2979    </p><p>
2980  </p></li><li><p>
2981    </p><p>
2982    It is mandatory to use G4VGFlashSensitiveDetector as
2983    (additional) base class for the sensitive detector.
2984    </p><p>
2985    </p><p>
2986    </p><div class="informalexample"><pre class="programlisting">
2987  class ExGflashSensitiveDetector: public G4VSensitiveDetector ,public G4VGFlashSensitiveDetector
2988    </pre></div><p>
2989    </p><p>
2990    </p><p>
2991    Here it is necessary to implement a separate interface, where the
2992    GFlash spots are processed.
2993    </p><p>
2994    </p><p>
2995    </p><div class="informalexample"><pre class="programlisting">
2996  (ProcessHits(G4GFlashSpot*aSpot ,G4TouchableHistory* ROhist))
2997    </pre></div><p>
2998    </p><p>
2999    </p><p>
3000    A separate interface is used, because the Gflash spots naturally
3001    contain less information than the full simulation.
3002    </p><p>
3003  </p></li></ul></div><p>
3004</p><p>
3005Since the parameters in the Gflash package are taken from fits to
3006full simulations with Geant3, some retuning might be necessary for
3007good agreement with Geant4 showers. For experiment-specific
3008geometries some retuning might be necessary anyway. The tuning is
3009quite complicated since there are many parameters (some correlated)
3010and cannot be described here (see again hep-ex/0001020). For brave
3011users the Gflash framework already forsees the possibility of
3012passing a class with the (users)
3013parameters,<span class="bold"><strong>GVFlashHomoShowerTuning</strong></span>,
3014to the GFlashHomoShowerParamterisation constructor.
3015The default parameters are the original Gflash parameters:
3016
3017</p><div class="informalexample"><pre class="programlisting">
3018GFlashHomoShowerParameterisation(G4Material * aMat, GVFlashHomoShowerTuning * aPar = 0);
3019</pre></div><p>
3020</p><p>
3021Now there is also a preliminary implemenation of a parameterization
3022for sampling calorimeters.
3023</p><p>
3024The user must specify the active and passive material, as well as
3025the thickness of the active and passive layer.
3026</p><p>
3027The sampling structure of the calorimeter is taken into account by
3028using an "effective medium" to compute the shower shape.
3029</p><p>
3030All material properties needed are calculated automatically. If
3031tuning is required,  the user can pass his own parameter set in
3032the class
3033<span class="bold"><strong>GFlashSamplingShowerTuning</strong></span>.
3034Here the user can also set his calorimeter resolution.
3035</p><p>
3036All in all the constructor looks the following:
3037
3038</p><div class="informalexample"><pre class="programlisting">
3039GFlashSamplingShowerParamterisation(G4Material * Mat1, G4Material * Mat2,G4double d1,G4double d2,
3040GVFlashSamplingShowerTuning * aPar = 0);
3041</pre></div><p>
3042</p><p>
3043An implementation of some tools that should help the user to tune
3044the parameterization is forseen.
3045</p></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="sect.PhysProc.Trans"></a>5.2.7. 
3046Transportation Process
3047</h3></div></div></div><p>
3048To be delivered by J. Apostolakis (<code class="email">&lt;<a href="mailto:John.Apostolakis@cern.ch">John.Apostolakis@cern.ch</a>&gt;</code>).
3049</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch05.html"><img src="AllResources/IconsGIF/prev.gif" alt="Prev"></a> </td><td width="20%" align="center"><a accesskey="u" href="ch05.html"><img src="AllResources/IconsGIF/up.gif" alt="Up"></a></td><td width="40%" align="right"> <a accesskey="n" href="ch05s03.html"><img src="AllResources/IconsGIF/next.gif" alt="Next"></a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 5. 
3050Tracking and Physics
3051 </td><td width="20%" align="center"><a accesskey="h" href="index.html"><img src="AllResources/IconsGIF/home.gif" alt="Home"></a></td><td width="40%" align="right" valign="top"> 5.3. 
3052Particles
3053</td></tr></table></div></body></html>
Note: See TracBrowser for help on using the repository browser.