15 #include <Geant4/G4NavigationHistory.hh>
16 #include <Geant4/G4ParticleDefinition.hh>
17 #include <Geant4/G4ReferenceCountedHandle.hh>
18 #include <Geant4/G4Step.hh>
19 #include <Geant4/G4StepPoint.hh>
20 #include <Geant4/G4StepStatus.hh>
21 #include <Geant4/G4String.hh>
22 #include <Geant4/G4SystemOfUnits.hh>
23 #include <Geant4/G4ThreeVector.hh>
24 #include <Geant4/G4TouchableHandle.hh>
25 #include <Geant4/G4Track.hh>
26 #include <Geant4/G4TrackStatus.hh>
27 #include <Geant4/G4Types.hh>
28 #include <Geant4/G4VPhysicalVolume.hh>
29 #include <Geant4/G4VTouchable.hh>
30 #include <Geant4/G4VUserTrackInformation.hh>
32 #include <boost/tokenizer.hpp>
36 #include <boost/version.hpp>
37 #if (__GNUC__ == 4 && __GNUC_MINOR__ == 4 && BOOST_VERSION == 105700)
38 #pragma GCC diagnostic ignored "-Wuninitialized"
39 #pragma message "ignoring bogus gcc warning in boost header lexical_cast.hpp"
40 #include <boost/lexical_cast.hpp>
41 #pragma GCC diagnostic warning "-Wuninitialized"
43 #include <boost/lexical_cast.hpp>
57 , m_Detector(detector)
58 , m_HitContainer(nullptr)
59 , m_AbsorberhitContainer(nullptr)
61 , m_SaveShower(nullptr)
105 int layer_id = -9999;
106 int stave_id = -9999;
110 if (layer_id < 0 || stave_id < 0)
112 cout <<
PHWHERE <<
"invalid Mvtx's layer (" << layer_id <<
") or stave (" << stave_id <<
") index " << endl;
125 cout <<
"Entering PHG4MvtxSteppingAction::UserSteppingAction for volume " << vtest->
GetName() << endl;
127 cout <<
"Entering PHG4MvtxSteppingAction::UserSteppingAction for volume 1 up " << vtest1->
GetName() << endl;
129 cout <<
"Entering PHG4MvtxSteppingAction::UserSteppingAction for volume 2 up " << vtest2->
GetName() << endl;
131 cout <<
"Entering PHG4MvtxSteppingAction::UserSteppingAction for volume 3 up " << vtest3->
GetName() << endl;
133 cout <<
"Entering PHG4MvtxSteppingAction::UserSteppingAction for volume 4 up " << vtest4->
GetName() << endl;
147 int half_stave_number = -1;
148 int module_number = -1;
149 int chip_number = -1;
153 <<
" UserSteppingAction: layer " << layer_id;
154 boost::char_separator<char> sep(
"_");
155 boost::tokenizer<boost::char_separator<char> >::const_iterator tokeniter;
160 boost::tokenizer<boost::char_separator<char> > tok1(v1->
GetName(), sep);
161 tokeniter = tok1.begin();
163 chip_number = boost::lexical_cast<
int>(*tokeniter);
164 if (
Verbosity() > 0) cout <<
" chip " << chip_number;
166 boost::tokenizer<boost::char_separator<char> > tok2(v2->
GetName(), sep);
167 tokeniter = tok2.begin();
169 module_number = boost::lexical_cast<
int>(*tokeniter);
170 if (
Verbosity() > 0) cout <<
" module " << module_number;
179 boost::tokenizer<boost::char_separator<char> > tok3(v3->
GetName(), sep);
180 tokeniter = tok3.begin();
185 if (
Verbosity() > 0) cout <<
" stave " << stave_id;
189 half_stave_number = boost::lexical_cast<
int>(*tokeniter);
190 if (
Verbosity() > 0) cout <<
" half_stave " << half_stave_number;
200 if (
Verbosity() > 0) cout <<
" edep = " << edep << endl;
213 bool geantino =
false;
258 cout <<
"entering volume name = " << vol1->
GetName() << endl;
372 cout <<
"----- PHg4MvtxSteppingAction::UserSteppingAction - active volume = " << sensor_volume->
GetName() << endl;
373 cout <<
" layer = " << layer_id << endl;
374 cout <<
" stave number = " << stave_id <<
" half_stave_number = " << half_stave_number << endl;
375 cout <<
" module number = " << module_number << endl;
376 cout <<
" chip number = " << chip_number << endl;
377 cout <<
" prepoint x position " << prePoint->
GetPosition().
x() /
cm << endl;
378 cout <<
" prepoint y position " << prePoint->
GetPosition().
y() /
cm << endl;
379 cout <<
" prepoint z position " << prePoint->
GetPosition().
z() /
cm << endl;
380 cout <<
" postpoint x position " << postPoint->
GetPosition().
x() /
cm << endl;
381 cout <<
" postpoint y position " << postPoint->
GetPosition().
y() /
cm << endl;
382 cout <<
" postpoint z position " << postPoint->
GetPosition().
z() /
cm << endl;
383 cout <<
" edep " << edep << endl;
388 cout <<
" stepping action found hit:" << endl;
443 string absorbernodename;
456 m_HitContainer = findNode::getClass<PHG4HitContainer>(topNode, hitnodename.c_str());
462 std::cout <<
"PHG4MvtxSteppingAction::SetTopNode - unable to find " << hitnodename << std::endl;
464 if (!m_AbsorberhitContainer)
468 cout <<
"PHG4MvtxSteppingAction::SetTopNode - unable to find " << absorbernodename << endl;