Geant4  10.01.p01
G4ITStepProcessor.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: G4ITStepProcessor.hh 87375 2014-12-02 08:17:28Z gcosmo $
27 //
28 // Author: Mathieu Karamitros, kara@cenbg.in2p3.fr
29 
30 // The code is developed in the framework of the ESA AO7146
31 //
32 // We would be very happy hearing from you, send us your feedback! :)
33 //
34 // In order for Geant4-DNA to be maintained and still open-source,
35 // article citations are crucial.
36 // If you use Geant4-DNA chemistry and you publish papers about your software,
37 // in addition to the general paper on Geant4-DNA:
38 //
39 // Int. J. Model. Simul. Sci. Comput. 1 (2010) 157–178
40 //
41 // we would be very happy if you could please also cite the following
42 // reference papers on chemistry:
43 //
44 // J. Comput. Phys. 274 (2014) 841-882
45 // Prog. Nucl. Sci. Tec. 2 (2011) 503-508
46 
47 #ifndef G4ITSTEPPROCESSOR_H
48 #define G4ITSTEPPROCESSOR_H
49 
50 #include "G4ios.hh" // Include from 'system'
51 #include "globals.hh" // Include from 'global'
52 #include "Randomize.hh" // Include from 'global'
53 
54 #include "G4LogicalVolume.hh" // Include from 'geometry'
55 #include "G4VPhysicalVolume.hh" // Include from 'geometry'
56 #include "G4ProcessManager.hh" // Include from 'piim'
57 
58 #include "G4Track.hh" // Include from 'track'
59 #include "G4TrackVector.hh" // Include from 'track'
60 #include "G4TrackStatus.hh" // Include from 'track'
61 #include "G4StepStatus.hh" // Include from 'track'
62 //#include "G4UserSteppingAction.hh" // Include from 'tracking'
63 //#include "G4UserTrackingAction.hh" // Include from 'tracking'
64 #include "G4Step.hh" // Include from 'track'
65 #include "G4StepPoint.hh" // Include from 'track'
66 #include "G4TouchableHandle.hh" // Include from 'geometry'
67 #include "G4TouchableHistoryHandle.hh" // Include from 'geometry'
68 
69 #include "G4TrackingInformation.hh"
70 
71 //class G4Navigator;
72 class G4ITNavigator;
75 class G4IT;
77 class G4ITTransportation;
78 class G4VITProcess;
79 typedef class std::vector<int, std::allocator<int> > G4SelectedAtRestDoItVector;
80 typedef class std::vector<int, std::allocator<int> > G4SelectedAlongStepDoItVector;
81 typedef class std::vector<int, std::allocator<int> > G4SelectedPostStepDoItVector;
82 
90 {
91 
92 public:
94  virtual ~G4ITStepProcessor();
95 
96  inline void SetPreviousStepTime(G4double);
97 
98  inline G4Track* GetTrack()
99  {
100  return fpTrack;
101  }
102  inline G4Step* GetStep()
103  {
104  return fpStep;
105  }
106  inline const G4Step* GetStep() const
107  {
108  return fpStep;
109  }
110  inline void SetStep(G4Step* val)
111  {
112  fpStep = val;
113  }
114 
116  {
117  return fpSecondary;
118  }
120  {
121  fpTrackingManager = trackMan;
122  }
124  {
125  return fpTrackingManager;
126  }
127 
128  virtual void Initialize();
129  void ForceReInitialization();
130 
132  void Stepping(G4Track*, const double&);
133  //void CalculateStep(G4Track*, const double&);
134  //void CalculateStep(G4Track*);
135 
136  //void DoIt(G4Track*,double);
137 
138  void FindTransportationStep();
139  // void UpdateTrack(G4Track*);
140 
141  inline double GetInteractionTime();
142  inline const G4Track* GetTrack() const;
143  inline void CleanProcessor();
144 
145 protected:
147  void ClearProcessInfo();
148  void SetTrack(G4Track*);
149 
150  void GetProcessInfo();
151 
152  void SetupMembers();
153  void ResetSecondaries();
154  void InitDefineStep();
155 
156  void SetInitialStep();
157 
158  void GetAtRestIL();
160  void DoStepping();
161 
162  // void CalculateStep();
163  // void DoCalculateStep();
164 
165  // void CloneProcesses();
166  void ActiveOnlyITProcess();
168 
169  void DealWithSecondaries(G4int&);
170  void InvokeAtRestDoItProcs();
173  void InvokePSDIP(size_t); //
175  void SetNavigator(G4ITNavigator *value);
177 
178  // Return the estimated safety value at the PostStepPoint
180 
181  G4ITStepProcessor(const G4ITStepProcessor& other);
183 
184 private:
185  //________________________________________________
186  //
187  // General members
188  //________________________________________________
189 
191 
193  // G4UserSteppingAction* fpUserSteppingAction;
194 
196  // Cached geometrical tolerance on surface
197 
198  G4ITNavigator* fpNavigator;
199  // G4Navigator* fpNavigator;
202 
203  //________________________________________________
204  //
205  // Members used as temporaries (= not proper to a track)
206  //________________________________________________
207 
208  G4double fTimeStep; // not proper to a track
210  G4TrackVector* fpSecondary; // get from fpStep at every configuration setup
212 
214  // The pointer to the process of which DoIt or
215  // GetPhysicalInteractionLength has been just executed
216 
217  // * Secondaries
221  // These are the numbers of secondaries generated by the process
222  // just executed.
223 
224  // * Process selection
228  // Record the selected process
229 
232  // Above three variables are for the method
233  // DefinePhysicalStepLength(). To pass these information to
234  // the method Verbose, they are kept at here. Need a more
235  // elegant mechanism.
236 
238  // The minimum physical interaction length over all possible processes
239 
240  // * Sensitive detector
241  // G4SteppingControl StepControlFlag;
242  // G4VSensitiveDetector* fpSensitive;
243 
244  G4VPhysicalVolume* fpCurrentVolume; // Get from fpStep or touchable, keep as member for user interface
245 
246  //________________________________________________
247  //
248  // Members related to ParticleDefinition and not
249  // proper to a track
250  //________________________________________________
252  {
256 
260  //
261  // Note: DoItVector has inverse order against GetPhysIntVector
262  // and SelectedPostStepDoItVector.
263  //
264  // * Max Number of Process
268  // Maximum number of processes for each type of process
269  // These depend on the G4ParticleDefinition, so on the track
270 
271  // * Transportation process
273  };
274 
275  std::map<const G4ParticleDefinition*, ProcessGeneralInfo*> fProcessGeneralInfoMap;
277 
279 
280  //________________________________________________
281  //
282  // Members proper to a track
283  //________________________________________________
285  {
286  public:
288  virtual ~G4ITStepProcessorState();
289 
290  // * Max Number of Process
293 
297 
299 
300  // * Safety
302  // This keeps the minimum safety value proposed by AlongStepGPILs.
305  // To get the true safety value at the PostStepPoint, you have
306  // to subtract the distance to 'endpointSafOrigin' from this value.
307 
309  private:
312  };
313 
314  //________________________________________________
315  //
316  // Members used for configurating the processor
317  //________________________________________________
318 
319  G4Track* fpTrack; // Set track
320  G4IT* fpITrack; // Set track
322 
323  G4ITStepProcessorState* fpState; // SetupMembers or InitDefineStep
324  G4Step* fpStep; // Set track or InitDefineStep
325 
326  G4StepPoint* fpPreStepPoint; // SetupMembers
327  G4StepPoint* fpPostStepPoint; // SetupMembers
328 };
329 
331 {
332  fPreviousTimeStep = previousTimeStep;
333 }
334 
336 {
337  return fpTrack;
338 }
339 
341 {
342  return std::max(
344  - fpPostStepPoint->GetPosition()).mag(),
345  kCarTolerance);
346 }
347 
348 inline void G4ITStepProcessor::SetNavigator(G4ITNavigator *value)
349 {
350  fpNavigator = value;
351 }
352 
354 {
355  fTimeStep = DBL_MAX;
357 
358  fpState = 0;
359  fpTrack = 0;
360  fpTrackingInfo = 0;
361  fpITrack = 0;
362  fpStep = 0;
363  fpPreStepPoint = 0;
364  fpPostStepPoint = 0;
365 
366  fpParticleChange = 0;
367 
368  fpCurrentVolume = 0;
369  // fpSensitive = 0;
370 
371  fpSecondary = 0;
372 
373  fpTransportation = 0;
374 
375  fpCurrentProcess= 0;
376  fpProcessInfo = 0;
377 
383 }
384 
385 //______________________________________________________________________________
387 {
388  return fTimeStep;
389 }
390 
391 #endif // G4ITSTEPPROCESSOR_H
G4TrackVector * fpSecondary
Its role is the same as G4StepManager :
void SetStep(G4Step *val)
G4ITTrackingManager * fpTrackingManager
CLHEP::Hep3Vector G4ThreeVector
void SetTrackingManager(G4ITTrackingManager *trackMan)
G4GPILSelection fGPILSelection
class std::vector< int, std::allocator< int > > G4SelectedAtRestDoItVector
G4SelectedAtRestDoItVector fSelectedAtRestDoItVector
class std::vector< int, std::allocator< int > > G4SelectedAlongStepDoItVector
void SetNavigator(G4ITNavigator *value)
std::map< const G4ParticleDefinition *, ProcessGeneralInfo * > fProcessGeneralInfoMap
G4VITProcess * fpCurrentProcess
The class G4TrackingInformation (hold by G4IT) emcompasses processes informations computed at the PS/...
void SetPreviousStepTime(G4double)
int G4int
Definition: G4Types.hh:78
G4StepStatus
Definition: G4StepStatus.hh:49
G4ForceCondition fCondition
void SetTrack(G4Track *)
void DefinePhysicalStepLength(G4Track *)
G4ITTrackingManager * GetTrackingManager()
G4TrackingInformation * fpTrackingInfo
class std::vector< int, std::allocator< int > > G4SelectedPostStepDoItVector
G4StepPoint * fpPreStepPoint
const G4ThreeVector & GetPosition() const
void ApplyProductionCut(G4Track *)
bool G4bool
Definition: G4Types.hh:79
void DealWithSecondaries(G4int &)
G4TrackVector * GetSecondaries()
G4VPhysicalVolume * fpCurrentVolume
Definition: G4Step.hh:76
G4ITNavigator * fpNavigator
G4ITStepProcessorState * fpState
G4StepPoint * fpPostStepPoint
#define INT_MAX
Definition: templates.hh:111
virtual void Initialize()
G4VParticleChange * fpParticleChange
std::vector< G4Track * > G4TrackVector
T max(const T t1, const T t2)
brief Return the largest of the two arguments
G4ITTransportation * fpTransportation
void Stepping(G4Track *, const double &)
G4ITStepProcessor & operator=(const G4ITStepProcessor &other)
ProcessGeneralInfo * fpProcessInfo
double G4double
Definition: G4Types.hh:76
void SetupGeneralProcessInfo(G4ParticleDefinition *, G4ProcessManager *)
G4ForceCondition
G4VITProcess inherits from G4VProcess.
Definition: G4VITProcess.hh:99
#define DBL_MAX
Definition: templates.hh:83
G4SelectedPostStepDoItVector fSelectedPostStepDoItVector
{ Class description:
size_t fPostStepAtTimeDoItProcTriggered
const G4Step * GetStep() const
G4GPILSelection