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

#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

Definition at line 50 of file G4QSS_CustomStats.hh.

Constructor & Destructor Documentation

◆ QSSStats()

QSSStats::QSSStats ( )
inline

Definition at line 66 of file G4QSS_CustomStats.hh.

67 {
68 substeps = 0;
69 reset_time = 0;
71
72 for (size_t i = 0; i < Qss_misc::VAR_IDX_END; i++) {
73 dqrel_changes[i] = 0;
74 dqmin_changes[i] = 0;
75 max_error[i] = 0;
76 }
77 };
constexpr unsigned int VAR_IDX_END
Definition G4qss_misc.hh:46
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 79 of file G4QSS_CustomStats.hh.

80 {
81 G4int steps = stepperSteps.load();
82
83 std::vector<std::string> vars{"x", "y", "z", "vx", "vy", "vz"};
84
85 G4double avg_substeps = (G4double)substeps / steps;
86 G4double avg_integration_time = (G4double)integration_time / steps;
87 G4double avg_substeps_integration_time = (G4double)integration_time / substeps;
88 G4double avg_reset_time = (G4double)reset_time / steps;
89
90 std::stringstream ss;
91
92 ss << "QSS stats:" << std::endl;
93 ss << "dQMin: " << precision_dQMin << std::endl;
94 ss << "dQRel: " << precision_dQRel << std::endl;
95
96 ss << " Total steps: " << steps << std::endl
97 << " Total substeps: " << substeps << std::endl
98 << " Substeps average per step: " << avg_substeps << std::endl;
99
100 ss << " Substeps by track-step:" << std::endl;
101 for (auto it = substepsByStepNumberByTrackID.begin(); it != substepsByStepNumberByTrackID.end();
102 ++it)
103 {
104 ss << " Track #" << it->first << std::endl;
105 for (auto it2 = it->second.begin(); it2 != it->second.end(); ++it2) {
106 ss << " Step " << it2->first << " => " << it2->second << " substeps" << std::endl;
107 }
108 }
109
110 ss << " Integration time: " << integration_time << std::endl
111 << " Integration time average (step): " << avg_integration_time << std::endl
112 << " Integration time average (substep): " << avg_substeps_integration_time << std::endl;
113
114 ss << " Reset time: " << reset_time << std::endl
115 << " Reset time average: " << avg_reset_time << std::endl;
116
117 for (G4int index = 0; index < Qss_misc::VAR_IDX_END; index++) {
118 ss << " Variable " << vars[index] << ":" << std::endl;
119 ss << " dQRel changes: " << dqrel_changes[index] << std::endl;
120 ss << " dQMin changes: " << dqmin_changes[index] << std::endl;
121 ss << " Max error: " << max_error[index] << std::endl;
122 }
123
124 std::cout << ss.rdbuf();
125 };
double G4double
Definition G4Types.hh:83
int G4int
Definition G4Types.hh:85
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 54 of file G4QSS_CustomStats.hh.

◆ dqmin_changes

G4int QSSStats::dqmin_changes[Qss_misc::VAR_IDX_END]

Definition at line 63 of file G4QSS_CustomStats.hh.

Referenced by print(), and QSSStats().

◆ dqrel_changes

G4int QSSStats::dqrel_changes[Qss_misc::VAR_IDX_END]

Definition at line 62 of file G4QSS_CustomStats.hh.

Referenced by print(), and QSSStats().

◆ integration_time

G4double QSSStats::integration_time

Definition at line 60 of file G4QSS_CustomStats.hh.

Referenced by print(), and QSSStats().

◆ max_error

G4double QSSStats::max_error[Qss_misc::VAR_IDX_END]

Definition at line 64 of file G4QSS_CustomStats.hh.

Referenced by print(), and QSSStats().

◆ precision_dQMin

G4double QSSStats::precision_dQMin

Definition at line 52 of file G4QSS_CustomStats.hh.

Referenced by print().

◆ precision_dQRel

G4double QSSStats::precision_dQRel

Definition at line 53 of file G4QSS_CustomStats.hh.

Referenced by print().

◆ reset_time

G4double QSSStats::reset_time

Definition at line 59 of file G4QSS_CustomStats.hh.

Referenced by print(), and QSSStats().

◆ stepperSteps

std::atomic<G4int> QSSStats::stepperSteps

Definition at line 56 of file G4QSS_CustomStats.hh.

Referenced by print().

◆ substeps

G4int QSSStats::substeps

Definition at line 55 of file G4QSS_CustomStats.hh.

Referenced by print(), and QSSStats().

◆ substepsByStepNumberByTrackID

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

Definition at line 57 of file G4QSS_CustomStats.hh.

Referenced by print().


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