4 #include <phparameter/PHParameters.h>
16 #include <Geant4/G4IonisParamMat.hh>
17 #include <Geant4/G4Material.hh>
18 #include <Geant4/G4MaterialCutsCouple.hh>
19 #include <Geant4/G4ParticleDefinition.hh>
20 #include <Geant4/G4ReferenceCountedHandle.hh>
21 #include <Geant4/G4Step.hh>
22 #include <Geant4/G4StepPoint.hh>
23 #include <Geant4/G4StepStatus.hh>
24 #include <Geant4/G4String.hh>
25 #include <Geant4/G4SystemOfUnits.hh>
26 #include <Geant4/G4ThreeVector.hh>
27 #include <Geant4/G4TouchableHandle.hh>
28 #include <Geant4/G4Track.hh>
29 #include <Geant4/G4TrackStatus.hh>
30 #include <Geant4/G4Types.hh>
31 #include <Geant4/G4VPhysicalVolume.hh>
32 #include <Geant4/G4VTouchable.hh>
33 #include <Geant4/G4VUserTrackInformation.hh>
45 , m_Detector(detector)
46 , m_ActiveFlag(parameters->get_int_param(
"active"))
47 , m_AbsorberTruthFlag(parameters->get_int_param(
"absorberactive"))
48 , m_BlackHoleFlag(parameters->get_int_param(
"blackhole"))
64 G4TouchableHandle touch = aStep->GetPreStepPoint()->GetTouchableHandle();
65 G4VPhysicalVolume*
volume = touch->GetVolume();
80 unsigned int icopy = touch->GetVolume(0)->GetCopyNo();
81 int idx_k = icopy >> 16;
82 int idx_j = icopy & 0xFFFF;
87 G4double edep = aStep->GetTotalEnergyDeposit() /
GeV;
88 G4double eion = (aStep->GetTotalEnergyDeposit() - aStep->GetNonIonizingEnergyDeposit()) /
GeV;
92 const G4Track* aTrack = aStep->GetTrack();
97 edep = aTrack->GetKineticEnergy() /
GeV;
98 G4Track* killtrack =
const_cast<G4Track*
>(aTrack);
99 killtrack->SetTrackStatus(fStopAndKill);
105 bool geantino =
false;
106 if (aTrack->GetParticleDefinition()->GetPDGEncoding() == 0 &&
107 aTrack->GetParticleDefinition()->GetParticleName().find(
"geantino") != std::string::npos)
113 G4StepPoint* prePoint = aStep->GetPreStepPoint();
114 G4StepPoint* postPoint = aStep->GetPostStepPoint();
116 switch (prePoint->GetStepStatus())
130 m_Hit->
set_t(0, prePoint->GetGlobalTime() / nanosecond);
155 if (G4VUserTrackInformation*
p = aTrack->GetUserInformation())
175 m_Hit->
set_t(1, postPoint->GetGlobalTime() / nanosecond);
196 if (G4VUserTrackInformation*
p = aTrack->GetUserInformation())
210 if (postPoint->GetStepStatus() == fGeomBoundary ||
211 postPoint->GetStepStatus() == fWorldBoundary ||
212 postPoint->GetStepStatus() == fAtRestDoItProc ||
213 aTrack->GetTrackStatus() == fStopAndKill)
253 std::cout <<
"PHG4BarrelEcalSteppingAction::SetTopNode - unable to find " <<
m_HitNodeName << std::endl;
255 if (!m_AbsorberHitContainer)
259 std::cout <<
"PHG4BarrelEcalSteppingAction::SetTopNode - unable to find " <<
m_AbsorberNodeName << std::endl;
262 if (!m_SupportHitContainer)
266 std::cout <<
"PHG4BarrelEcalSteppingAction::SetTopNode - unable to find " <<
m_SupportNodeName << std::endl;