17 #include <Geant4/G4ParticleDefinition.hh>
18 #include <Geant4/G4ReferenceCountedHandle.hh>
19 #include <Geant4/G4Step.hh>
20 #include <Geant4/G4StepPoint.hh>
21 #include <Geant4/G4StepStatus.hh>
22 #include <Geant4/G4String.hh>
23 #include <Geant4/G4SystemOfUnits.hh>
24 #include <Geant4/G4ThreeVector.hh>
25 #include <Geant4/G4TouchableHandle.hh>
26 #include <Geant4/G4Track.hh>
27 #include <Geant4/G4TrackStatus.hh>
28 #include <Geant4/G4Types.hh>
29 #include <Geant4/G4VPhysicalVolume.hh>
30 #include <Geant4/G4VTouchable.hh>
31 #include <Geant4/G4VUserTrackInformation.hh>
58 G4TouchableHandle touch = aStep->GetPreStepPoint()->GetTouchableHandle();
59 G4TouchableHandle touchpost = aStep->GetPostStepPoint()->GetTouchableHandle();
73 G4double edep = aStep->GetTotalEnergyDeposit() /
GeV;
74 G4double eion = (aStep->GetTotalEnergyDeposit() - aStep->GetNonIonizingEnergyDeposit()) /
GeV;
75 const G4Track* aTrack = aStep->GetTrack();
78 bool geantino =
false;
82 if (aTrack->GetParticleDefinition()->GetPDGEncoding() == 0 &&
83 aTrack->GetParticleDefinition()->GetParticleName().find(
"geantino") != std::string::npos)
87 G4StepPoint* prePoint = aStep->GetPreStepPoint();
88 G4StepPoint* postPoint = aStep->GetPostStepPoint();
93 layer_id = touch->GetCopyNumber();
94 if (layer_id != whichactive)
96 std::cout <<
PHWHERE <<
" inconsistency between G4 copy number: "
97 << layer_id <<
" and module id from detector: "
98 << whichactive << std::endl;
102 switch (prePoint->GetStepStatus())
104 case fPostStepDoItProc:
111 std::cout <<
GetName() <<
": New Hit for " << std::endl;
117 <<
", current trackid: " << aTrack->GetTrackID() << std::endl;
118 std::cout <<
"phys pre vol: " << volume->GetName()
119 <<
" post vol : " << touchpost->GetVolume()->GetName() << std::endl;
120 std::cout <<
" previous phys pre vol: " <<
savevolpre->GetName()
121 <<
" previous phys post vol: " <<
savevolpost->GetName() << std::endl;
132 hit->
set_x(0, prePoint->GetPosition().x() /
cm);
133 hit->
set_y(0, prePoint->GetPosition().y() /
cm);
134 hit->
set_z(0, prePoint->GetPosition().z() /
cm);
136 hit->
set_t(0, prePoint->GetGlobalTime() / nanosecond);
140 if (G4VUserTrackInformation*
p = aTrack->GetUserInformation())
157 std::cout <<
"implement stuff for whichactive < 0" << std::endl;
160 if (G4VUserTrackInformation*
p = aTrack->GetUserInformation())
178 std::cout <<
GetName() <<
": hit was not created" << std::endl;
184 <<
", current trackid: " << aTrack->GetTrackID() << std::endl;
185 std::cout <<
"phys pre vol: " << volume->GetName()
186 <<
" post vol : " << touchpost->GetVolume()->GetName() << std::endl;
187 std::cout <<
" previous phys pre vol: " <<
savevolpre->GetName()
188 <<
" previous phys post vol: " <<
savevolpost->GetName() << std::endl;
194 std::cout <<
GetName() <<
": hits do not belong to the same track" << std::endl;
196 <<
", current trackid: " << aTrack->GetTrackID()
197 <<
", prestep status: " << prePoint->GetStepStatus()
225 if (postPoint->GetStepStatus() == fGeomBoundary ||
226 postPoint->GetStepStatus() == fWorldBoundary ||
227 postPoint->GetStepStatus() == fAtRestDoItProc ||
228 aTrack->GetTrackStatus() == fStopAndKill)
235 hit->
set_x(1, postPoint->GetPosition().x() /
cm);
236 hit->
set_y(1, postPoint->GetPosition().y() /
cm);
237 hit->
set_z(1, postPoint->GetPosition().z() /
cm);
239 hit->
set_t(1, postPoint->GetGlobalTime() / nanosecond);
240 if (G4VUserTrackInformation*
p = aTrack->GetUserInformation())
294 hits_ = findNode::getClass<PHG4HitContainer>(topNode, hitnodename);
299 std::cout <<
"PHG4PSTOFSteppingAction::SetTopNode - unable to find " << hitnodename << std::endl;