Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Data Fields
G4SteppingManager Class Reference

#include <G4SteppingManager.hh>

Public Member Functions

 G4SteppingManager ()
 
 ~G4SteppingManager ()
 
const G4TrackVectorGetSecondary () const
 
void SetUserAction (G4UserSteppingAction *apAction)
 
G4TrackGetTrack () const
 
void SetVerboseLevel (G4int vLevel)
 
void SetVerbose (G4VSteppingVerbose *)
 
G4StepGetStep () const
 
void SetNavigator (G4Navigator *value)
 
G4StepStatus Stepping ()
 
void SetInitialStep (G4Track *valueTrack)
 
void GetProcessNumber ()
 
G4double GetPhysicalStep ()
 
G4double GetGeometricalStep ()
 
G4double GetCorrectedStep ()
 
G4bool GetPreStepPointIsGeom ()
 
G4bool GetFirstStep ()
 
G4StepStatus GetfStepStatus ()
 
G4double GetTempInitVelocity ()
 
G4double GetTempVelocity ()
 
G4double GetMass ()
 
G4double GetsumEnergyChange ()
 
G4VParticleChangeGetfParticleChange ()
 
G4TrackGetfTrack ()
 
G4TrackVectorGetfSecondary ()
 
G4StepGetfStep ()
 
G4StepPointGetfPreStepPoint ()
 
G4StepPointGetfPostStepPoint ()
 
G4VPhysicalVolumeGetfCurrentVolume ()
 
G4VSensitiveDetectorGetfSensitive ()
 
G4VProcessGetfCurrentProcess ()
 
G4ProcessVectorGetfAtRestDoItVector ()
 
G4ProcessVectorGetfAlongStepDoItVector ()
 
G4ProcessVectorGetfPostStepDoItVector ()
 
G4ProcessVectorGetfAlongStepGetPhysIntVector ()
 
G4ProcessVectorGetfPostStepGetPhysIntVector ()
 
G4ProcessVectorGetfAtRestGetPhysIntVector ()
 
G4double GetcurrentMinimumStep ()
 
G4double GetnumberOfInteractionLengthLeft ()
 
size_t GetfAtRestDoItProcTriggered ()
 
size_t GetfAlongStepDoItProcTriggered ()
 
size_t GetfPostStepDoItProcTriggered ()
 
G4int GetfN2ndariesAtRestDoIt ()
 
G4int GetfN2ndariesAlongStepDoIt ()
 
G4int GetfN2ndariesPostStepDoIt ()
 
G4NavigatorGetfNavigator ()
 
G4int GetverboseLevel ()
 
size_t GetMAXofAtRestLoops ()
 
size_t GetMAXofAlongStepLoops ()
 
size_t GetMAXofPostStepLoops ()
 
G4SelectedAtRestDoItVectorGetfSelectedAtRestDoItVector ()
 
G4SelectedAlongStepDoItVectorGetfSelectedAlongStepDoItVector ()
 
G4SelectedPostStepDoItVectorGetfSelectedPostStepDoItVector ()
 
G4double GetfPreviousStepSize ()
 
const G4TouchableHandleGetTouchableHandle ()
 
G4SteppingControl GetStepControlFlag ()
 
G4UserSteppingActionGetUserAction ()
 
G4double GetphysIntLength ()
 
G4ForceCondition GetfCondition ()
 
G4GPILSelection GetfGPILSelection ()
 

Data Fields

G4bool KillVerbose
 

Detailed Description

Definition at line 92 of file G4SteppingManager.hh.

Constructor & Destructor Documentation

G4SteppingManager::G4SteppingManager ( )

Definition at line 56 of file G4SteppingManager.cc.

References DBL_MAX, G4GeometryTolerance::GetInstance(), G4VSteppingVerbose::GetInstance(), G4Step::GetPostStepPoint(), G4Step::GetPreStepPoint(), G4GeometryTolerance::GetSurfaceTolerance(), G4TransportationManager::GetTransportationManager(), KillVerbose, G4Step::NewSecondaryVector(), G4VSteppingVerbose::SetInstance(), and SetNavigator().

58  : fUserSteppingAction(0), verboseLevel(0)
59 {
60 
61 // Construct simple 'has-a' related objects
62  fStep = new G4Step();
63  fSecondary = fStep->NewSecondaryVector();
64  fPreStepPoint = fStep->GetPreStepPoint();
65  fPostStepPoint = fStep->GetPostStepPoint();
66 #ifdef G4VERBOSE
68  fVerbose = new G4SteppingVerbose();
70  fVerbose -> SetManager(this);
71  KillVerbose = true;
72  }
73  else {
75  fVerbose -> SetManager(this);
76  KillVerbose = false;
77  }
78 #endif
80  ->GetNavigatorForTracking());
81 
82  fSelectedAtRestDoItVector
83  = new G4SelectedAtRestDoItVector(SizeOfSelectedDoItVector,0);
84  fSelectedAlongStepDoItVector
85  = new G4SelectedAlongStepDoItVector(SizeOfSelectedDoItVector,0);
86  fSelectedPostStepDoItVector
87  = new G4SelectedPostStepDoItVector(SizeOfSelectedDoItVector,0);
88 
90  ->GetNavigatorForTracking());
91 
92  physIntLength = DBL_MAX;
94 }
static G4VSteppingVerbose * GetInstance()
void SetNavigator(G4Navigator *value)
class std::vector< int, std::allocator< int > > G4SelectedAtRestDoItVector
class std::vector< int, std::allocator< int > > G4SelectedAlongStepDoItVector
G4double GetSurfaceTolerance() const
G4StepPoint * GetPreStepPoint() const
class std::vector< int, std::allocator< int > > G4SelectedPostStepDoItVector
G4TrackVector * NewSecondaryVector()
Definition: G4Step.hh:76
static G4TransportationManager * GetTransportationManager()
static void SetInstance(G4VSteppingVerbose *Instance)
G4StepPoint * GetPostStepPoint() const
#define DBL_MAX
Definition: templates.hh:83
static G4GeometryTolerance * GetInstance()
G4SteppingManager::~G4SteppingManager ( )

Definition at line 97 of file G4SteppingManager.cc.

References G4Step::DeleteSecondaryVector(), and KillVerbose.

99 {
100  fTouchableHandle = 0;
101 // Destruct simple 'has-a' objects
102  fStep->DeleteSecondaryVector();
103 /////////////////////////// delete fSecondary;
104  delete fStep;
105  delete fSelectedAtRestDoItVector;
106  delete fSelectedAlongStepDoItVector;
107  delete fSelectedPostStepDoItVector;
108  if (fUserSteppingAction) delete fUserSteppingAction;
109 #ifdef G4VERBOSE
110  if(KillVerbose) delete fVerbose;
111 #endif
112 }
void DeleteSecondaryVector()

Member Function Documentation

G4double G4SteppingManager::GetCorrectedStep ( )
inline

Definition at line 307 of file G4SteppingManager.hh.

Referenced by G4VSteppingVerbose::CopyState().

307  {
308  return CorrectedStep;
309  }
G4double G4SteppingManager::GetcurrentMinimumStep ( )
size_t G4SteppingManager::GetfAlongStepDoItProcTriggered ( )
inline

Definition at line 403 of file G4SteppingManager.hh.

Referenced by G4VSteppingVerbose::CopyState().

403  {
404  return fAtRestDoItProcTriggered;
405  }
G4ProcessVector * G4SteppingManager::GetfAlongStepDoItVector ( )
inline

Definition at line 371 of file G4SteppingManager.hh.

Referenced by G4VSteppingVerbose::CopyState().

371  {
372  return fAlongStepDoItVector;
373  }
G4ProcessVector * G4SteppingManager::GetfAlongStepGetPhysIntVector ( )
inline

Definition at line 382 of file G4SteppingManager.hh.

Referenced by G4VSteppingVerbose::CopyState().

382  {
383  return fAlongStepGetPhysIntVector;
384  }
size_t G4SteppingManager::GetfAtRestDoItProcTriggered ( )
inline

Definition at line 400 of file G4SteppingManager.hh.

Referenced by G4VSteppingVerbose::CopyState().

400  {
401  return fAtRestDoItProcTriggered;
402  }
G4ProcessVector * G4SteppingManager::GetfAtRestDoItVector ( )
inline

Definition at line 368 of file G4SteppingManager.hh.

Referenced by G4VSteppingVerbose::CopyState().

368  {
369  return fAtRestDoItVector;
370  }
G4ProcessVector * G4SteppingManager::GetfAtRestGetPhysIntVector ( )
inline

Definition at line 378 of file G4SteppingManager.hh.

Referenced by G4VSteppingVerbose::CopyState().

378  {
379  return fAtRestGetPhysIntVector;
380  }
G4ForceCondition G4SteppingManager::GetfCondition ( )
inline

Definition at line 452 of file G4SteppingManager.hh.

Referenced by G4VSteppingVerbose::CopyState().

452  {
453  return fCondition;
454  }
G4VProcess * G4SteppingManager::GetfCurrentProcess ( )
inline

Definition at line 364 of file G4SteppingManager.hh.

Referenced by G4VSteppingVerbose::CopyState().

364  {
365  return fCurrentProcess;
366  }
G4VPhysicalVolume * G4SteppingManager::GetfCurrentVolume ( )
inline

Definition at line 358 of file G4SteppingManager.hh.

Referenced by G4VSteppingVerbose::CopyState().

358  {
359  return fCurrentVolume;
360  }
G4GPILSelection G4SteppingManager::GetfGPILSelection ( )
inline

Definition at line 455 of file G4SteppingManager.hh.

Referenced by G4VSteppingVerbose::CopyState().

455  {
456  return fGPILSelection;
457  }
G4bool G4SteppingManager::GetFirstStep ( )
inline

Definition at line 315 of file G4SteppingManager.hh.

Referenced by G4VSteppingVerbose::CopyState().

315  {
316  return FirstStep;
317  }
G4int G4SteppingManager::GetfN2ndariesAlongStepDoIt ( )
inline

Definition at line 412 of file G4SteppingManager.hh.

Referenced by G4VSteppingVerbose::CopyState(), and LXeSteppingAction::UserSteppingAction().

412  {
413  return fN2ndariesAlongStepDoIt;
414  }
G4int G4SteppingManager::GetfN2ndariesAtRestDoIt ( )
inline

Definition at line 409 of file G4SteppingManager.hh.

Referenced by G4VSteppingVerbose::CopyState(), and LXeSteppingAction::UserSteppingAction().

409  {
410  return fN2ndariesAtRestDoIt;
411  }
G4int G4SteppingManager::GetfN2ndariesPostStepDoIt ( )
inline

Definition at line 415 of file G4SteppingManager.hh.

Referenced by G4VSteppingVerbose::CopyState(), and LXeSteppingAction::UserSteppingAction().

415  {
416  return fN2ndariesPostStepDoIt;
417  }
G4Navigator * G4SteppingManager::GetfNavigator ( )
inline

Definition at line 419 of file G4SteppingManager.hh.

Referenced by G4VSteppingVerbose::CopyState().

419  {
420  return fNavigator;
421  }
G4VParticleChange * G4SteppingManager::GetfParticleChange ( )
inline

Definition at line 337 of file G4SteppingManager.hh.

Referenced by G4VSteppingVerbose::CopyState().

337  {
338  return fParticleChange;
339  }
size_t G4SteppingManager::GetfPostStepDoItProcTriggered ( )
inline

Definition at line 406 of file G4SteppingManager.hh.

Referenced by G4VSteppingVerbose::CopyState().

406  {
407  return fPostStepDoItProcTriggered;
408  }
G4ProcessVector * G4SteppingManager::GetfPostStepDoItVector ( )
inline

Definition at line 374 of file G4SteppingManager.hh.

Referenced by G4VSteppingVerbose::CopyState().

374  {
375  return fPostStepDoItVector;
376  }
G4ProcessVector * G4SteppingManager::GetfPostStepGetPhysIntVector ( )
inline

Definition at line 386 of file G4SteppingManager.hh.

Referenced by G4VSteppingVerbose::CopyState().

386  {
387  return fPostStepGetPhysIntVector;
388  }
G4StepPoint * G4SteppingManager::GetfPostStepPoint ( )
inline

Definition at line 354 of file G4SteppingManager.hh.

Referenced by G4VSteppingVerbose::CopyState().

354  {
355  return fPostStepPoint;
356  }
G4StepPoint * G4SteppingManager::GetfPreStepPoint ( )
inline

Definition at line 351 of file G4SteppingManager.hh.

Referenced by G4VSteppingVerbose::CopyState().

351  {
352  return fPreStepPoint;
353  }
G4double G4SteppingManager::GetfPreviousStepSize ( )
inline

Definition at line 438 of file G4SteppingManager.hh.

Referenced by G4VSteppingVerbose::CopyState().

438  {
439  return fPreviousStepSize;
440  }
G4TrackVector * G4SteppingManager::GetfSecondary ( )
inline

Definition at line 345 of file G4SteppingManager.hh.

References G4Step::GetfSecondary().

Referenced by G4VSteppingVerbose::CopyState(), G4TrackingManager::GimmeSecondaries(), and LXeSteppingAction::UserSteppingAction().

345  {
346  return fStep->GetfSecondary();
347  }
G4TrackVector * GetfSecondary()
G4SelectedAlongStepDoItVector * G4SteppingManager::GetfSelectedAlongStepDoItVector ( )
inline

Definition at line 430 of file G4SteppingManager.hh.

Referenced by G4VSteppingVerbose::CopyState().

430  {
431  return fSelectedAlongStepDoItVector;
432  }
G4SelectedAtRestDoItVector * G4SteppingManager::GetfSelectedAtRestDoItVector ( )
inline

Definition at line 426 of file G4SteppingManager.hh.

Referenced by G4VSteppingVerbose::CopyState().

426  {
427  return fSelectedAtRestDoItVector;
428  }
G4SelectedPostStepDoItVector * G4SteppingManager::GetfSelectedPostStepDoItVector ( )
inline

Definition at line 434 of file G4SteppingManager.hh.

Referenced by G4VSteppingVerbose::CopyState().

434  {
435  return fSelectedPostStepDoItVector;
436  }
G4VSensitiveDetector * G4SteppingManager::GetfSensitive ( )
inline

Definition at line 361 of file G4SteppingManager.hh.

Referenced by G4VSteppingVerbose::CopyState().

361  {
362  return fSensitive;
363  }
G4Step * G4SteppingManager::GetfStep ( )
inline

Definition at line 348 of file G4SteppingManager.hh.

Referenced by G4VSteppingVerbose::CopyState().

348  {
349  return fStep;
350  }
G4StepStatus G4SteppingManager::GetfStepStatus ( )
inline

Definition at line 319 of file G4SteppingManager.hh.

Referenced by G4VSteppingVerbose::CopyState().

319  {
320  return fStepStatus;
321  }
G4Track * G4SteppingManager::GetfTrack ( )
inline

Definition at line 341 of file G4SteppingManager.hh.

Referenced by G4VSteppingVerbose::CopyState().

341  {
342  return fTrack;
343  }
G4double G4SteppingManager::GetGeometricalStep ( )
inline

Definition at line 303 of file G4SteppingManager.hh.

Referenced by G4VSteppingVerbose::CopyState().

303  {
304  return GeometricalStep;
305  }
G4double G4SteppingManager::GetMass ( )
inline

Definition at line 329 of file G4SteppingManager.hh.

Referenced by G4VSteppingVerbose::CopyState().

329  {
330  return Mass;
331  }
size_t G4SteppingManager::GetMAXofAlongStepLoops ( )
inline

Definition at line 393 of file G4SteppingManager.hh.

Referenced by G4VSteppingVerbose::CopyState().

393  {
394  return MAXofAlongStepLoops;
395  }
size_t G4SteppingManager::GetMAXofAtRestLoops ( )
inline

Definition at line 390 of file G4SteppingManager.hh.

Referenced by G4VSteppingVerbose::CopyState().

390  {
391  return MAXofAtRestLoops;
392  }
size_t G4SteppingManager::GetMAXofPostStepLoops ( )
inline

Definition at line 396 of file G4SteppingManager.hh.

Referenced by G4VSteppingVerbose::CopyState().

396  {
397  return MAXofPostStepLoops;
398  }
G4double G4SteppingManager::GetnumberOfInteractionLengthLeft ( )
G4double G4SteppingManager::GetPhysicalStep ( )
inline

Definition at line 299 of file G4SteppingManager.hh.

Referenced by G4VSteppingVerbose::CopyState().

299  {
300  return PhysicalStep;
301  }
G4double G4SteppingManager::GetphysIntLength ( )
inline

Definition at line 449 of file G4SteppingManager.hh.

Referenced by G4VSteppingVerbose::CopyState().

449  {
450  return physIntLength;
451  }
G4bool G4SteppingManager::GetPreStepPointIsGeom ( )
inline

Definition at line 311 of file G4SteppingManager.hh.

Referenced by G4VSteppingVerbose::CopyState().

311  {
312  return PreStepPointIsGeom;
313  }
void G4SteppingManager::GetProcessNumber ( )

Definition at line 56 of file G4SteppingManager2.cc.

References G4ProcessVector::entries(), FatalException, G4cerr, G4cout, G4endl, G4Exception(), G4ProcessManager::GetAlongStepProcessVector(), G4ProcessManager::GetAtRestProcessVector(), G4Track::GetDefinition(), G4ParticleDefinition::GetParticleName(), G4ParticleDefinition::GetPDGEncoding(), G4ProcessManager::GetPostStepProcessVector(), G4ParticleDefinition::GetProcessManager(), typeDoIt, and typeGPIL.

Referenced by G4ErrorPropagator::InitG4Track(), and G4TrackingManager::ProcessOneTrack().

58 {
59 #ifdef debug
60  G4cout<<"G4SteppingManager::GetProcessNumber: is called track="
61  <<fTrack<<G4endl;
62 #endif
63 
65  if(!pm)
66  {
67  G4cerr << "ERROR - G4SteppingManager::GetProcessNumber()" << G4endl
68  << " ProcessManager is NULL for particle = "
69  << fTrack->GetDefinition()->GetParticleName() << ", PDG_code = "
70  << fTrack->GetDefinition()->GetPDGEncoding() << G4endl;
71  G4Exception("G4SteppingManager::GetProcessNumber()", "Tracking0011",
72  FatalException, "Process Manager is not found.");
73  return;
74  }
75 
76 // AtRestDoits
77  MAXofAtRestLoops = pm->GetAtRestProcessVector()->entries();
78  fAtRestDoItVector = pm->GetAtRestProcessVector(typeDoIt);
79  fAtRestGetPhysIntVector = pm->GetAtRestProcessVector(typeGPIL);
80 #ifdef debug
81  G4cout << "G4SteppingManager::GetProcessNumber: #ofAtRest="
82  << MAXofAtRestLoops << G4endl;
83 #endif
84 
85 // AlongStepDoits
86  MAXofAlongStepLoops = pm->GetAlongStepProcessVector()->entries();
87  fAlongStepDoItVector = pm->GetAlongStepProcessVector(typeDoIt);
88  fAlongStepGetPhysIntVector = pm->GetAlongStepProcessVector(typeGPIL);
89 #ifdef debug
90  G4cout << "G4SteppingManager::GetProcessNumber:#ofAlongStp="
91  << MAXofAlongStepLoops << G4endl;
92 #endif
93 
94 // PostStepDoits
95  MAXofPostStepLoops = pm->GetPostStepProcessVector()->entries();
96  fPostStepDoItVector = pm->GetPostStepProcessVector(typeDoIt);
97  fPostStepGetPhysIntVector = pm->GetPostStepProcessVector(typeGPIL);
98 #ifdef debug
99  G4cout << "G4SteppingManager::GetProcessNumber: #ofPostStep="
100  << MAXofPostStepLoops << G4endl;
101 #endif
102 
103  if (SizeOfSelectedDoItVector<MAXofAtRestLoops ||
104  SizeOfSelectedDoItVector<MAXofAlongStepLoops ||
105  SizeOfSelectedDoItVector<MAXofPostStepLoops )
106  {
107  G4cerr << "ERROR - G4SteppingManager::GetProcessNumber()" << G4endl
108  << " SizeOfSelectedDoItVector= " << SizeOfSelectedDoItVector
109  << " ; is smaller then one of MAXofAtRestLoops= "
110  << MAXofAtRestLoops << G4endl
111  << " or MAXofAlongStepLoops= " << MAXofAlongStepLoops
112  << " or MAXofPostStepLoops= " << MAXofPostStepLoops << G4endl;
113  G4Exception("G4SteppingManager::GetProcessNumber()",
114  "Tracking0012", FatalException,
115  "The array size is smaller than the actual No of processes.");
116  }
117 }
G4ParticleDefinition * GetDefinition() const
G4ProcessManager * GetProcessManager() const
const G4String & GetParticleName() const
G4ProcessVector * GetAtRestProcessVector(G4ProcessVectorTypeIndex typ=typeGPIL) const
G4int entries() const
G4GLOB_DLL std::ostream G4cout
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
#define G4endl
Definition: G4ios.hh:61
G4ProcessVector * GetAlongStepProcessVector(G4ProcessVectorTypeIndex typ=typeGPIL) const
G4GLOB_DLL std::ostream G4cerr
G4ProcessVector * GetPostStepProcessVector(G4ProcessVectorTypeIndex typ=typeGPIL) const
const G4TrackVector * G4SteppingManager::GetSecondary ( ) const
inline

Definition at line 459 of file G4SteppingManager.hh.

References G4Step::GetSecondary().

459  {
460  return fStep->GetSecondary();
461  }
const G4TrackVector * GetSecondary() const
G4Step * G4SteppingManager::GetStep ( ) const
inline

Definition at line 486 of file G4SteppingManager.hh.

Referenced by G4ErrorPropagator::InitG4Track(), and G4TrackingManager::ProcessOneTrack().

486  {
487  return fStep;
488  }
G4SteppingControl G4SteppingManager::GetStepControlFlag ( )
inline

Definition at line 446 of file G4SteppingManager.hh.

Referenced by G4VSteppingVerbose::CopyState().

446  {
447  return StepControlFlag;
448  }
G4double G4SteppingManager::GetsumEnergyChange ( )
inline

Definition at line 333 of file G4SteppingManager.hh.

Referenced by G4VSteppingVerbose::CopyState().

333  {
334  return sumEnergyChange;
335  }
G4double G4SteppingManager::GetTempInitVelocity ( )
inline

Definition at line 323 of file G4SteppingManager.hh.

Referenced by G4VSteppingVerbose::CopyState().

323  {
324  return TempInitVelocity;
325  }
G4double G4SteppingManager::GetTempVelocity ( )
inline

Definition at line 326 of file G4SteppingManager.hh.

Referenced by G4VSteppingVerbose::CopyState().

326  {
327  return TempVelocity;
328  }
const G4TouchableHandle & G4SteppingManager::GetTouchableHandle ( )
inline

Definition at line 442 of file G4SteppingManager.hh.

Referenced by G4VSteppingVerbose::CopyState().

442  {
443  return fTouchableHandle;
444  }
G4Track * G4SteppingManager::GetTrack ( ) const
inline

Definition at line 474 of file G4SteppingManager.hh.

Referenced by G4TrackingMessenger::SetNewValue().

474  {
475  return fTrack;
476  }
G4UserSteppingAction * G4SteppingManager::GetUserAction ( )
inline

Definition at line 470 of file G4SteppingManager.hh.

Referenced by G4VSteppingVerbose::CopyState().

470  {
471  return fUserSteppingAction;
472  }
G4int G4SteppingManager::GetverboseLevel ( )
inline

Definition at line 422 of file G4SteppingManager.hh.

Referenced by G4VSteppingVerbose::CopyState().

422  {
423  return verboseLevel;
424  }
void G4SteppingManager::SetInitialStep ( G4Track valueTrack)

Definition at line 256 of file G4SteppingManager.cc.

References G4Navigator::CreateTouchableHistory(), fAlive, FatalException, fPostponeToNextEvent, fStopAndKill, fStopButAlive, fSuspend, fUndefined, G4cerr, G4cout, G4endl, G4Exception(), G4Track::GetCurrentStepNumber(), G4Track::GetDynamicParticle(), G4Track::GetKineticEnergy(), G4VPhysicalVolume::GetLogicalVolume(), G4DynamicParticle::GetMass(), G4Track::GetMomentumDirection(), G4Track::GetParentID(), G4Track::GetPosition(), G4VPhysicalVolume::GetRegularStructureId(), G4Track::GetTouchableHandle(), G4Track::GetTrackStatus(), G4VTouchable::GetVolume(), G4Track::GetVolume(), G4Step::InitializeStep(), G4Navigator::LocateGlobalPointAndSetup(), G4Navigator::ResetHierarchyAndLocate(), G4Track::SetLogicalVolumeAtVertex(), G4Track::SetNextTouchableHandle(), G4Track::SetTouchableHandle(), G4Track::SetTrackStatus(), G4Track::SetVertexKineticEnergy(), G4Track::SetVertexMomentumDirection(), G4Track::SetVertexPosition(), and G4VSteppingVerbose::TrackingStarted().

Referenced by G4ErrorPropagator::InitG4Track(), and G4TrackingManager::ProcessOneTrack().

258 {
259 
260 // Set up several local variables.
261  PreStepPointIsGeom = false;
262  FirstStep = true;
263  fParticleChange = 0;
264  fPreviousStepSize = 0.;
265  fStepStatus = fUndefined;
266 
267  fTrack = valueTrack;
268  Mass = fTrack->GetDynamicParticle()->GetMass();
269 
270  PhysicalStep = 0.;
271  GeometricalStep = 0.;
272  CorrectedStep = 0.;
273  PreStepPointIsGeom = false;
274  FirstStep = false;
275  fStepStatus = fUndefined;
276 
277  TempInitVelocity = 0.;
278  TempVelocity = 0.;
279  sumEnergyChange = 0.;
280 
281 
282 // If the primary track has 'Suspend' or 'PostponeToNextEvent' state,
283 // set the track state to 'Alive'.
284  if( (fTrack->GetTrackStatus()==fSuspend) ||
285  (fTrack->GetTrackStatus()==fPostponeToNextEvent) ){
286  fTrack->SetTrackStatus(fAlive);
287  }
288 
289 // If the primary track has 'zero' kinetic energy, set the track
290 // state to 'StopButAlive'.
291  if(fTrack->GetKineticEnergy() <= 0.0){
292  fTrack->SetTrackStatus( fStopButAlive );
293  }
294 
295 
296 // Set Touchable to track and a private attribute of G4SteppingManager
297 
298 
299  if ( ! fTrack->GetTouchableHandle() ) {
300  G4ThreeVector direction= fTrack->GetMomentumDirection();
301  fNavigator->LocateGlobalPointAndSetup( fTrack->GetPosition(),
302  &direction, false, false );
303  fTouchableHandle = fNavigator->CreateTouchableHistory();
304 
305  fTrack->SetTouchableHandle( fTouchableHandle );
306  fTrack->SetNextTouchableHandle( fTouchableHandle );
307  }else{
308  fTrack->SetNextTouchableHandle( fTouchableHandle = fTrack->GetTouchableHandle() );
309  G4VPhysicalVolume* oldTopVolume= fTrack->GetTouchableHandle()->GetVolume();
310  G4VPhysicalVolume* newTopVolume=
311  fNavigator->ResetHierarchyAndLocate( fTrack->GetPosition(),
312  fTrack->GetMomentumDirection(),
313  *((G4TouchableHistory*)fTrack->GetTouchableHandle()()) );
314 // if(newTopVolume != oldTopVolume ){
315  if(newTopVolume != oldTopVolume || oldTopVolume->GetRegularStructureId() == 1 ) {
316  fTouchableHandle = fNavigator->CreateTouchableHistory();
317  fTrack->SetTouchableHandle( fTouchableHandle );
318  fTrack->SetNextTouchableHandle( fTouchableHandle );
319  }
320  }
321 // Set vertex information of G4Track at here
322  if ( fTrack->GetCurrentStepNumber() == 0 ) {
323  fTrack->SetVertexPosition( fTrack->GetPosition() );
325  fTrack->SetVertexKineticEnergy( fTrack->GetKineticEnergy() );
326  fTrack->SetLogicalVolumeAtVertex( fTrack->GetVolume()->GetLogicalVolume() );
327  }
328 // Initial set up for attributes of 'G4SteppingManager'
329  fCurrentVolume = fTouchableHandle->GetVolume();
330 
331 // If track is already outside the world boundary, kill it
332  if( fCurrentVolume==0 ){
333  // If the track is a primary, stop processing
334  if(fTrack->GetParentID()==0)
335  {
336  G4cerr << "ERROR - G4SteppingManager::SetInitialStep()" << G4endl
337  << " Primary particle starting at - "
338  << fTrack->GetPosition()
339  << " - is outside of the world volume." << G4endl;
340  G4Exception("G4SteppingManager::SetInitialStep()", "Tracking0010",
341  FatalException, "Primary vertex outside of the world!");
342  }
343 
344  fTrack->SetTrackStatus( fStopAndKill );
345  G4cout << "WARNING - G4SteppingManager::SetInitialStep()" << G4endl
346  << " Initial track position is outside world! - "
347  << fTrack->GetPosition() << G4endl;
348  }
349  else {
350 // Initial set up for attribues of 'Step'
351  fStep->InitializeStep( fTrack );
352  }
353 #ifdef G4VERBOSE
354  // !!!!! Verbose
355  if(verboseLevel>0) fVerbose->TrackingStarted();
356 #endif
357 }
void SetTrackStatus(const G4TrackStatus aTrackStatus)
G4int GetParentID() const
void SetVertexMomentumDirection(const G4ThreeVector &aValue)
const G4DynamicParticle * GetDynamicParticle() const
const G4ThreeVector & GetPosition() const
G4TrackStatus GetTrackStatus() const
void SetNextTouchableHandle(const G4TouchableHandle &apValue)
void SetTouchableHandle(const G4TouchableHandle &apValue)
virtual G4VPhysicalVolume * ResetHierarchyAndLocate(const G4ThreeVector &point, const G4ThreeVector &direction, const G4TouchableHistory &h)
Definition: G4Navigator.cc:90
G4double GetKineticEnergy() const
G4GLOB_DLL std::ostream G4cout
G4int GetCurrentStepNumber() const
G4double GetMass() const
virtual G4int GetRegularStructureId() const =0
void SetVertexKineticEnergy(const G4double aValue)
const G4TouchableHandle & GetTouchableHandle() const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
G4TouchableHistory * CreateTouchableHistory() const
const G4ThreeVector & GetMomentumDirection() const
G4LogicalVolume * GetLogicalVolume() const
virtual G4VPhysicalVolume * GetVolume(G4int depth=0) const
Definition: G4VTouchable.cc:44
void SetVertexPosition(const G4ThreeVector &aValue)
virtual G4VPhysicalVolume * LocateGlobalPointAndSetup(const G4ThreeVector &point, const G4ThreeVector *direction=0, const G4bool pRelativeSearch=true, const G4bool ignoreDirection=true)
Definition: G4Navigator.cc:118
G4VPhysicalVolume * GetVolume() const
#define G4endl
Definition: G4ios.hh:61
void InitializeStep(G4Track *aValue)
G4GLOB_DLL std::ostream G4cerr
void SetLogicalVolumeAtVertex(const G4LogicalVolume *)
virtual void TrackingStarted()=0
void G4SteppingManager::SetNavigator ( G4Navigator value)
inline

Definition at line 463 of file G4SteppingManager.hh.

Referenced by G4SteppingManager().

463  {
464  fNavigator = value;
465  }
const XML_Char int const XML_Char * value
void G4SteppingManager::SetUserAction ( G4UserSteppingAction apAction)
inline

Definition at line 467 of file G4SteppingManager.hh.

Referenced by G4TrackingManager::SetUserAction().

467  {
468  fUserSteppingAction = apAction;
469  }
void G4SteppingManager::SetVerbose ( G4VSteppingVerbose yourVerbose)
inline

Definition at line 482 of file G4SteppingManager.hh.

482  {
483  fVerbose = yourVerbose;
484  }
void G4SteppingManager::SetVerboseLevel ( G4int  vLevel)
inline

Definition at line 478 of file G4SteppingManager.hh.

Referenced by RE06SteppingVerbose::InitializeTimers(), and G4ErrorPropagatorManager::SetSteppingManagerVerboseLevel().

478  {
479  verboseLevel = vLevel;
480  }
G4StepStatus G4SteppingManager::Stepping ( )

Definition at line 116 of file G4SteppingManager.cc.

References G4Track::AddTrackLength(), G4VSteppingVerbose::AlongStepDoItAllDone(), G4VSteppingVerbose::AtRestDoItInvoked(), AvoidHitInvocation, G4Step::CopyPostToPreStepPoint(), fAtRestDoItProc, fStopAndKill, fStopButAlive, G4Step::GetControlFlag(), G4VPhysicalVolume::GetLogicalVolume(), G4Track::GetNextTouchableHandle(), G4StepPoint::GetPhysicalVolume(), G4StepPoint::GetPosition(), G4Step::GetPostStepPoint(), G4Step::GetPreStepPoint(), G4LogicalVolume::GetRegion(), G4Region::GetRegionalSteppingAction(), G4Step::GetStepLength(), G4Track::GetTrackStatus(), G4VSensitiveDetector::Hit(), G4INCL::Math::max(), G4VSteppingVerbose::NewStep(), G4VSteppingVerbose::PostStepDoItAllDone(), G4Step::ResetTotalEnergyDeposit(), G4Step::SetPointerToVectorOfAuxiliaryPoints(), G4StepPoint::SetSafety(), G4VSteppingVerbose::SetSilent(), G4Step::SetStepLength(), G4Track::SetStepLength(), G4StepPoint::SetStepStatus(), G4Track::SetTouchableHandle(), G4Step::SetTrack(), G4Track::SetTrackStatus(), G4VSteppingVerbose::StepInfo(), G4Step::UpdateTrack(), and G4UserSteppingAction::UserSteppingAction().

Referenced by G4ErrorPropagator::MakeOneStep(), and G4TrackingManager::ProcessOneTrack().

118 {
119 
120 //--------
121 // Prelude
122 //--------
123 #ifdef G4VERBOSE
124  // !!!!! Verbose
125  if(verboseLevel>0) fVerbose->NewStep();
126  else
127  if(verboseLevel==-1) {
129  }
130  else
132 #endif
133 
134 // Store last PostStepPoint to PreStepPoint, and swap current and nex
135 // volume information of G4Track. Reset total energy deposit in one Step.
136  fStep->CopyPostToPreStepPoint();
137  fStep->ResetTotalEnergyDeposit();
138 
139 // Switch next touchable in track to current one
140  fTrack->SetTouchableHandle(fTrack->GetNextTouchableHandle());
141 
142 // Reset the secondary particles
143  fN2ndariesAtRestDoIt = 0;
144  fN2ndariesAlongStepDoIt = 0;
145  fN2ndariesPostStepDoIt = 0;
146 
147 //JA Set the volume before it is used (in DefineStepLength() for User Limit)
148  fCurrentVolume = fStep->GetPreStepPoint()->GetPhysicalVolume();
149 
150 // Reset the step's auxiliary points vector pointer
152 
153 //-----------------
154 // AtRest Processes
155 //-----------------
156 
157  if( fTrack->GetTrackStatus() == fStopButAlive ){
158  if( MAXofAtRestLoops>0 ){
159  InvokeAtRestDoItProcs();
160  fStepStatus = fAtRestDoItProc;
161  fStep->GetPostStepPoint()->SetStepStatus( fStepStatus );
162 
163 #ifdef G4VERBOSE
164  // !!!!! Verbose
165  if(verboseLevel>0) fVerbose->AtRestDoItInvoked();
166 #endif
167 
168  }
169  // Make sure the track is killed
170  fTrack->SetTrackStatus( fStopAndKill );
171  }
172 
173 //---------------------------------
174 // AlongStep and PostStep Processes
175 //---------------------------------
176 
177 
178  else{
179  // Find minimum Step length demanded by active disc./cont. processes
180  DefinePhysicalStepLength();
181 
182  // Store the Step length (geometrical length) to G4Step and G4Track
183  fStep->SetStepLength( PhysicalStep );
184  fTrack->SetStepLength( PhysicalStep );
185  G4double GeomStepLength = PhysicalStep;
186 
187  // Store StepStatus to PostStepPoint
188  fStep->GetPostStepPoint()->SetStepStatus( fStepStatus );
189 
190  // Invoke AlongStepDoIt
191  InvokeAlongStepDoItProcs();
192 
193  // Update track by taking into account all changes by AlongStepDoIt
194  fStep->UpdateTrack();
195 
196  // Update safety after invocation of all AlongStepDoIts
197  endpointSafOrigin= fPostStepPoint->GetPosition();
198 // endpointSafety= std::max( proposedSafety - GeomStepLength, 0.);
199  endpointSafety= std::max( proposedSafety - GeomStepLength, kCarTolerance);
200 
201  fStep->GetPostStepPoint()->SetSafety( endpointSafety );
202 
203 #ifdef G4VERBOSE
204  // !!!!! Verbose
205  if(verboseLevel>0) fVerbose->AlongStepDoItAllDone();
206 #endif
207 
208  // Invoke PostStepDoIt
209  InvokePostStepDoItProcs();
210 
211 #ifdef G4VERBOSE
212  // !!!!! Verbose
213  if(verboseLevel>0) fVerbose->PostStepDoItAllDone();
214 #endif
215  }
216 
217 //-------
218 // Finale
219 //-------
220 
221 // Update 'TrackLength' and remeber the Step length of the current Step
222  fTrack->AddTrackLength(fStep->GetStepLength());
223  fPreviousStepSize = fStep->GetStepLength();
224  fStep->SetTrack(fTrack);
225 #ifdef G4VERBOSE
226  // !!!!! Verbose
227 
228  if(verboseLevel>0) fVerbose->StepInfo();
229 #endif
230 // Send G4Step information to Hit/Dig if the volume is sensitive
231  fCurrentVolume = fStep->GetPreStepPoint()->GetPhysicalVolume();
232  StepControlFlag = fStep->GetControlFlag();
233  if( fCurrentVolume != 0 && StepControlFlag != AvoidHitInvocation) {
234  fSensitive = fStep->GetPreStepPoint()->
235  GetSensitiveDetector();
236  if( fSensitive != 0 ) {
237  fSensitive->Hit(fStep);
238  }
239  }
240 
241 // User intervention process.
242  if( fUserSteppingAction != 0 ) {
243  fUserSteppingAction->UserSteppingAction(fStep);
244  }
245  G4UserSteppingAction* regionalAction
248  if( regionalAction ) regionalAction->UserSteppingAction(fStep);
249 
250 // Stepping process finish. Return the value of the StepStatus.
251  return fStepStatus;
252 
253 }
void SetTrackStatus(const G4TrackStatus aTrackStatus)
void SetStepLength(G4double value)
void SetTrack(G4Track *value)
G4double GetStepLength() const
static void SetSilent(G4int fSilent)
virtual void StepInfo()=0
virtual void PostStepDoItAllDone()=0
G4TrackStatus GetTrackStatus() const
void SetTouchableHandle(const G4TouchableHandle &apValue)
G4SteppingControl GetControlFlag() const
void SetPointerToVectorOfAuxiliaryPoints(std::vector< G4ThreeVector > *theNewVectorPointer)
Definition: G4Step.hh:237
G4Region * GetRegion() const
virtual void UserSteppingAction(const G4Step *)
void SetStepStatus(const G4StepStatus aValue)
G4StepPoint * GetPreStepPoint() const
void UpdateTrack()
G4VPhysicalVolume * GetPhysicalVolume() const
const G4ThreeVector & GetPosition() const
void SetStepLength(G4double value)
void ResetTotalEnergyDeposit()
const G4TouchableHandle & GetNextTouchableHandle() const
G4bool Hit(G4Step *aStep)
G4LogicalVolume * GetLogicalVolume() const
T max(const T t1, const T t2)
brief Return the largest of the two arguments
G4StepPoint * GetPostStepPoint() const
virtual void AtRestDoItInvoked()=0
void AddTrackLength(const G4double aValue)
virtual void NewStep()=0
virtual void AlongStepDoItAllDone()=0
double G4double
Definition: G4Types.hh:76
void SetSafety(const G4double aValue)
G4UserSteppingAction * GetRegionalSteppingAction() const
void CopyPostToPreStepPoint()

Field Documentation

G4bool G4SteppingManager::KillVerbose

Definition at line 186 of file G4SteppingManager.hh.

Referenced by G4SteppingManager(), and ~G4SteppingManager().


The documentation for this class was generated from the following files: