5 #include <phparameter/PHParameters.h>
16 #include <Geant4/G4ParticleDefinition.hh>
17 #include <Geant4/G4ReferenceCountedHandle.hh>
18 #include <Geant4/G4Step.hh>
19 #include <Geant4/G4StepPoint.hh>
20 #include <Geant4/G4StepStatus.hh>
21 #include <Geant4/G4String.hh>
22 #include <Geant4/G4SystemOfUnits.hh>
23 #include <Geant4/G4ThreeVector.hh>
24 #include <Geant4/G4TouchableHandle.hh>
25 #include <Geant4/G4Track.hh>
26 #include <Geant4/G4TrackStatus.hh>
27 #include <Geant4/G4Types.hh>
28 #include <Geant4/G4VPhysicalVolume.hh>
29 #include <Geant4/G4VTouchable.hh>
30 #include <Geant4/G4VUserTrackInformation.hh>
40 static const int nrow = 4;
41 static const int nslat = 9;
48 , m_Detector(detector)
49 , m_HitContainer(nullptr)
50 , m_AbsorberHitContainer(nullptr)
52 , m_Params(parameters)
53 , m_SaveHitContainer(nullptr)
54 , m_SaveShower(nullptr)
55 , m_AbsorberTruthFlag(m_Params->get_int_param(
"absorbertruth"))
56 , m_IsActiveFlag(m_Params->get_int_param(
"active"))
57 , m_IsBlackHoleFlag(m_Params->get_int_param(
"blackhole"))
58 , m_LightScintModelFlag(m_Params->get_int_param(
"light_scint_model"))
59 , m_LightBalanceInnerCorr(m_Params->get_double_param(
"light_balance_inner_corr"))
60 , m_LightBalanceInnerRadius(m_Params->get_double_param(
"light_balance_inner_radius") *
cm)
61 , m_LightBalanceOuterCorr(m_Params->get_double_param(
"light_balance_outer_corr"))
62 , m_LightBalanceOuterRadius(m_Params->get_double_param(
"light_balance_outer_radius") *
cm)
78 G4TouchableHandle touch = aStep->GetPreStepPoint()->GetTouchableHandle();
98 slat_id = volume->GetCopyNo();
105 #ifdef TESTSINGLESLAT
110 if (slat_id != nslat)
120 #ifdef TESTSINGLESLAT
125 G4double edep = aStep->GetTotalEnergyDeposit() /
GeV;
126 G4double eion = (aStep->GetTotalEnergyDeposit() - aStep->GetNonIonizingEnergyDeposit()) /
GeV;
127 G4double light_yield = 0;
128 const G4Track* aTrack = aStep->GetTrack();
133 edep = aTrack->GetKineticEnergy() /
GeV;
134 G4Track* killtrack =
const_cast<G4Track*
>(aTrack);
135 killtrack->SetTrackStatus(fStopAndKill);
141 bool geantino =
false;
146 if (aTrack->GetParticleDefinition()->GetPDGEncoding() == 0 &&
147 aTrack->GetParticleDefinition()->GetParticleName().find(
"geantino") != string::npos)
151 G4StepPoint* prePoint = aStep->GetPreStepPoint();
152 G4StepPoint* postPoint = aStep->GetPostStepPoint();
156 switch (prePoint->GetStepStatus())
174 m_Hit->
set_t(0, prePoint->GetGlobalTime() / nanosecond);
177 if (G4VUserTrackInformation*
p = aTrack->GetUserInformation())
190 if ((aTrack->GetParticleDefinition()->GetParticleName().find(
"e+") != string::npos) ||
191 (aTrack->GetParticleDefinition()->GetParticleName().find(
"e-") != string::npos))
205 if (G4VUserTrackInformation*
p = aTrack->GetUserInformation())
225 m_Hit->
set_t(1, postPoint->GetGlobalTime() / nanosecond);
240 double r = sqrt(postPoint->GetPosition().x() * postPoint->GetPosition().x() + postPoint->GetPosition().y() * postPoint->GetPosition().y());
242 light_yield = light_yield * cor;
260 if (G4VUserTrackInformation*
p = aTrack->GetUserInformation())
276 if (postPoint->GetStepStatus() == fGeomBoundary ||
277 postPoint->GetStepStatus() == fWorldBoundary ||
278 postPoint->GetStepStatus() == fAtRestDoItProc ||
279 aTrack->GetTrackStatus() == fStopAndKill)
316 string absorbernodename;
329 m_HitContainer = findNode::getClass<PHG4HitContainer>(topNode, hitnodename.c_str());
335 std::cout <<
"PHG4Prototype2InnerHcalSteppingAction::SetTopNode - unable to find " << hitnodename << std::endl;
337 if (!m_AbsorberHitContainer)
341 cout <<
"PHG4HcalSteppingAction::SetTopNode - unable to find " << absorbernodename << endl;
352 if (value > 1.0)
return 1.0;
353 if (value < 0.0)
return 0.0;