6 #include <phparameter/PHParameters.h>
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>
44 , m_Detector(detector)
45 , m_Params(parameters)
46 , m_HitContainer(nullptr)
48 , m_SaveShower(nullptr)
49 , m_SaveVolPre(nullptr)
50 , m_SaveVolPost(nullptr)
52 , m_SavePreStepStatus(-1)
53 , m_SavePostStepStatus(-1)
54 , m_ActiveFlag(m_Params->get_int_param(
"active"))
55 , m_BlackHoleFlag(m_Params->get_int_param(
"blackhole"))
56 , m_UseG4StepsFlag(m_Params->get_int_param(
"use_g4steps"))
72 G4TouchableHandle touch = aStep->GetPreStepPoint()->GetTouchableHandle();
73 G4TouchableHandle touchpost = aStep->GetPostStepPoint()->GetTouchableHandle();
75 G4VPhysicalVolume*
volume = touch->GetVolume();
83 G4double edep = aStep->GetTotalEnergyDeposit() /
GeV;
84 G4double eion = (aStep->GetTotalEnergyDeposit() - aStep->GetNonIonizingEnergyDeposit()) /
GeV;
85 const G4Track* aTrack = aStep->GetTrack();
90 edep = aTrack->GetKineticEnergy() /
GeV;
91 G4Track* killtrack =
const_cast<G4Track*
>(aTrack);
92 killtrack->SetTrackStatus(fStopAndKill);
99 bool geantino =
false;
103 if (aTrack->GetParticleDefinition()->GetPDGEncoding() == 0 &&
104 aTrack->GetParticleDefinition()->GetParticleName().find(
"geantino") != string::npos)
108 G4StepPoint* prePoint = aStep->GetPreStepPoint();
109 G4StepPoint* postPoint = aStep->GetPostStepPoint();
113 int prepointstatus = prePoint->GetStepStatus();
114 if (prepointstatus == fGeomBoundary ||
115 prepointstatus == fUndefined ||
121 cout <<
GetName() <<
": New Hit for " << endl;
127 <<
", current trackid: " << aTrack->GetTrackID() << endl;
128 cout <<
"phys pre vol: " << volume->GetName()
129 <<
" post vol : " << touchpost->GetVolume()->GetName() << endl;
130 cout <<
" previous phys pre vol: " <<
m_SaveVolPre->GetName()
131 <<
" previous phys post vol: " <<
m_SaveVolPost->GetName() << endl;
143 m_Hit->
set_t(0, prePoint->GetGlobalTime() / nanosecond);
154 if (G4VUserTrackInformation*
p = aTrack->GetUserInformation())
169 cout <<
GetName() <<
": hit was not created" << endl;
175 <<
", current trackid: " << aTrack->GetTrackID() << endl;
176 cout <<
"phys pre vol: " << volume->GetName()
177 <<
" post vol : " << touchpost->GetVolume()->GetName() << endl;
178 cout <<
" previous phys pre vol: " <<
m_SaveVolPre->GetName()
179 <<
" previous phys post vol: " <<
m_SaveVolPost->GetName() << endl;
186 cout <<
"hits do not belong to the same track" << endl;
188 <<
", current trackid: " << aTrack->GetTrackID()
204 m_Hit->
set_t(1, postPoint->GetGlobalTime() / nanosecond);
220 if (G4VUserTrackInformation*
p = aTrack->GetUserInformation())
236 if (postPoint->GetStepStatus() == fGeomBoundary ||
237 postPoint->GetStepStatus() == fWorldBoundary ||
238 postPoint->GetStepStatus() == fAtRestDoItProc ||
239 aTrack->GetTrackStatus() == fStopAndKill ||
285 m_HitContainer = findNode::getClass<PHG4HitContainer>(topNode, hitnodename.c_str());
290 std::cout <<
"PHG4BlockSteppingAction::SetTopNode - unable to find " << hitnodename << std::endl;