Geant4  10.02.p02
G4ITTransportation.hh
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 // $Id: G4ITTransportation.hh 94218 2015-11-09 08:24:48Z gcosmo $
27 //
31 //
32 // Original Author : John Apostolakis
33 //
34 // Contact : Mathieu Karamitros (kara (AT) cenbg . in2p3 . fr)
35 //
36 // WARNING : This class is released as a prototype.
37 // It might strongly evolve or even disapear in the next releases.
38 //
39 // -------------------------------------------------------------------
40 // Author: Mathieu Karamitros, kara@cenbg.in2p3.fr
41 
42 // The code is developed in the framework of the ESA AO7146
43 //
44 // We would be very happy hearing from you, send us your feedback! :)
45 //
46 // In order for Geant4-DNA to be maintained and still open-source,
47 // article citations are crucial.
48 // If you use Geant4-DNA chemistry and you publish papers about your software,
49 // in addition to the general paper on Geant4-DNA:
50 //
51 // Int. J. Model. Simul. Sci. Comput. 1 (2010) 157–178
52 //
53 // we would be very happy if you could please also cite the following
54 // reference papers on chemistry:
55 //
56 // J. Comput. Phys. 274 (2014) 841-882
57 // Prog. Nucl. Sci. Tec. 2 (2011) 503-508
58 
59 #ifndef G4ITTransportation_H
60 #define G4ITTransportation_H
61 
62 #include <CLHEP/Units/SystemOfUnits.h>
63 
64 #include "G4VITProcess.hh"
65 #include "G4Track.hh"
66 #include "G4Step.hh"
68 
69 class G4ITNavigator;
70 //class G4Navigator;
71 class G4ITSafetyHelper;
73 
75 {
76  // Concrete class that does the geometrical transport
77 public:
78  // with description
79 
80  G4ITTransportation(const G4String& aName = "ITTransportation",
81  G4int verbosityLevel = 0);
82  virtual ~G4ITTransportation();
83 
85 
87 
88  virtual void BuildPhysicsTable(const G4ParticleDefinition&);
89 
90  virtual void ComputeStep(const G4Track&,
91  const G4Step&,
92  const double timeStep,
93  double& spaceStep);
94 
95  virtual void StartTracking(G4Track* aTrack);
96  // Give to the track a pointer to the transportation state
97 
99  {
100  return GetState<G4ITTransportationState>()->fGeometryLimitedStep;
101  }
102 
103  //________________________________________________________
104 public:
105  // without description
106 
109  {
110  return -1.0;
111  }
112  // No operation in AtRestDoIt.
113 
114  virtual G4VParticleChange* AtRestDoIt(const G4Track&, const G4Step&)
115  {
116  return 0;
117  }
118  // No operation in AtRestDoIt.
119 
121  G4double, // previousStepSize
122  G4double currentMinimumStep,
123  G4double& currentSafety,
124  G4GPILSelection* selection);
125 
126  virtual G4double PostStepGetPhysicalInteractionLength(const G4Track&, // track
127  G4double, // previousStepSize
128  G4ForceCondition* pForceCond);
129 
130  virtual G4VParticleChange* AlongStepDoIt(const G4Track& track,
131  const G4Step& stepData);
132 
133  virtual G4VParticleChange* PostStepDoIt(const G4Track& track, const G4Step&);
134 
135  //________________________________________________________
136  // inline virtual G4double GetTransportationTime() ;
137 
139  void SetPropagatorInField(G4PropagatorInField* pFieldPropagator);
140  // Access/set the assistant class that Propagate in a Field.
141 
142  inline void SetVerboseLevel(G4int verboseLevel);
143  inline G4int GetVerboseLevel() const;
144  // Level of warnings regarding eg energy conservation
145  // in field integration.
146 
147  inline G4double GetThresholdWarningEnergy() const;
148  inline G4double GetThresholdImportantEnergy() const;
149  inline G4int GetThresholdTrials() const;
150 
151  inline void SetThresholdWarningEnergy(G4double newEnWarn);
152  inline void SetThresholdImportantEnergy(G4double newEnImp);
153  inline void SetThresholdTrials(G4int newMaxTrials);
154 
155  // Get/Set parameters for killing loopers:
156  // Above 'important' energy a 'looping' particle in field will
157  // *NOT* be abandoned, except after fThresholdTrials attempts.
158  // Below Warning energy, no verbosity for looping particles is issued
159 
160  inline G4double GetMaxEnergyKilled() const;
161  inline G4double GetSumEnergyKilled() const;
162  inline void ResetKilledStatistics(G4int report = 1);
163  // Statistics for tracks killed (currently due to looping in field)
164 
165  inline void EnableShortStepOptimisation(G4bool optimise = true);
166  // Whether short steps < safety will avoid to call Navigator (if field=0)
167 
168 protected:
169  //________________________________________________________________
170  // Protected methods
172  // Checks whether a field exists for the "global" field manager.
173 
174  //________________________________________________________________
175  // Process information
177  {
178  public:
180  virtual ~G4ITTransportationState();
181  virtual G4String GetType()
182  {
183  return "G4ITTransportationState";
184  }
185 
195  // The particle's state after this Step, Store for DoIt
196 
199  // Flag to determine whether a boundary was reached.
200 
203  // Remember last safety origin & value.
204 
205  // Counter for steps in which particle reports 'looping',
206  // if it is above 'Important' Energy
208 
209  // G4bool fFieldExists;
210  // Whether a magnetic field exists ...
211  // A data member for this is problematic: it is useful only if it
212  // can be initialised and updated -- and a scheme is not yet possible.
213 
215  };
216 
217  //________________________________________________________________
218  // Informations relative to the process only (meaning no information
219  // relative to the treated particle)
220  G4ITNavigator* fLinearNavigator;
222  // The Propagators used to transport the particle
223 
224  // static const G4TouchableHandle nullTouchableHandle;
225  // Points to (G4VTouchable*) 0
226 
228  // New ParticleChange
229 
230  // Thresholds for looping particles:
231  //
232  G4double fThreshold_Warning_Energy; // Warn above this energy
233  G4double fThreshold_Important_Energy; // Hesitate above this
234  G4int fThresholdTrials; // for this no of trials
235  // Above 'important' energy a 'looping' particle in field will
236  // *NOT* be abandoned, except after fThresholdTrials attempts.
238  // Below this energy, no verbosity for looping particles is issued
239 
240  // Statistics for tracks abandoned
243 
244  // Whether to avoid calling G4Navigator for short step ( < safety)
245  // If using it, the safety estimate for endpoint will likely be smaller.
247 
248  G4ITSafetyHelper* fpSafetyHelper; // To pass it the safety value obtained
249 
250  // Verbosity
252  // Verbosity level for warnings
253  // eg about energy non-conservation in magnetic field.
254 
256  {
258  }
259 
261  {
263  }
264 
265 private:
268 };
269 
270 #include "G4ITTransportation.icc"
271 #endif // G4ITTransportation_H
G4int GetThresholdTrials() const
#define G4IT_ADD_CLONE(parent_class, kid_class)
Definition: AddClone_def.hh:53
G4PropagatorInField * GetPropagatorInField()
G4ParticleChangeForTransport fParticleChange
G4int verboseLevel
Definition: G4VProcess.hh:368
CLHEP::Hep3Vector G4ThreeVector
virtual void BuildPhysicsTable(const G4ParticleDefinition &)
void EnableShortStepOptimisation(G4bool optimise=true)
G4int GetVerboseLevel() const
virtual G4VParticleChange * PostStepDoIt(const G4Track &track, const G4Step &)
virtual G4VParticleChange * AlongStepDoIt(const G4Track &track, const G4Step &stepData)
void SetPropagatorInField(G4PropagatorInField *pFieldPropagator)
virtual G4double AlongStepGetPhysicalInteractionLength(const G4Track &track, G4double, G4double currentMinimumStep, G4double &currentSafety, G4GPILSelection *selection)
virtual G4VParticleChange * AtRestDoIt(const G4Track &, const G4Step &)
G4double GetSumEnergyKilled() const
int G4int
Definition: G4Types.hh:78
void SetThresholdTrials(G4int newMaxTrials)
G4double GetThresholdWarningEnergy() const
G4ITNavigator * fLinearNavigator
void SetThresholdWarningEnergy(G4double newEnWarn)
virtual G4double AtRestGetPhysicalInteractionLength(const G4Track &, G4ForceCondition *)
G4ITTransportation & operator=(const G4ITTransportation &)
virtual void StartTracking(G4Track *aTrack)
virtual G4double PostStepGetPhysicalInteractionLength(const G4Track &, G4double, G4ForceCondition *pForceCond)
virtual void ComputeStep(const G4Track &, const G4Step &, const double timeStep, double &spaceStep)
bool G4bool
Definition: G4Types.hh:79
G4double GetThresholdImportantEnergy() const
G4PropagatorInField * fFieldPropagator
void SetVerboseLevel(G4int verboseLevel)
void SetInstantiateProcessState(G4bool flag)
Definition: G4Step.hh:76
G4ITSafetyHelper * fpSafetyHelper
G4ITTransportation(const G4String &aName="ITTransportation", G4int verbosityLevel=0)
void SetThresholdImportantEnergy(G4double newEnImp)
double G4double
Definition: G4Types.hh:76
G4double fThreshold_Important_Energy
void ResetKilledStatistics(G4int report=1)
G4ForceCondition
G4VITProcess inherits from G4VProcess.
Definition: G4VITProcess.hh:99
G4double GetMaxEnergyKilled() const
G4GPILSelection