ATLAS Offline Software
Public Member Functions | Public Attributes | List of all members
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. More...
 
std::pair< double, double > meanAndSigma ()
 Calculate the mean and sample std dev. More...
 
void merge (const Report &rep)
 

Public Attributes

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

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.

17  : nEvent(0), eventTime(0), eventTimeSquared(0)
18  {}

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  }

◆ 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:
pdg_comparison.sigma
sigma
Definition: pdg_comparison.py:324
G4UA::G4SimTimer::Report::eventTime
double eventTime
Accumulated event time.
Definition: G4SimTimer.h:54
mean
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="")
Definition: dependence.cxx:254
G4UA::G4SimTimer::Report::eventTimeSquared
double eventTimeSquared
Accumulated squared event time.
Definition: G4SimTimer.h:56
make_hlt_rep.rep
rep
Definition: make_hlt_rep.py:32
G4UA::G4SimTimer::Report::nEvent
unsigned int nEvent
Number of timed G4 events (we skip the first).
Definition: G4SimTimer.h:52