20 #include <Geant4/G4ParticleDefinition.hh>
21 #include <Geant4/G4ReferenceCountedHandle.hh>
22 #include <Geant4/G4Step.hh>
23 #include <Geant4/G4StepPoint.hh>
24 #include <Geant4/G4StepStatus.hh>
25 #include <Geant4/G4String.hh>
26 #include <Geant4/G4SystemOfUnits.hh>
27 #include <Geant4/G4ThreeVector.hh>
28 #include <Geant4/G4TouchableHandle.hh>
29 #include <Geant4/G4Track.hh>
30 #include <Geant4/G4TrackStatus.hh>
31 #include <Geant4/G4Types.hh>
32 #include <Geant4/G4VTouchable.hh>
33 #include <Geant4/G4VUserTrackInformation.hh>
44 , m_Detector(detector)
55 G4StepPoint* prestep = aStep->GetPreStepPoint();
56 G4TouchableHandle prehandle = prestep->GetTouchableHandle();
71 G4double deposit = aStep->GetTotalEnergyDeposit() /
GeV;
72 G4double ionising = deposit - aStep->GetNonIonizingEnergyDeposit() /
GeV;
79 G4Track
const* track = aStep->GetTrack();
81 G4ParticleDefinition
const*
particle = track->GetParticleDefinition();
83 bool geantino = (particle->GetPDGEncoding() == 0 && particle->GetParticleName().find(
"geantino") != std::string::npos);
85 G4StepPoint* prePoint = aStep->GetPreStepPoint();
86 G4StepPoint* postPoint = aStep->GetPostStepPoint();
88 switch (prePoint->GetStepStatus())
90 case fPostStepDoItProc:
97 std::cout <<
GetName() <<
": New Hit for " << std::endl;
105 if (
m_Hit ==
nullptr)
119 m_Hit->
set_t(0, prestep->GetGlobalTime() / nanosecond);
123 if (
PHG4TrackUserInfoV1* userinfo = dynamic_cast<PHG4TrackUserInfoV1*>(track->GetUserInformation()))
136 G4StepPoint* poststep = aStep->GetPostStepPoint();
137 const G4ThreeVector postpos = poststep->GetPosition();
146 if (postPoint->GetStepStatus() != fGeomBoundary &&
147 postPoint->GetStepStatus() != fWorldBoundary &&
148 postPoint->GetStepStatus() != fAtRestDoItProc &&
149 track->GetTrackStatus() != fStopAndKill)
163 m_Hit->
set_t(1, poststep->GetGlobalTime() / nanosecond);
167 if (userinfo !=
nullptr)
194 std::cout <<
"PHG4EPDSteppingAction::SetTopNode - unable to find hit node " <<
m_HitNodeName << std::endl;
198 if (!m_SupportHitContainer)
202 std::cout <<
"PHG4EPDSteppingAction::SetTopNode - unable to find support hit node " <<
m_SupportNodeName << std::endl;
214 else if (type ==
"G4HIT_SUPPORT")
219 std::cout <<
"Invalid output hit node type " << type << std::endl;