ATLAS Offline Software
Loading...
Searching...
No Matches
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"
57class G4SafetyHelper;
58
59class 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
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;
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
211
212#endif
void SetThresholdImportantEnergy(G4double newEnImp)
G4VParticleChange * AtRestDoIt(const G4Track &, const G4Step &)
G4ThreeVector m_previousSftOrigin
G4double GetSumEnergyKilled() const
G4PropagatorInField * m_fieldPropagator
void SetThresholdTrials(G4int newMaxTrials)
G4ThreeVector m_transportEndPosition
G4Navigator * m_linearNavigator
G4ThreeVector m_transportEndSpin
void StartTracking(G4Track *aTrack)
G4double AtRestGetPhysicalInteractionLength(const G4Track &, G4ForceCondition *)
G4double GetMaxEnergyKilled() const
G4double GetThresholdImportantEnergy() const
G4ParticleChangeForTransport m_particleChange
G4ThreeVector m_transportEndMomentumDir
G4double GetThresholdWarningEnergy() const
void SetPropagatorInField(G4PropagatorInField *pFieldPropagator)
G4VParticleChange * PostStepDoIt(const G4Track &track, const G4Step &stepData)
G4int GetVerboseLevel() const
G4SafetyHelper * m_safetyHelper
void ResetKilledStatistics(G4int report=1)
G4VParticleChange * AlongStepDoIt(const G4Track &track, const G4Step &stepData)
G4TouchableHandle m_currentTouchableHandle
G4double PostStepGetPhysicalInteractionLength(const G4Track &, G4double previousStepSize, G4ForceCondition *pForceCond)
void SetVerboseLevel(G4int verboseLevel)
G4int GetThresholdTrials() const
G4bool DoesGlobalFieldExist()
void SetThresholdWarningEnergy(G4double newEnWarn)
void EnableShortStepOptimisation(G4bool optimise=true)
G4double AlongStepGetPhysicalInteractionLength(const G4Track &track, G4double previousStepSize, G4double currentMinimumStep, G4double &currentSafety, G4GPILSelection *selection)
G4PropagatorInField * GetPropagatorInField()
QuirkTransportation(G4int verbosityLevel=1)
const std::string selection