Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
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::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}

◆ ~G4TrialsCounter()

G4TrialsCounter::~G4TrialsCounter ( )

Definition at line 48 of file G4TrialsCounter.cc.

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

Member Function Documentation

◆ AccumulateCounts()

void G4TrialsCounter::AccumulateCounts ( G4int  noTrials)
inline

◆ ClearCounts()

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}

Referenced by G4TrialsCounter().

◆ PrintStatistics()

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}
#define G4endl
Definition: G4ios.hh:52
G4DLLIMPORT std::ostream G4cout

Referenced by ~G4TrialsCounter().

◆ ReturnTotals()

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: