4 #include <phparameter/PHParameters.h>
15 #include <Geant4/G4ParticleDefinition.hh>
16 #include <Geant4/G4ReferenceCountedHandle.hh>
17 #include <Geant4/G4Step.hh>
18 #include <Geant4/G4StepPoint.hh>
19 #include <Geant4/G4StepStatus.hh>
20 #include <Geant4/G4String.hh>
21 #include <Geant4/G4SystemOfUnits.hh>
22 #include <Geant4/G4ThreeVector.hh>
23 #include <Geant4/G4TouchableHandle.hh>
24 #include <Geant4/G4Track.hh>
25 #include <Geant4/G4TrackStatus.hh>
26 #include <Geant4/G4Types.hh>
27 #include <Geant4/G4VPhysicalVolume.hh>
28 #include <Geant4/G4VTouchable.hh>
29 #include <Geant4/G4VUserTrackInformation.hh>
41 , m_Detector(detector)
43 , m_AbsorberHits(nullptr)
45 , m_Params(parameters)
46 , m_SaveHitContainer(nullptr)
47 , m_SaveShower(nullptr)
48 , m_AbsorberTruthFlag(m_Params->get_int_param(
"absorbertruth"))
49 , m_IsActiveFlag(m_Params->get_int_param(
"active"))
50 , m_IsBlackHoleFlag(m_Params->get_int_param(
"blackhole"))
51 , m_LightScintModelFlag(m_Params->get_int_param(
"light_scint_model"))
52 , m_LightBalanceInnerCorr(m_Params->get_double_param(
"light_balance_inner_corr"))
53 , m_LightBalanceInnerRadius(m_Params->get_double_param(
"light_balance_inner_radius") *
cm)
54 , m_LightBalanceOuterCorr(m_Params->get_double_param(
"light_balance_outer_corr"))
55 , m_LightBalanceOuterRadius(m_Params->get_double_param(
"light_balance_outer_radius") *
cm)
71 G4TouchableHandle touch = aStep->GetPreStepPoint()->GetTouchableHandle();
92 slat_id = volume->GetCopyNo();
103 G4double edep = aStep->GetTotalEnergyDeposit() /
GeV;
104 G4double eion = (aStep->GetTotalEnergyDeposit() - aStep->GetNonIonizingEnergyDeposit()) /
GeV;
105 G4double light_yield = 0;
106 const G4Track* aTrack = aStep->GetTrack();
111 edep = aTrack->GetKineticEnergy() /
GeV;
112 G4Track* killtrack =
const_cast<G4Track*
>(aTrack);
113 killtrack->SetTrackStatus(fStopAndKill);
120 bool geantino =
false;
125 if (aTrack->GetParticleDefinition()->GetPDGEncoding() == 0 &&
126 aTrack->GetParticleDefinition()->GetParticleName().find(
"geantino") != string::npos)
130 G4StepPoint* prePoint = aStep->GetPreStepPoint();
131 G4StepPoint* postPoint = aStep->GetPostStepPoint();
135 switch (prePoint->GetStepStatus())
153 m_Hit->
set_t(0, prePoint->GetGlobalTime() / nanosecond);
156 if (G4VUserTrackInformation*
p = aTrack->GetUserInformation())
169 if ((aTrack->GetParticleDefinition()->GetParticleName().find(
"e+") != string::npos) ||
170 (aTrack->GetParticleDefinition()->GetParticleName().find(
"e-") != string::npos))
184 if (G4VUserTrackInformation*
p = aTrack->GetUserInformation())
204 m_Hit->
set_t(1, postPoint->GetGlobalTime() / nanosecond);
219 double r = sqrt(postPoint->GetPosition().x() * postPoint->GetPosition().x() + postPoint->GetPosition().y() * postPoint->GetPosition().y());
221 light_yield = light_yield * cor;
239 if (G4VUserTrackInformation*
p = aTrack->GetUserInformation())
256 if (postPoint->GetStepStatus() == fGeomBoundary ||
257 postPoint->GetStepStatus() == fWorldBoundary ||
258 postPoint->GetStepStatus() == fAtRestDoItProc ||
259 aTrack->GetTrackStatus() == fStopAndKill)
295 string absorbernodename;
308 m_Hits = findNode::getClass<PHG4HitContainer>(topNode, hitnodename.c_str());
309 m_AbsorberHits = findNode::getClass<PHG4HitContainer>(topNode, absorbernodename.c_str());
314 std::cout <<
"PHG4Prototype2OuterHcalSteppingAction::SetTopNode - unable to find " << hitnodename << std::endl;
320 cout <<
"PHG4HcalSteppingAction::SetTopNode - unable to find " << absorbernodename << endl;
331 if (value > 1.0)
return 1.0;
332 if (value < 0.0)
return 0.0;