41 {
42
43
44 const int id = std::abs(aStep->GetTrack()->GetDynamicParticle()->GetDefinition()->GetPDGEncoding());
45
46
47 if (id>=1000000 && id<=1100000 &&
49 id == 1000021 ||
51
52 G4Material *
mat = aStep->GetTrack()->GetMaterial();
53 double minA=1500000.;
54 for (
unsigned int i=0;
i<
mat->GetNumberOfElements();++
i){
55 if (
mat->GetElement(i) &&
56 minA>
mat->GetElement(i)->GetN()){
57 minA=
mat->GetElement(i)->GetN();
58 }
59 }
60
61
62 if (aStep->GetPostStepPoint()->GetVelocity()>0.15*std::pow(minA,-2./3.)*CLHEP::c_light &&
63 ( !aStep->GetPostStepPoint()->GetProcessDefinedStep() ||
64 aStep->GetPostStepPoint()->GetProcessDefinedStep()->GetProcessType()!=fDecay) )
65 return;
66
69
70 G4SDManager * g4sdm = G4SDManager::GetSDMpointer();
71 if (!g4sdm) {
72 ATH_MSG_ERROR(
"StoppedParticleFastSim could not get sensitive detector catalog." );
73 } else {
74 G4VSensitiveDetector * g4sd = g4sdm->FindSensitiveDetector("ToolSvc.SensitiveDetectorMasterTool.TrackFastSimSD");
75 if (!g4sd) {
76 ATH_MSG_ERROR(
"StoppedParticleFastSim could not get ToolSvc.SensitiveDetectorMasterTool.TrackFastSimSD sensitive detector." );
77 } else {
78 m_fsSD =
dynamic_cast<TrackFastSimSD*
>(g4sd);
80 ATH_MSG_ERROR(
"StoppedParticleFastSim could not cast the SD." );
81 }
82 }
83 }
84 }
85
87 m_fsSD->WriteTrack( aStep->GetTrack() ,
false ,
true );
88 }
89 }
90
91 aStep->GetTrack()->SetTrackStatus(fStopAndKill);
92 const G4TrackVector *tv = aStep->GetSecondary();
93 for (
unsigned int i=0;
i<tv->size();
i++){
94 (*tv)[
i]->SetTrackStatus(fStopAndKill);
95 }
96 }
bool isSquarkLH(const T &p)
bool isRHadron(const T &p)