Geant4  10.00.p02
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 64057 2012-10-30 15:04:49Z gcosmo $
27 //
28 // Author: Mathieu Karamitros (kara (AT) cenbg . in2p3 . fr)
29 //
30 // WARNING : This class is released as a prototype.
31 // It might strongly evolve or even disapear in the next releases.
32 //
33 // History:
34 // -----------
35 // 10 Oct 2011 M.Karamitros created
36 //
37 // -------------------------------------------------------------------
38 
39 #ifndef G4ITSTEPPROCESSOR_H
40 #define G4ITSTEPPROCESSOR_H
41 
42 #include "G4ios.hh" // Include from 'system'
43 #include "globals.hh" // Include from 'global'
44 #include "Randomize.hh" // Include from 'global'
45 
46 #include "G4LogicalVolume.hh" // Include from 'geometry'
47 #include "G4VPhysicalVolume.hh" // Include from 'geometry'
48 #include "G4ProcessManager.hh" // Include from 'piim'
49 
50 #include "G4Track.hh" // Include from 'track'
51 #include "G4TrackVector.hh" // Include from 'track'
52 #include "G4TrackStatus.hh" // Include from 'track'
53 #include "G4StepStatus.hh" // Include from 'track'
54 //#include "G4UserSteppingAction.hh" // Include from 'tracking'
55 //#include "G4UserTrackingAction.hh" // Include from 'tracking'
56 #include "G4Step.hh" // Include from 'track'
57 #include "G4StepPoint.hh" // Include from 'track'
58 #include "G4TouchableHandle.hh" // Include from 'geometry'
59 #include "G4TouchableHistoryHandle.hh" // Include from 'geometry'
60 
61 
62 #include "G4TrackingInformation.hh"
63 
64 //class G4Navigator;
65 class G4ITNavigator;
68 class G4IT;
70 class G4ITTransportation;
71 class G4VITProcess;
72 typedef class std::vector<int, std::allocator<int> > G4SelectedAtRestDoItVector;
73 typedef class std::vector<int, std::allocator<int> > G4SelectedAlongStepDoItVector;
74 typedef class std::vector<int, std::allocator<int> > G4SelectedPostStepDoItVector;
75 
76 
84 {
85 
86 public:
88  virtual ~G4ITStepProcessor();
89 
90  inline void SetPreviousStepTime(G4double);
91 
92  inline G4Track* GetTrack() {return fpTrack;}
93  inline G4Step* GetStep() {return fpStep;}
94  inline const G4Step* GetStep() const {return fpStep;}
95  inline void SetStep(G4Step* val) {fpStep = val;}
96 
98  inline void SetTrackingManager(G4ITTrackingManager* trackMan) {fpTrackingManager = trackMan;}
100 
101  virtual void Initialize();
102  void ForceReInitialization();
103 
105  void Stepping(G4Track*, const double&);
106  void CalculateStep(G4Track*, const double&);
107  void CalculateStep(G4Track*);
108 
109  void DoIt(G4Track*,double);
110 
111  void FindTransportationStep();
112  void UpdateTrack(G4Track*);
113 
114  inline double GetInteractionTime();
115  inline const G4Track* GetTrack() const ;
116  inline void CleanProcessor();
117 
118 protected:
120  void ClearProcessInfo();
121  void SetTrack(G4Track*);
122 
123  void GetProcessInfo();
124 
125  void SetupMembers();
126  void ResetSecondaries();
127  void InitDefineStep();
128 
129  void SetInitialStep();
130 
131  void GetAtRestIL();
133  void DoStepping();
134 
135  void CalculateStep();
136  void DoCalculateStep();
137 
138  void CloneProcesses();
139  void ActiveOnlyITProcess();
141 
142  void DealWithSecondaries(G4int&);
143  void InvokeAtRestDoItProcs();
146  void InvokePSDIP(size_t); //
148  void SetNavigator(G4ITNavigator *value);
150 
151  // Return the estimated safety value at the PostStepPoint
153 
154 
155  G4ITStepProcessor(const G4ITStepProcessor& other);
157 
158 private:
159  //________________________________________________
160  //
161  // General members
162  //________________________________________________
163 
165 
167  // G4UserSteppingAction* fpUserSteppingAction;
168 
170  // Cached geometrical tolerance on surface
171 
173 // G4Navigator* fpNavigator;
176 
177  //________________________________________________
178  //
179  // Members used as temporaries (= not proper to a track)
180  //________________________________________________
181 
182  G4double fTimeStep ; // not proper to a track
184  G4TrackVector* fpSecondary ; // get from fpStep at every configuration setup
186 
188  // The pointer to the process of which DoIt or
189  // GetPhysicalInteractionLength has been just executed
190 
191  // * Secondaries
195  // These are the numbers of secondaries generated by the process
196  // just executed.
197 
198  // * Process selection
202  // Record the selected process
203 
206  // Above three variables are for the method
207  // DefinePhysicalStepLength(). To pass these information to
208  // the method Verbose, they are kept at here. Need a more
209  // elegant mechanism.
210 
212  // The minimum physical interaction length over all possible processes
213 
214  // * Sensitive detector
215 // G4SteppingControl StepControlFlag;
216 // G4VSensitiveDetector* fpSensitive;
217 
218  G4VPhysicalVolume* fpCurrentVolume; // Get from fpStep or touchable, keep as member for user interface
219 
220  //________________________________________________
221  //
222  // Members related to ParticleDefinition and not
223  // proper to a track
224  //________________________________________________
226  {
230 
234  //
235  // Note: DoItVector has inverse order against GetPhysIntVector
236  // and SelectedPostStepDoItVector.
237  //
238  // * Max Number of Process
242  // Maximum number of processes for each type of process
243  // These depend on the G4ParticleDefinition, so on the track
244 
245  // * Transportation process
247  };
248 
249  std::map<const G4ParticleDefinition*, ProcessGeneralInfo*> fProcessGeneralInfoMap;
251 
253 
254  //________________________________________________
255  //
256  // Members proper to a track
257  //________________________________________________
259  {
260  public:
262  virtual ~G4ITStepProcessorState();
263 
264  // * Max Number of Process
267 
271 
273 
274  // * Safety
276  // This keeps the minimum safety value proposed by AlongStepGPILs.
279  // To get the true safety value at the PostStepPoint, you have
280  // to subtract the distance to 'endpointSafOrigin' from this value.
281 
283  private :
286  };
287 
288  //________________________________________________
289  //
290  // Members used for configurating the processor
291  //________________________________________________
292 
293  G4Track* fpTrack; // Set track
294  G4IT* fpITrack ; // Set track
296 
297  G4ITStepProcessorState* fpState; // SetupMembers or InitDefineStep
298  G4Step* fpStep; // Set track or InitDefineStep
299 
300  G4StepPoint* fpPreStepPoint; // SetupMembers
301  G4StepPoint* fpPostStepPoint; // SetupMembers
302 };
303 
305 {
306  fPreviousTimeStep = previousTimeStep;
307 }
308 
310 {
311  return fpTrack;
312 }
313 
315 {
316  return std::max( fpState->endpointSafety -
318  kCarTolerance );
319 }
320 
322 {
323  fpNavigator = value;
324 }
325 
327 {
328  fTimeStep = DBL_MAX ;
330 
331  fpState = 0;
332  fpTrack = 0;
333  fpTrackingInfo = 0 ;
334  fpITrack = 0;
335  fpStep = 0;
336  fpPreStepPoint = 0;
337  fpPostStepPoint = 0;
338 
339  fpParticleChange = 0;
340 
341  fpCurrentVolume = 0;
342 // fpSensitive = 0;
343 
344  fpSecondary = 0 ;
345 
346  fpTransportation = 0;
347 
348  fpCurrentProcess= 0;
349  fpProcessInfo = 0;
350 
356 }
357 
358 //______________________________________________________________________________
360 {
361  return fTimeStep ;
362 }
363 
364 
365 #endif // G4ITSTEPPROCESSOR_H
G4TrackVector * fpSecondary
Its role is the same as G4StepManager :
G4IT is a interface which allows the inheriting object :
Definition: G4IT.hh:82
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
void UpdateTrack(G4Track *)
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:74
#define DBL_MAX
Definition: templates.hh:83
G4SelectedPostStepDoItVector fSelectedPostStepDoItVector
void DoIt(G4Track *, double)
size_t fPostStepAtTimeDoItProcTriggered
const G4Step * GetStep() const
G4GPILSelection