6 #include <phparameter/PHParameters.h>
19 #include <Geant4/G4ParticleDefinition.hh>
20 #include <Geant4/G4ReferenceCountedHandle.hh>
21 #include <Geant4/G4Step.hh>
22 #include <Geant4/G4StepPoint.hh>
23 #include <Geant4/G4StepStatus.hh>
24 #include <Geant4/G4String.hh>
25 #include <Geant4/G4SystemOfUnits.hh>
26 #include <Geant4/G4ThreeVector.hh>
27 #include <Geant4/G4TouchableHandle.hh>
28 #include <Geant4/G4Track.hh>
29 #include <Geant4/G4TrackStatus.hh>
30 #include <Geant4/G4Types.hh>
31 #include <Geant4/G4VPhysicalVolume.hh>
32 #include <Geant4/G4VTouchable.hh>
33 #include <Geant4/G4VUserTrackInformation.hh>
46 , m_Detector(detector)
48 , m_AbsorberHits(nullptr)
50 , m_Params(parameters)
51 , m_SaveHitContainer(nullptr)
52 , m_SaveShower(nullptr)
53 , m_SaveVolPre(nullptr)
54 , m_SaveVolPost(nullptr)
56 , m_SavePreStepStatus(-1)
57 , m_SavePostStepStatus(-1)
58 , m_IsActive(m_Params->get_int_param(
"active"))
59 , m_IsBlackHole(m_Params->get_int_param(
"blackhole"))
60 , m_LightScintModel(m_Params->get_int_param(
"light_scint_model"))
79 G4TouchableHandle touch = aStep->GetPreStepPoint()->GetTouchableHandle();
80 G4TouchableHandle touchpost = aStep->GetPostStepPoint()->GetTouchableHandle();
82 G4VPhysicalVolume*
volume = touch->GetVolume();
101 layer_id = layer_tower.first;
102 tower_id = layer_tower.second;
108 layer_id = touch->GetCopyNumber();
111 G4double edep = aStep->GetTotalEnergyDeposit() /
GeV;
112 G4double eion = (aStep->GetTotalEnergyDeposit() - aStep->GetNonIonizingEnergyDeposit()) /
GeV;
113 G4double light_yield = 0;
114 const G4Track* aTrack = aStep->GetTrack();
119 edep = aTrack->GetKineticEnergy() /
GeV;
120 G4Track* killtrack =
const_cast<G4Track*
>(aTrack);
121 killtrack->SetTrackStatus(fStopAndKill);
127 bool geantino =
false;
132 if (aTrack->GetParticleDefinition()->GetPDGEncoding() == 0 &&
133 aTrack->GetParticleDefinition()->GetParticleName().find(
"geantino") != string::npos)
137 G4StepPoint* prePoint = aStep->GetPreStepPoint();
138 G4StepPoint* postPoint = aStep->GetPostStepPoint();
142 switch (prePoint->GetStepStatus())
144 case fPostStepDoItProc:
151 cout <<
GetName() <<
": New Hit for " << endl;
157 <<
", current trackid: " << aTrack->GetTrackID() << endl;
158 cout <<
"phys pre vol: " << volume->GetName()
159 <<
" post vol : " << touchpost->GetVolume()->GetName() << endl;
160 cout <<
" previous phys pre vol: " <<
m_SaveVolPre->GetName()
161 <<
" previous phys post vol: " <<
m_SaveVolPost->GetName() << endl;
177 m_Hit->
set_t(0, prePoint->GetGlobalTime() / nanosecond);
195 if (G4VUserTrackInformation*
p = aTrack->GetUserInformation())
212 cout <<
GetName() <<
": hit was not created" << endl;
218 <<
", current trackid: " << aTrack->GetTrackID() << endl;
219 cout <<
"phys pre vol: " << volume->GetName()
220 <<
" post vol : " << touchpost->GetVolume()->GetName() << endl;
221 cout <<
" previous phys pre vol: " <<
m_SaveVolPre->GetName()
222 <<
" previous phys post vol: " <<
m_SaveVolPost->GetName() << endl;
228 cout <<
GetName() <<
": hits do not belong to the same track" << endl;
230 <<
", current trackid: " << aTrack->GetTrackID()
231 <<
", prestep status: " << prePoint->GetStepStatus()
248 m_Hit->
set_t(1, postPoint->GetGlobalTime() / nanosecond);
260 light_yield = light_yield *
GetLightCorrection(postPoint->GetPosition().x(), postPoint->GetPosition().y());
270 if (G4VUserTrackInformation*
p = aTrack->GetUserInformation())
287 if (postPoint->GetStepStatus() == fGeomBoundary ||
288 postPoint->GetStepStatus() == fWorldBoundary ||
289 postPoint->GetStepStatus() == fAtRestDoItProc ||
290 aTrack->GetTrackStatus() == fStopAndKill)
325 string absorbernodename;
338 m_Hits = findNode::getClass<PHG4HitContainer>(topNode, hitnodename.c_str());
339 m_AbsorberHits = findNode::getClass<PHG4HitContainer>(topNode, absorbernodename.c_str());
344 std::cout <<
"PHG4InnerHcalSteppingAction::SetTopNode - unable to find " << hitnodename << std::endl;
350 cout <<
"PHG4HcalSteppingAction::SetTopNode - unable to find " << absorbernodename << endl;