#include <G4AccumulableManager.hh>
Definition at line 43 of file G4AccumulableManager.hh.
◆ ~G4AccumulableManager()
G4AccumulableManager::~G4AccumulableManager |
( |
| ) |
|
|
virtual |
Definition at line 73 of file G4AccumulableManager.cc.
74{
75
76 for ( auto it : fAccumulablesToDelete ) {
77 delete it;
78 }
79}
◆ Begin()
std::vector< G4VAccumulable * >::iterator G4AccumulableManager::Begin |
( |
| ) |
|
◆ BeginConst()
std::vector< G4VAccumulable * >::const_iterator G4AccumulableManager::BeginConst |
( |
| ) |
const |
◆ CreateAccumulable() [1/2]
◆ CreateAccumulable() [2/2]
template<typename T >
G4Accumulable< T > * G4AccumulableManager::CreateAccumulable |
( |
T |
value, |
|
|
G4MergeMode |
mergeMode = G4MergeMode::kAddition |
|
) |
| |
◆ End()
std::vector< G4VAccumulable * >::iterator G4AccumulableManager::End |
( |
| ) |
|
◆ EndConst()
std::vector< G4VAccumulable * >::const_iterator G4AccumulableManager::EndConst |
( |
| ) |
const |
◆ GetAccumulable() [1/4]
◆ GetAccumulable() [2/4]
Definition at line 135 of file G4AccumulableManager.cc.
136{
137
138 auto it = fMap.find(name);
139 if ( it == fMap.end() ) {
140 if ( warn) {
142 description <<
" " <<
"accumulable " <<
name <<
" does not exist.";
143 G4Exception(
"G4AccumulableManager::GetAccumulable",
145 }
146 return nullptr;
147 }
148
149 return it->second;
150}
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
const char * name(G4int ptype)
◆ GetAccumulable() [3/4]
◆ GetAccumulable() [4/4]
Definition at line 154 of file G4AccumulableManager.cc.
155{
156
157 if ( id < 0 || id >=
G4int(fVector.size()) ) {
158 if ( warn) {
160 description << " " << "accumulable " << id << " does not exist.";
161 G4Exception(
"G4AccumulableManager::GetAccumulable",
163 }
164 return nullptr;
165 }
166
167 return fVector[id];
168}
◆ GetNofAccumulables()
G4int G4AccumulableManager::GetNofAccumulables |
( |
| ) |
const |
◆ Instance()
Definition at line 44 of file G4AccumulableManager.cc.
45{
46 if ( fgInstance == nullptr ) {
49 }
50
51 return fgInstance;
52}
◆ Merge()
void G4AccumulableManager::Merge |
( |
| ) |
|
Definition at line 171 of file G4AccumulableManager.cc.
172{
173
174
176
177
178 if ( ! fgMasterInstance ) {
180 description
181 << " " << "No master G4AccumulableManager instance exists."
183 << " " << "Accumulables will not be merged.";
186 return;
187 }
188
189
190
191
193
194
195 auto it = fVector.begin();
196 for ( auto itMaster : fgMasterInstance->fVector ) {
197
198
199
200 itMaster->Merge(*(*(it++)));
201 }
202 lock.unlock();
203}
◆ RegisterAccumulable() [1/2]
◆ RegisterAccumulable() [2/2]
Definition at line 115 of file G4AccumulableManager.cc.
116{
118
119
120 if ( ! CheckName(name, "RegisterAccumulable") ) return false;
121
122
123 if ( !
name.length() ) {
124 name = GenerateName();
126 }
127
128 fMap[
name] = accumulable;
129 fVector.push_back(accumulable);
130 return true;
131}
◆ Reset()
void G4AccumulableManager::Reset |
( |
| ) |
|
The documentation for this class was generated from the following files: