Geant4 10.7.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 41 of file G4TrialsCounter.hh.

Constructor & Destructor Documentation

◆ G4TrialsCounter()

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

Definition at line 34 of file G4TrialsCounter.cc.

37 : fName(nameStats), fDescription(description), fStatsVerbose(printOnExit)
38{
39 ClearCounts();
40}

◆ ~G4TrialsCounter()

G4TrialsCounter::~G4TrialsCounter ( )

Definition at line 42 of file G4TrialsCounter.cc.

43{
44 if( (fStatsVerbose) && (!fPrinted) ) { PrintStatistics(); }
45}

Member Function Documentation

◆ AccumulateCounts()

void G4TrialsCounter::AccumulateCounts ( G4int  noTrials)
inline

◆ ClearCounts()

void G4TrialsCounter::ClearCounts ( )

Definition at line 63 of file G4TrialsCounter.cc.

64{
65 fTotalNoTrials = 0;
66 fNumberCalls = 0;
67 fmaxTrials = 0; // Maximum --> so only unsigned ints expected
68 fNoTimesMaxTrials = 0;
69}

Referenced by G4TrialsCounter().

◆ PrintStatistics()

void G4TrialsCounter::PrintStatistics ( )

Definition at line 48 of file G4TrialsCounter.cc.

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

Referenced by ~G4TrialsCounter().

◆ ReturnTotals()

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

Definition at line 72 of file G4TrialsCounter.cc.

73{
74 calls = fNumberCalls;
75 maxTrials = fmaxTrials;
76 numMaxT = fNoTimesMaxTrials;
77
78 return fTotalNoTrials;
79}

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