Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
QSSStats Struct Reference

QSSStats contains functions for statistics on the QSS drivers. More...

#include <G4QSS_CustomStats.hh>

Public Member Functions

 QSSStats ()
void print () const

Public Attributes

G4double precision_dQMin
G4double precision_dQRel
G4int currentStep
G4int substeps
std::atomic< G4intstepperSteps
std::map< G4int, std::map< G4int, G4int > > substepsByStepNumberByTrackID
G4double reset_time
G4double integration_time
G4int dqrel_changes [Qss_misc::VAR_IDX_END]
G4int dqmin_changes [Qss_misc::VAR_IDX_END]
G4double max_error [Qss_misc::VAR_IDX_END]

Detailed Description

QSSStats contains functions for statistics on the QSS drivers.

Definition at line 56 of file G4QSS_CustomStats.hh.

Constructor & Destructor Documentation

◆ QSSStats()

QSSStats::QSSStats ( )
inline

Definition at line 72 of file G4QSS_CustomStats.hh.

73 {
74 substeps = 0;
75 reset_time = 0;
77
78 for (std::size_t i = 0; i < Qss_misc::VAR_IDX_END; ++i)
79 {
80 dqrel_changes[i] = 0;
81 dqmin_changes[i] = 0;
82 max_error[i] = 0;
83 }
84 };
constexpr unsigned int VAR_IDX_END
Definition G4qss_misc.hh:57
G4int dqmin_changes[Qss_misc::VAR_IDX_END]
G4int dqrel_changes[Qss_misc::VAR_IDX_END]
G4double reset_time
G4double integration_time
G4double max_error[Qss_misc::VAR_IDX_END]

Member Function Documentation

◆ print()

void QSSStats::print ( ) const
inline

Definition at line 86 of file G4QSS_CustomStats.hh.

87 {
88 G4int steps = stepperSteps.load();
89
90 std::vector<std::string> vars{"x", "y", "z", "vx", "vy", "vz"};
91
92 G4double avg_substeps = (G4double)substeps / steps;
93 G4double avg_integration_time = (G4double)integration_time / steps;
94 G4double avg_substeps_integration_time = (G4double)integration_time / substeps;
95 G4double avg_reset_time = (G4double)reset_time / steps;
96
97 std::stringstream ss;
98
99 ss << "QSS stats:" << std::endl;
100 ss << "dQMin: " << precision_dQMin << std::endl;
101 ss << "dQRel: " << precision_dQRel << std::endl;
102
103 ss << " Total steps: " << steps << std::endl
104 << " Total substeps: " << substeps << std::endl
105 << " Substeps average per step: " << avg_substeps << std::endl;
106
107 ss << " Substeps by track-step:" << std::endl;
108 for (const auto& stp : substepsByStepNumberByTrackID)
109 {
110 ss << " Track #" << stp.first << std::endl;
111 for (const auto& stp2 : stp.second)
112 {
113 ss << " Step " << stp2.first << " => " << stp2.second << " substeps" << std::endl;
114 }
115 }
116
117 ss << " Integration time: " << integration_time << std::endl
118 << " Integration time average (step): " << avg_integration_time << std::endl
119 << " Integration time average (substep): " << avg_substeps_integration_time << std::endl;
120
121 ss << " Reset time: " << reset_time << std::endl
122 << " Reset time average: " << avg_reset_time << std::endl;
123
124 for (std::size_t index = 0; index < Qss_misc::VAR_IDX_END; ++index)
125 {
126 ss << " Variable " << vars[index] << ":" << std::endl;
127 ss << " dQRel changes: " << dqrel_changes[index] << std::endl;
128 ss << " dQMin changes: " << dqmin_changes[index] << std::endl;
129 ss << " Max error: " << max_error[index] << std::endl;
130 }
131
132 G4cout << ss.rdbuf();
133 };
double G4double
Definition G4Types.hh:83
int G4int
Definition G4Types.hh:85
G4GLOB_DLL std::ostream G4cout
G4double precision_dQRel
std::atomic< G4int > stepperSteps
std::map< G4int, std::map< G4int, G4int > > substepsByStepNumberByTrackID
G4double precision_dQMin

Member Data Documentation

◆ currentStep

G4int QSSStats::currentStep

Definition at line 60 of file G4QSS_CustomStats.hh.

◆ dqmin_changes

G4int QSSStats::dqmin_changes[Qss_misc::VAR_IDX_END]

Definition at line 69 of file G4QSS_CustomStats.hh.

Referenced by print(), and QSSStats().

◆ dqrel_changes

G4int QSSStats::dqrel_changes[Qss_misc::VAR_IDX_END]

Definition at line 68 of file G4QSS_CustomStats.hh.

Referenced by print(), and QSSStats().

◆ integration_time

G4double QSSStats::integration_time

Definition at line 66 of file G4QSS_CustomStats.hh.

Referenced by print(), and QSSStats().

◆ max_error

G4double QSSStats::max_error[Qss_misc::VAR_IDX_END]

Definition at line 70 of file G4QSS_CustomStats.hh.

Referenced by print(), and QSSStats().

◆ precision_dQMin

G4double QSSStats::precision_dQMin

Definition at line 58 of file G4QSS_CustomStats.hh.

Referenced by print().

◆ precision_dQRel

G4double QSSStats::precision_dQRel

Definition at line 59 of file G4QSS_CustomStats.hh.

Referenced by print().

◆ reset_time

G4double QSSStats::reset_time

Definition at line 65 of file G4QSS_CustomStats.hh.

Referenced by print(), and QSSStats().

◆ stepperSteps

std::atomic<G4int> QSSStats::stepperSteps

Definition at line 62 of file G4QSS_CustomStats.hh.

Referenced by print().

◆ substeps

G4int QSSStats::substeps

Definition at line 61 of file G4QSS_CustomStats.hh.

Referenced by print(), and QSSStats().

◆ substepsByStepNumberByTrackID

std::map<G4int, std::map<G4int, G4int> > QSSStats::substepsByStepNumberByTrackID

Definition at line 63 of file G4QSS_CustomStats.hh.

Referenced by print().


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