Geant4  10.01.p01
G4Transportation.hh
Go to the documentation of this file.
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 //
27 // $Id: G4Transportation.hh 89285 2015-03-31 08:14:25Z gcosmo $
28 //
29 //
30 // ------------------------------------------------------------
31 // GEANT 4 include file implementation
32 // ------------------------------------------------------------
33 //
34 // Class description:
35 //
36 // G4Transportation is a process responsible for the transportation of
37 // a particle, i.e. the geometrical propagation encountering the
38 // geometrical sub-volumes of the detectors.
39 // It is also tasked with part of updating the "safety".
40 
41 // =======================================================================
42 // Created: 19 March 1997, J. Apostolakis
43 // =======================================================================
44 #ifndef G4Transportation_hh
45 #define G4Transportation_hh 1
46 
47 #include "G4VProcess.hh"
48 #include "G4FieldManager.hh"
49 
50 #include "G4Navigator.hh"
52 #include "G4PropagatorInField.hh"
53 #include "G4Track.hh"
54 #include "G4Step.hh"
56 class G4SafetyHelper;
58 
60 {
61  // Concrete class that does the geometrical transport
62 
63  public: // with description
64 
65  G4Transportation( G4int verbosityLevel= 1);
67 
69  const G4Track& track,
70  G4double previousStepSize,
71  G4double currentMinimumStep,
72  G4double& currentSafety,
73  G4GPILSelection* selection
74  );
75 
77  const G4Track& track,
78  const G4Step& stepData
79  );
80 
82  const G4Track& track,
83  const G4Step& stepData
84  );
85  // Responsible for the relocation.
86 
88  const G4Track& ,
89  G4double previousStepSize,
90  G4ForceCondition* pForceCond
91  );
92  // Forces the PostStepDoIt action to be called,
93  // but does not limit the step.
94 
96  void SetPropagatorInField( G4PropagatorInField* pFieldPropagator);
97  // Access/set the assistant class that Propagate in a Field.
98 
99  inline void SetVerboseLevel( G4int verboseLevel );
100  inline G4int GetVerboseLevel() const;
101  // Level of warnings regarding eg energy conservation
102  // in field integration.
103 
104  inline G4double GetThresholdWarningEnergy() const;
105  inline G4double GetThresholdImportantEnergy() const;
106  inline G4int GetThresholdTrials() const;
107 
108  inline void SetThresholdWarningEnergy( G4double newEnWarn );
109  inline void SetThresholdImportantEnergy( G4double newEnImp );
110  inline void SetThresholdTrials(G4int newMaxTrials );
111 
112  // Get/Set parameters for killing loopers:
113  // Above 'important' energy a 'looping' particle in field will
114  // *NOT* be abandoned, except after fThresholdTrials attempts.
115  // Below Warning energy, no verbosity for looping particles is issued
116 
117  inline G4double GetMaxEnergyKilled() const;
118  inline G4double GetSumEnergyKilled() const;
119  inline void ResetKilledStatistics( G4int report = 1);
120  // Statistics for tracks killed (currently due to looping in field)
121 
122  inline void EnableShortStepOptimisation(G4bool optimise=true);
123  // Whether short steps < safety will avoid to call Navigator (if field=0)
124 
125  static G4bool EnableUseMagneticMoment(G4bool useMoment=true);
126  // Whether to deflect particles with force due to magnetic moment
127 
128  public: // without description
129 
131  const G4Track& ,
133  ) { return -1.0; };
134  // No operation in AtRestDoIt.
135 
137  const G4Track& ,
138  const G4Step&
139  ) {return 0;};
140  // No operation in AtRestDoIt.
141 
142  void StartTracking(G4Track* aTrack);
143  // Reset state for new (potentially resumed) track
144 
145  protected:
146 
148  // Checks whether a field exists for the "global" field manager.
149 
150  private:
151 
154  // The Propagators used to transport the particle
155 
156  // G4FieldManager* fGlobalFieldMgr; // Used MagneticField CC
157  // Field Manager for the whole Detector
158 
166  // The particle's state after this Step, Store for DoIt
167 
169 
171 
172  // G4bool fFieldExists;
173  // Whether a magnetic field exists ...
174  // A data member for this is problematic: it is useful only if it
175  // can be initialised and updated -- and a scheme is not yet possible.
176 
178  // Flag to determine whether a boundary was reached.
179 
182  // Remember last safety origin & value.
183 
185  // New ParticleChange
186 
188 
189  // Thresholds for looping particles:
190  //
191  G4double fThreshold_Warning_Energy; // Warn above this energy
192  G4double fThreshold_Important_Energy; // Hesitate above this
193  G4int fThresholdTrials; // for this no of trials
194  // Above 'important' energy a 'looping' particle in field will
195  // *NOT* be abandoned, except after fThresholdTrials attempts.
196 
197  // Counter for steps in which particle reports 'looping',
198  // if it is above 'Important' Energy
200  // Statistics for tracks abandoned
203 
204  // Whether to avoid calling G4Navigator for short step ( < safety)
205  // If using it, the safety estimate for endpoint will likely be smaller.
207 
208  G4SafetyHelper* fpSafetyHelper; // To pass it the safety value obtained
209 
210  // Verbosity
212  // Verbosity level for warnings
213  // eg about energy non-conservation in magnetic field.
214 
215  // Whether to track state change from magnetic moment in a B-field
216 
217  private:
220 
221 };
222 
223 #include "G4Transportation.icc"
224 
225 #endif
void SetPropagatorInField(G4PropagatorInField *pFieldPropagator)
G4VParticleChange * PostStepDoIt(const G4Track &track, const G4Step &stepData)
G4double GetThresholdWarningEnergy() const
G4PropagatorInField * fFieldPropagator
G4int verboseLevel
Definition: G4VProcess.hh:368
CLHEP::Hep3Vector G4ThreeVector
G4double fTransportEndKineticEnergy
void StartTracking(G4Track *aTrack)
G4VParticleChange * AlongStepDoIt(const G4Track &track, const G4Step &stepData)
G4PropagatorInField * GetPropagatorInField()
G4ThreeVector fTransportEndPosition
G4SafetyHelper * fpSafetyHelper
int G4int
Definition: G4Types.hh:78
void SetThresholdImportantEnergy(G4double newEnImp)
void SetThresholdWarningEnergy(G4double newEnWarn)
void SetThresholdTrials(G4int newMaxTrials)
G4double fThreshold_Important_Energy
bool G4bool
Definition: G4Types.hh:79
G4double AtRestGetPhysicalInteractionLength(const G4Track &, G4ForceCondition *)
G4bool DoesGlobalFieldExist()
Definition: G4Step.hh:76
G4ThreeVector fPreviousSftOrigin
G4TouchableHandle fCurrentTouchableHandle
G4Transportation(G4int verbosityLevel=1)
G4double PostStepGetPhysicalInteractionLength(const G4Track &, G4double previousStepSize, G4ForceCondition *pForceCond)
G4int GetVerboseLevel() const
G4double AlongStepGetPhysicalInteractionLength(const G4Track &track, G4double previousStepSize, G4double currentMinimumStep, G4double &currentSafety, G4GPILSelection *selection)
G4VParticleChange * AtRestDoIt(const G4Track &, const G4Step &)
G4double fThreshold_Warning_Energy
G4int GetThresholdTrials() const
G4ThreeVector fTransportEndSpin
void ResetKilledStatistics(G4int report=1)
G4Navigator * fLinearNavigator
double G4double
Definition: G4Types.hh:76
G4ForceCondition
G4double fCandidateEndGlobalTime
void EnableShortStepOptimisation(G4bool optimise=true)
G4ParticleChangeForTransport fParticleChange
void SetVerboseLevel(G4int verboseLevel)
G4GPILSelection
G4double GetSumEnergyKilled() const
G4ThreeVector fTransportEndMomentumDir
G4double GetThresholdImportantEnergy() const
static G4bool fUseMagneticMoment
static G4bool EnableUseMagneticMoment(G4bool useMoment=true)
G4double GetMaxEnergyKilled() const