source: trunk/documents/UserDoc/DocBookUsersGuides/ForApplicationDeveloper/xml/TrackingAndPhysics/physicsProcess.xml @ 904

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

ajout de la doc

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