ATLAS Offline Software
Loading...
Searching...
No Matches
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
68class G4SafetyHelper;
69class CustomMonopole;
70
71class G4mplAtlasTransportation : public G4VProcess
72{
73 // Concrete class that does the geometrical transport
74
75public: // 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
137public: // 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
157protected:
158
160 // Checks whether a field exists for the "global" field manager.
161
162private:
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
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;
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
G4VParticleChange * AtRestDoIt(const G4Track &, const G4Step &)
G4int GetVerboseLevel() const
G4int GetThresholdTrials() const
void SetPropagatorInField(G4PropagatorInField *pFieldPropagator)
G4double AtRestGetPhysicalInteractionLength(const G4Track &, G4ForceCondition *)
G4double GetSumEnergyKilled() const
void SetThresholdTrials(G4int newMaxTrials)
G4VParticleChange * PostStepDoIt(const G4Track &track, const G4Step &stepData)
G4PropagatorInField * GetPropagatorInField()
void ResetKilledStatistics(G4int report=1)
void EnableShortStepOptimisation(G4bool optimise=true)
G4double GetThresholdImportantEnergy() const
void SetThresholdImportantEnergy(G4double newEnImp)
G4PropagatorInField * fFieldPropagator
G4ParticleChangeForTransport fParticleChange
G4double AlongStepGetPhysicalInteractionLength(const G4Track &track, G4double previousStepSize, G4double currentMinimumStep, G4double &currentSafety, G4GPILSelection *selection)
G4double PostStepGetPhysicalInteractionLength(const G4Track &, G4double previousStepSize, G4ForceCondition *pForceCond)
const CustomMonopole * mplParticle
G4double GetThresholdWarningEnergy() const
void SetThresholdWarningEnergy(G4double newEnWarn)
G4mplAtlasTransportation(const CustomMonopole *p, G4int verbosityLevel=1)
G4VParticleChange * AlongStepDoIt(const G4Track &track, const G4Step &stepData)
void SetVerboseLevel(G4int verboseLevel)
G4double GetMaxEnergyKilled() const
const std::string selection