15 #include "G4Material.hh"
16 #include "G4StepPoint.hh"
17 #include "G4TouchableHistory.hh"
18 #include "G4LogicalVolume.hh"
19 #include "G4DynamicParticle.hh"
21 #include "G4VSensitiveDetector.hh"
37 if(
m_helper.retrieve()!=StatusCode::SUCCESS)
40 description <<
"Cannot retrieve ActsGeantFollower helper";
41 G4Exception(
"ActsGeantFollower",
"ActsGeantFollower1", FatalException,
description);
50 if (aStep->GetTrack()->GetParentID() || aStep->GetPreStepPoint()->GetMomentum().mag()<500 )
52 std::cout <<
"low pt" << std::endl;
53 aStep->GetTrack()->SetTrackStatus(fStopAndKill);
58 if (aStep->GetPreStepPoint()->GetPosition().z()>3000 || sqrt(aStep->GetPreStepPoint()->GetPosition().x()*aStep->GetPreStepPoint()->GetPosition().x()+aStep->GetPreStepPoint()->GetPosition().y()*aStep->GetPreStepPoint()->GetPosition().y())>1050 )
60 std::cout <<
"out" << std::endl;
61 aStep->GetTrack()->SetTrackStatus(fStopAndKill);
66 G4StepPoint * g4PreStep = aStep->GetPreStepPoint();
67 G4ThreeVector g4Momentum = g4PreStep->GetMomentum();
68 G4ThreeVector g4Position = g4PreStep->GetPosition();
70 G4Track* g4Track = aStep->GetTrack();
71 const G4DynamicParticle* g4DynParticle = g4Track->GetDynamicParticle();
74 const G4TouchableHistory* touchHist =
static_cast<const G4TouchableHistory*
>(aStep->GetPreStepPoint()->GetTouchable());
78 const G4LogicalVolume *lv= touchHist->GetVolume()->GetLogicalVolume();
81 const G4Material *
mat = lv->GetMaterial();
83 double steplength = aStep->GetStepLength();
85 double X0 =
mat->GetRadlen();
88 bool isSensitive =
true;
89 m_helper->trackParticle(g4Position, g4Momentum, g4DynParticle->GetPDGcode(), g4DynParticle->GetCharge(), steplength,
X0, isSensitive);
95 description <<
"ActsGeantFollower::SteppingAction NULL G4LogicalVolume pointer.";
96 G4Exception(
"ActsGeantFollower",
"ActsGeantFollower2", FatalException,
description);
102 description <<
"ActsGeantFollower::SteppingAction NULL G4TouchableHistory pointer.";
103 G4Exception(
"ActsGeantFollower",
"ActsGeantFollower3", FatalException,
description);