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/G4SystemOfUnits.hh>
26 #include <Geant4/G4ThreeVector.hh>
27 #include <Geant4/G4TouchableHandle.hh>
28 #include <Geant4/G4Track.hh>
29 #include <Geant4/G4TrackStatus.hh>
30 #include <Geant4/G4Types.hh>
31 #include <Geant4/G4VTouchable.hh>
32 #include <Geant4/G4VUserTrackInformation.hh>
38 class G4VPhysicalVolume;
43 , m_Detector(detector)
54 G4StepPoint* prestep = aStep->GetPreStepPoint();
55 G4TouchableHandle prehandle = prestep->GetTouchableHandle();
57 G4VPhysicalVolume*
volume = prehandle->GetVolume();
70 G4double deposit = aStep->GetTotalEnergyDeposit() /
GeV;
71 G4double ionising = deposit - aStep->GetNonIonizingEnergyDeposit() /
GeV;
78 G4Track
const* track = aStep->GetTrack();
80 G4ParticleDefinition
const*
particle = track->GetParticleDefinition();
82 bool geantino = (particle->GetPDGEncoding() == 0 && particle->GetParticleName().find(
"geantino") != std::string::npos);
84 G4StepPoint* prePoint = aStep->GetPreStepPoint();
85 G4StepPoint* postPoint = aStep->GetPostStepPoint();
87 switch (prePoint->GetStepStatus())
89 case fPostStepDoItProc:
96 std::cout <<
GetName() <<
": New Hit for " << std::endl;
104 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;