5 #include <phparameter/PHParameters.h>
17 #include <Geant4/G4IonisParamMat.hh>
18 #include <Geant4/G4Material.hh>
19 #include <Geant4/G4MaterialCutsCouple.hh>
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/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>
43 , m_Detector(detector)
44 , m_ActiveFlag(parameters->get_int_param(
"active"))
45 , m_AbsorberTruthFlag(parameters->get_int_param(
"absorberactive"))
46 , m_BlackHoleFlag(parameters->get_int_param(
"blackhole"))
47 , m_NlayersPerTowerSeg(parameters->get_int_param(
"nlayerspertowerseg"))
48 , m_zdepthtailcatcher(parameters->get_double_param(
"zdepthcatcheroffset"))
49 , m_NLayerTailCatcherOffset(parameters->get_int_param(
"nLayerOffsetTailcatcher"))
65 G4TouchableHandle touch = aStep->GetPreStepPoint()->GetTouchableHandle();
66 G4VPhysicalVolume*
volume = touch->GetVolume();
81 unsigned int icopy = touch->GetVolume(3)->GetCopyNo();
82 unsigned int layer = touch->GetVolume(1)->GetCopyNo();
83 int idx_j = icopy >> 16;
84 int idx_k = icopy & 0xFFFF;
88 std::cout <<
"\t" << icopy <<
"\t idx_j =" << idx_j <<
", idx_k =" << idx_k <<
", idx_l =" << idx_l <<
"\t id:" << icopy <<
"\t layer:" << layer << std::endl;
91 double edep = aStep->GetTotalEnergyDeposit() /
GeV;
92 double eion = (aStep->GetTotalEnergyDeposit() - aStep->GetNonIonizingEnergyDeposit()) /
GeV;
95 const G4Track* aTrack = aStep->GetTrack();
100 edep = aTrack->GetKineticEnergy() /
GeV;
101 G4Track* killtrack =
const_cast<G4Track*
>(aTrack);
102 killtrack->SetTrackStatus(fStopAndKill);
109 bool geantino =
false;
110 double light_yield = 0;
111 if (aTrack->GetParticleDefinition()->GetPDGEncoding() == 0 &&
112 aTrack->GetParticleDefinition()->GetParticleName().find(
"geantino") != std::string::npos)
118 G4StepPoint* prePoint = aStep->GetPreStepPoint();
119 G4StepPoint* postPoint = aStep->GetPostStepPoint();
128 switch (prePoint->GetStepStatus())
143 m_Hit->
set_t(0, prePoint->GetGlobalTime() / nanosecond);
167 if (G4VUserTrackInformation*
p = aTrack->GetUserInformation())
184 static bool once =
true;
185 if (once && edep > 0)
191 std::cout <<
"PHG4LFHcalSteppingAction::UserSteppingAction::"
194 <<
" use scintillating light model at each Geant4 steps. "
197 << aTrack->GetMaterialCutsCouple()->GetMaterial()->GetName()
199 <<
"Birk Constant = "
200 << aTrack->GetMaterialCutsCouple()->GetMaterial()->GetIonisation()->GetBirksConstant()
202 <<
"edep = " << edep <<
", "
205 <<
"light_yield = " << light_yield << std::endl;
216 m_Hit->
set_t(1, postPoint->GetGlobalTime() / nanosecond);
237 if (G4VUserTrackInformation*
p = aTrack->GetUserInformation())
251 if (postPoint->GetStepStatus() == fGeomBoundary ||
252 postPoint->GetStepStatus() == fWorldBoundary ||
253 postPoint->GetStepStatus() == fAtRestDoItProc ||
254 aTrack->GetTrackStatus() == fStopAndKill)
288 std::string hitnodename;
289 std::string absorbernodename;
303 m_HitContainer = findNode::getClass<PHG4HitContainer>(topNode, hitnodename);
309 std::cout <<
"PHG4LFHcalSteppingAction::SetTopNode - unable to find " << hitnodename << std::endl;
311 if (!m_AbsorberHitContainer)
315 std::cout <<
"PHG4LFHcalSteppingAction::SetTopNode - unable to find " << absorbernodename << std::endl;