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>
43 , m_Detector(detector)
44 , m_HitContainer(nullptr)
46 , m_SaveHitContainer(nullptr)
47 , m_SaveVolPre(nullptr)
48 , m_SaveVolPost(nullptr)
50 , m_SavePreStepStatus(-1)
51 , m_SavePostStepStatus(-1)
69 G4TouchableHandle touch = aStep->GetPreStepPoint()->GetTouchableHandle();
70 G4TouchableHandle touchpost = aStep->GetPostStepPoint()->GetTouchableHandle();
72 G4VPhysicalVolume*
volume = touch->GetVolume();
84 G4double edep = aStep->GetTotalEnergyDeposit() /
GeV;
85 G4double eion = (aStep->GetTotalEnergyDeposit() - aStep->GetNonIonizingEnergyDeposit()) /
GeV;
86 const G4Track* aTrack = aStep->GetTrack();
88 int layer_id = whichactive - 1;
89 bool geantino =
false;
93 if (aTrack->GetParticleDefinition()->GetPDGEncoding() == 0 &&
94 aTrack->GetParticleDefinition()->GetParticleName().find(
"geantino") != string::npos)
98 G4StepPoint* prePoint = aStep->GetPreStepPoint();
99 G4StepPoint* postPoint = aStep->GetPostStepPoint();
104 switch (prePoint->GetStepStatus())
106 case fPostStepDoItProc:
113 cout <<
GetName() <<
": New Hit for " << endl;
119 <<
", current trackid: " << aTrack->GetTrackID() << endl;
120 cout <<
"phys pre vol: " << volume->GetName()
121 <<
" post vol : " << touchpost->GetVolume()->GetName() << endl;
122 cout <<
" previous phys pre vol: " <<
m_SaveVolPre->GetName()
123 <<
" previous phys post vol: " <<
m_SaveVolPost->GetName() << endl;
137 m_Hit->
set_t(0, prePoint->GetGlobalTime() / nanosecond);
141 if (G4VUserTrackInformation*
p = aTrack->GetUserInformation())
158 cout <<
"implement stuff for whichactive < 0" << endl;
161 if (G4VUserTrackInformation*
p = aTrack->GetUserInformation())
179 cout <<
GetName() <<
": hit was not created" << endl;
185 <<
", current trackid: " << aTrack->GetTrackID() << endl;
186 cout <<
"phys pre vol: " << volume->GetName()
187 <<
" post vol : " << touchpost->GetVolume()->GetName() << endl;
188 cout <<
" previous phys pre vol: " <<
m_SaveVolPre->GetName()
189 <<
" previous phys post vol: " <<
m_SaveVolPost->GetName() << endl;
195 cout <<
GetName() <<
": hits do not belong to the same track" << endl;
197 <<
", current trackid: " << aTrack->GetTrackID()
198 <<
", prestep status: " << prePoint->GetStepStatus()
226 if (postPoint->GetStepStatus() == fGeomBoundary ||
227 postPoint->GetStepStatus() == fWorldBoundary ||
228 postPoint->GetStepStatus() == fAtRestDoItProc ||
229 aTrack->GetTrackStatus() == fStopAndKill)
240 m_Hit->
set_t(1, postPoint->GetGlobalTime() / nanosecond);
241 if (G4VUserTrackInformation*
p = aTrack->GetUserInformation())
295 m_HitContainer = findNode::getClass<PHG4HitContainer>(topNode, hitnodename);
300 std::cout <<
"G4JLeicDIRCSteppingAction::SetTopNode - unable to find " << hitnodename << std::endl;