47{
48
49 if (aStep->GetTrack()->GetParentID() || aStep->GetPreStepPoint()->GetMomentum().mag()<500 )
50 {
51 std::cout << "low pt" << std::endl;
52 aStep->GetTrack()->SetTrackStatus(fStopAndKill);
53 return;
54 }
55
56
57 if (aStep->GetPreStepPoint()->GetPosition().z()>3000 || sqrt(aStep->GetPreStepPoint()->GetPosition().x()*aStep->GetPreStepPoint()->GetPosition().x()+aStep->GetPreStepPoint()->GetPosition().y()*aStep->GetPreStepPoint()->GetPosition().y())>1050 )
58 {
59 std::cout << "out" << std::endl;
60 aStep->GetTrack()->SetTrackStatus(fStopAndKill);
61 return;
62 }
63
64
65 G4StepPoint * g4PreStep = aStep->GetPreStepPoint();
66 G4ThreeVector g4Momentum = g4PreStep->GetMomentum();
67 G4ThreeVector g4Position = g4PreStep->GetPosition();
68
69 G4Track* g4Track = aStep->GetTrack();
70 const G4DynamicParticle* g4DynParticle = g4Track->GetDynamicParticle();
71
72
73 const G4TouchableHistory* touchHist = static_cast<const G4TouchableHistory*>(aStep->GetPreStepPoint()->GetTouchable());
75 {
76
77 const G4LogicalVolume *lv= touchHist->GetVolume()->GetLogicalVolume();
79 {
80 const G4Material *
mat = lv->GetMaterial();
81
82 double steplength = aStep->GetStepLength();
83
84 double X0 =
mat->GetRadlen();
85
86
87 bool isSensitive = true;
88 m_helper->trackParticle(g4Position, g4Momentum, g4DynParticle->GetPDGcode(), g4DynParticle->GetCharge(), steplength, X0, isSensitive);
89
90 }
91 else
92 {
94 description <<
"ActsGeantFollower::SteppingAction NULL G4LogicalVolume pointer.";
95 G4Exception(
"ActsGeantFollower",
"ActsGeantFollower2", FatalException,
description);
96 }
97 }
98 else
99 {
101 description <<
"ActsGeantFollower::SteppingAction NULL G4TouchableHistory pointer.";
102 G4Exception(
"ActsGeantFollower",
"ActsGeantFollower3", FatalException,
description);
103 }
104 return;
105}