5 #include <phparameter/PHParameters.h>
6 #include <phparameter/PHParametersContainer.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>
46 , m_Detector(detector)
47 , m_ParamsContainer(parameters)
50 for (
auto layeriter = layer_begin_end.first; layeriter != layer_begin_end.second; ++layeriter)
52 int layer = layeriter->second;
83 G4TouchableHandle touch = aStep->GetPreStepPoint()->GetTouchableHandle();
86 const G4Track* aTrack = aStep->GetTrack();
87 G4StepPoint* prePoint = aStep->GetPreStepPoint();
88 G4StepPoint* postPoint = aStep->GetPostStepPoint();
99 std::cout << std::endl
100 <<
"PHG4SilicoTrackerSteppingAction::UserSteppingAction for volume name (pre) " << touch->GetVolume()->GetName()
101 <<
" volume name (1) " << touch->GetVolume(1)->GetName()
102 <<
" volume->GetTranslation " << touch->GetVolume()->GetTranslation()
119 std::tie(inttlayer, ladderz, ladderphi, zposneg) = iter->second;
122 std::cout <<
" inttlayer " << inttlayer <<
" ladderz_base " << ladderz <<
" ladderphi " << ladderphi <<
" zposneg " << zposneg << std::endl;
124 if (inttlayer < 0 || inttlayer > 7)
126 assert(!
"PHG4InttSteppingAction: check Intt ladder layer.");
129 std::map<int, int>::const_iterator activeiter =
m_IsActiveMap.find(inttlayer);
132 std::cout <<
"PHG4InttSteppingAction: could not find active flag for layer " << inttlayer << std::endl;
135 if (activeiter->second == 0)
143 std::tie(inttlayer, ladderz) = iter->second;
144 sphxlayer = inttlayer;
148 G4double edep = aStep->GetTotalEnergyDeposit() /
GeV;
149 G4double eion = (aStep->GetTotalEnergyDeposit() - aStep->GetNonIonizingEnergyDeposit()) /
GeV;
154 edep = aTrack->GetKineticEnergy() /
GeV;
155 G4Track* killtrack =
const_cast<G4Track*
>(aTrack);
156 killtrack->SetTrackStatus(fStopAndKill);
159 bool geantino =
false;
164 if (aTrack->GetParticleDefinition()->GetPDGEncoding() == 0 && aTrack->GetParticleDefinition()->GetParticleName().find(
"geantino") != std::string::npos)
171 std::cout <<
" aTrack->GetTrackID " << aTrack->GetTrackID() <<
" aTrack->GetParentID " << aTrack->GetParentID()
172 <<
" Intt layer " << inttlayer
173 <<
" prePoint step status = " << prePoint->GetStepStatus() <<
" postPoint step status = " << postPoint->GetStepStatus()
176 switch (prePoint->GetStepStatus())
183 std::cout <<
" start new g4hit for: aTrack->GetParentID " << aTrack->GetParentID() <<
" aTrack->GetTrackID " << aTrack->GetTrackID() <<
" Intt layer " << inttlayer
184 <<
" prePoint step status = " << prePoint->GetStepStatus() <<
" postPoint->GetStepStatus = " << postPoint->GetStepStatus() << std::endl;
198 if (
Verbosity() > 0) std::cout <<
" ladderz = " << ladderz << std::endl;
221 std::cout <<
" prePoint hit position x,y,z = " << prePoint->GetPosition().x() /
cm
222 <<
" " << prePoint->GetPosition().y() /
cm
223 <<
" " << prePoint->GetPosition().z() /
cm
228 m_Hit->
set_t(0, prePoint->GetGlobalTime() / nanosecond);
246 if (G4VUserTrackInformation*
p = aTrack->GetUserInformation())
280 m_Hit->
set_t(1, postPoint->GetGlobalTime() / nanosecond);
296 if (G4VUserTrackInformation*
p = aTrack->GetUserInformation())
313 if (postPoint->GetStepStatus() == fGeomBoundary ||
314 postPoint->GetStepStatus() == fWorldBoundary ||
315 postPoint->GetStepStatus() == fAtRestDoItProc ||
316 aTrack->GetTrackStatus() == fStopAndKill)
320 std::cout <<
" postPoint step status changed to " << postPoint->GetStepStatus() <<
" or aTrack status changed to "
321 << aTrack->GetTrackStatus() << std::endl;
322 std::cout <<
" end g4hit for: aTrack->GetParentID " << aTrack->GetParentID() <<
" aTrack->GetTrackID " << aTrack->GetTrackID() <<
" eion = " << eion << std::endl;
323 std::cout <<
" end hit position x,y,z = " << postPoint->GetPosition().x() /
cm
324 <<
" " << postPoint->GetPosition().y() /
cm
325 <<
" " << postPoint->GetPosition().z() /
cm
365 std::cout <<
"PHG4InttSteppingAction::SetTopNode - unable to find " <<
m_HitNodeName << std::endl;
369 if (!m_AbsorberHitContainer &&
Verbosity() > 1)
371 std::cout <<
"PHG4InttSteppingAction::SetTopNode - unable to find " <<
m_AbsorberNodeName << std::endl;
382 else if (type ==
"G4HIT_ABSORBER")
387 std::cout <<
"Invalid output hit node type " << type << std::endl;