6 #include <phparameter/PHParameters.h>
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>
44 , m_Detector(detector)
45 , m_Params(parameters)
46 , m_ActiveFlag(m_Params->get_int_param(
"active"))
47 , m_BlackHoleFlag(m_Params->get_int_param(
"blackhole"))
48 , m_SupportFlag(m_Params->get_int_param(
"supportactive"))
66 G4TouchableHandle touch = aStep->GetPreStepPoint()->GetTouchableHandle();
67 G4TouchableHandle touchpost = aStep->GetPostStepPoint()->GetTouchableHandle();
83 G4double edep = aStep->GetTotalEnergyDeposit() /
GeV;
84 G4double eion = (aStep->GetTotalEnergyDeposit() - aStep->GetNonIonizingEnergyDeposit()) /
GeV;
85 G4double steplen = aStep->GetStepLength() /
cm;
86 const G4Track* aTrack = aStep->GetTrack();
100 edep = aTrack->GetKineticEnergy() /
GeV;
101 G4Track* killtrack =
const_cast<G4Track*
>(aTrack);
102 killtrack->SetTrackStatus(fStopAndKill);
112 bool geantino =
false;
116 if (aTrack->GetParticleDefinition()->GetPDGEncoding() == 0 &&
117 aTrack->GetParticleDefinition()->GetParticleName().find(
"geantino") != std::string::npos)
122 G4StepPoint* prePoint = aStep->GetPreStepPoint();
123 G4StepPoint* postPoint = aStep->GetPostStepPoint();
129 int tube_id = touch->GetCopyNumber(1);
136 switch (prePoint->GetStepStatus())
138 case fPostStepDoItProc:
149 std::cout <<
GetName() <<
": New Hit for " << std::endl;
155 <<
", current trackid: " << aTrack->GetTrackID() << std::endl;
156 std::cout <<
"phys pre vol: " << volume->GetName()
157 <<
" post vol : " << touchpost->GetVolume()->GetName() << std::endl;
158 std::cout <<
" previous phys pre vol: " <<
m_SaveVolPre->GetName()
159 <<
" previous phys post vol: " <<
m_SaveVolPost->GetName() << std::endl;
200 if (G4VUserTrackInformation*
p = aTrack->GetUserInformation())
218 std::cout <<
GetName() <<
": hit was not created" << std::endl;
224 <<
", current trackid: " << aTrack->GetTrackID() << std::endl;
225 std::cout <<
"phys pre vol: " << volume->GetName()
226 <<
" post vol : " << touchpost->GetVolume()->GetName() << std::endl;
227 std::cout <<
" previous phys pre vol: " <<
m_SaveVolPre->GetName()
228 <<
" previous phys post vol: " <<
m_SaveVolPost->GetName() << std::endl;
235 std::cout <<
GetName() <<
": hits do not belong to the same track" << std::endl;
237 <<
", current trackid: " << aTrack->GetTrackID()
238 <<
", prestep status: " << prePoint->GetStepStatus()
272 if (postPoint->GetStepStatus() == fGeomBoundary ||
273 postPoint->GetStepStatus() == fWorldBoundary ||
274 postPoint->GetStepStatus() == fAtRestDoItProc ||
275 aTrack->GetTrackStatus() == fStopAndKill)
286 m_Hit->
set_t(1, postPoint->GetGlobalTime() / nanosecond);
287 if (G4VUserTrackInformation*
p = aTrack->GetUserInformation())
339 std::cout <<
"PHG4BbcSteppingAction::SetTopNode - unable to find " <<
m_HitNodeName << std::endl;
344 if (!m_SupportHitContainer)
348 std::cout <<
"PHG4BbcSteppingAction::SetTopNode - unable to find " <<
m_SupportNodeName << std::endl;
360 else if (type ==
"G4HIT_SUPPORT")
365 std::cout <<
"Invalid output hit node type " << type << std::endl;