4 #include <phparameter/PHParameters.h>
16 #include <Geant4/G4IonisParamMat.hh>
17 #include <Geant4/G4Material.hh>
18 #include <Geant4/G4MaterialCutsCouple.hh>
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>
45 , m_Detector(detector)
46 , m_ActiveFlag(parameters->get_int_param(
"active"))
47 , m_AbsorberTruthFlag(parameters->get_int_param(
"absorberactive"))
48 , m_BlackHoleFlag(parameters->get_int_param(
"blackhole"))
64 G4TouchableHandle touch = aStep->GetPreStepPoint()->GetTouchableHandle();
65 G4VPhysicalVolume*
volume = touch->GetVolume();
82 unsigned int icopy = touch->GetVolume(3)->GetCopyNo();
84 icopy = touch->GetVolume(1)->GetCopyNo();
85 int idx_j = icopy >> 16;
86 int idx_k = icopy & 0xFFFF;
89 std::cout <<
"\t" << icopy <<
"\t idx_j =" << idx_j <<
", idx_k =" << idx_k <<
"\t id:" << icopy <<
"\t type: " << towertype << std::endl;
92 double edep = aStep->GetTotalEnergyDeposit() /
GeV;
93 double eion = (aStep->GetTotalEnergyDeposit() - aStep->GetNonIonizingEnergyDeposit()) /
GeV;
94 double light_yield = 0;
97 const G4Track* aTrack = aStep->GetTrack();
102 edep = aTrack->GetKineticEnergy() /
GeV;
103 G4Track* killtrack =
const_cast<G4Track*
>(aTrack);
104 killtrack->SetTrackStatus(fStopAndKill);
111 bool geantino =
false;
112 if (aTrack->GetParticleDefinition()->GetPDGEncoding() == 0 &&
113 aTrack->GetParticleDefinition()->GetParticleName().find(
"geantino") != std::string::npos)
119 G4StepPoint* prePoint = aStep->GetPreStepPoint();
120 G4StepPoint* postPoint = aStep->GetPostStepPoint();
122 switch (prePoint->GetStepStatus())
137 m_Hit->
set_t(0, prePoint->GetGlobalTime() / nanosecond);
161 if (G4VUserTrackInformation*
p = aTrack->GetUserInformation())
178 static bool once =
true;
179 if (once && edep > 0)
185 std::cout <<
"PHG4ForwardEcalSteppingAction::UserSteppingAction::"
188 <<
" use scintillating light model at each Geant4 steps. "
191 << aTrack->GetMaterialCutsCouple()->GetMaterial()->GetName()
193 <<
"Birk Constant = "
194 << aTrack->GetMaterialCutsCouple()->GetMaterial()->GetIonisation()->GetBirksConstant()
196 <<
"edep = " << edep <<
", "
199 <<
"light_yield = " << light_yield << std::endl;
210 m_Hit->
set_t(1, postPoint->GetGlobalTime() / nanosecond);
231 if (G4VUserTrackInformation*
p = aTrack->GetUserInformation())
245 if (postPoint->GetStepStatus() == fGeomBoundary ||
246 postPoint->GetStepStatus() == fWorldBoundary ||
247 postPoint->GetStepStatus() == fAtRestDoItProc ||
248 aTrack->GetTrackStatus() == fStopAndKill)
281 std::string hitnodename;
282 std::string absorbernodename;
302 std::cout <<
"PHG4ForwardEcalSteppingAction::SetTopNode - unable to find " << hitnodename << std::endl;
306 if (!m_AbsorberHitContainer)
310 std::cout <<
"PHG4ForwardEcalSteppingAction::SetTopNode - unable to find " << absorbernodename << std::endl;