5 #include <phparameter/PHParameters.h>
21 #include <Geant4/G4NavigationHistory.hh>
22 #include <Geant4/G4ParticleDefinition.hh>
23 #include <Geant4/G4ReferenceCountedHandle.hh>
24 #include <Geant4/G4Step.hh>
25 #include <Geant4/G4StepPoint.hh>
26 #include <Geant4/G4StepStatus.hh>
27 #include <Geant4/G4String.hh>
28 #include <Geant4/G4SystemOfUnits.hh>
29 #include <Geant4/G4ThreeVector.hh>
30 #include <Geant4/G4TouchableHandle.hh>
31 #include <Geant4/G4Track.hh>
32 #include <Geant4/G4TrackStatus.hh>
33 #include <Geant4/G4TransportationManager.hh>
34 #include <Geant4/G4Types.hh>
35 #include <Geant4/G4VPhysicalVolume.hh>
36 #include <Geant4/G4VProcess.hh>
37 #include <Geant4/G4VTouchable.hh>
38 #include <Geant4/G4VUserTrackInformation.hh>
39 #include <Geant4/Randomize.hh>
50 , m_Detector(detector)
51 , m_Params(parameters)
52 , m_ActiveFlag(m_Params->get_int_param(
"active"))
53 , m_BlackHoleFlag(m_Params->get_int_param(
"blackhole"))
70 G4TouchableHandle touch = aStep->GetPreStepPoint()->GetTouchableHandle();
71 G4TouchableHandle touchpost = aStep->GetPostStepPoint()->GetTouchableHandle();
73 G4VPhysicalVolume*
volume = touch->GetVolume();
81 bool whichactive = (whichactive_int > 0 && whichactive_int < 12);
90 const G4Track* aTrack = aStep->GetTrack();
91 G4double edep = aStep->GetTotalEnergyDeposit() /
GeV;
92 G4double eion = (aStep->GetTotalEnergyDeposit() - aStep->GetNonIonizingEnergyDeposit()) /
GeV;
97 edep = aTrack->GetKineticEnergy() /
GeV;
98 G4Track* killtrack =
const_cast<G4Track*
>(aTrack);
99 killtrack->SetTrackStatus(fStopAndKill);
105 bool geantino =
false;
109 if (aTrack->GetParticleDefinition()->GetPDGEncoding() == 0 &&
110 aTrack->GetParticleDefinition()->GetParticleName().find(
"geantino") != std::string::npos)
114 G4StepPoint* prePoint = aStep->GetPreStepPoint();
115 G4StepPoint* postPoint = aStep->GetPostStepPoint();
119 int prepointstatus = prePoint->GetStepStatus();
120 if (prepointstatus == fGeomBoundary ||
121 prepointstatus == fUndefined ||
126 std::cout <<
GetName() <<
": New Hit for " << std::endl;
132 <<
", current trackid: " << aTrack->GetTrackID() << std::endl;
133 std::cout <<
"phys pre vol: " << volume->GetName()
134 <<
" post vol : " << touchpost->GetVolume()->GetName() << std::endl;
135 std::cout <<
" previous phys pre vol: " <<
m_SaveVolPre->GetName()
136 <<
" previous phys post vol: " <<
m_SaveVolPost->GetName() << std::endl;
151 m_Hit->
set_t(0, prePoint->GetGlobalTime() / nanosecond);
162 if (G4VUserTrackInformation*
p = aTrack->GetUserInformation())
176 std::cout <<
GetName() <<
": hit was not created" << std::endl;
182 <<
", current trackid: " << aTrack->GetTrackID() << std::endl;
183 std::cout <<
"phys pre vol: " << volume->GetName()
184 <<
" post vol : " << touchpost->GetVolume()->GetName() << std::endl;
185 std::cout <<
" previous phys pre vol: " <<
m_SaveVolPre->GetName()
186 <<
" previous phys post vol: " <<
m_SaveVolPost->GetName() << std::endl;
193 std::cout <<
"hits do not belong to the same track" << std::endl;
195 <<
", current trackid: " << aTrack->GetTrackID()
215 m_Hit->
set_t(1, postPoint->GetGlobalTime() / nanosecond);
231 if (G4VUserTrackInformation*
p = aTrack->GetUserInformation())
247 if (postPoint->GetStepStatus() == fGeomBoundary ||
248 postPoint->GetStepStatus() == fWorldBoundary ||
249 postPoint->GetStepStatus() == fAtRestDoItProc ||
250 aTrack->GetTrackStatus() == fStopAndKill)
291 std::cout <<
"G4EicDircSteppingAction::SetTopNode - unable to find " <<
m_AbsorberNodeName << std::endl;
302 std::cout <<
"G4EicDircSteppingAction::SetTopNode - unable to find " <<
m_SupportNodeName << std::endl;
308 std::cout <<
"G4EicDircSteppingAction::SetTopNode - unable to find " <<
m_HitNodeName << std::endl;