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>
30 class G4VPhysicalVolume;
58 G4VPhysicalVolume*
volume =
59 aStep->GetPreStepPoint()->GetTouchableHandle()->GetVolume();
62 G4double edep = aStep->GetTotalEnergyDeposit() /
GeV;
63 G4double eion = (aStep->GetTotalEnergyDeposit() - aStep->GetNonIonizingEnergyDeposit()) /
GeV;
65 const G4Track* aTrack = aStep->GetTrack();
70 bool geantino =
false;
74 if (aTrack->GetParticleDefinition()->GetPDGEncoding() == 0 && aTrack->GetParticleDefinition()->GetParticleName().find(
"geantino") != string::npos)
78 G4StepPoint* prePoint = aStep->GetPreStepPoint();
79 G4StepPoint* postPoint = aStep->GetPostStepPoint();
84 switch (prePoint->GetStepStatus())
93 hit->
set_x(0, prePoint->GetPosition().x() /
cm);
94 hit->
set_y(0, prePoint->GetPosition().y() /
cm);
95 hit->
set_z(0, prePoint->GetPosition().z() /
cm);
97 hit->
set_t(0, prePoint->GetGlobalTime() / nanosecond);
100 if (G4VUserTrackInformation*
p = aTrack->GetUserInformation())
113 layer_id = aStep->GetPreStepPoint()->GetTouchable()->GetReplicaNumber(1);
123 hit->
set_x(1, postPoint->GetPosition().x() /
cm);
124 hit->
set_y(1, postPoint->GetPosition().y() /
cm);
125 hit->
set_z(1, postPoint->GetPosition().z() /
cm);
127 hit->
set_t(1, postPoint->GetGlobalTime() / nanosecond);
138 if (G4VUserTrackInformation*
p = aTrack->GetUserInformation())
141 dynamic_cast<PHG4TrackUserInfoV1*>(
p))
153 if (postPoint->GetStepStatus() == fGeomBoundary ||
154 postPoint->GetStepStatus() == fWorldBoundary ||
155 postPoint->GetStepStatus() == fAtRestDoItProc ||
156 aTrack->GetTrackStatus() == fStopAndKill)
203 hits_ = findNode::getClass<PHG4HitContainer>(topNode, hitnodename.c_str());
208 std::cout <<
"PHG4SectorSteppingAction::SetTopNode - unable to find "
209 << hitnodename << std::endl;