#endif
}
+#include "AliMC.h"
+
// public methods
-void AliSteppingAction::UserSteppingAction(const G4Step* step)
+void AliSteppingAction::SteppingAction(const G4Step* step)
{
// After processing the given number of steps (kCheckNofSteps)
// the particle position is compared with the previus one
// detect looping track
G4ThreeVector newStepPoint = step->GetPreStepPoint()->GetPosition();
G4double trajectory = (newStepPoint-fKeptStepPoint).mag();
+ G4bool kill = false;
if (trajectory < fgkTolerance) {
// print looping info
G4cout << "*** Particle is looping. ***" << G4endl;
if (fStandardVerboseLevel == 0) PrintTrackInfo(track);
}
+ kill = true;
+ }
+
+ if (stepNumber> kMaxNofSteps) {
+
+ // print looping info
+ if (fLoopVerboseLevel > 0) {
+ G4cout << "*** Particle reached max step number ("
+ << kMaxNofSteps << "). ***" << G4endl;
+ if (fStandardVerboseLevel == 0) PrintTrackInfo(track);
+ }
+ kill = true;
+ }
+
+ if (kill) {
+
// set loop verbose level
fpSteppingManager->SetVerboseLevel(fLoopVerboseLevel);