#include <Doxymodules_parallel.h>
Public Types | |
typedef std::map< G4int, G4double > | MutexHitsMap_t |
Public Member Functions | |
TSRun (const G4String &) | |
virtual | ~TSRun () |
virtual void | RecordEvent (const G4Event *) |
G4THitsMap< G4double > * | GetHitsMap (const G4String &collname) const |
G4TAtomicHitsMap< G4double > * | GetAtomicHitsMap (const G4String &) const |
MutexHitsMap_t * | GetMutexHitsMap (const G4String &) const |
G4StatContainer< G4StatAnalysis > * | GetStatMap (const G4String &collname) const |
G4StatContainer< G4ConvergenceTester > * | GetConvMap (const G4String &) const |
void | ConstructMFD (const G4String &) |
virtual void | Merge (const G4Run *) |
Private Attributes | |
std::vector< G4String > | fCollNames |
std::vector< G4int > | fCollIDs |
std::vector< G4THitsMap< G4double > * > | fRunMaps |
std::vector< G4StatContainer< G4StatAnalysis > * > | fStatMaps |
Static Private Attributes | |
static std::vector< G4TAtomicHitsMap< G4double > * > | fAtomicRunMaps |
TSRun contains five hits collections types: 1) a thread-local hits map, 2) a global atomic hits map 3) a global "mutex" hits map 4) a global G4StatAnalysis hits deque 5) a global G4ConvergenceTester hits deque. | |
static std::map< G4String, MutexHitsMap_t > | fMutexRunMaps |
static std::vector< G4StatContainer< G4ConvergenceTester > * > | fConvMaps |
Definition at line 149 of file Doxymodules_parallel.h.
typedef std::map<G4int, G4double> TSRun::MutexHitsMap_t |
TSRun::TSRun | ( | const G4String & | mfd_name | ) |
|
virtual |
Definition at line 97 of file TSRun.cc.
|
virtual |
Definition at line 182 of file TSRun.cc.
G4THitsMap< G4double > * TSRun::GetHitsMap | ( | const G4String & | collname | ) | const |
G4TAtomicHitsMap< G4double > * TSRun::GetAtomicHitsMap | ( | const G4String & | collName | ) | const |
TSRun::MutexHitsMap_t * TSRun::GetMutexHitsMap | ( | const G4String & | collName | ) | const |
G4StatContainer< G4StatAnalysis > * TSRun::GetStatMap | ( | const G4String & | collname | ) | const |
G4StatContainer< G4ConvergenceTester > * TSRun::GetConvMap | ( | const G4String & | collName | ) | const |
void TSRun::ConstructMFD | ( | const G4String & | mfdName | ) |
Definition at line 120 of file TSRun.cc.
|
virtual |
|
private |
|
private |
|
staticprivate |
TSRun contains five hits collections types: 1) a thread-local hits map, 2) a global atomic hits map 3) a global "mutex" hits map 4) a global G4StatAnalysis hits deque 5) a global G4ConvergenceTester hits deque.
The thread-local hits map is the same as you will find in many other examples.
The atomics hits map is the purpose of this example. Code-wise, the implementation looks extremely similar to the thread-local version with 3 primary exceptions: (1) construction - there should only be one instance so it should be a static member variable or a pointer/reference to a single instance (2) It does not need to, nor should be, summed in G4Run::Merge() (3) destruction – it should only be cleared by the master thread since there is only one instance.
The "mutex" hits map is also included as reference for checking the results accumulated by the thread-local hits maps and atomic hits maps. The differences w.r.t. this hits maps are computed in TSRunAction::EndOfRunAction
The "G4StatAnalysis" and "G4ConvergenceTester" hits deques are memory-efficient version of the standard G4THitsMap. While maps are ideal for scoring at the G4Event-level, where sparsity w.r.t. indices is common; at the G4Run-level, these data structures require much less memory overhead. Due to a lack of G4ConvergenceTester::operator+=(G4ConvergenceTester), the static version of G4ConvergenceTester is the only valid way to use G4ConvergenceTester in a scoring container. This is not the case for G4StatAnalysis, which can be used in lieu of G4double.
|
staticprivate |
|
staticprivate |