Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4TrialsCounter Class Reference

#include <G4TrialsCounter.hh>

Public Member Functions

 G4TrialsCounter (const G4String &nameStats, const G4String &description, G4bool printOnExit=false)
 
 ~G4TrialsCounter ()
 
void AccumulateCounts (G4int noTrials)
 
void ClearCounts ()
 
G4int ReturnTotals (G4int &calls, G4int &maxTrials, G4int &numMaxT)
 
void PrintStatistics ()
 

Detailed Description

Definition at line 46 of file G4TrialsCounter.hh.

Constructor & Destructor Documentation

G4TrialsCounter::G4TrialsCounter ( const G4String nameStats,
const G4String description,
G4bool  printOnExit = false 
)

Definition at line 39 of file G4TrialsCounter.cc.

42  : fName(nameStats), fDescription(description),
43  fStatsVerbose(printOnExit), fPrinted(false)
44 {
45  ClearCounts();
46 }

Here is the call graph for this function:

G4TrialsCounter::~G4TrialsCounter ( )

Definition at line 48 of file G4TrialsCounter.cc.

49 {
50  if( (fStatsVerbose) && (!fPrinted) ) { PrintStatistics(); }
51 }

Here is the call graph for this function:

Member Function Documentation

void G4TrialsCounter::AccumulateCounts ( G4int  noTrials)
inline
void G4TrialsCounter::ClearCounts ( )

Definition at line 68 of file G4TrialsCounter.cc.

69 {
70  fTotalNoTrials= 0;
71  fNumberCalls = 0;
72  fmaxTrials = 0; // Maximum --> so only unsigned ints expected
73  fNoTimesMaxTrials=0;
74 }

Here is the caller graph for this function:

void G4TrialsCounter::PrintStatistics ( )

Definition at line 54 of file G4TrialsCounter.cc.

55 {
56  // Print Statistics
57  G4cout << "G4TrialsCounter::PrintStatistics()" << G4endl
58  << "Report of counts for " << fDescription << " : " << G4endl;
59  G4cout << "Stats for '" << fName << "' > "
60  << " No-trials= " << fTotalNoTrials
61  << " No-calls= " << fNumberCalls
62  << " Max-trial= " << fmaxTrials
63  << " no-max= " << fNoTimesMaxTrials
64  << G4endl;
65  fPrinted= true;
66 }
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61

Here is the caller graph for this function:

G4int G4TrialsCounter::ReturnTotals ( G4int calls,
G4int maxTrials,
G4int numMaxT 
)

Definition at line 77 of file G4TrialsCounter.cc.

78 {
79  calls = fNumberCalls;
80  maxTrials= fmaxTrials;
81  numMaxT = fNoTimesMaxTrials;
82 
83  return fTotalNoTrials;
84 }

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