Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4SteppingManager Class Reference

#include <G4SteppingManager.hh>

Public Types

using ProfilerConfig = G4Step::ProfilerConfig
 

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 ()
 
std::size_t GetfAtRestDoItProcTriggered ()
 
std::size_t GetfAlongStepDoItProcTriggered ()
 
std::size_t GetfPostStepDoItProcTriggered ()
 
G4int GetfN2ndariesAtRestDoIt ()
 
G4int GetfN2ndariesAlongStepDoIt ()
 
G4int GetfN2ndariesPostStepDoIt ()
 
G4NavigatorGetfNavigator ()
 
G4int GetverboseLevel ()
 
std::size_t GetMAXofAtRestLoops ()
 
std::size_t GetMAXofAlongStepLoops ()
 
std::size_t GetMAXofPostStepLoops ()
 
G4SelectedAtRestDoItVectorGetfSelectedAtRestDoItVector ()
 
G4SelectedAlongStepDoItVectorGetfSelectedAlongStepDoItVector ()
 
G4SelectedPostStepDoItVectorGetfSelectedPostStepDoItVector ()
 
G4double GetfPreviousStepSize ()
 
const G4TouchableHandleGetTouchableHandle ()
 
G4SteppingControl GetStepControlFlag ()
 
G4UserSteppingActionGetUserAction ()
 
G4double GetphysIntLength ()
 
G4ForceCondition GetfCondition ()
 
G4GPILSelection GetfGPILSelection ()
 

Detailed Description

Definition at line 73 of file G4SteppingManager.hh.

Member Typedef Documentation

◆ ProfilerConfig

Constructor & Destructor Documentation

◆ G4SteppingManager()

G4SteppingManager::G4SteppingManager ( )

Definition at line 53 of file G4SteppingManager.cc.

55{
56 // Construct simple 'has-a' related objects
57
58 fStep = new G4Step();
59 fSecondary = fStep->NewSecondaryVector();
60 fPreStepPoint = fStep->GetPreStepPoint();
61 fPostStepPoint = fStep->GetPostStepPoint();
62
63#ifdef G4VERBOSE
65 if (fVerbose == nullptr) {
68 if (prec > 0) {
69 fVerbose = new G4SteppingVerboseWithUnits(prec);
70 }
71 else {
72 fVerbose = new G4SteppingVerbose();
73 }
74 }
75 else {
77 }
78 KillVerbose = true;
79 }
80 else {
81 KillVerbose = false;
82 }
83 fVerbose->SetManager(this);
84#endif
85
87
88 fSelectedAtRestDoItVector = new G4SelectedAtRestDoItVector(SizeOfSelectedDoItVector, 0);
89 fSelectedAlongStepDoItVector = new G4SelectedAlongStepDoItVector(SizeOfSelectedDoItVector, 0);
90 fSelectedPostStepDoItVector = new G4SelectedPostStepDoItVector(SizeOfSelectedDoItVector, 0);
91
93
94 physIntLength = DBL_MAX;
96
97 fNoProcess = new G4NoProcess;
98}
std::vector< G4int > G4SelectedPostStepDoItVector
std::vector< G4int > G4SelectedAtRestDoItVector
std::vector< G4int > G4SelectedAlongStepDoItVector
int G4int
Definition G4Types.hh:85
G4double GetSurfaceTolerance() const
static G4GeometryTolerance * GetInstance()
G4StepPoint * GetPreStepPoint() const
G4TrackVector * NewSecondaryVector()
G4StepPoint * GetPostStepPoint() const
void SetNavigator(G4Navigator *value)
static G4int BestUnitPrecision()
static G4TransportationManager * GetTransportationManager()
static G4VSteppingVerbose * GetInstance()
virtual G4VSteppingVerbose * Clone()
static G4VSteppingVerbose * GetMasterInstance()
virtual void SetManager(G4SteppingManager *const)
#define DBL_MAX
Definition templates.hh:62

◆ ~G4SteppingManager()

G4SteppingManager::~G4SteppingManager ( )

Definition at line 101 of file G4SteppingManager.cc.

103{
104 fTouchableHandle = nullptr;
105
106 // Destruct simple 'has-a' objects
107 //
108 fStep->DeleteSecondaryVector();
109
110 // delete fSecondary;
111 delete fStep;
112 delete fSelectedAtRestDoItVector;
113 delete fSelectedAlongStepDoItVector;
114 delete fSelectedPostStepDoItVector;
115 delete fUserSteppingAction;
116#ifdef G4VERBOSE
117 if (KillVerbose) delete fVerbose;
118#endif
119}
void DeleteSecondaryVector()

Member Function Documentation

◆ GetCorrectedStep()

G4double G4SteppingManager::GetCorrectedStep ( )
inline

Definition at line 276 of file G4SteppingManager.hh.

276{ return CorrectedStep; }

Referenced by G4VSteppingVerbose::CopyState().

◆ GetcurrentMinimumStep()

G4double G4SteppingManager::GetcurrentMinimumStep ( )

◆ GetfAlongStepDoItProcTriggered()

size_t G4SteppingManager::GetfAlongStepDoItProcTriggered ( )
inline

Definition at line 342 of file G4SteppingManager.hh.

343{
344 return fAtRestDoItProcTriggered;
345}

Referenced by G4VSteppingVerbose::CopyState().

◆ GetfAlongStepDoItVector()

G4ProcessVector * G4SteppingManager::GetfAlongStepDoItVector ( )
inline

Definition at line 312 of file G4SteppingManager.hh.

313{
314 return fAlongStepDoItVector;
315}

Referenced by G4VSteppingVerbose::CopyState().

◆ GetfAlongStepGetPhysIntVector()

G4ProcessVector * G4SteppingManager::GetfAlongStepGetPhysIntVector ( )
inline

Definition at line 324 of file G4SteppingManager.hh.

325{
326 return fAlongStepGetPhysIntVector;
327}

Referenced by G4VSteppingVerbose::CopyState().

◆ GetfAtRestDoItProcTriggered()

size_t G4SteppingManager::GetfAtRestDoItProcTriggered ( )
inline

Definition at line 340 of file G4SteppingManager.hh.

340{ return fAtRestDoItProcTriggered; }

Referenced by G4VSteppingVerbose::CopyState().

◆ GetfAtRestDoItVector()

G4ProcessVector * G4SteppingManager::GetfAtRestDoItVector ( )
inline

Definition at line 310 of file G4SteppingManager.hh.

310{ return fAtRestDoItVector; }

Referenced by G4VSteppingVerbose::CopyState().

◆ GetfAtRestGetPhysIntVector()

G4ProcessVector * G4SteppingManager::GetfAtRestGetPhysIntVector ( )
inline

Definition at line 319 of file G4SteppingManager.hh.

320{
321 return fAtRestGetPhysIntVector;
322}

Referenced by G4VSteppingVerbose::CopyState().

◆ GetfCondition()

G4ForceCondition G4SteppingManager::GetfCondition ( )
inline

Definition at line 385 of file G4SteppingManager.hh.

385{ return fCondition; }

Referenced by G4VSteppingVerbose::CopyState().

◆ GetfCurrentProcess()

G4VProcess * G4SteppingManager::GetfCurrentProcess ( )
inline

Definition at line 308 of file G4SteppingManager.hh.

308{ return fCurrentProcess; }

Referenced by G4VSteppingVerbose::CopyState().

◆ GetfCurrentVolume()

G4VPhysicalVolume * G4SteppingManager::GetfCurrentVolume ( )
inline

Definition at line 304 of file G4SteppingManager.hh.

304{ return fCurrentVolume; }

Referenced by G4VSteppingVerbose::CopyState().

◆ GetfGPILSelection()

G4GPILSelection G4SteppingManager::GetfGPILSelection ( )
inline

Definition at line 387 of file G4SteppingManager.hh.

387{ return fGPILSelection; }

Referenced by G4VSteppingVerbose::CopyState().

◆ GetFirstStep()

G4bool G4SteppingManager::GetFirstStep ( )
inline

Definition at line 280 of file G4SteppingManager.hh.

280{ return FirstStep; }

Referenced by G4VSteppingVerbose::CopyState().

◆ GetfN2ndariesAlongStepDoIt()

G4int G4SteppingManager::GetfN2ndariesAlongStepDoIt ( )
inline

Definition at line 354 of file G4SteppingManager.hh.

354{ return fN2ndariesAlongStepDoIt; }

Referenced by G4VSteppingVerbose::CopyState().

◆ GetfN2ndariesAtRestDoIt()

G4int G4SteppingManager::GetfN2ndariesAtRestDoIt ( )
inline

Definition at line 352 of file G4SteppingManager.hh.

352{ return fN2ndariesAtRestDoIt; }

Referenced by G4VSteppingVerbose::CopyState().

◆ GetfN2ndariesPostStepDoIt()

G4int G4SteppingManager::GetfN2ndariesPostStepDoIt ( )
inline

Definition at line 356 of file G4SteppingManager.hh.

356{ return fN2ndariesPostStepDoIt; }

Referenced by G4VSteppingVerbose::CopyState().

◆ GetfNavigator()

G4Navigator * G4SteppingManager::GetfNavigator ( )
inline

Definition at line 358 of file G4SteppingManager.hh.

358{ return fNavigator; }

Referenced by G4VSteppingVerbose::CopyState().

◆ GetfParticleChange()

G4VParticleChange * G4SteppingManager::GetfParticleChange ( )
inline

Definition at line 292 of file G4SteppingManager.hh.

292{ return fParticleChange; }

Referenced by G4VSteppingVerbose::CopyState().

◆ GetfPostStepDoItProcTriggered()

size_t G4SteppingManager::GetfPostStepDoItProcTriggered ( )
inline

Definition at line 347 of file G4SteppingManager.hh.

348{
349 return fPostStepDoItProcTriggered;
350}

Referenced by G4VSteppingVerbose::CopyState().

◆ GetfPostStepDoItVector()

G4ProcessVector * G4SteppingManager::GetfPostStepDoItVector ( )
inline

Definition at line 317 of file G4SteppingManager.hh.

317{ return fPostStepDoItVector; }

Referenced by G4VSteppingVerbose::CopyState().

◆ GetfPostStepGetPhysIntVector()

G4ProcessVector * G4SteppingManager::GetfPostStepGetPhysIntVector ( )
inline

Definition at line 329 of file G4SteppingManager.hh.

330{
331 return fPostStepGetPhysIntVector;
332}

Referenced by G4VSteppingVerbose::CopyState().

◆ GetfPostStepPoint()

G4StepPoint * G4SteppingManager::GetfPostStepPoint ( )
inline

Definition at line 302 of file G4SteppingManager.hh.

302{ return fPostStepPoint; }

Referenced by G4VSteppingVerbose::CopyState().

◆ GetfPreStepPoint()

G4StepPoint * G4SteppingManager::GetfPreStepPoint ( )
inline

Definition at line 300 of file G4SteppingManager.hh.

300{ return fPreStepPoint; }

Referenced by G4VSteppingVerbose::CopyState().

◆ GetfPreviousStepSize()

G4double G4SteppingManager::GetfPreviousStepSize ( )
inline

Definition at line 377 of file G4SteppingManager.hh.

377{ return fPreviousStepSize; }

Referenced by G4VSteppingVerbose::CopyState().

◆ GetfSecondary()

G4TrackVector * G4SteppingManager::GetfSecondary ( )
inline

Definition at line 296 of file G4SteppingManager.hh.

296{ return fStep->GetfSecondary(); }
G4TrackVector * GetfSecondary()

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

◆ GetfSelectedAlongStepDoItVector()

G4SelectedAlongStepDoItVector * G4SteppingManager::GetfSelectedAlongStepDoItVector ( )
inline

Definition at line 367 of file G4SteppingManager.hh.

368{
369 return fSelectedAlongStepDoItVector;
370}

Referenced by G4VSteppingVerbose::CopyState().

◆ GetfSelectedAtRestDoItVector()

G4SelectedAtRestDoItVector * G4SteppingManager::GetfSelectedAtRestDoItVector ( )
inline

Definition at line 362 of file G4SteppingManager.hh.

363{
364 return fSelectedAtRestDoItVector;
365}

Referenced by G4VSteppingVerbose::CopyState().

◆ GetfSelectedPostStepDoItVector()

G4SelectedPostStepDoItVector * G4SteppingManager::GetfSelectedPostStepDoItVector ( )
inline

Definition at line 372 of file G4SteppingManager.hh.

373{
374 return fSelectedPostStepDoItVector;
375}

Referenced by G4VSteppingVerbose::CopyState().

◆ GetfSensitive()

G4VSensitiveDetector * G4SteppingManager::GetfSensitive ( )
inline

Definition at line 306 of file G4SteppingManager.hh.

306{ return fSensitive; }

Referenced by G4VSteppingVerbose::CopyState().

◆ GetfStep()

G4Step * G4SteppingManager::GetfStep ( )
inline

Definition at line 298 of file G4SteppingManager.hh.

298{ return fStep; }

Referenced by G4VSteppingVerbose::CopyState().

◆ GetfStepStatus()

G4StepStatus G4SteppingManager::GetfStepStatus ( )
inline

Definition at line 282 of file G4SteppingManager.hh.

282{ return fStepStatus; }

Referenced by G4VSteppingVerbose::CopyState().

◆ GetfTrack()

G4Track * G4SteppingManager::GetfTrack ( )
inline

Definition at line 294 of file G4SteppingManager.hh.

294{ return fTrack; }

Referenced by G4VSteppingVerbose::CopyState().

◆ GetGeometricalStep()

G4double G4SteppingManager::GetGeometricalStep ( )
inline

Definition at line 274 of file G4SteppingManager.hh.

274{ return GeometricalStep; }

Referenced by G4VSteppingVerbose::CopyState().

◆ GetMass()

G4double G4SteppingManager::GetMass ( )
inline

Definition at line 288 of file G4SteppingManager.hh.

288{ return Mass; }

Referenced by G4VSteppingVerbose::CopyState().

◆ GetMAXofAlongStepLoops()

size_t G4SteppingManager::GetMAXofAlongStepLoops ( )
inline

Definition at line 336 of file G4SteppingManager.hh.

336{ return MAXofAlongStepLoops; }

Referenced by G4VSteppingVerbose::CopyState().

◆ GetMAXofAtRestLoops()

size_t G4SteppingManager::GetMAXofAtRestLoops ( )
inline

Definition at line 334 of file G4SteppingManager.hh.

334{ return MAXofAtRestLoops; }

Referenced by G4VSteppingVerbose::CopyState().

◆ GetMAXofPostStepLoops()

size_t G4SteppingManager::GetMAXofPostStepLoops ( )
inline

Definition at line 338 of file G4SteppingManager.hh.

338{ return MAXofPostStepLoops; }

Referenced by G4VSteppingVerbose::CopyState().

◆ GetnumberOfInteractionLengthLeft()

G4double G4SteppingManager::GetnumberOfInteractionLengthLeft ( )

◆ GetPhysicalStep()

G4double G4SteppingManager::GetPhysicalStep ( )
inline

Definition at line 272 of file G4SteppingManager.hh.

272{ return PhysicalStep; }

Referenced by G4VSteppingVerbose::CopyState().

◆ GetphysIntLength()

G4double G4SteppingManager::GetphysIntLength ( )
inline

Definition at line 383 of file G4SteppingManager.hh.

383{ return physIntLength; }

Referenced by G4VSteppingVerbose::CopyState().

◆ GetPreStepPointIsGeom()

G4bool G4SteppingManager::GetPreStepPointIsGeom ( )
inline

Definition at line 278 of file G4SteppingManager.hh.

278{ return PreStepPointIsGeom; }

Referenced by G4VSteppingVerbose::CopyState().

◆ GetProcessNumber()

void G4SteppingManager::GetProcessNumber ( )

Definition at line 380 of file G4SteppingManager.cc.

382{
383#ifdef debug
384 G4cout << "G4SteppingManager::GetProcessNumber: is called track=" << fTrack << G4endl;
385#endif
386
388 if (pm == nullptr) {
389 G4cerr << "ERROR - G4SteppingManager::GetProcessNumber()" << G4endl
390 << " ProcessManager is NULL for particle = "
391 << fTrack->GetDefinition()->GetParticleName()
392 << ", PDG_code = " << fTrack->GetDefinition()->GetPDGEncoding() << G4endl;
393 G4Exception("G4SteppingManager::GetProcessNumber()", "Tracking0011", FatalException,
394 "Process Manager is not found.");
395 return;
396 }
397
398 // AtRestDoits
399 //
400 MAXofAtRestLoops = pm->GetAtRestProcessVector()->entries();
401 fAtRestDoItVector = pm->GetAtRestProcessVector(typeDoIt);
402 fAtRestGetPhysIntVector = pm->GetAtRestProcessVector(typeGPIL);
403
404#ifdef debug
405 G4cout << "G4SteppingManager::GetProcessNumber: #ofAtRest=" << MAXofAtRestLoops << G4endl;
406#endif
407
408 // AlongStepDoits
409 //
410 MAXofAlongStepLoops = pm->GetAlongStepProcessVector()->entries();
411 fAlongStepDoItVector = pm->GetAlongStepProcessVector(typeDoIt);
412 fAlongStepGetPhysIntVector = pm->GetAlongStepProcessVector(typeGPIL);
413
414#ifdef debug
415 G4cout << "G4SteppingManager::GetProcessNumber:#ofAlongStp=" << MAXofAlongStepLoops << G4endl;
416#endif
417
418 // PostStepDoits
419 //
420 MAXofPostStepLoops = pm->GetPostStepProcessVector()->entries();
421 fPostStepDoItVector = pm->GetPostStepProcessVector(typeDoIt);
422 fPostStepGetPhysIntVector = pm->GetPostStepProcessVector(typeGPIL);
423
424#ifdef debug
425 G4cout << "G4SteppingManager::GetProcessNumber: #ofPostStep=" << MAXofPostStepLoops << G4endl;
426#endif
427
428 if (SizeOfSelectedDoItVector < MAXofAtRestLoops ||
429 SizeOfSelectedDoItVector < MAXofAlongStepLoops ||
430 SizeOfSelectedDoItVector < MAXofPostStepLoops)
431 {
432 G4cerr << "ERROR - G4SteppingManager::GetProcessNumber()" << G4endl
433 << " SizeOfSelectedDoItVector= " << SizeOfSelectedDoItVector
434 << " ; is smaller then one of MAXofAtRestLoops= " << MAXofAtRestLoops << G4endl
435 << " or MAXofAlongStepLoops= " << MAXofAlongStepLoops
436 << " or MAXofPostStepLoops= " << MAXofPostStepLoops << G4endl;
437 G4Exception("G4SteppingManager::GetProcessNumber()", "Tracking0012", FatalException,
438 "The array size is smaller than the actual No of processes.");
439 }
440}
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
@ typeGPIL
@ typeDoIt
G4GLOB_DLL std::ostream G4cerr
#define G4endl
Definition G4ios.hh:67
G4GLOB_DLL std::ostream G4cout
G4ProcessManager * GetProcessManager() const
const G4String & GetParticleName() const
G4ProcessVector * GetAlongStepProcessVector(G4ProcessVectorTypeIndex typ=typeGPIL) const
G4ProcessVector * GetPostStepProcessVector(G4ProcessVectorTypeIndex typ=typeGPIL) const
G4ProcessVector * GetAtRestProcessVector(G4ProcessVectorTypeIndex typ=typeGPIL) const
std::size_t entries() const
G4ParticleDefinition * GetDefinition() const

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

◆ GetSecondary()

const G4TrackVector * G4SteppingManager::GetSecondary ( ) const
inline

Definition at line 389 of file G4SteppingManager.hh.

390{
391 return fStep->GetSecondary();
392}
const G4TrackVector * GetSecondary() const

◆ GetStep()

G4Step * G4SteppingManager::GetStep ( ) const
inline

Definition at line 412 of file G4SteppingManager.hh.

412{ return fStep; }

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

◆ GetStepControlFlag()

G4SteppingControl G4SteppingManager::GetStepControlFlag ( )
inline

Definition at line 381 of file G4SteppingManager.hh.

381{ return StepControlFlag; }

Referenced by G4VSteppingVerbose::CopyState().

◆ GetsumEnergyChange()

G4double G4SteppingManager::GetsumEnergyChange ( )
inline

Definition at line 290 of file G4SteppingManager.hh.

290{ return sumEnergyChange; }

Referenced by G4VSteppingVerbose::CopyState().

◆ GetTempInitVelocity()

G4double G4SteppingManager::GetTempInitVelocity ( )
inline

Definition at line 284 of file G4SteppingManager.hh.

284{ return TempInitVelocity; }

Referenced by G4VSteppingVerbose::CopyState().

◆ GetTempVelocity()

G4double G4SteppingManager::GetTempVelocity ( )
inline

Definition at line 286 of file G4SteppingManager.hh.

286{ return TempVelocity; }

Referenced by G4VSteppingVerbose::CopyState().

◆ GetTouchableHandle()

const G4TouchableHandle & G4SteppingManager::GetTouchableHandle ( )
inline

Definition at line 379 of file G4SteppingManager.hh.

379{ return fTouchableHandle; }

Referenced by G4VSteppingVerbose::CopyState().

◆ GetTrack()

G4Track * G4SteppingManager::GetTrack ( ) const
inline

Definition at line 403 of file G4SteppingManager.hh.

403{ return fTrack; }

Referenced by G4TrackingMessenger::SetNewValue().

◆ GetUserAction()

G4UserSteppingAction * G4SteppingManager::GetUserAction ( )
inline

Definition at line 401 of file G4SteppingManager.hh.

401{ return fUserSteppingAction; }

Referenced by G4VSteppingVerbose::CopyState().

◆ GetverboseLevel()

G4int G4SteppingManager::GetverboseLevel ( )
inline

Definition at line 360 of file G4SteppingManager.hh.

360{ return verboseLevel; }

Referenced by G4VSteppingVerbose::CopyState().

◆ SetInitialStep()

void G4SteppingManager::SetInitialStep ( G4Track * valueTrack)

Definition at line 274 of file G4SteppingManager.cc.

276{
277 // Set up several local variables
278 //
279 PreStepPointIsGeom = false;
280 FirstStep = true;
281 fParticleChange = nullptr;
282 fPreviousStepSize = 0.;
283 fStepStatus = fUndefined;
284
285 fTrack = valueTrack;
286 Mass = fTrack->GetDynamicParticle()->GetMass();
287
288 PhysicalStep = 0.;
289 GeometricalStep = 0.;
290 CorrectedStep = 0.;
291 PreStepPointIsGeom = false;
292 FirstStep = false;
293
294 TempInitVelocity = 0.;
295 TempVelocity = 0.;
296 sumEnergyChange = 0.;
297
298 // If the primary track has 'Suspend' or 'PostponeToNextEvent' state,
299 // set the track state to 'Alive'
300 //
301 if ((fTrack->GetTrackStatus() == fSuspend) || (fTrack->GetTrackStatus() == fPostponeToNextEvent))
302 {
303 fTrack->SetTrackStatus(fAlive);
304 }
305
306 // If the primary track has 'zero' kinetic energy, set the track
307 // state to 'StopButAlive'
308 //
309 if (fTrack->GetKineticEnergy() <= 0.0) {
311 }
312
313 // Set Touchable to track and a private attribute of G4SteppingManager
314
315 if (! fTrack->GetTouchableHandle()) {
316 G4ThreeVector direction = fTrack->GetMomentumDirection();
317 fNavigator->LocateGlobalPointAndSetup(fTrack->GetPosition(), &direction, false, false);
318 fTouchableHandle = fNavigator->CreateTouchableHistory();
319 fTrack->SetTouchableHandle(fTouchableHandle);
320 fTrack->SetNextTouchableHandle(fTouchableHandle);
321 }
322 else {
323 fTrack->SetNextTouchableHandle(fTouchableHandle = fTrack->GetTouchableHandle());
324 G4VPhysicalVolume* oldTopVolume = fTrack->GetTouchableHandle()->GetVolume();
325 G4VPhysicalVolume* newTopVolume = fNavigator->ResetHierarchyAndLocate(fTrack->GetPosition(),
327 if (newTopVolume != oldTopVolume || oldTopVolume->GetRegularStructureId() == 1) {
328 fTouchableHandle = fNavigator->CreateTouchableHistory();
329 fTrack->SetTouchableHandle(fTouchableHandle);
330 fTrack->SetNextTouchableHandle(fTouchableHandle);
331 }
332 }
333
334 // Set OriginTouchableHandle for primary track
335 //
336 if (fTrack->GetParentID() == 0) {
338 }
339
340 // Set vertex information of G4Track at here
341 //
342 if (fTrack->GetCurrentStepNumber() == 0) {
343 fTrack->SetVertexPosition(fTrack->GetPosition());
345 fTrack->SetVertexKineticEnergy(fTrack->GetKineticEnergy());
347 }
348
349 // Initial set up for attributes of 'G4SteppingManager'
350 fCurrentVolume = fTouchableHandle->GetVolume();
351
352 // If track is already outside the world boundary, kill it
353 //
354 if (fCurrentVolume == nullptr) {
355 // If the track is a primary, stop processing
356 if (fTrack->GetParentID() == 0) {
357 G4cerr << "ERROR - G4SteppingManager::SetInitialStep()" << G4endl
358 << " Primary particle starting at - " << fTrack->GetPosition()
359 << " - is outside of the world volume." << G4endl;
360 G4Exception("G4SteppingManager::SetInitialStep()", "Tracking0010", FatalException,
361 "Primary vertex outside of the world!");
362 }
363
365 G4cout << "WARNING - G4SteppingManager::SetInitialStep()" << G4endl
366 << " Initial track position is outside world! - " << fTrack->GetPosition()
367 << G4endl;
368 }
369 else {
370 // Initial set up for attributes of 'Step'
371 fStep->InitializeStep(fTrack);
372 }
373
374#ifdef G4VERBOSE
375 if (verboseLevel > 0) fVerbose->TrackingStarted();
376#endif
377}
@ fUndefined
@ fSuspend
@ fAlive
@ fStopAndKill
@ fStopButAlive
@ fPostponeToNextEvent
G4double GetMass() const
G4TouchableHistory * CreateTouchableHistory() const
virtual G4VPhysicalVolume * LocateGlobalPointAndSetup(const G4ThreeVector &point, const G4ThreeVector *direction=nullptr, const G4bool pRelativeSearch=true, const G4bool ignoreDirection=true)
virtual G4VPhysicalVolume * ResetHierarchyAndLocate(const G4ThreeVector &point, const G4ThreeVector &direction, const G4TouchableHistory &h)
void InitializeStep(G4Track *aValue)
virtual G4VPhysicalVolume * GetVolume(G4int depth=0) const
G4TrackStatus GetTrackStatus() const
void SetTrackStatus(const G4TrackStatus aTrackStatus)
G4VPhysicalVolume * GetVolume() const
void SetVertexPosition(const G4ThreeVector &aValue)
void SetVertexMomentumDirection(const G4ThreeVector &aValue)
void SetNextTouchableHandle(const G4TouchableHandle &apValue)
const G4ThreeVector & GetPosition() const
void SetTouchableHandle(const G4TouchableHandle &apValue)
G4int GetCurrentStepNumber() const
void SetOriginTouchableHandle(const G4TouchableHandle &apValue)
const G4DynamicParticle * GetDynamicParticle() const
const G4TouchableHandle & GetTouchableHandle() const
const G4ThreeVector & GetMomentumDirection() const
G4double GetKineticEnergy() const
void SetVertexKineticEnergy(const G4double aValue)
G4int GetParentID() const
void SetLogicalVolumeAtVertex(const G4LogicalVolume *)
G4LogicalVolume * GetLogicalVolume() const
virtual G4int GetRegularStructureId() const =0
virtual void TrackingStarted()=0

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

◆ SetNavigator()

void G4SteppingManager::SetNavigator ( G4Navigator * value)
inline

Definition at line 394 of file G4SteppingManager.hh.

394{ fNavigator = value; }

Referenced by G4SteppingManager().

◆ SetUserAction()

void G4SteppingManager::SetUserAction ( G4UserSteppingAction * apAction)
inline

Definition at line 396 of file G4SteppingManager.hh.

397{
398 fUserSteppingAction = apAction;
399}

Referenced by G4TrackingManager::SetUserAction().

◆ SetVerbose()

void G4SteppingManager::SetVerbose ( G4VSteppingVerbose * yourVerbose)
inline

Definition at line 407 of file G4SteppingManager.hh.

408{
409 fVerbose = yourVerbose;
410}

◆ SetVerboseLevel()

void G4SteppingManager::SetVerboseLevel ( G4int vLevel)
inline

Definition at line 405 of file G4SteppingManager.hh.

405{ verboseLevel = vLevel; }

Referenced by G4ErrorPropagatorManager::SetSteppingManagerVerboseLevel(), and G4TrackingManager::SetVerboseLevel().

◆ Stepping()

G4StepStatus G4SteppingManager::Stepping ( )

Definition at line 122 of file G4SteppingManager.cc.

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

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


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