11 #include <simulation/kernel/SteppingAction.h>
12 #include <simulation/kernel/UserInfo.h>
13 #include <framework/logging/Logger.h>
14 #include <framework/gearbox/Unit.h>
16 #include <G4UnitsTable.hh>
21 using namespace Simulation;
42 G4Track* track = step->GetTrack();
47 if (track->GetVolume() == NULL) {
48 B2WARNING(
"SteppingAction: Track in NULL volume, terminating!\n"
49 <<
"step_no=" << track->GetCurrentStepNumber() <<
" type=" << track->GetDefinition()->GetParticleName()
50 <<
"\n position=" << G4BestUnit(track->GetPosition(),
"Length") <<
" momentum=" << G4BestUnit(track->GetMomentum(),
"Energy"));
51 track->SetTrackStatus(fStopAndKill);
59 const G4ThreeVector stepPrePos = step->GetPreStepPoint()->GetPosition() / CLHEP::mm *
Unit::mm;
60 const G4ThreeVector stepPostPos = step->GetPostStepPoint()->GetPosition() / CLHEP::mm *
Unit::mm;
61 if (stepPrePos.perp() < (rAbsorber *
Unit::cm) && stepPostPos.perp() > (rAbsorber *
Unit::cm)) {
65 track->SetTrackStatus(fStopAndKill);
74 B2WARNING(
"SteppingAction: Too many steps for this track, terminating!\n"
75 <<
"step_no=" << track->GetCurrentStepNumber() <<
"type=" << track->GetDefinition()->GetParticleName()
76 <<
"\n position=" << G4BestUnit(track->GetPosition(),
"Length") <<
" momentum=" << G4BestUnit(track->GetMomentum(),
"Energy"));
77 track->SetTrackStatus(fStopAndKill);
86 if (info && info->getTrajectory()) {
88 if (trajectory.
empty()) {
89 const G4ThreeVector stepPos = step->GetPreStepPoint()->GetPosition() / CLHEP::mm *
Unit::mm;
90 const G4ThreeVector stepMom = step->GetPreStepPoint()->GetMomentum() / CLHEP::MeV *
Unit::MeV;
92 stepPos.x(), stepPos.y(), stepPos.z(),
93 stepMom.x(), stepMom.y(), stepMom.z()
96 const G4ThreeVector stepPos = step->GetPostStepPoint()->GetPosition() / CLHEP::mm *
Unit::mm;
97 const G4ThreeVector stepMom = step->GetPostStepPoint()->GetMomentum() / CLHEP::MeV *
Unit::MeV;
99 stepPos.x(), stepPos.y(), stepPos.z(),
100 stepMom.x(), stepMom.y(), stepMom.z()