Geant4  10.00.p02
G4SteppingManager.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 //
27 // $Id: G4SteppingManager.hh 66241 2012-12-13 18:34:42Z gunter $
28 //
29 //---------------------------------------------------------------
30 //
31 // G4SteppingManager.hh
32 //
33 // class description:
34 // This is the class which plays an essential role in tracking
35 // the particle. It takes cares all message passing between
36 // objects in the different categories (for example,
37 // geometry(including transportation), interactions in
38 // matter, etc). It's public method 'stepping' steers to step
39 // the particle.
40 // Geant4 kernel use only
41 //
42 // Contact:
43 // Questions and comments to this code should be sent to
44 // Katsuya Amako (e-mail: Katsuya.Amako@kek.jp)
45 // Takashi Sasaki (e-mail: Takashi.Sasaki@kek.jp)
46 //
47 //---------------------------------------------------------------
48 // modified for new ParticleChange 12 Mar. 1998 H.Kurashige
49 
50 
51 class G4SteppingManager;
52 
53 #ifndef G4SteppingManager_h
54 #define G4SteppingManager_h 1
55 
57 
58 #include "G4ios.hh" // Include from 'system'
59 #include <iomanip> // Include from 'system'
60 #include <vector> // Include from 'system'
61 #include "globals.hh" // Include from 'global'
62 #include "Randomize.hh" // Include from 'global'
63 
64 #include "G4Navigator.hh" // Include from 'geometry'
65 #include "G4LogicalVolume.hh" // Include from 'geometry'
66 #include "G4VPhysicalVolume.hh" // Include from 'geometry'
67 #include "G4ProcessManager.hh" // Include from 'piim'
68 
69 #include "G4Track.hh" // Include from 'tracking'
70 #include "G4TrackVector.hh" // Include from 'tracking'
71 #include "G4TrackStatus.hh" // Include from 'tracking'
72 #include "G4StepStatus.hh" // Include from 'tracking'
73 #include "G4UserSteppingAction.hh" // Include from 'tracking'
74 #include "G4Step.hh" // Include from 'tracking'
75 #include "G4StepPoint.hh" // Include from 'tracking'
76 #include "G4VSteppingVerbose.hh" // Include from 'tracking'
77 #include "G4TouchableHandle.hh" // Include from 'geometry'
78 #include "G4TouchableHistoryHandle.hh" // Include from 'geometry'
79 
80 //
81  typedef std::vector<G4int>
83  typedef std::vector<G4int>
85  typedef std::vector<G4int>
87 
88  static const size_t SizeOfSelectedDoItVector=100;
89  // In global scope for porting on WIN-VC compiler...
90 
94 {
95 
96 //--------
97 public: //without description
98 //--------
99 
100 // Constructor/Destructor
101 
103  // SteppingManger should be dynamically persistent, therefore
104  // you need to invoke new() when you call this constructor.
105  // "Secodary track vector" will be dynamically created by this
106  // cosntructor. "G4UserSteppingAction" will be also constructed
107  // in this constructor, and "this" pointer will be passed to
108  // "G4UserSteppingAction".
109 
111 
112 // Get/Set functions
113 
114  const G4TrackVector* GetSecondary() const;
115  void SetUserAction(G4UserSteppingAction* apAction);
116  G4Track* GetTrack() const;
117  void SetVerboseLevel(G4int vLevel);
119  G4Step* GetStep() const;
120  void SetNavigator(G4Navigator* value);
121 
122 
123 // Other member functions
124 
126  // Steers to move the give particle from the TrackingManger
127  // by one Step.
128 
129  void SetInitialStep(G4Track* valueTrack);
130  // Sets up initial track information (enegry, position, etc) to
131  // the PreStepPoint of the G4Step. This funciton has to be called
132  // just once before the stepping loop in the "TrackingManager".
133 
134  void GetProcessNumber();
135 
136 // Get methods
145  G4double GetMass();
148  G4Track* GetfTrack();
150  G4Step* GetfStep();
172  size_t GetMAXofAtRestLoops();
173  size_t GetMAXofAlongStepLoops();
174  size_t GetMAXofPostStepLoops();
185  //
187 //---------
188  private:
189 //---------
190 
191 // Member functions
192 
194  // Calculate corresponding physical length from the mean free path
195  // left for each discrete phyiscs process. The minimum allowable
196  // Step for each continious process will be also calculated.
197  void InvokeAtRestDoItProcs();
200  void InvokePSDIP(size_t); //
202  // Return the estimated safety value at the PostStepPoint
204 
205 // Member data
206 
208 
210 
217 
221 
223 
230 
234  // The pointer to the process of which DoIt or
235  // GetPhysicalInteractionLength has been just executed.
236 
237 
241 
245 
249 
253 
257  // These are the numbers of secondaries generated by the process
258  // just executed.
259 
261 
263 
267 
269 
271 
273 
275  // Cached geometrical tolerance on surface
277  // This keeps the minimum safety value proposed by AlongStepGPILs.
280  // To get the true safety value at the PostStepPoint, you have
281  // to subtract the distance to 'endpointSafOrigin' from this value.
285  // Above three variables are for the method
286  // DefinePhysicalStepLength(). To pass these information to
287  // the method Verbose, they are kept at here. Need a more
288  // elegant mechanism.
289 
290 };
291 
292 
293 //*******************************************************************
294 //
295 // Inline function
296 //
297 //*******************************************************************
298 
300  return PhysicalStep;
301  }
302 
304  return GeometricalStep;
305  }
306 
308  return CorrectedStep;
309  }
310 
312  return PreStepPointIsGeom;
313  }
314 
316  return FirstStep;
317  }
318 
320  return fStepStatus;
321  }
322 
324  return TempInitVelocity;
325  }
327  return TempVelocity;
328  }
330  return Mass;
331  }
332 
334  return sumEnergyChange;
335  }
336 
338  return fParticleChange;
339  }
340 
342  return fTrack;
343  }
344 
346  return fStep->GetfSecondary();
347  }
349  return fStep;
350  }
352  return fPreStepPoint;
353  }
355  return fPostStepPoint;
356  }
357 
359  return fCurrentVolume;
360  }
362  return fSensitive;
363  }
365  return fCurrentProcess;
366  }
367 
369  return fAtRestDoItVector;
370  }
372  return fAlongStepDoItVector;
373  }
375  return fPostStepDoItVector;
376  }
377 
380  }
381 
384  }
385 
388  }
389 
391  return MAXofAtRestLoops;
392  }
394  return MAXofAlongStepLoops;
395  }
397  return MAXofPostStepLoops;
398  }
399 
402  }
405  }
408  }
410  return fN2ndariesAtRestDoIt;
411  }
414  }
416  return fN2ndariesPostStepDoIt;
417  }
418 
420  return fNavigator;
421  }
423  return verboseLevel;
424  }
425 
428  }
429 
432  }
433 
436  }
437 
439  return fPreviousStepSize;
440  }
441 
443  return fTouchableHandle;
444  }
445 
447  return StepControlFlag;
448  }
450  return physIntLength;
451  }
453  return fCondition;
454  }
456  return fGPILSelection;
457  }
458 
460  return fStep->GetSecondary();
461  }
462 
464  fNavigator = value;
465  }
466 
468  fUserSteppingAction = apAction;
469  }
471  return fUserSteppingAction;
472  }
473 
475  return fTrack;
476  }
477 
479  verboseLevel = vLevel;
480  }
481 
483  fVerbose = yourVerbose;
484  }
485 
487  return fStep;
488  }
489 
491  return std::max( endpointSafety -
493  kCarTolerance );
494  }
495 
496 
497 #endif
G4StepPoint * GetfPreStepPoint()
G4ProcessVector * GetfAlongStepDoItVector()
G4double GetcurrentMinimumStep()
void SetNavigator(G4Navigator *value)
G4double GetTempInitVelocity()
G4ProcessVector * fPostStepGetPhysIntVector
CLHEP::Hep3Vector G4ThreeVector
G4ProcessVector * fPostStepDoItVector
G4double GetGeometricalStep()
class std::vector< int, std::allocator< int > > G4SelectedAtRestDoItVector
static const size_t SizeOfSelectedDoItVector
void SetVerboseLevel(G4int vLevel)
std::vector< G4int > G4SelectedAlongStepDoItVector
G4SteppingControl StepControlFlag
class std::vector< int, std::allocator< int > > G4SelectedAlongStepDoItVector
G4Navigator * fNavigator
G4VSteppingVerbose * fVerbose
G4SteppingControl
std::vector< G4int > G4SelectedAtRestDoItVector
const G4TrackVector * GetSecondary() const
G4UserSteppingAction * fUserSteppingAction
G4VSensitiveDetector * GetfSensitive()
G4ProcessVector * fAlongStepGetPhysIntVector
G4SelectedPostStepDoItVector * fSelectedPostStepDoItVector
G4StepPoint * GetfPostStepPoint()
G4ForceCondition GetfCondition()
int G4int
Definition: G4Types.hh:78
G4StepStatus GetfStepStatus()
G4Navigator * GetfNavigator()
G4double GetnumberOfInteractionLengthLeft()
G4StepStatus
Definition: G4StepStatus.hh:49
G4VProcess * fCurrentProcess
void SetVerbose(G4VSteppingVerbose *)
size_t GetfPostStepDoItProcTriggered()
G4double GetsumEnergyChange()
G4SelectedAlongStepDoItVector * fSelectedAlongStepDoItVector
class std::vector< int, std::allocator< int > > G4SelectedPostStepDoItVector
G4double GetfPreviousStepSize()
G4SelectedPostStepDoItVector * GetfSelectedPostStepDoItVector()
const G4TouchableHandle & GetTouchableHandle()
const G4ThreeVector & GetPosition() const
G4ProcessVector * GetfPostStepDoItVector()
G4SelectedAtRestDoItVector * GetfSelectedAtRestDoItVector()
G4VParticleChange * GetfParticleChange()
bool G4bool
Definition: G4Types.hh:79
void ApplyProductionCut(G4Track *)
std::vector< G4int > G4SelectedPostStepDoItVector
Definition: G4Step.hh:76
G4int GetfN2ndariesAlongStepDoIt()
G4StepStatus Stepping()
G4ThreeVector endpointSafOrigin
void SetInitialStep(G4Track *valueTrack)
G4VPhysicalVolume * GetfCurrentVolume()
G4StepPoint * fPostStepPoint
G4TrackVector * GetfSecondary()
G4ProcessVector * fAlongStepDoItVector
std::vector< G4Track * > G4TrackVector
G4TrackVector * fSecondary
T max(const T t1, const T t2)
brief Return the largest of the two arguments
G4ProcessVector * GetfAlongStepGetPhysIntVector()
G4VSensitiveDetector * fSensitive
void SetUserAction(G4UserSteppingAction *apAction)
size_t GetfAtRestDoItProcTriggered()
G4VPhysicalVolume * fCurrentVolume
size_t GetfAlongStepDoItProcTriggered()
G4ProcessVector * GetfAtRestDoItVector()
G4VProcess * GetfCurrentProcess()
G4ForceCondition fCondition
G4GPILSelection fGPILSelection
double G4double
Definition: G4Types.hh:76
G4ProcessVector * GetfAtRestGetPhysIntVector()
G4ForceCondition
G4SelectedAlongStepDoItVector * GetfSelectedAlongStepDoItVector()
G4ProcessVector * fAtRestGetPhysIntVector
G4VParticleChange * fParticleChange
G4SelectedAtRestDoItVector * fSelectedAtRestDoItVector
G4TrackVector * GetfSecondary()
G4ProcessVector * fAtRestDoItVector
G4SteppingControl GetStepControlFlag()
G4ProcessVector * GetfPostStepGetPhysIntVector()
const G4TrackVector * GetSecondary() const
G4Step * GetStep() const
G4GPILSelection
G4StepStatus fStepStatus
G4Track * GetTrack() const
G4TouchableHandle fTouchableHandle
G4GPILSelection GetfGPILSelection()
G4UserSteppingAction * GetUserAction()
G4StepPoint * fPreStepPoint