17 #include <Geant4/G4ParticleDefinition.hh>
18 #include <Geant4/G4ReferenceCountedHandle.hh>
19 #include <Geant4/G4Step.hh>
20 #include <Geant4/G4StepPoint.hh>
21 #include <Geant4/G4StepStatus.hh>
22 #include <Geant4/G4String.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_HitContainer(nullptr)
45 , m_AbsorberHitContainer(nullptr)
47 , m_SaveHitContainer(nullptr)
48 , m_SaveVolPre(nullptr)
49 , m_SaveVolPost(nullptr)
51 , m_SavePreStepStatus(-1)
52 , m_SavePostStepStatus(-1)
70 G4TouchableHandle touch = aStep->GetPreStepPoint()->GetTouchableHandle();
71 G4TouchableHandle touchpost = aStep->GetPostStepPoint()->GetTouchableHandle();
73 G4VPhysicalVolume*
volume = touch->GetVolume();
85 G4double edep = aStep->GetTotalEnergyDeposit() /
GeV;
86 G4double eion = (aStep->GetTotalEnergyDeposit() - aStep->GetNonIonizingEnergyDeposit()) /
GeV;
87 const G4Track* aTrack = aStep->GetTrack();
89 int layer_id = whichactive - 1;
90 bool geantino =
false;
94 if (aTrack->GetParticleDefinition()->GetPDGEncoding() == 0 &&
95 aTrack->GetParticleDefinition()->GetParticleName().find(
"geantino") != string::npos)
99 G4StepPoint* prePoint = aStep->GetPreStepPoint();
100 G4StepPoint* postPoint = aStep->GetPostStepPoint();
105 switch (prePoint->GetStepStatus())
107 case fPostStepDoItProc:
114 cout <<
GetName() <<
": New Hit for " << endl;
120 <<
", current trackid: " << aTrack->GetTrackID() << endl;
121 cout <<
"phys pre vol: " << volume->GetName()
122 <<
" post vol : " << touchpost->GetVolume()->GetName() << endl;
123 cout <<
" previous phys pre vol: " <<
m_SaveVolPre->GetName()
124 <<
" previous phys post vol: " <<
m_SaveVolPost->GetName() << endl;
138 m_Hit->
set_t(0, prePoint->GetGlobalTime() / nanosecond);
142 if (G4VUserTrackInformation*
p = aTrack->GetUserInformation())
161 if (G4VUserTrackInformation*
p = aTrack->GetUserInformation())
179 cout <<
GetName() <<
": hit was not created" << endl;
185 <<
", current trackid: " << aTrack->GetTrackID() << endl;
186 cout <<
"phys pre vol: " << volume->GetName()
187 <<
" post vol : " << touchpost->GetVolume()->GetName() << endl;
188 cout <<
" previous phys pre vol: " <<
m_SaveVolPre->GetName()
189 <<
" previous phys post vol: " <<
m_SaveVolPost->GetName() << endl;
195 cout <<
GetName() <<
": hits do not belong to the same track" << endl;
197 <<
", current trackid: " << aTrack->GetTrackID()
198 <<
", prestep status: " << prePoint->GetStepStatus()
226 if (postPoint->GetStepStatus() == fGeomBoundary ||
227 postPoint->GetStepStatus() == fWorldBoundary ||
228 postPoint->GetStepStatus() == fAtRestDoItProc ||
229 aTrack->GetTrackStatus() == fStopAndKill)
240 m_Hit->
set_t(1, postPoint->GetGlobalTime() / nanosecond);
241 if (G4VUserTrackInformation*
p = aTrack->GetUserInformation())
285 string absorbernodename;
298 m_HitContainer = findNode::getClass<PHG4HitContainer>(topNode, hitnodename);
304 std::cout <<
"G4JLeicBeamLineMagnetSteppingAction::SetTopNode - unable to find " << hitnodename << std::endl;
306 if (!m_AbsorberHitContainer)
310 cout <<
"G4JLeicBeamLineMagnetSteppingAction::SetTopNode - unable to find " << absorbernodename << endl;