6 #include <phparameter/PHParameters.h>
20 #include <Geant4/G4ParticleDefinition.hh>
21 #include <Geant4/G4ReferenceCountedHandle.hh>
22 #include <Geant4/G4Step.hh>
23 #include <Geant4/G4StepPoint.hh>
24 #include <Geant4/G4StepStatus.hh>
25 #include <Geant4/G4String.hh>
26 #include <Geant4/G4SystemOfUnits.hh>
27 #include <Geant4/G4ThreeVector.hh>
28 #include <Geant4/G4TouchableHandle.hh>
29 #include <Geant4/G4Track.hh>
30 #include <Geant4/G4TrackStatus.hh>
31 #include <Geant4/G4Types.hh>
32 #include <Geant4/G4VPhysicalVolume.hh>
33 #include <Geant4/G4VTouchable.hh>
34 #include <Geant4/G4VUserTrackInformation.hh>
46 , m_Detector(detector)
47 , m_Params(parameters)
48 , m_IsBlackHoleFlag(m_Params->get_int_param(
"blackhole"))
68 G4TouchableHandle touch = aStep->GetPreStepPoint()->GetTouchableHandle();
69 G4TouchableHandle touchpost = aStep->GetPostStepPoint()->GetTouchableHandle();
85 G4double edep = aStep->GetTotalEnergyDeposit() /
GeV;
86 G4double eion = (aStep->GetTotalEnergyDeposit() - aStep->GetNonIonizingEnergyDeposit()) /
GeV;
87 const G4Track* aTrack = aStep->GetTrack();
92 edep = aTrack->GetKineticEnergy() /
GeV;
93 G4Track* killtrack =
const_cast<G4Track*
>(aTrack);
94 killtrack->SetTrackStatus(fStopAndKill);
97 bool geantino =
false;
102 if (aTrack->GetParticleDefinition()->GetPDGEncoding() == 0 &&
103 aTrack->GetParticleDefinition()->GetParticleName().find(
"geantino") != std::string::npos)
107 G4StepPoint* prePoint = aStep->GetPreStepPoint();
108 G4StepPoint* postPoint = aStep->GetPostStepPoint();
109 int prepointstatus = prePoint->GetStepStatus();
116 prepointstatus == fGeomBoundary ||
117 prepointstatus == fUndefined ||
120 unsigned int layer_id = 99;
124 std::cout <<
GetName() <<
": New Hit for " << std::endl;
130 <<
", current trackid: " << aTrack->GetTrackID() << std::endl;
131 std::cout <<
"phys pre vol: " << volume->GetName()
132 <<
" post vol : " << touchpost->GetVolume()->GetName() << std::endl;
133 std::cout <<
" previous phys pre vol: " <<
m_SaveVolPre->GetName()
134 <<
" previous phys post vol: " <<
m_SaveVolPost->GetName() << std::endl;
154 m_Hit->
set_t(0, prePoint->GetGlobalTime() / nanosecond);
170 if (G4VUserTrackInformation*
p = aTrack->GetUserInformation())
183 std::cout <<
GetName() <<
": hit was not created" << std::endl;
189 <<
", current trackid: " << aTrack->GetTrackID() << std::endl;
190 std::cout <<
"phys pre vol: " << volume->GetName()
191 <<
" post vol : " << touchpost->GetVolume()->GetName() << std::endl;
192 std::cout <<
" previous phys pre vol: " <<
m_SaveVolPre->GetName()
193 <<
" previous phys post vol: " <<
m_SaveVolPost->GetName() << std::endl;
199 std::cout <<
GetName() <<
": hits do not belong to the same track" << std::endl;
201 <<
", current trackid: " << aTrack->GetTrackID()
202 <<
", prestep status: " << prePoint->GetStepStatus()
223 m_Hit->
set_t(1, postPoint->GetGlobalTime() / nanosecond);
241 if (G4VUserTrackInformation*
p = aTrack->GetUserInformation())
259 postPoint->GetStepStatus() == fGeomBoundary ||
260 postPoint->GetStepStatus() == fWorldBoundary ||
261 postPoint->GetStepStatus() == fAtRestDoItProc ||
262 aTrack->GetTrackStatus() == fStopAndKill)
276 if ((rin > 69.0 && rin < 70.125) || (rout > 69.0 && rout < 70.125))
278 std::cout <<
"Added Tpc g4hit with rin, rout = " << rin <<
" " << rout
293 <<
" rav " << (rout + rin) / 2.0
327 std::cout <<
"PHG4TpcSteppingAction::SetTopNode - unable to find " <<
m_HitNodeName << std::endl;
329 if (!m_AbsorberHitContainer)
333 std::cout <<
"PHG4HcalSteppingAction::SetTopNode - unable to find " <<
m_AbsorberNodeName << std::endl;
345 else if (type ==
"G4HIT_ABSORBER")
350 std::cout <<
"Invalid output hit node type " << type << std::endl;