6 #include <phparameter/PHParameters.h>
18 #include <Geant4/G4ParticleDefinition.hh>
19 #include <Geant4/G4ReferenceCountedHandle.hh>
20 #include <Geant4/G4Step.hh>
21 #include <Geant4/G4StepPoint.hh>
22 #include <Geant4/G4StepStatus.hh>
23 #include <Geant4/G4SystemOfUnits.hh>
24 #include <Geant4/G4ThreeVector.hh>
25 #include <Geant4/G4TouchableHandle.hh>
26 #include <Geant4/G4Track.hh>
27 #include <Geant4/G4TrackStatus.hh>
28 #include <Geant4/G4Types.hh>
29 #include <Geant4/G4VPhysicalVolume.hh>
30 #include <Geant4/G4VTouchable.hh>
31 #include <Geant4/G4VUserTrackInformation.hh>
43 , m_Detector(detector)
44 , m_ActiveFlag(parameters->get_int_param(
"active"))
45 , m_BlackHoleFlag(parameters->get_int_param(
"blackhole"))
61 G4TouchableHandle touch = aStep->GetPreStepPoint()->GetTouchableHandle();
62 G4VPhysicalVolume*
volume = touch->GetVolume();
89 for (
int i = 0; i < 3; i++)
91 unsigned int icopy = touch->GetVolume(i)->GetCopyNo();
93 k[i] = icopy & 0xFFFF;
95 idx_j = j[0] + j[1] * 2 + j[2] * 4;
96 idx_k = k[0] + k[1] * 2 + k[2] * 4;
100 unsigned int icopy = touch->GetVolume(1)->GetCopyNo();
102 idx_k = icopy & 0xFFFF;
107 G4double edep = aStep->GetTotalEnergyDeposit() /
GeV;
108 G4double eion = (aStep->GetTotalEnergyDeposit() - aStep->GetNonIonizingEnergyDeposit()) /
GeV;
112 const G4Track* aTrack = aStep->GetTrack();
117 edep = aTrack->GetKineticEnergy() /
GeV;
118 G4Track* killtrack =
const_cast<G4Track*
>(aTrack);
119 killtrack->SetTrackStatus(fStopAndKill);
126 bool geantino =
false;
127 if (aTrack->GetParticleDefinition()->GetPDGEncoding() == 0 &&
128 aTrack->GetParticleDefinition()->GetParticleName().find(
"geantino") != std::string::npos)
134 G4StepPoint* prePoint = aStep->GetPreStepPoint();
135 G4StepPoint* postPoint = aStep->GetPostStepPoint();
137 switch (prePoint->GetStepStatus())
152 m_Hit->
set_t(0, prePoint->GetGlobalTime() / nanosecond);
177 if (G4VUserTrackInformation*
p = aTrack->GetUserInformation())
197 m_Hit->
set_t(1, postPoint->GetGlobalTime() / nanosecond);
221 if (G4VUserTrackInformation*
p = aTrack->GetUserInformation())
235 if (postPoint->GetStepStatus() == fGeomBoundary ||
236 postPoint->GetStepStatus() == fWorldBoundary ||
237 postPoint->GetStepStatus() == fAtRestDoItProc ||
238 aTrack->GetTrackStatus() == fStopAndKill)
271 std::string hitnodename;
272 std::string absorbernodename;
286 m_HitContainer = findNode::getClass<PHG4HitContainer>(topNode, hitnodename);
292 std::cout <<
"PHG4HybridHomogeneousCalorimeterSteppingAction::SetInterfacePointers - unable to find " << hitnodename << std::endl;
295 if (!m_AbsorberHitContainer)
299 std::cout <<
"PHG4HybridHomogeneousCalorimeterSteppingAction::SetInterfacePointers - unable to find " << absorbernodename << std::endl;