Project

General

Profile

Geant4 Particle Transportation » History » Version 9

Soon Jun, 06/17/2015 06:59 PM

1 1 Soon Jun
h1. Geant4 Particle Transportation
2 1 Soon Jun
3 1 Soon Jun
h2. Top-Down Transportation Chain:
4 1 Soon Jun
5 1 Soon Jun
## test the existence of a magnetic field and whether the particle is charged  
6 1 Soon Jun
   if(charged particle && non-zero-BField)  G4PropagatorInField::ComputeStep in http://www-geant4.kek.jp/lxr/source/geometry/navigation/src/G4PropagatorInField.cc
7 1 Soon Jun
   else                                      G4Navigator::ComputeStep        in http://www-geant4.kek.jp/lxr/source/geometry/navigation/src/G4Navigator.cc                             
8 8 Soon Jun
## determine **epsilon** (local error bound) using **DeltaOneStep** (distance unit, default = 0.01 mm), **epsilonMin** and **epsilonMax** (unit-less), 
9 8 Soon Jun
and the given physical step size (h)
10 6 Soon Jun
<pre>epsilon = DeltaOneStep / ProposedStepLength
11 6 Soon Jun
if(epsilon < epsilonMin) epsilon = epsilonMin            (for the case that h is relatively a small step)
12 6 Soon Jun
if(epsilon > epsilonMax) epsilon = epsilonMax            (for the case that h is relatively a large step)
13 6 Soon Jun
</pre>see again G4PropagatorInField::ComputeStep http://www-geant4.kek.jp/lxr/source/geometry/navigation/src/G4PropagatorInField.cc
14 1 Soon Jun
## do-while loop inside G4PropagatorInField::ComputeStep
15 6 Soon Jun
   until sum(h_i) < step where
16 6 Soon Jun
   h_i (step length taken) =  G4ChordFinder::AdvanceChordLimited in http://www-geant4.kek.jp/lxr/source/geometry/magneticfield/src/G4ChordFinder.cc
17 7 Soon Jun
   and find the crossing point **if** the resultant chord intersects with a geometrical boundary with
18 7 Soon Jun
   IntersectChord in http://www-geant4.kek.jp/lxr/source/geometry/navigation/src/G4MultiLevelLocator.cc
19 7 Soon Jun
   The accuracy of the intersection is controlled by **DeltaIntersection** (distance unit, default = 1 micron) which is the distance between the segment and 
20 7 Soon Jun
   the ending position of the stepper near the volume boundary by the iterative approach inside the routine.  
21 1 Soon Jun
## test for a quick advance or an accurate advance inside G4ChordFinder::AdvanceChordLimited
22 6 Soon Jun
   do while QuickAdvance if (delta < DeltaChord) where delta is the shortest distance to chord (**sagitta**) and **DeltaChord** is the **miss-distance** (default = 0.25mm or set to the smallest volume dimension) 
23 6 Soon Jun
   then if (step possible x epsilon) > epsilon0) invoke G4MagInt_Driver::AccurateAdvance in http://www-geant4.kek.jp/lxr/source/geometry/magneticfield/src/G4MagIntegratorDriver.cc 
24 6 Soon Jun
    where epsilon0 is the local truncated error from the stepper 
25 9 Soon Jun
## G4MagInt_Driver::AccurateAdvance test for h_i < **stepMinimum** (do-while loop until sum(h_i) < hstep) where stepMinimum is the minimum step size for G4MagInt_Driver::QuickAdvance 
26 9 Soon Jun
   (otherwise, use G4MagInt_Driver::OneGoodStep) - h_i is calculated by either QuickAdvance or AccurateAdvance.
27 1 Soon Jun
## G4MagInt_Driver::QuickAdvance 
28 1 Soon Jun
   OneGoodStep loops over the Stepper and evaluates the truncation error (for-loop test epsilon<epsilon0 before break) (and then adjust the step size control if necessary)
29 1 Soon Jun
   G4MagInt_Driver::QuickAdvance call Stepper and DistanceChord
30 1 Soon Jun
   default Stepper: G4ClassicalRK4::DumbStepper in http://www-geant4.kek.jp/lxr/source/geometry/magneticfield/src/G4ClassicalRK4.cc 
31 4 Soon Jun
## G4ClassicalRK4::Stepper calls G4EquationOfMotion::EvaluateRhsReturnB in http://www-geant4.kek.jp/lxr/source/geometry/magneticfield/src/G4EquationOfMotion.cc
32 2 Soon Jun
## G4EquationOfMotion::EvaluateRhsReturnB calls G4MagneticField::GetFieldValue (pure virtual) in  http://www-geant4.kek.jp/lxr/source/geometry/magneticfield/include/G4MagneticField.hh 
33 3 Soon Jun
34 1 Soon Jun
h2. Soon's (scratch) Diagram: