29 return std::make_pair(
mean, sigma);
61 m_results.eventTimeSquared += eventTime*eventTime;
62 auto meanSigma =
m_results.meanAndSigma();
64 std::setprecision(4) << eventTime <<
" s. New average " <<
65 std::setprecision(4) << meanSigma.first <<
" +- " <<
66 std::setprecision(4) << meanSigma.second);
AthMessaging(IMessageSvc *msgSvc, const std::string &name)
Constructor.
G4Timer m_eventTimer
My private instance of an event timer.
virtual void EndOfEventAction(const G4Event *event) override final
Finish timing this Geant4 event.
Report m_results
My timing results.
virtual void BeginOfEventAction(const G4Event *event) override final
Start timing this Geant4 event.
bool m_firstEvent
Used to skip the first event.
void mean(std::vector< double > &bins, std::vector< double > &values, const std::vector< std::string > &files, const std::string &histname, const std::string &tplotname, const std::string &label="")
std::pair< double, double > meanAndSigma()
Calculate the mean and sample std dev.
double eventTime
Accumulated event time.
Report()
Initializes the variables.
unsigned int nEvent
Number of timed G4 events (we skip the first).
double eventTimeSquared
Accumulated squared event time.