14 #include <Geant4/G4ParticleDefinition.hh>
15 #include <Geant4/G4Step.hh>
16 #include <Geant4/G4StepPoint.hh>
17 #include <Geant4/G4StepStatus.hh>
18 #include <Geant4/G4String.hh>
19 #include <Geant4/G4SystemOfUnits.hh>
20 #include <Geant4/G4ThreeVector.hh>
21 #include <Geant4/G4TouchableHandle.hh>
22 #include <Geant4/G4Track.hh>
23 #include <Geant4/G4TrackStatus.hh>
24 #include <Geant4/G4Types.hh>
25 #include <Geant4/G4VTouchable.hh>
26 #include <Geant4/G4VUserTrackInformation.hh>
55 G4VPhysicalVolume* volume = aStep->GetPreStepPoint()->GetTouchableHandle()->GetVolume();
58 G4double edep = aStep->GetTotalEnergyDeposit() /
GeV;
59 G4double eion = (aStep->GetTotalEnergyDeposit() - aStep->GetNonIonizingEnergyDeposit()) /
GeV;
60 G4double light_yield = 0;
62 const G4Track* aTrack = aStep->GetTrack();
71 bool geantino =
false;
75 if (aTrack->GetParticleDefinition()->GetPDGEncoding() == 0 &&
76 aTrack->GetParticleDefinition()->GetParticleName().find(
"geantino") != std::string::npos)
80 G4StepPoint* prePoint = aStep->GetPreStepPoint();
81 G4StepPoint* postPoint = aStep->GetPostStepPoint();
85 switch (prePoint->GetStepStatus())
102 m_Hit->
set_t(0, prePoint->GetGlobalTime() / nanosecond);
105 if (G4VUserTrackInformation*
p = aTrack->GetUserInformation())
132 if (G4VUserTrackInformation*
p = aTrack->GetUserInformation())
141 std::cout <<
"PHG4HcalSteppingAction: hit outside acceptance, layer: " << layer_id << std::endl;
155 m_Hit->
set_t(1, postPoint->GetGlobalTime() / nanosecond);
170 light_yield = light_yield *
GetLightCorrection(postPoint->GetPosition().x() /
cm, (postPoint->GetPosition().y() /
cm));
182 std::cout <<
"PHG4HcalSteppingAction: hit outside acceptance zmin " <<
zmin <<
", zmax " <<
zmax <<
" at exit" << std::endl;
192 if (G4VUserTrackInformation*
p = aTrack->GetUserInformation())
208 if (postPoint->GetStepStatus() == fGeomBoundary ||
209 postPoint->GetStepStatus() == fWorldBoundary ||
210 postPoint->GetStepStatus() == fAtRestDoItProc ||
211 aTrack->GetTrackStatus() == fStopAndKill)
261 m_HitContainer = findNode::getClass<PHG4HitContainer>(topNode, hitnodename);
262 m_AbsorberHits = findNode::getClass<PHG4HitContainer>(topNode, absorbernodename);
266 std::cout <<
"PHG4HcalSteppingAction::SetTopNode - unable to find " << hitnodename << std::endl;
272 std::cout <<
"PHG4HcalSteppingAction::SetTopNode - unable to find " << absorbernodename << std::endl;