26 inline std::string
vPrFmt (
double time,
double nEv,
double tRun,
int depth,
const std::string&
id)
29 if (
depth == -999) dprnt =
" ";
30 std::ostringstream oss;
31 oss << std::setw(12) << time << std::setw(12) << time/nEv << std::setw(12) << time/tRun
32 << std::setw(6) << dprnt <<
" " << id;
36 typedef std::map<VolTree, TestActionVPTimer::volumeData>
VolMap;
37 typedef VolMap::const_iterator
VolIt;
41 const std::string& name,
42 const IInterface* parent)
45 declareProperty(
"CaloDepth",
m_config.dCALO);
46 declareProperty(
"BeamPipeDepth",
m_config.dBeam);
47 declareProperty(
"InDetDepth",
m_config.dIDET);
48 declareProperty(
"MuonDepth",
m_config.dMUON);
49 declareProperty(
"DetailDepth",
m_config.dDetail);
53 std::unique_ptr<TestActionVPTimer>
57 auto action = std::make_unique<TestActionVPTimer>(
m_config);
58 actionList.
runActions.push_back( action.get() );
82 topPV.push_back(
m_report.time_index.begin()->first.front());
87 <<
" Dead Time " << DeadTime );
92 ATH_MSG_INFO(setw(12) <<
"Time" << setw(12) <<
"per Event" << setw(12)
93 <<
"per Run" << setw(6) <<
"Depth" <<
" Location/Particle" );
97 ATH_MSG_INFO(
"\n******* Data by volume/select particles *******");
98 ATH_MSG_INFO(
"Data printed in reverse tree order (mother following daughter)");
105 ATH_MSG_INFO(
"\n******* Data by particle/category *******");
117 }
else {
ATH_MSG_WARNING(
"******* No Timing information recorded! *******"); }
119 return StatusCode::SUCCESS;
126 if (v !=
m_report.time_index.end()) {
140 const double tTotal,
const int depth)
const
142 G4VPhysicalVolume* pv = vp.first.back().first;
143 std::string physical =
stringify(pv->GetName());
144 std::string copyNo =
stringify(vp.first.back().second);
145 std::string mother =
"";
146 if (vp.first.size() != 1) mother =
stringify( (vp.first.end()-2)->first->GetName() );
153 double tOther = vp.second.tTotal - vp.second.tElectron - vp.second.tPhoton - vp.second.tNeutron - vp.second.tPion;
#define ATH_MSG_WARNING(x)
std::vector< VolID > VolTree
std::string stringify(T obj)
const Report & getReport() const
std::string depth
tag string for intendation
std::map< VolTree, TestActionVPTimer::volumeData > VolMap
std::string vPrFmt(double time, double nEv, double tRun, int depth, const std::string &id)
VolMap::const_iterator VolIt
Struct for passing around user actions.
std::vector< G4UserSteppingAction * > steppingActions
std::vector< G4UserEventAction * > eventActions
std::vector< G4UserRunAction * > runActions
void merge(const Report &rep)
double tMeson
Time spent on all mesons in volume.
double tBaryon
Time spent on other baryons in volume.
double tPhoton
Time spent on photons in volume.
double tTotal
Overloaded += operator.
double tPion
Time spent on pions in volume.
double tNeutron
Time spent on neutrons in volume.
double tOther
Time spent on all other particles in volume (mostly nuclei)
double tLepton
Time spent on other leptons in volume.
double tElectron
Time spent on e objects in volume.