ATLAS Offline Software
G4mplAtlasTransportation.h
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: G4mplAtlasTransportation.h 559744 2013-08-29 12:40:10Z wtaylor $
28 // GEANT4 tag $Name: geant4-09-03-patch-01 $
29 //
30 //
31 // ------------------------------------------------------------
32 // GEANT 4 include file implementation
33 // ------------------------------------------------------------
34 //
35 // Class description:
36 //
37 // G4mplAtlasTransportation is a process responsible for the transportation of
38 // a particle, i.e. the geometrical propagation encountering the
39 // geometrical sub-volumes of the detectors.
40 // It is also tasked with part of updating the "safety".
41 
42 // =======================================================================
43 // Modified: 20 Aug 2013, W. Taylor, J.Apostolakis: Calculate monopole time by
44 // integrating over the velocity
45 // Created: 19 March 1997, J. Apostolakis
46 // =======================================================================
47 #ifndef MONOPOLE_G4mplAtlasTransportation_hh
48 #define MONOPOLE_G4mplAtlasTransportation_hh 1
49 
50 // base class header
51 #include "G4VProcess.hh"
52 
53 // package headers
54 #include "G4mplEquationSetup.hh"
55 
56 // Geant4 headers
57 #include "G4FieldManager.hh"
58 #include "G4Navigator.hh"
59 #include "G4ParticleChangeForTransport.hh"
60 #include "G4PropagatorInField.hh"
61 #include "G4Step.hh"
62 #include "G4Track.hh"
63 #include "G4TransportationManager.hh"
64 
65 // STL headers
66 #include <fstream>
67 
68 class G4SafetyHelper;
69 class CustomMonopole;
70 
71 class G4mplAtlasTransportation : public G4VProcess
72 {
73  // Concrete class that does the geometrical transport
74 
75 public: // with description
76 
77  G4mplAtlasTransportation(const CustomMonopole* p, G4int verbosityLevel= 1);
79 
81  const G4Track& track,
82  G4double previousStepSize,
83  G4double currentMinimumStep,
84  G4double& currentSafety,
85  G4GPILSelection* selection
86  );
87 
88  G4VParticleChange* AlongStepDoIt(
89  const G4Track& track,
90  const G4Step& stepData
91  );
92 
93  G4VParticleChange* PostStepDoIt(
94  const G4Track& track,
95  const G4Step& stepData
96  );
97  // Responsible for the relocation.
98 
100  const G4Track& ,
101  G4double previousStepSize,
102  G4ForceCondition* pForceCond
103  );
104  // Forces the PostStepDoIt action to be called,
105  // but does not limit the step.
106 
107  G4PropagatorInField* GetPropagatorInField();
108  void SetPropagatorInField( G4PropagatorInField* pFieldPropagator);
109  // Access/set the assistant class that Propagate in a Field.
110 
111  inline void SetVerboseLevel( G4int verboseLevel );
112  inline G4int GetVerboseLevel() const;
113  // Level of warnings regarding eg energy conservation
114  // in field integration.
115 
116  inline G4double GetThresholdWarningEnergy() const;
117  inline G4double GetThresholdImportantEnergy() const;
118  inline G4int GetThresholdTrials() const;
119 
120  inline void SetThresholdWarningEnergy( G4double newEnWarn );
121  inline void SetThresholdImportantEnergy( G4double newEnImp );
122  inline void SetThresholdTrials(G4int newMaxTrials );
123 
124  // Get/Set parameters for killing loopers:
125  // Above 'important' energy a 'looping' particle in field will
126  // *NOT* be abandoned, except after fThresholdTrials attempts.
127  // Below Warning energy, no verbosity for looping particles is issued
128 
129  inline G4double GetMaxEnergyKilled() const;
130  inline G4double GetSumEnergyKilled() const;
131  inline void ResetKilledStatistics( G4int report = 1);
132  // Statistics for tracks killed (currently due to looping in field)
133 
134  inline void EnableShortStepOptimisation(G4bool optimise=true);
135  // Whether short steps < safety will avoid to call Navigator (if field=0)
136 
137 public: // without description
138 
140  const G4Track& ,
141  G4ForceCondition*
142  ) { return -1.0; };
143  // No operation in AtRestDoIt.
144 
145  G4VParticleChange* AtRestDoIt(
146  const G4Track& ,
147  const G4Step&
148  ) {return 0;};
149  // No operation in AtRestDoIt.
150 
151  void StartTracking(G4Track* aTrack);
152  // Reset state for new (potentially resumed) track
153 
154  void EndTracking();
155  // Reset dependent classes & clean up 'side effects' after the end of a monopole track
156 
157 protected:
158 
160  // Checks whether a field exists for the "global" field manager.
161 
162 private:
163 
165 
166  G4Navigator* fLinearNavigator;
167  G4PropagatorInField* fFieldPropagator;
168  // The Propagators used to transport the particle
169 
170  // G4FieldManager* fGlobalFieldMgr; // Used MagneticField CC
171  // Field Manager for the whole Detector
172 
173  G4ThreeVector fTransportEndPosition;
176  G4ThreeVector fTransportEndSpin;
178  //G4bool fEnergyChanged; // Not used?
181  // The particle's state after this Step, Store for DoIt
182 
184 
185  G4TouchableHandle fCurrentTouchableHandle;
186 
187  // G4bool fFieldExists;
188  // Whether a magnetic field exists ...
189  // A data member for this is problematic: it is useful only if it
190  // can be initialised and updated -- and a scheme is not yet possible.
191 
193  // Flag to determine whether a boundary was reached.
194 
195  G4ThreeVector fPreviousSftOrigin;
196  G4double fPreviousSafety;
197  // Remember last safety origin & value.
198 
199  G4ParticleChangeForTransport fParticleChange;
200  // New ParticleChange
201 
203 
204  // Thresholds for looping particles:
205  //
206  G4double fThreshold_Warning_Energy; // Warn above this energy
207  G4double fThreshold_Important_Energy; // Hesitate above this
208  G4int fThresholdTrials; // for this no of trials
209  // Above 'important' energy a 'looping' particle in field will
210  // *NOT* be abandoned, except after fThresholdTrials attempts.
211  //G4double fUnimportant_Energy; // Not used?
212  // Below this energy, no verbosity for looping particles is issued
213 
214  // Counter for steps in which particle reports 'looping',
215  // if it is above 'Important' Energy
217  // Statistics for tracks abandoned
220 
221  // Whether to avoid calling G4Navigator for short step ( < safety)
222  // If using it, the safety estimate for endpoint will likely be smaller.
224 
225  G4SafetyHelper* fpSafetyHelper; // To pass it the safety value obtained
226 
227  // Verbosity
229  // Verbosity level for warnings
230  // eg about energy non-conservation in magnetic field.
231 
232  G4double accumLength;
233 
234  G4mplEquationSetup *fEquationSetup;
235 };
236 
238 
239 #endif
G4mplAtlasTransportation::EndTracking
void EndTracking()
Definition: G4mplAtlasTransportation.cxx:858
G4mplAtlasTransportation::fTransportEndSpin
G4ThreeVector fTransportEndSpin
Definition: G4mplAtlasTransportation.h:176
G4mplAtlasTransportation::mplParticle
const CustomMonopole * mplParticle
Definition: G4mplAtlasTransportation.h:164
G4mplAtlasTransportation::fSumEnergyKilled
G4double fSumEnergyKilled
Definition: G4mplAtlasTransportation.h:218
G4mplAtlasTransportation::~G4mplAtlasTransportation
~G4mplAtlasTransportation()
Definition: G4mplAtlasTransportation.cxx:141
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
G4mplAtlasTransportation::fPreviousSftOrigin
G4ThreeVector fPreviousSftOrigin
Definition: G4mplAtlasTransportation.h:195
G4mplAtlasTransportation::GetMaxEnergyKilled
G4double GetMaxEnergyKilled() const
G4mplAtlasTransportation::AtRestDoIt
G4VParticleChange * AtRestDoIt(const G4Track &, const G4Step &)
Definition: G4mplAtlasTransportation.h:145
G4mplAtlasTransportation::fCandidateEndGlobalTime
G4double fCandidateEndGlobalTime
Definition: G4mplAtlasTransportation.h:180
G4mplAtlasTransportation::GetThresholdTrials
G4int GetThresholdTrials() const
G4mplAtlasTransportation::AlongStepDoIt
G4VParticleChange * AlongStepDoIt(const G4Track &track, const G4Step &stepData)
Definition: G4mplAtlasTransportation.cxx:540
G4mplAtlasTransportation::fThreshold_Warning_Energy
G4double fThreshold_Warning_Energy
Definition: G4mplAtlasTransportation.h:206
checkTP.report
report
Definition: checkTP.py:127
G4mplAtlasTransportation::SetVerboseLevel
void SetVerboseLevel(G4int verboseLevel)
G4mplAtlasTransportation::AlongStepGetPhysicalInteractionLength
G4double AlongStepGetPhysicalInteractionLength(const G4Track &track, G4double previousStepSize, G4double currentMinimumStep, G4double &currentSafety, G4GPILSelection *selection)
Definition: G4mplAtlasTransportation.cxx:160
G4mplAtlasTransportation::fNoLooperTrials
G4int fNoLooperTrials
Definition: G4mplAtlasTransportation.h:216
G4mplAtlasTransportation::fTransportEndPosition
G4ThreeVector fTransportEndPosition
Definition: G4mplAtlasTransportation.h:173
G4mplAtlasTransportation::endpointDistance
G4double endpointDistance
Definition: G4mplAtlasTransportation.h:202
G4mplAtlasTransportation::fMaxEnergyKilled
G4double fMaxEnergyKilled
Definition: G4mplAtlasTransportation.h:219
G4mplAtlasTransportation::StartTracking
void StartTracking(G4Track *aTrack)
Definition: G4mplAtlasTransportation.cxx:807
G4mplAtlasTransportation::fThreshold_Important_Energy
G4double fThreshold_Important_Energy
Definition: G4mplAtlasTransportation.h:207
G4mplAtlasTransportation::fTransportEndKineticEnergy
G4double fTransportEndKineticEnergy
Definition: G4mplAtlasTransportation.h:175
G4mplAtlasTransportation::DoesGlobalFieldExist
G4bool DoesGlobalFieldExist()
G4mplAtlasTransportation::fPreviousSafety
G4double fPreviousSafety
Definition: G4mplAtlasTransportation.h:196
G4mplAtlasTransportation::fVerboseLevel
G4int fVerboseLevel
Definition: G4mplAtlasTransportation.h:228
G4mplAtlasTransportation::ResetKilledStatistics
void ResetKilledStatistics(G4int report=1)
G4mplAtlasTransportation::fParticleIsLooping
G4bool fParticleIsLooping
Definition: G4mplAtlasTransportation.h:183
G4mplAtlasTransportation
Definition: G4mplAtlasTransportation.h:72
G4mplAtlasTransportation.icc
G4mplAtlasTransportation::fGeometryLimitedStep
G4bool fGeometryLimitedStep
Definition: G4mplAtlasTransportation.h:192
G4mplAtlasTransportation::GetThresholdImportantEnergy
G4double GetThresholdImportantEnergy() const
G4mplAtlasTransportation::SetPropagatorInField
void SetPropagatorInField(G4PropagatorInField *pFieldPropagator)
G4mplAtlasTransportation::fThresholdTrials
G4int fThresholdTrials
Definition: G4mplAtlasTransportation.h:208
G4mplAtlasTransportation::fFieldPropagator
G4PropagatorInField * fFieldPropagator
Definition: G4mplAtlasTransportation.h:167
G4mplAtlasTransportation::PostStepDoIt
G4VParticleChange * PostStepDoIt(const G4Track &track, const G4Step &stepData)
Definition: G4mplAtlasTransportation.cxx:705
G4mplAtlasTransportation::SetThresholdTrials
void SetThresholdTrials(G4int newMaxTrials)
selection
std::string selection
Definition: fbtTestBasics.cxx:73
G4mplAtlasTransportation::GetVerboseLevel
G4int GetVerboseLevel() const
G4mplAtlasTransportation::GetPropagatorInField
G4PropagatorInField * GetPropagatorInField()
G4mplAtlasTransportation::accumLength
G4double accumLength
Definition: G4mplAtlasTransportation.h:232
G4mplAtlasTransportation::G4mplAtlasTransportation
G4mplAtlasTransportation(const CustomMonopole *p, G4int verbosityLevel=1)
Definition: G4mplAtlasTransportation.cxx:89
G4mplAtlasTransportation::GetSumEnergyKilled
G4double GetSumEnergyKilled() const
G4mplAtlasTransportation::GetThresholdWarningEnergy
G4double GetThresholdWarningEnergy() const
G4mplAtlasTransportation::fEquationSetup
G4mplEquationSetup * fEquationSetup
Definition: G4mplAtlasTransportation.h:234
G4mplAtlasTransportation::EnableShortStepOptimisation
void EnableShortStepOptimisation(G4bool optimise=true)
G4mplAtlasTransportation::fShortStepOptimisation
G4bool fShortStepOptimisation
Definition: G4mplAtlasTransportation.h:223
G4mplAtlasTransportation::fParticleChange
G4ParticleChangeForTransport fParticleChange
Definition: G4mplAtlasTransportation.h:199
G4mplAtlasTransportation::fCurrentTouchableHandle
G4TouchableHandle fCurrentTouchableHandle
Definition: G4mplAtlasTransportation.h:185
G4mplAtlasTransportation::fEndGlobalTimeComputed
G4bool fEndGlobalTimeComputed
Definition: G4mplAtlasTransportation.h:179
G4mplAtlasTransportation::PostStepGetPhysicalInteractionLength
G4double PostStepGetPhysicalInteractionLength(const G4Track &, G4double previousStepSize, G4ForceCondition *pForceCond)
Definition: G4mplAtlasTransportation.cxx:694
G4mplAtlasTransportation::fMomentumChanged
G4bool fMomentumChanged
Definition: G4mplAtlasTransportation.h:177
G4mplAtlasTransportation::fpSafetyHelper
G4SafetyHelper * fpSafetyHelper
Definition: G4mplAtlasTransportation.h:225
G4mplAtlasTransportation::SetThresholdImportantEnergy
void SetThresholdImportantEnergy(G4double newEnImp)
G4mplAtlasTransportation::SetThresholdWarningEnergy
void SetThresholdWarningEnergy(G4double newEnWarn)
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
G4mplAtlasTransportation::fTransportEndMomentumDir
G4ThreeVector fTransportEndMomentumDir
Definition: G4mplAtlasTransportation.h:174
G4mplAtlasTransportation::AtRestGetPhysicalInteractionLength
G4double AtRestGetPhysicalInteractionLength(const G4Track &, G4ForceCondition *)
Definition: G4mplAtlasTransportation.h:139
G4mplAtlasTransportation::fLinearNavigator
G4Navigator * fLinearNavigator
Definition: G4mplAtlasTransportation.h:166
CustomMonopole
Definition: CustomMonopole.h:34