Geant4  10.01.p03
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 87375 2014-12-02 08:17:28Z 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 "G4IT.hh"
65 #include "G4VITProcess.hh"
66 #include "G4Track.hh"
67 #include "G4Step.hh"
69 
70 class G4ITNavigator;
71 //class G4Navigator;
72 class G4ITSafetyHelper;
74 
76 {
77  // Concrete class that does the geometrical transport
78 public:
79  // with description
80 
81  G4ITTransportation(const G4String& aName = "ITTransportation",
82  G4int verbosityLevel = 0);
83  virtual ~G4ITTransportation();
84 
86 
88 
89  virtual void BuildPhysicsTable(const G4ParticleDefinition&);
90 
91  virtual void ComputeStep(const G4Track&,
92  const G4Step&,
93  const double timeStep,
94  double& spaceStep);
95 
96  virtual void StartTracking(G4Track* aTrack);
97  // Give to the track a pointer to the transportation state
98 
99  //________________________________________________________
100 public:
101  // without description
102 
105  {
106  return -1.0;
107  }
108  // No operation in AtRestDoIt.
109 
110  virtual G4VParticleChange* AtRestDoIt(const G4Track&, const G4Step&)
111  {
112  return 0;
113  }
114  // No operation in AtRestDoIt.
115 
117  G4double, // previousStepSize
118  G4double currentMinimumStep,
119  G4double& currentSafety,
120  G4GPILSelection* selection);
121 
122  virtual G4double PostStepGetPhysicalInteractionLength(const G4Track&, // track
123  G4double, // previousStepSize
124  G4ForceCondition* pForceCond);
125 
126  virtual G4VParticleChange* AlongStepDoIt(const G4Track& track,
127  const G4Step& stepData);
128 
129  virtual G4VParticleChange* PostStepDoIt(const G4Track& track, const G4Step&);
130 
131  //________________________________________________________
132  // inline virtual G4double GetTransportationTime() ;
133 
135  void SetPropagatorInField(G4PropagatorInField* pFieldPropagator);
136  // Access/set the assistant class that Propagate in a Field.
137 
138  inline void SetVerboseLevel(G4int verboseLevel);
139  inline G4int GetVerboseLevel() const;
140  // Level of warnings regarding eg energy conservation
141  // in field integration.
142 
143  inline G4double GetThresholdWarningEnergy() const;
144  inline G4double GetThresholdImportantEnergy() const;
145  inline G4int GetThresholdTrials() const;
146 
147  inline void SetThresholdWarningEnergy(G4double newEnWarn);
148  inline void SetThresholdImportantEnergy(G4double newEnImp);
149  inline void SetThresholdTrials(G4int newMaxTrials);
150 
151  // Get/Set parameters for killing loopers:
152  // Above 'important' energy a 'looping' particle in field will
153  // *NOT* be abandoned, except after fThresholdTrials attempts.
154  // Below Warning energy, no verbosity for looping particles is issued
155 
156  inline G4double GetMaxEnergyKilled() const;
157  inline G4double GetSumEnergyKilled() const;
158  inline void ResetKilledStatistics(G4int report = 1);
159  // Statistics for tracks killed (currently due to looping in field)
160 
161  inline void EnableShortStepOptimisation(G4bool optimise = true);
162  // Whether short steps < safety will avoid to call Navigator (if field=0)
163 
164 protected:
165  //________________________________________________________________
166  // Protected methods
168  // Checks whether a field exists for the "global" field manager.
169 
170  //________________________________________________________________
171  // Process information
173  {
174  public:
176  virtual ~G4ITTransportationState();
177  virtual G4String GetType()
178  {
179  return "G4ITTransportationState";
180  }
181 
191  // The particle's state after this Step, Store for DoIt
192 
195  // Flag to determine whether a boundary was reached.
196 
199  // Remember last safety origin & value.
200 
201  // Counter for steps in which particle reports 'looping',
202  // if it is above 'Important' Energy
204 
205  // G4bool fFieldExists;
206  // Whether a magnetic field exists ...
207  // A data member for this is problematic: it is useful only if it
208  // can be initialised and updated -- and a scheme is not yet possible.
209 
211  };
212 
213  //________________________________________________________________
214  // Informations relative to the process only (meaning no information
215  // relative to the treated particle)
216  G4ITNavigator* fLinearNavigator;
218  // The Propagators used to transport the particle
219 
220  // static const G4TouchableHandle nullTouchableHandle;
221  // Points to (G4VTouchable*) 0
222 
224  // New ParticleChange
225 
226  // Thresholds for looping particles:
227  //
228  G4double fThreshold_Warning_Energy; // Warn above this energy
229  G4double fThreshold_Important_Energy; // Hesitate above this
230  G4int fThresholdTrials; // for this no of trials
231  // Above 'important' energy a 'looping' particle in field will
232  // *NOT* be abandoned, except after fThresholdTrials attempts.
234  // Below this energy, no verbosity for looping particles is issued
235 
236  // Statistics for tracks abandoned
239 
240  // Whether to avoid calling G4Navigator for short step ( < safety)
241  // If using it, the safety estimate for endpoint will likely be smaller.
243 
244  G4ITSafetyHelper* fpSafetyHelper; // To pass it the safety value obtained
245 
246  // Verbosity
248  // Verbosity level for warnings
249  // eg about energy non-conservation in magnetic field.
250 
252  {
254  }
255 
257  {
259  }
260 
261 private:
264 };
265 
266 #include "G4ITTransportation.icc"
267 #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