23 #include <phparameter/PHParameters.h>
38 #include <Geant4/G4ParticleDefinition.hh>
39 #include <Geant4/G4ReferenceCountedHandle.hh>
40 #include <Geant4/G4Step.hh>
41 #include <Geant4/G4StepPoint.hh>
42 #include <Geant4/G4StepStatus.hh>
43 #include <Geant4/G4String.hh>
44 #include <Geant4/G4SystemOfUnits.hh>
45 #include <Geant4/G4ThreeVector.hh>
46 #include <Geant4/G4TouchableHandle.hh>
47 #include <Geant4/G4Track.hh>
48 #include <Geant4/G4TrackStatus.hh>
49 #include <Geant4/G4Types.hh>
50 #include <Geant4/G4VPhysicalVolume.hh>
51 #include <Geant4/G4VTouchable.hh>
52 #include <Geant4/G4VUserTrackInformation.hh>
65 , m_Detector(detector)
66 , m_Params(parameters)
67 , m_HitContainer(nullptr)
69 , m_SaveHitContainer(nullptr)
70 , m_SaveVolPre(nullptr)
71 , m_SaveVolPost(nullptr)
73 , m_SavePreStepStatus(-1)
74 , m_SavePostStepStatus(-1)
75 , m_ActiveFlag(m_Params->get_int_param(
"active"))
76 , m_BlackHoleFlag(m_Params->get_int_param(
"blackhole"))
96 G4TouchableHandle touch = aStep->GetPreStepPoint()->GetTouchableHandle();
97 G4TouchableHandle touchpost = aStep->GetPostStepPoint()->GetTouchableHandle();
99 G4VPhysicalVolume *
volume = touch->GetVolume();
110 G4double edep = aStep->GetTotalEnergyDeposit() /
GeV;
111 G4double eion = (aStep->GetTotalEnergyDeposit() - aStep->GetNonIonizingEnergyDeposit()) /
GeV;
112 const G4Track *aTrack = aStep->GetTrack();
116 edep = aTrack->GetKineticEnergy() /
GeV;
117 G4Track *killtrack =
const_cast<G4Track *
>(aTrack);
118 killtrack->SetTrackStatus(fStopAndKill);
125 bool geantino =
false;
129 if (aTrack->GetParticleDefinition()->GetPDGEncoding() == 0 &&
130 aTrack->GetParticleDefinition()->GetParticleName().find(
"geantino") !=
135 G4StepPoint *prePoint = aStep->GetPreStepPoint();
136 G4StepPoint *postPoint = aStep->GetPostStepPoint();
150 switch (prePoint->GetStepStatus())
152 case fPostStepDoItProc:
163 cout <<
GetName() <<
": New Hit for " << endl;
164 cout <<
"prestep status: "
166 <<
", poststep status: "
168 <<
", last pre step status: "
170 <<
", last post step status: "
173 <<
", current trackid: " << aTrack->GetTrackID() << endl;
174 cout <<
"phys pre vol: " << volume->GetName()
175 <<
" post vol : " << touchpost->GetVolume()->GetName() << endl;
176 cout <<
" previous phys pre vol: " <<
m_SaveVolPre->GetName()
177 <<
" previous phys post vol: " <<
m_SaveVolPost->GetName() << endl;
192 m_Hit->
set_t(0, prePoint->GetGlobalTime() / nanosecond);
212 cout <<
"implement stuff for whichactive < 0 (inactive volumes)" << endl;
216 if (G4VUserTrackInformation *
p = aTrack->GetUserInformation())
234 cout <<
GetName() <<
": hit was not created" << endl;
235 cout <<
"prestep status: "
237 <<
", poststep status: "
239 <<
", last pre step status: "
241 <<
", last post step status: "
244 <<
", current trackid: " << aTrack->GetTrackID() << endl;
245 cout <<
"phys pre vol: " << volume->GetName()
246 <<
" post vol : " << touchpost->GetVolume()->GetName() << endl;
247 cout <<
" previous phys pre vol: " <<
m_SaveVolPre->GetName()
248 <<
" previous phys post vol: " <<
m_SaveVolPost->GetName() << endl;
255 cout <<
GetName() <<
": hits do not belong to the same track" << endl;
257 <<
", current trackid: " << aTrack->GetTrackID()
258 <<
", prestep status: " << prePoint->GetStepStatus()
287 if (postPoint->GetStepStatus() == fGeomBoundary ||
288 postPoint->GetStepStatus() == fWorldBoundary ||
289 postPoint->GetStepStatus() == fAtRestDoItProc ||
290 aTrack->GetTrackStatus() == fStopAndKill)
300 m_Hit->
set_t(1, postPoint->GetGlobalTime() / nanosecond);
301 if (G4VUserTrackInformation *
p = aTrack->GetUserInformation())
351 m_HitContainer = findNode::getClass<PHG4HitContainer>(topNode, hitnodename);
355 std::cout <<
"EicFRichSteppingAction::SetTopNode - unable to find "
356 << hitnodename << std::endl;