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

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

CVS update

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