13 #include <Geant4/G4ParticleDefinition.hh>
14 #include <Geant4/G4Step.hh>
15 #include <Geant4/G4StepPoint.hh>
16 #include <Geant4/G4StepStatus.hh>
17 #include <Geant4/G4String.hh>
18 #include <Geant4/G4SystemOfUnits.hh>
19 #include <Geant4/G4ThreeVector.hh>
20 #include <Geant4/G4TouchableHandle.hh>
21 #include <Geant4/G4Track.hh>
22 #include <Geant4/G4TrackStatus.hh>
23 #include <Geant4/G4Types.hh>
24 #include <Geant4/G4VTouchable.hh>
25 #include <Geant4/G4VUserTrackInformation.hh>
54 aStep->GetPreStepPoint()->GetTouchableHandle()->GetVolume();
57 G4double edep = aStep->GetTotalEnergyDeposit() /
GeV;
58 G4double eion = (aStep->GetTotalEnergyDeposit() - aStep->GetNonIonizingEnergyDeposit()) /
GeV;
60 const G4Track* aTrack = aStep->GetTrack();
65 bool geantino =
false;
69 if (aTrack->GetParticleDefinition()->GetPDGEncoding() == 0 && aTrack->GetParticleDefinition()->GetParticleName().find(
"geantino") != std::string::npos)
73 G4StepPoint* prePoint = aStep->GetPreStepPoint();
74 G4StepPoint* postPoint = aStep->GetPostStepPoint();
79 switch (prePoint->GetStepStatus())
88 hit->
set_x(0, prePoint->GetPosition().x() /
cm);
89 hit->
set_y(0, prePoint->GetPosition().y() /
cm);
90 hit->
set_z(0, prePoint->GetPosition().z() /
cm);
92 hit->
set_t(0, prePoint->GetGlobalTime() / nanosecond);
95 if (G4VUserTrackInformation*
p = aTrack->GetUserInformation())
108 layer_id = aStep->GetPreStepPoint()->GetTouchable()->GetReplicaNumber(1);
118 hit->
set_x(1, postPoint->GetPosition().x() /
cm);
119 hit->
set_y(1, postPoint->GetPosition().y() /
cm);
120 hit->
set_z(1, postPoint->GetPosition().z() /
cm);
122 hit->
set_t(1, postPoint->GetGlobalTime() / nanosecond);
133 if (G4VUserTrackInformation*
p = aTrack->GetUserInformation())
136 dynamic_cast<PHG4TrackUserInfoV1*>(
p))
148 if (postPoint->GetStepStatus() == fGeomBoundary ||
149 postPoint->GetStepStatus() == fWorldBoundary ||
150 postPoint->GetStepStatus() == fAtRestDoItProc ||
151 aTrack->GetTrackStatus() == fStopAndKill)
198 hits_ = findNode::getClass<PHG4HitContainer>(topNode, hitnodename);
203 std::cout <<
"PHG4SectorSteppingAction::SetTopNode - unable to find "
204 << hitnodename << std::endl;