5 #include <phparameter/PHParameters.h>
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/G4VPhysicalVolume.hh>
33 #include <Geant4/G4VTouchable.hh>
34 #include <Geant4/G4VUserTrackInformation.hh>
45 , m_Detector(detector)
46 , m_Params(parameters)
47 , m_ActiveFlag(m_Params->get_int_param(
"active"))
48 , m_BlackHoleFlag(m_Params->get_int_param(
"blackhole"))
66 G4TouchableHandle touch = aStep->GetPreStepPoint()->GetTouchableHandle();
67 G4TouchableHandle touchpost = aStep->GetPostStepPoint()->GetTouchableHandle();
80 G4double edep = aStep->GetTotalEnergyDeposit() /
GeV;
81 G4double eion = (aStep->GetTotalEnergyDeposit() - aStep->GetNonIonizingEnergyDeposit()) /
GeV;
82 const G4Track *aTrack = aStep->GetTrack();
86 edep = aTrack->GetKineticEnergy() /
GeV;
87 G4Track *killtrack =
const_cast<G4Track *
>(aTrack);
88 killtrack->SetTrackStatus(fStopAndKill);
95 bool geantino =
false;
99 if (aTrack->GetParticleDefinition()->GetPDGEncoding() == 0 &&
100 aTrack->GetParticleDefinition()->GetParticleName().find(
"geantino") !=
105 G4StepPoint *prePoint = aStep->GetPreStepPoint();
106 G4StepPoint *postPoint = aStep->GetPostStepPoint();
120 switch (prePoint->GetStepStatus())
122 case fPostStepDoItProc:
133 std::cout <<
GetName() <<
": New Hit for " << std::endl;
134 std::cout <<
"prestep status: "
136 <<
", poststep status: "
138 <<
", last pre step status: "
140 <<
", last post step status: "
143 <<
", current trackid: " << aTrack->GetTrackID() << std::endl;
144 std::cout <<
"phys pre vol: " << volume->GetName()
145 <<
" post vol : " << touchpost->GetVolume()->GetName() << std::endl;
146 std::cout <<
" previous phys pre vol: " <<
m_SaveVolPre->GetName()
147 <<
" previous phys post vol: " <<
m_SaveVolPost->GetName() << std::endl;
163 m_Hit->
set_t(0, prePoint->GetGlobalTime() / nanosecond);
183 std::cout <<
"implement stuff for whichactive < 0 (inactive volumes)" << std::endl;
187 if (G4VUserTrackInformation *
p = aTrack->GetUserInformation())
205 std::cout <<
GetName() <<
": hit was not created" << std::endl;
206 std::cout <<
"prestep status: "
208 <<
", poststep status: "
210 <<
", last pre step status: "
212 <<
", last post step status: "
215 <<
", current trackid: " << aTrack->GetTrackID() << std::endl;
216 std::cout <<
"phys pre vol: " << volume->GetName()
217 <<
" post vol : " << touchpost->GetVolume()->GetName() << std::endl;
218 std::cout <<
" previous phys pre vol: " <<
m_SaveVolPre->GetName()
219 <<
" previous phys post vol: " <<
m_SaveVolPost->GetName() << std::endl;
226 std::cout <<
GetName() <<
": hits do not belong to the same track" << std::endl;
228 <<
", current trackid: " << aTrack->GetTrackID()
229 <<
", prestep status: " << prePoint->GetStepStatus()
258 if (postPoint->GetStepStatus() == fGeomBoundary ||
259 postPoint->GetStepStatus() == fWorldBoundary ||
260 postPoint->GetStepStatus() == fAtRestDoItProc ||
261 aTrack->GetTrackStatus() == fStopAndKill)
271 m_Hit->
set_t(1, postPoint->GetGlobalTime() / nanosecond);
272 if (G4VUserTrackInformation *
p = aTrack->GetUserInformation())
325 std::cout <<
"PHG4TpcEndCapSteppingAction::SetTopNode - unable to find "
338 std::cout <<
"Invalid output hit node type " << type << std::endl;