ATLAS Offline Software
Loading...
Searching...
No Matches
G4UA::G4SimTimer::Report Struct Reference

Simple struct which holds timing results for an action instance. More...

#include <G4SimTimer.h>

Collaboration diagram for G4UA::G4SimTimer::Report:

Public Member Functions

 Report ()
 Initializes the variables.
std::pair< double, double > meanAndSigma ()
 Calculate the mean and sample std dev.
void merge (const Report &rep)

Public Attributes

unsigned int nEvent
 Number of timed G4 events (we skip the first).
double eventTime
 Accumulated event time.
double eventTimeSquared
 Accumulated squared event time.

Detailed Description

Simple struct which holds timing results for an action instance.

Definition at line 46 of file G4SimTimer.h.

Constructor & Destructor Documentation

◆ Report()

G4UA::G4SimTimer::Report::Report ( )

Initializes the variables.

Definition at line 16 of file G4SimTimer.cxx.

18 {}
double eventTime
Accumulated event time.
Definition G4SimTimer.h:54
unsigned int nEvent
Number of timed G4 events (we skip the first).
Definition G4SimTimer.h:52
double eventTimeSquared
Accumulated squared event time.
Definition G4SimTimer.h:56

Member Function Documentation

◆ meanAndSigma()

std::pair< double, double > G4UA::G4SimTimer::Report::meanAndSigma ( )

Calculate the mean and sample std dev.

Definition at line 23 of file G4SimTimer.cxx.

24 {
25 double mean = nEvent > 0 ? eventTime / nEvent : -1.;
26 double sigma = -1.;
27 if(nEvent > 1)
28 sigma = sqrt( (eventTimeSquared/nEvent - mean*mean) / (nEvent-1) );
29 return std::make_pair(mean, sigma);
30 }
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="")

◆ merge()

void G4UA::G4SimTimer::Report::merge ( const Report & rep)
inline

Definition at line 60 of file G4SimTimer.h.

60 {
61 nEvent += rep.nEvent;
62 eventTime += rep.eventTime;
63 eventTimeSquared += rep.eventTimeSquared;
64 }

Member Data Documentation

◆ eventTime

double G4UA::G4SimTimer::Report::eventTime

Accumulated event time.

Definition at line 54 of file G4SimTimer.h.

◆ eventTimeSquared

double G4UA::G4SimTimer::Report::eventTimeSquared

Accumulated squared event time.

Definition at line 56 of file G4SimTimer.h.

◆ nEvent

unsigned int G4UA::G4SimTimer::Report::nEvent

Number of timed G4 events (we skip the first).

Might want to use a larger int type.

Definition at line 52 of file G4SimTimer.h.


The documentation for this struct was generated from the following files: