Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
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 ()
 

Public Attributes

G4bool KillVerbose
 

Detailed Description

Definition at line 92 of file G4SteppingManager.hh.

Constructor & Destructor Documentation

◆ G4SteppingManager()

G4SteppingManager::G4SteppingManager ( )

Definition at line 56 of file G4SteppingManager.cc.

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}
std::vector< G4int > G4SelectedAlongStepDoItVector
std::vector< G4int > G4SelectedAtRestDoItVector
std::vector< G4int > G4SelectedPostStepDoItVector
G4double GetSurfaceTolerance() const
static G4GeometryTolerance * GetInstance()
Definition: G4Step.hh:78
G4StepPoint * GetPreStepPoint() const
G4TrackVector * NewSecondaryVector()
G4StepPoint * GetPostStepPoint() const
void SetNavigator(G4Navigator *value)
static G4TransportationManager * GetTransportationManager()
static G4VSteppingVerbose * GetInstance()
static void SetInstance(G4VSteppingVerbose *Instance)
#define DBL_MAX
Definition: templates.hh:83

◆ ~G4SteppingManager()

G4SteppingManager::~G4SteppingManager ( )

Definition at line 97 of file G4SteppingManager.cc.

99{
100
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

◆ GetCorrectedStep()

G4double G4SteppingManager::GetCorrectedStep ( )
inline

Definition at line 307 of file G4SteppingManager.hh.

307 {
308 return CorrectedStep;
309 }

Referenced by G4VSteppingVerbose::CopyState().

◆ GetcurrentMinimumStep()

G4double G4SteppingManager::GetcurrentMinimumStep ( )

◆ GetfAlongStepDoItProcTriggered()

size_t G4SteppingManager::GetfAlongStepDoItProcTriggered ( )
inline

Definition at line 403 of file G4SteppingManager.hh.

403 {
404 return fAtRestDoItProcTriggered;
405 }

Referenced by G4VSteppingVerbose::CopyState().

◆ GetfAlongStepDoItVector()

G4ProcessVector * G4SteppingManager::GetfAlongStepDoItVector ( )
inline

Definition at line 371 of file G4SteppingManager.hh.

371 {
372 return fAlongStepDoItVector;
373 }

Referenced by G4VSteppingVerbose::CopyState().

◆ GetfAlongStepGetPhysIntVector()

G4ProcessVector * G4SteppingManager::GetfAlongStepGetPhysIntVector ( )
inline

Definition at line 382 of file G4SteppingManager.hh.

382 {
383 return fAlongStepGetPhysIntVector;
384 }

Referenced by G4VSteppingVerbose::CopyState().

◆ GetfAtRestDoItProcTriggered()

size_t G4SteppingManager::GetfAtRestDoItProcTriggered ( )
inline

Definition at line 400 of file G4SteppingManager.hh.

400 {
401 return fAtRestDoItProcTriggered;
402 }

Referenced by G4VSteppingVerbose::CopyState().

◆ GetfAtRestDoItVector()

G4ProcessVector * G4SteppingManager::GetfAtRestDoItVector ( )
inline

Definition at line 368 of file G4SteppingManager.hh.

368 {
369 return fAtRestDoItVector;
370 }

Referenced by G4VSteppingVerbose::CopyState().

◆ GetfAtRestGetPhysIntVector()

G4ProcessVector * G4SteppingManager::GetfAtRestGetPhysIntVector ( )
inline

Definition at line 378 of file G4SteppingManager.hh.

378 {
379 return fAtRestGetPhysIntVector;
380 }

Referenced by G4VSteppingVerbose::CopyState().

◆ GetfCondition()

G4ForceCondition G4SteppingManager::GetfCondition ( )
inline

Definition at line 452 of file G4SteppingManager.hh.

452 {
453 return fCondition;
454 }

Referenced by G4VSteppingVerbose::CopyState().

◆ GetfCurrentProcess()

G4VProcess * G4SteppingManager::GetfCurrentProcess ( )
inline

Definition at line 364 of file G4SteppingManager.hh.

364 {
365 return fCurrentProcess;
366 }

Referenced by G4VSteppingVerbose::CopyState().

◆ GetfCurrentVolume()

G4VPhysicalVolume * G4SteppingManager::GetfCurrentVolume ( )
inline

Definition at line 358 of file G4SteppingManager.hh.

358 {
359 return fCurrentVolume;
360 }

Referenced by G4VSteppingVerbose::CopyState().

◆ GetfGPILSelection()

G4GPILSelection G4SteppingManager::GetfGPILSelection ( )
inline

Definition at line 455 of file G4SteppingManager.hh.

455 {
456 return fGPILSelection;
457 }

Referenced by G4VSteppingVerbose::CopyState().

◆ GetFirstStep()

G4bool G4SteppingManager::GetFirstStep ( )
inline

Definition at line 315 of file G4SteppingManager.hh.

315 {
316 return FirstStep;
317 }

Referenced by G4VSteppingVerbose::CopyState().

◆ GetfN2ndariesAlongStepDoIt()

G4int G4SteppingManager::GetfN2ndariesAlongStepDoIt ( )
inline

Definition at line 412 of file G4SteppingManager.hh.

412 {
413 return fN2ndariesAlongStepDoIt;
414 }

Referenced by G4VSteppingVerbose::CopyState().

◆ GetfN2ndariesAtRestDoIt()

G4int G4SteppingManager::GetfN2ndariesAtRestDoIt ( )
inline

Definition at line 409 of file G4SteppingManager.hh.

409 {
410 return fN2ndariesAtRestDoIt;
411 }

Referenced by G4VSteppingVerbose::CopyState().

◆ GetfN2ndariesPostStepDoIt()

G4int G4SteppingManager::GetfN2ndariesPostStepDoIt ( )
inline

Definition at line 415 of file G4SteppingManager.hh.

415 {
416 return fN2ndariesPostStepDoIt;
417 }

Referenced by G4VSteppingVerbose::CopyState().

◆ GetfNavigator()

G4Navigator * G4SteppingManager::GetfNavigator ( )
inline

Definition at line 419 of file G4SteppingManager.hh.

419 {
420 return fNavigator;
421 }

Referenced by G4VSteppingVerbose::CopyState().

◆ GetfParticleChange()

G4VParticleChange * G4SteppingManager::GetfParticleChange ( )
inline

Definition at line 337 of file G4SteppingManager.hh.

337 {
338 return fParticleChange;
339 }

Referenced by G4VSteppingVerbose::CopyState().

◆ GetfPostStepDoItProcTriggered()

size_t G4SteppingManager::GetfPostStepDoItProcTriggered ( )
inline

Definition at line 406 of file G4SteppingManager.hh.

406 {
407 return fPostStepDoItProcTriggered;
408 }

Referenced by G4VSteppingVerbose::CopyState().

◆ GetfPostStepDoItVector()

G4ProcessVector * G4SteppingManager::GetfPostStepDoItVector ( )
inline

Definition at line 374 of file G4SteppingManager.hh.

374 {
375 return fPostStepDoItVector;
376 }

Referenced by G4VSteppingVerbose::CopyState().

◆ GetfPostStepGetPhysIntVector()

G4ProcessVector * G4SteppingManager::GetfPostStepGetPhysIntVector ( )
inline

Definition at line 386 of file G4SteppingManager.hh.

386 {
387 return fPostStepGetPhysIntVector;
388 }

Referenced by G4VSteppingVerbose::CopyState().

◆ GetfPostStepPoint()

G4StepPoint * G4SteppingManager::GetfPostStepPoint ( )
inline

Definition at line 354 of file G4SteppingManager.hh.

354 {
355 return fPostStepPoint;
356 }

Referenced by G4VSteppingVerbose::CopyState().

◆ GetfPreStepPoint()

G4StepPoint * G4SteppingManager::GetfPreStepPoint ( )
inline

Definition at line 351 of file G4SteppingManager.hh.

351 {
352 return fPreStepPoint;
353 }

Referenced by G4VSteppingVerbose::CopyState().

◆ GetfPreviousStepSize()

G4double G4SteppingManager::GetfPreviousStepSize ( )
inline

Definition at line 438 of file G4SteppingManager.hh.

438 {
439 return fPreviousStepSize;
440 }

Referenced by G4VSteppingVerbose::CopyState().

◆ GetfSecondary()

G4TrackVector * G4SteppingManager::GetfSecondary ( )
inline

Definition at line 345 of file G4SteppingManager.hh.

345 {
346 return fStep->GetfSecondary();
347 }
G4TrackVector * GetfSecondary()

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

◆ GetfSelectedAlongStepDoItVector()

G4SelectedAlongStepDoItVector * G4SteppingManager::GetfSelectedAlongStepDoItVector ( )
inline

Definition at line 430 of file G4SteppingManager.hh.

430 {
431 return fSelectedAlongStepDoItVector;
432 }

Referenced by G4VSteppingVerbose::CopyState().

◆ GetfSelectedAtRestDoItVector()

G4SelectedAtRestDoItVector * G4SteppingManager::GetfSelectedAtRestDoItVector ( )
inline

Definition at line 426 of file G4SteppingManager.hh.

426 {
427 return fSelectedAtRestDoItVector;
428 }

Referenced by G4VSteppingVerbose::CopyState().

◆ GetfSelectedPostStepDoItVector()

G4SelectedPostStepDoItVector * G4SteppingManager::GetfSelectedPostStepDoItVector ( )
inline

Definition at line 434 of file G4SteppingManager.hh.

434 {
435 return fSelectedPostStepDoItVector;
436 }

Referenced by G4VSteppingVerbose::CopyState().

◆ GetfSensitive()

G4VSensitiveDetector * G4SteppingManager::GetfSensitive ( )
inline

Definition at line 361 of file G4SteppingManager.hh.

361 {
362 return fSensitive;
363 }

Referenced by G4VSteppingVerbose::CopyState().

◆ GetfStep()

G4Step * G4SteppingManager::GetfStep ( )
inline

Definition at line 348 of file G4SteppingManager.hh.

348 {
349 return fStep;
350 }

Referenced by G4VSteppingVerbose::CopyState().

◆ GetfStepStatus()

G4StepStatus G4SteppingManager::GetfStepStatus ( )
inline

Definition at line 319 of file G4SteppingManager.hh.

319 {
320 return fStepStatus;
321 }

Referenced by G4VSteppingVerbose::CopyState().

◆ GetfTrack()

G4Track * G4SteppingManager::GetfTrack ( )
inline

Definition at line 341 of file G4SteppingManager.hh.

341 {
342 return fTrack;
343 }

Referenced by G4VSteppingVerbose::CopyState().

◆ GetGeometricalStep()

G4double G4SteppingManager::GetGeometricalStep ( )
inline

Definition at line 303 of file G4SteppingManager.hh.

303 {
304 return GeometricalStep;
305 }

Referenced by G4VSteppingVerbose::CopyState().

◆ GetMass()

G4double G4SteppingManager::GetMass ( )
inline

Definition at line 329 of file G4SteppingManager.hh.

329 {
330 return Mass;
331 }

Referenced by G4VSteppingVerbose::CopyState().

◆ GetMAXofAlongStepLoops()

size_t G4SteppingManager::GetMAXofAlongStepLoops ( )
inline

Definition at line 393 of file G4SteppingManager.hh.

393 {
394 return MAXofAlongStepLoops;
395 }

Referenced by G4VSteppingVerbose::CopyState().

◆ GetMAXofAtRestLoops()

size_t G4SteppingManager::GetMAXofAtRestLoops ( )
inline

Definition at line 390 of file G4SteppingManager.hh.

390 {
391 return MAXofAtRestLoops;
392 }

Referenced by G4VSteppingVerbose::CopyState().

◆ GetMAXofPostStepLoops()

size_t G4SteppingManager::GetMAXofPostStepLoops ( )
inline

Definition at line 396 of file G4SteppingManager.hh.

396 {
397 return MAXofPostStepLoops;
398 }

Referenced by G4VSteppingVerbose::CopyState().

◆ GetnumberOfInteractionLengthLeft()

G4double G4SteppingManager::GetnumberOfInteractionLengthLeft ( )

◆ GetPhysicalStep()

G4double G4SteppingManager::GetPhysicalStep ( )
inline

Definition at line 299 of file G4SteppingManager.hh.

299 {
300 return PhysicalStep;
301 }

Referenced by G4VSteppingVerbose::CopyState().

◆ GetphysIntLength()

G4double G4SteppingManager::GetphysIntLength ( )
inline

Definition at line 449 of file G4SteppingManager.hh.

449 {
450 return physIntLength;
451 }

Referenced by G4VSteppingVerbose::CopyState().

◆ GetPreStepPointIsGeom()

G4bool G4SteppingManager::GetPreStepPointIsGeom ( )
inline

Definition at line 311 of file G4SteppingManager.hh.

311 {
312 return PreStepPointIsGeom;
313 }

Referenced by G4VSteppingVerbose::CopyState().

◆ GetProcessNumber()

void G4SteppingManager::GetProcessNumber ( )

Definition at line 55 of file G4SteppingManager2.cc.

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

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

◆ GetSecondary()

const G4TrackVector * G4SteppingManager::GetSecondary ( ) const
inline

Definition at line 459 of file G4SteppingManager.hh.

459 {
460 return fStep->GetSecondary();
461 }
const G4TrackVector * GetSecondary() const

◆ GetStep()

G4Step * G4SteppingManager::GetStep ( ) const
inline

Definition at line 486 of file G4SteppingManager.hh.

486 {
487 return fStep;
488 }

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

◆ GetStepControlFlag()

G4SteppingControl G4SteppingManager::GetStepControlFlag ( )
inline

Definition at line 446 of file G4SteppingManager.hh.

446 {
447 return StepControlFlag;
448 }

Referenced by G4VSteppingVerbose::CopyState().

◆ GetsumEnergyChange()

G4double G4SteppingManager::GetsumEnergyChange ( )
inline

Definition at line 333 of file G4SteppingManager.hh.

333 {
334 return sumEnergyChange;
335 }

Referenced by G4VSteppingVerbose::CopyState().

◆ GetTempInitVelocity()

G4double G4SteppingManager::GetTempInitVelocity ( )
inline

Definition at line 323 of file G4SteppingManager.hh.

323 {
324 return TempInitVelocity;
325 }

Referenced by G4VSteppingVerbose::CopyState().

◆ GetTempVelocity()

G4double G4SteppingManager::GetTempVelocity ( )
inline

Definition at line 326 of file G4SteppingManager.hh.

326 {
327 return TempVelocity;
328 }

Referenced by G4VSteppingVerbose::CopyState().

◆ GetTouchableHandle()

const G4TouchableHandle & G4SteppingManager::GetTouchableHandle ( )
inline

Definition at line 442 of file G4SteppingManager.hh.

442 {
443 return fTouchableHandle;
444 }

Referenced by G4VSteppingVerbose::CopyState().

◆ GetTrack()

G4Track * G4SteppingManager::GetTrack ( ) const
inline

Definition at line 474 of file G4SteppingManager.hh.

474 {
475 return fTrack;
476 }

Referenced by G4TrackingMessenger::SetNewValue().

◆ GetUserAction()

G4UserSteppingAction * G4SteppingManager::GetUserAction ( )
inline

Definition at line 470 of file G4SteppingManager.hh.

470 {
471 return fUserSteppingAction;
472 }

Referenced by G4VSteppingVerbose::CopyState().

◆ GetverboseLevel()

G4int G4SteppingManager::GetverboseLevel ( )
inline

Definition at line 422 of file G4SteppingManager.hh.

422 {
423 return verboseLevel;
424 }

Referenced by G4VSteppingVerbose::CopyState().

◆ SetInitialStep()

void G4SteppingManager::SetInitialStep ( G4Track valueTrack)

Definition at line 256 of file G4SteppingManager.cc.

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() );
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}
@ fUndefined
Definition: G4StepStatus.hh:66
@ fSuspend
@ fAlive
@ fStopAndKill
@ fStopButAlive
@ fPostponeToNextEvent
G4double GetMass() const
G4TouchableHistory * CreateTouchableHistory() const
virtual G4VPhysicalVolume * ResetHierarchyAndLocate(const G4ThreeVector &point, const G4ThreeVector &direction, const G4TouchableHistory &h)
Definition: G4Navigator.cc:88
virtual G4VPhysicalVolume * LocateGlobalPointAndSetup(const G4ThreeVector &point, const G4ThreeVector *direction=0, const G4bool pRelativeSearch=true, const G4bool ignoreDirection=true)
Definition: G4Navigator.cc:116
void InitializeStep(G4Track *aValue)
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
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
virtual G4VPhysicalVolume * GetVolume(G4int depth=0) const
Definition: G4VTouchable.cc:44

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

◆ SetNavigator()

void G4SteppingManager::SetNavigator ( G4Navigator value)
inline

Definition at line 463 of file G4SteppingManager.hh.

463 {
464 fNavigator = value;
465 }

Referenced by G4SteppingManager().

◆ SetUserAction()

void G4SteppingManager::SetUserAction ( G4UserSteppingAction apAction)
inline

Definition at line 467 of file G4SteppingManager.hh.

467 {
468 fUserSteppingAction = apAction;
469 }

Referenced by G4TrackingManager::SetUserAction().

◆ SetVerbose()

void G4SteppingManager::SetVerbose ( G4VSteppingVerbose yourVerbose)
inline

Definition at line 482 of file G4SteppingManager.hh.

482 {
483 fVerbose = yourVerbose;
484 }

◆ SetVerboseLevel()

void G4SteppingManager::SetVerboseLevel ( G4int  vLevel)
inline

Definition at line 478 of file G4SteppingManager.hh.

478 {
479 verboseLevel = vLevel;
480 }

Referenced by G4ErrorPropagatorManager::SetSteppingManagerVerboseLevel().

◆ Stepping()

G4StepStatus G4SteppingManager::Stepping ( )

Definition at line 116 of file G4SteppingManager.cc.

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();
138
139// Switch next touchable in track to current one
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}
@ fAtRestDoItProc
Definition: G4StepStatus.hh:56
@ AvoidHitInvocation
double G4double
Definition: G4Types.hh:64
G4Region * GetRegion() const
G4UserSteppingAction * GetRegionalSteppingAction() const
void SetSafety(const G4double aValue)
void SetStepStatus(const G4StepStatus aValue)
const G4ThreeVector & GetPosition() const
G4VPhysicalVolume * GetPhysicalVolume() const
G4SteppingControl GetControlFlag() const
void UpdateTrack()
void ResetTotalEnergyDeposit()
void SetStepLength(G4double value)
void CopyPostToPreStepPoint()
void SetPointerToVectorOfAuxiliaryPoints(std::vector< G4ThreeVector > *theNewVectorPointer)
Definition: G4Step.hh:237
G4double GetStepLength() const
void SetTrack(G4Track *value)
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().

Member Data Documentation

◆ KillVerbose

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: