Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
G4CoupledTransportation.hh
이 파일의 문서화 페이지로 가기
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: G4CoupledTransportation.hh 110805 2018-06-15 06:52:15Z gcosmo $
28 //
29 //
30 // ------------------------------------------------------------
31 // GEANT 4 include file implementation
32 // ------------------------------------------------------------
33 //
34 // Class description:
35 //
36 // G4CoupledTransportation is an optional process to transport
37 // a particle, in case of coupled navigation in parallel geometries
38 // i.e. the geometrical propagation will be done
39 // encountering the geometrical volumes of the detectors and
40 // those of parallel geometries (eg for biasing, scoring, fast simulation)
41 // It is tasked with updating the "safety" to reflect the geometrical
42 // distance to the nearest volume, and the time of flight of the particle.
43 
44 // =======================================================================
45 // Created: 17 May 2006, J. Apostolakis
46 // =======================================================================
47 #ifndef G4CoupledTransportation_hh
48 #define G4CoupledTransportation_hh 1
49 
50 #include "G4VProcess.hh"
51 
52 #include "G4FieldManager.hh"
53 
54 #include "G4Navigator.hh"
56 #include "G4PropagatorInField.hh"
57 #include "G4PathFinder.hh"
58 
59 #include "G4Track.hh"
60 #include "G4Step.hh"
62 
63 class G4SafetyHelper;
65 
67 {
68  // Concrete class that does the geometrical transport
69 
70  public: // with description
71 
72  G4CoupledTransportation( G4int verbosityLevel= 0);
74 
76  const G4Track& track,
77  G4double previousStepSize,
78  G4double currentMinimumStep,
79  G4double& currentSafety,
80  G4GPILSelection* selection
81  );
82 
84  const G4Track& track,
85  const G4Step& stepData
86  );
87 
89  const G4Track& track,
90  const G4Step& stepData
91  );
92  // Responsible for the relocation
93 
95  const G4Track& ,
96  G4double previousStepSize,
97  G4ForceCondition* pForceCond
98  );
99  // Forces the PostStepDoIt action to be called,
100  // but does not limit the step
101 
103  void SetPropagatorInField( G4PropagatorInField* pFieldPropagator);
104  // Access/set the assistant class that Propagate in a Field
105 
106  inline G4double GetThresholdWarningEnergy() const;
107  inline G4double GetThresholdImportantEnergy() const;
108  inline G4int GetThresholdTrials() const;
109 
110  inline void SetThresholdWarningEnergy( G4double newEnWarn );
111  inline void SetThresholdImportantEnergy( G4double newEnImp );
112  inline void SetThresholdTrials(G4int newMaxTrials );
113 
114  // Get/Set parameters for killing loopers:
115  // Above 'important' energy a 'looping' particle in field will
116  // *NOT* be abandoned, except after fThresholdTrials attempts.
117  // Below Warning energy, no verbosity for looping particles is issued
118 
119  inline G4double GetMaxEnergyKilled() const;
120  inline G4double GetSumEnergyKilled() const;
121  inline void ResetKilledStatistics( G4int report = 1);
122  // Statistics for tracks killed (currently due to looping in field)
123 
124  static G4bool EnableUseMagneticMoment(G4bool useMoment=true);
125  // Whether to deflect particles with force due to magnetic moment
126 
127  static void SetSignifyStepsInAnyVolume( G4bool anyVol )
128  { fSignifyStepInAnyVolume = anyVol; }
130  { return fSignifyStepInAnyVolume; }
131  // Flag in step corresponds to first/last step in a volume 'any'
132  // geometry (if this is true) or refers to first/last step in mass
133  // geometry only (if false)
134 
135  // The following methods give access to first/last step in particular
136  // geometry *independent* of the choice of the 'Signify' flag
137  //
142 
143  public: // without description
144 
145  void StartTracking(G4Track* aTrack);
146  void EndTracking();
147 
150  { return -1.0; } // No operation in AtRestGPIL
151 
153  { return 0; } // No operation in AtRestDoIt
154 
155  protected:
156 
158  // Checks whether a field exists for the "global" field manager
159 
160  void ReportInexactEnergy(G4double startEnergy, G4double endEnergy);
161  // Issue warning
162 
163  void ReportMove( G4ThreeVector OldVector, G4ThreeVector NewVector,
164  const G4String& Quantity );
165 
166  // void ReportLoopingTrack( .. ) -> Moved to Logger class
167  // Warn about dropping of tracks that repeatedly exceed number of
168  // iterations for propagaton in field
169 
170  private:
171 
173  // The navigator for the 'mass' geometry
174  // (the real one, that physics occurs in)
177  // The PathFinder used to transport the particle
178 
180  // Still required in order to find/set the fieldmanager
181 
183  // G4bool fStartedNewTrack; // True for first step or restarted tracking
184  // until first step's AlongStepGPIL
185 
191  // The particle's state after this Step, Store for DoIt
192 
195 
201 
203 
204  // G4bool fFieldExists;
205  // Whether a magnetic field exists ...
206  // A data member for this is problematic: it is useful only if it
207  // can be initialised and updated -- and a scheme is not yet possible.
208 
210  // Flag to determine whether a 'mass' boundary was reached.
212  // Did any geometry limit the step ?
213 
215  // New ParticleChange
216 
218 
219 
220  // Thresholds for looping particles:
221  //
222  G4double fThreshold_Warning_Energy; // Warn above this energy
223  G4double fThreshold_Important_Energy; // Hesitate above this
224  G4int fThresholdTrials; // for this no of trials
225  // Above 'important' energy a 'looping' particle in field will
226  // *NOT* be abandoned, except after fThresholdTrials attempts.
227 
228  // Counter for steps in which particle reports 'looping',
229  // if it is above 'Important' Energy
230  //
232 
233  // Statistics for tracks abandoned
234  //
237 
238  G4SafetyHelper* fpSafetyHelper; // To pass it the safety value obtained
239  G4TransportationLogger* fpLogger; // Reports issues / raises warnings
240 
241  private:
242 
243  friend class G4Transportation;
245 
246  private:
247 
250  // G4bool fLastStepInMassVolume; => use fMassGeometryLimitedStep
251  // G4bool fLastStepInAnyVolume; => use fAnyGeometryLimitedStep
252 
254  // True: First/Last step in any one of the geometries
255  // False: First/Last step in volume of 'mass' geometry
256 };
257 
258 #include "G4CoupledTransportation.icc"
259 
260 #endif
G4double GetMaxEnergyKilled() const
void ReportInexactEnergy(G4double startEnergy, G4double endEnergy)
G4double GetThresholdImportantEnergy() const
G4VParticleChange * AtRestDoIt(const G4Track &, const G4Step &)
void ReportMove(G4ThreeVector OldVector, G4ThreeVector NewVector, const G4String &Quantity)
G4TransportationLogger * fpLogger
G4ParticleChangeForTransport fParticleChange
G4VParticleChange * PostStepDoIt(const G4Track &track, const G4Step &stepData)
G4PropagatorInField * fFieldPropagator
G4double GetThresholdWarningEnergy() const
void SetThresholdTrials(G4int newMaxTrials)
void SetPropagatorInField(G4PropagatorInField *pFieldPropagator)
double G4double
Definition: G4Types.hh:76
bool G4bool
Definition: G4Types.hh:79
void ResetKilledStatistics(G4int report=1)
void SetThresholdWarningEnergy(G4double newEnWarn)
G4PropagatorInField * GetPropagatorInField()
G4GPILSelection
G4double AlongStepGetPhysicalInteractionLength(const G4Track &track, G4double previousStepSize, G4double currentMinimumStep, G4double &currentSafety, G4GPILSelection *selection)
void StartTracking(G4Track *aTrack)
static void SetSignifyStepsInAnyVolume(G4bool anyVol)
Definition: G4Step.hh:76
G4double GetSumEnergyKilled() const
static G4bool GetSignifyStepsInAnyVolume()
int G4int
Definition: G4Types.hh:78
G4double PostStepGetPhysicalInteractionLength(const G4Track &, G4double previousStepSize, G4ForceCondition *pForceCond)
static G4bool EnableUseMagneticMoment(G4bool useMoment=true)
G4double AtRestGetPhysicalInteractionLength(const G4Track &, G4ForceCondition *)
G4TouchableHandle fCurrentTouchableHandle
G4ForceCondition
G4int GetThresholdTrials() const
G4VParticleChange * AlongStepDoIt(const G4Track &track, const G4Step &stepData)
void SetThresholdImportantEnergy(G4double newEnImp)
G4CoupledTransportation(G4int verbosityLevel=0)