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>
38 static const int nrow = 3;
39 static const int nslat = 10;
46 , m_Detector(detector)
47 , m_HitContainer(nullptr)
48 , m_AbsorberHitContainer(nullptr)
50 , m_Params(parameters)
51 , m_SaveHitContainer(nullptr)
52 , m_SaveShower(nullptr)
53 , m_AbsorberTruth(m_Params->get_int_param(
"absorbertruth"))
54 , m_IsActive(m_Params->get_int_param(
"active"))
55 , m_IsBlackHole(m_Params->get_int_param(
"blackhole"))
56 , m_LightScintModel(m_Params->get_int_param(
"light_scint_model"))
76 G4TouchableHandle touch = aStep->GetPreStepPoint()->GetTouchableHandle();
97 slat_id = volume->GetCopyNo();
104 #ifdef TESTSINGLESLAT
109 if (slat_id != nslat)
119 #ifdef TESTSINGLESLAT
124 G4double edep = aStep->GetTotalEnergyDeposit() /
GeV;
125 G4double eion = (aStep->GetTotalEnergyDeposit() - aStep->GetNonIonizingEnergyDeposit()) /
GeV;
126 G4double light_yield = 0;
127 const G4Track* aTrack = aStep->GetTrack();
132 edep = aTrack->GetKineticEnergy() /
GeV;
133 G4Track* killtrack =
const_cast<G4Track*
>(aTrack);
134 killtrack->SetTrackStatus(fStopAndKill);
140 bool geantino =
false;
145 if (aTrack->GetParticleDefinition()->GetPDGEncoding() == 0 &&
146 aTrack->GetParticleDefinition()->GetParticleName().find(
"geantino") != string::npos)
150 G4StepPoint* prePoint = aStep->GetPreStepPoint();
151 G4StepPoint* postPoint = aStep->GetPostStepPoint();
155 switch (prePoint->GetStepStatus())
173 m_Hit->
set_t(0, prePoint->GetGlobalTime() / nanosecond);
176 if (G4VUserTrackInformation*
p = aTrack->GetUserInformation())
189 if ((aTrack->GetParticleDefinition()->GetParticleName().find(
"e+") != string::npos) ||
190 (aTrack->GetParticleDefinition()->GetParticleName().find(
"e-") != string::npos))
204 if (G4VUserTrackInformation*
p = aTrack->GetUserInformation())
224 m_Hit->
set_t(1, postPoint->GetGlobalTime() / nanosecond);
236 light_yield = light_yield *
GetLightCorrection(postPoint->GetPosition().x()/
cm,postPoint->GetPosition().y()/
cm) ;
254 if (G4VUserTrackInformation*
p = aTrack->GetUserInformation())
270 if (postPoint->GetStepStatus() == fGeomBoundary ||
271 postPoint->GetStepStatus() == fWorldBoundary ||
272 postPoint->GetStepStatus() == fAtRestDoItProc ||
273 aTrack->GetTrackStatus() == fStopAndKill)
310 string absorbernodename;
323 m_HitContainer = findNode::getClass<PHG4HitContainer>(topNode, hitnodename.c_str());
329 std::cout <<
"PHG4Prototype3InnerHcalSteppingAction::SetTopNode - unable to find " << hitnodename << std::endl;
331 if (!m_AbsorberHitContainer)
335 cout <<
"PHG4HcalSteppingAction::SetTopNode - unable to find " << absorbernodename << endl;