13 #include "G4DynamicParticle.hh"
14 #include "G4ParticleDefinition.hh"
15 #include "G4Material.hh"
16 #include "G4Element.hh"
17 #include "G4SDManager.hh"
18 #include "G4VSensitiveDetector.hh"
19 #include "G4VProcess.hh"
20 #include "G4ProcessType.hh"
24 #include "GaudiKernel/Bootstrap.h"
25 #include "GaudiKernel/ISvcLocator.h"
26 #include "GaudiKernel/IMessageSvc.h"
35 "StoppedParticleAction"),
36 m_fsSD(0), m_init(false)
44 const int id = std::abs(aStep->GetTrack()->GetDynamicParticle()->GetDefinition()->GetPDGEncoding());
47 if (
id>=1000000 &&
id<=1100000 &&
52 G4Material *
mat = aStep->GetTrack()->GetMaterial();
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();
63 ( !aStep->GetPostStepPoint()->GetProcessDefinedStep() ||
64 aStep->GetPostStepPoint()->GetProcessDefinedStep()->GetProcessType()!=fDecay) )
70 G4SDManager * g4sdm = G4SDManager::GetSDMpointer();
72 ATH_MSG_ERROR(
"StoppedParticleFastSim could not get sensitive detector catalog." );
74 G4VSensitiveDetector * g4sd = g4sdm->FindSensitiveDetector(
"ToolSvc.SensitiveDetectorMasterTool.TrackFastSimSD");
76 ATH_MSG_ERROR(
"StoppedParticleFastSim could not get ToolSvc.SensitiveDetectorMasterTool.TrackFastSimSD sensitive detector." );
80 ATH_MSG_ERROR(
"StoppedParticleFastSim could not cast the SD." );
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);