ATLAS Offline Software
QuirkTransportation.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: QuirkTransportation.h 583415 2014-02-14 16:44:26Z jblack $
28 // GEANT4 tag $Name: geant4-09-04-patch-01 $
29 //
30 //
31 // ------------------------------------------------------------
32 // GEANT 4 include file implementation
33 // ------------------------------------------------------------
34 //
35 // Class description:
36 //
37 // G4Transportation 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 // Created: 19 March 1997, J. Apostolakis
44 // =======================================================================
45 #ifndef QUIRKTRANSPORTATION_H
46 #define QUIRKTRANSPORTATION_H
47 
48 #include "G4VProcess.hh"
49 #include "G4FieldManager.hh"
50 
51 #include "G4Navigator.hh"
52 #include "G4TransportationManager.hh"
53 #include "G4PropagatorInField.hh"
54 #include "G4Track.hh"
55 #include "G4Step.hh"
56 #include "G4ParticleChangeForTransport.hh"
57 class G4SafetyHelper;
58 
59 class QuirkTransportation : public G4VProcess
60 {
61  // Concrete class that does the geometrical transport
62 
63  public: // with description
64 
65  QuirkTransportation( G4int verbosityLevel= 1);
67 
69  const G4Track& track,
70  G4double previousStepSize,
71  G4double currentMinimumStep,
72  G4double& currentSafety,
73  G4GPILSelection* selection
74  );
75 
76  G4VParticleChange* AlongStepDoIt(
77  const G4Track& track,
78  const G4Step& stepData
79  );
80 
81  G4VParticleChange* PostStepDoIt(
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 
95  G4PropagatorInField* GetPropagatorInField();
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  public: // without description
126 
128  const G4Track& ,
129  G4ForceCondition*
130  ) { return -1.0; };
131  // No operation in AtRestDoIt.
132 
133  G4VParticleChange* AtRestDoIt(
134  const G4Track& ,
135  const G4Step&
136  ) {return 0;};
137  // No operation in AtRestDoIt.
138 
139  void StartTracking(G4Track* aTrack);
140  // Reset state for new (potentially resumed) track
141 
142  protected:
143 
145  // Checks whether a field exists for the "global" field manager.
146 
147  private:
148 
149  G4Navigator* m_linearNavigator;
150  G4PropagatorInField* m_fieldPropagator;
151  // The Propagators used to transport the particle
152 
153  // G4FieldManager* fGlobalFieldMgr; // Used MagneticField CC
154  // Field Manager for the whole Detector
155 
156  G4ThreeVector m_transportEndPosition;
159  G4ThreeVector m_transportEndSpin;
162  // The particle's state after this Step, Store for DoIt
163 
165 
166  G4TouchableHandle m_currentTouchableHandle;
167 
168  // G4bool fFieldExists;
169  // Whether a magnetic field exists ...
170  // A data member for this is problematic: it is useful only if it
171  // can be initialised and updated -- and a scheme is not yet possible.
172 
174  // Flag to determine whether a boundary was reached.
175 
176  G4ThreeVector m_previousSftOrigin;
177  G4double m_previousSafety;
178  // Remember last safety origin & value.
179 
180  G4ParticleChangeForTransport m_particleChange;
181  // New ParticleChange
182 
184 
185  // Thresholds for looping particles:
186  //
187  G4double m_threshold_Warning_Energy; // Warn above this energy
188  G4double m_threshold_Important_Energy; // Hesitate above this
189  G4int m_thresholdTrials; // for this no of trials
190 
191  // Counter for steps in which particle reports 'looping',
192  // if it is above 'Important' Energy
194  // Statistics for tracks abandoned
197 
198  // Whether to avoid calling G4Navigator for short step ( < safety)
199  // If using it, the safety estimate for endpoint will likely be smaller.
201 
202  G4SafetyHelper* m_safetyHelper; // To pass it the safety value obtained
203 
204  // Verbosity
206  // Verbosity level for warnings
207  // eg about energy non-conservation in magnetic field.
208 };
209 
210 #include "QuirkTransportation.icc"
211 
212 #endif
QuirkTransportation.icc
QuirkTransportation::m_threshold_Warning_Energy
G4double m_threshold_Warning_Energy
Definition: QuirkTransportation.h:187
QuirkTransportation::GetThresholdTrials
G4int GetThresholdTrials() const
QuirkTransportation::GetThresholdImportantEnergy
G4double GetThresholdImportantEnergy() const
QuirkTransportation::m_endpointDistance
G4double m_endpointDistance
Definition: QuirkTransportation.h:183
QuirkTransportation
Definition: QuirkTransportation.h:60
QuirkTransportation::m_transportEndPosition
G4ThreeVector m_transportEndPosition
Definition: QuirkTransportation.h:156
QuirkTransportation::StartTracking
void StartTracking(G4Track *aTrack)
Definition: QuirkTransportation.cxx:590
QuirkTransportation::m_transportEndKineticEnergy
G4double m_transportEndKineticEnergy
Definition: QuirkTransportation.h:158
QuirkTransportation::DoesGlobalFieldExist
G4bool DoesGlobalFieldExist()
QuirkTransportation::m_momentumChanged
G4bool m_momentumChanged
Definition: QuirkTransportation.h:160
checkTP.report
report
Definition: checkTP.py:127
QuirkTransportation::m_particleIsLooping
G4bool m_particleIsLooping
Definition: QuirkTransportation.h:164
QuirkTransportation::SetThresholdTrials
void SetThresholdTrials(G4int newMaxTrials)
QuirkTransportation::GetVerboseLevel
G4int GetVerboseLevel() const
QuirkTransportation::AlongStepGetPhysicalInteractionLength
G4double AlongStepGetPhysicalInteractionLength(const G4Track &track, G4double previousStepSize, G4double currentMinimumStep, G4double &currentSafety, G4GPILSelection *selection)
Definition: QuirkTransportation.cxx:136
QuirkTransportation::EnableShortStepOptimisation
void EnableShortStepOptimisation(G4bool optimise=true)
QuirkTransportation::SetVerboseLevel
void SetVerboseLevel(G4int verboseLevel)
QuirkTransportation::AtRestGetPhysicalInteractionLength
G4double AtRestGetPhysicalInteractionLength(const G4Track &, G4ForceCondition *)
Definition: QuirkTransportation.h:127
QuirkTransportation::m_particleChange
G4ParticleChangeForTransport m_particleChange
Definition: QuirkTransportation.h:180
QuirkTransportation::GetMaxEnergyKilled
G4double GetMaxEnergyKilled() const
QuirkTransportation::m_candidateEndGlobalTime
G4double m_candidateEndGlobalTime
Definition: QuirkTransportation.h:161
QuirkTransportation::m_fieldPropagator
G4PropagatorInField * m_fieldPropagator
Definition: QuirkTransportation.h:150
QuirkTransportation::m_transportEndMomentumDir
G4ThreeVector m_transportEndMomentumDir
Definition: QuirkTransportation.h:157
QuirkTransportation::PostStepDoIt
G4VParticleChange * PostStepDoIt(const G4Track &track, const G4Step &stepData)
Definition: QuirkTransportation.cxx:464
QuirkTransportation::AtRestDoIt
G4VParticleChange * AtRestDoIt(const G4Track &, const G4Step &)
Definition: QuirkTransportation.h:133
QuirkTransportation::m_geometryLimitedStep
G4bool m_geometryLimitedStep
Definition: QuirkTransportation.h:173
QuirkTransportation::GetPropagatorInField
G4PropagatorInField * GetPropagatorInField()
QuirkTransportation::~QuirkTransportation
~QuirkTransportation()
Definition: QuirkTransportation.cxx:119
QuirkTransportation::m_linearNavigator
G4Navigator * m_linearNavigator
Definition: QuirkTransportation.h:149
QuirkTransportation::ResetKilledStatistics
void ResetKilledStatistics(G4int report=1)
QuirkTransportation::m_transportEndSpin
G4ThreeVector m_transportEndSpin
Definition: QuirkTransportation.h:159
QuirkTransportation::m_shortStepOptimisation
G4bool m_shortStepOptimisation
Definition: QuirkTransportation.h:200
selection
const std::string selection
Definition: fbtTestBasics.cxx:74
QuirkTransportation::m_currentTouchableHandle
G4TouchableHandle m_currentTouchableHandle
Definition: QuirkTransportation.h:166
QuirkTransportation::GetSumEnergyKilled
G4double GetSumEnergyKilled() const
QuirkTransportation::m_thresholdTrials
G4int m_thresholdTrials
Definition: QuirkTransportation.h:189
QuirkTransportation::PostStepGetPhysicalInteractionLength
G4double PostStepGetPhysicalInteractionLength(const G4Track &, G4double previousStepSize, G4ForceCondition *pForceCond)
Definition: QuirkTransportation.cxx:453
QuirkTransportation::m_threshold_Important_Energy
G4double m_threshold_Important_Energy
Definition: QuirkTransportation.h:188
QuirkTransportation::GetThresholdWarningEnergy
G4double GetThresholdWarningEnergy() const
QuirkTransportation::QuirkTransportation
QuirkTransportation(G4int verbosityLevel=1)
Definition: QuirkTransportation.cxx:79
QuirkTransportation::AlongStepDoIt
G4VParticleChange * AlongStepDoIt(const G4Track &track, const G4Step &stepData)
Definition: QuirkTransportation.cxx:353
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
QuirkTransportation::m_safetyHelper
G4SafetyHelper * m_safetyHelper
Definition: QuirkTransportation.h:202
QuirkTransportation::SetThresholdImportantEnergy
void SetThresholdImportantEnergy(G4double newEnImp)
QuirkTransportation::m_noLooperTrials
G4int m_noLooperTrials
Definition: QuirkTransportation.h:193
QuirkTransportation::m_previousSafety
G4double m_previousSafety
Definition: QuirkTransportation.h:177
QuirkTransportation::m_verboseLevel
G4int m_verboseLevel
Definition: QuirkTransportation.h:205
QuirkTransportation::SetThresholdWarningEnergy
void SetThresholdWarningEnergy(G4double newEnWarn)
QuirkTransportation::m_maxEnergyKilled
G4double m_maxEnergyKilled
Definition: QuirkTransportation.h:196
QuirkTransportation::SetPropagatorInField
void SetPropagatorInField(G4PropagatorInField *pFieldPropagator)
QuirkTransportation::m_sumEnergyKilled
G4double m_sumEnergyKilled
Definition: QuirkTransportation.h:195
QuirkTransportation::m_previousSftOrigin
G4ThreeVector m_previousSftOrigin
Definition: QuirkTransportation.h:176