Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
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$
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"
53#include "G4Track.hh"
54#include "G4Step.hh"
56class G4SafetyHelper;
57
59{
60 // Concrete class that does the geometrical transport
61
62 public: // with description
63
64 G4Transportation( G4int verbosityLevel= 1);
66
68 const G4Track& track,
69 G4double previousStepSize,
70 G4double currentMinimumStep,
71 G4double& currentSafety,
72 G4GPILSelection* selection
73 );
74
76 const G4Track& track,
77 const G4Step& stepData
78 );
79
81 const G4Track& track,
82 const G4Step& stepData
83 );
84 // Responsible for the relocation.
85
87 const G4Track& ,
88 G4double previousStepSize,
89 G4ForceCondition* pForceCond
90 );
91 // Forces the PostStepDoIt action to be called,
92 // but does not limit the step.
93
95 void SetPropagatorInField( G4PropagatorInField* pFieldPropagator);
96 // Access/set the assistant class that Propagate in a Field.
97
99 inline G4int GetVerboseLevel() const;
100 // Level of warnings regarding eg energy conservation
101 // in field integration.
102
105 inline G4int GetThresholdTrials() const;
106
107 inline void SetThresholdWarningEnergy( G4double newEnWarn );
108 inline void SetThresholdImportantEnergy( G4double newEnImp );
109 inline void SetThresholdTrials(G4int newMaxTrials );
110
111 // Get/Set parameters for killing loopers:
112 // Above 'important' energy a 'looping' particle in field will
113 // *NOT* be abandoned, except after fThresholdTrials attempts.
114 // Below Warning energy, no verbosity for looping particles is issued
115
118 inline void ResetKilledStatistics( G4int report = 1);
119 // Statistics for tracks killed (currently due to looping in field)
120
121 inline void EnableShortStepOptimisation(G4bool optimise=true);
122 // Whether short steps < safety will avoid to call Navigator (if field=0)
123
124 inline G4bool EnableUseMagneticMoment(G4bool useMoment=true);
125 // Whether to deflect particles with force due to magnetic moment
126
127 public: // without description
128
130 const G4Track& ,
132 ) { return -1.0; };
133 // No operation in AtRestDoIt.
134
136 const G4Track& ,
137 const G4Step&
138 ) {return 0;};
139 // No operation in AtRestDoIt.
140
141 void StartTracking(G4Track* aTrack);
142 // Reset state for new (potentially resumed) track
143
144 protected:
145
147 // Checks whether a field exists for the "global" field manager.
148
149 private:
150
151 G4Navigator* fLinearNavigator;
152 G4PropagatorInField* fFieldPropagator;
153 // The Propagators used to transport the particle
154
155 // G4FieldManager* fGlobalFieldMgr; // Used MagneticField CC
156 // Field Manager for the whole Detector
157
158 G4ThreeVector fTransportEndPosition;
159 G4ThreeVector fTransportEndMomentumDir;
160 G4double fTransportEndKineticEnergy;
161 G4ThreeVector fTransportEndSpin;
162 G4bool fMomentumChanged;
163 G4bool fEnergyChanged;
164 G4bool fEndGlobalTimeComputed;
165 G4double fCandidateEndGlobalTime;
166 // The particle's state after this Step, Store for DoIt
167
168 G4bool fParticleIsLooping;
169
170 G4TouchableHandle fCurrentTouchableHandle;
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
177 G4bool fGeometryLimitedStep;
178 // Flag to determine whether a boundary was reached.
179
180 G4ThreeVector fPreviousSftOrigin;
181 G4double fPreviousSafety;
182 // Remember last safety origin & value.
183
184 G4ParticleChangeForTransport fParticleChange;
185 // New ParticleChange
186
187 G4double fEndPointDistance;
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 G4double fUnimportant_Energy;
197 // Below this energy, no verbosity for looping particles is issued
198
199 // Counter for steps in which particle reports 'looping',
200 // if it is above 'Important' Energy
201 G4int fNoLooperTrials;
202 // Statistics for tracks abandoned
203 G4double fSumEnergyKilled;
204 G4double fMaxEnergyKilled;
205
206 // Whether to avoid calling G4Navigator for short step ( < safety)
207 // If using it, the safety estimate for endpoint will likely be smaller.
208 G4bool fShortStepOptimisation;
209
210 // Whether to track state change from magnetic moment in a B-field
211 G4bool fUseMagneticMoment;
212
213 G4SafetyHelper* fpSafetyHelper; // To pass it the safety value obtained
214
215 // Verbosity
216 G4int fVerboseLevel;
217 // Verbosity level for warnings
218 // eg about energy non-conservation in magnetic field.
219};
220
221#include "G4Transportation.icc"
222
223#endif
G4ForceCondition
G4GPILSelection
double G4double
Definition: G4Types.hh:64
int G4int
Definition: G4Types.hh:66
bool G4bool
Definition: G4Types.hh:67
Definition: G4Step.hh:78
void SetThresholdImportantEnergy(G4double newEnImp)
G4PropagatorInField * GetPropagatorInField()
G4double AlongStepGetPhysicalInteractionLength(const G4Track &track, G4double previousStepSize, G4double currentMinimumStep, G4double &currentSafety, G4GPILSelection *selection)
void EnableShortStepOptimisation(G4bool optimise=true)
G4int GetVerboseLevel() const
G4int GetThresholdTrials() const
void SetVerboseLevel(G4int verboseLevel)
G4double GetThresholdImportantEnergy() const
void SetPropagatorInField(G4PropagatorInField *pFieldPropagator)
G4VParticleChange * AlongStepDoIt(const G4Track &track, const G4Step &stepData)
void SetThresholdTrials(G4int newMaxTrials)
G4double GetSumEnergyKilled() const
G4VParticleChange * PostStepDoIt(const G4Track &track, const G4Step &stepData)
G4bool DoesGlobalFieldExist()
G4bool EnableUseMagneticMoment(G4bool useMoment=true)
G4double PostStepGetPhysicalInteractionLength(const G4Track &, G4double previousStepSize, G4ForceCondition *pForceCond)
G4VParticleChange * AtRestDoIt(const G4Track &, const G4Step &)
void ResetKilledStatistics(G4int report=1)
G4double GetMaxEnergyKilled() const
void StartTracking(G4Track *aTrack)
G4double AtRestGetPhysicalInteractionLength(const G4Track &, G4ForceCondition *)
G4double GetThresholdWarningEnergy() const
void SetThresholdWarningEnergy(G4double newEnWarn)
G4int verboseLevel
Definition: G4VProcess.hh:368