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