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

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

CVS update

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