ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TSRun Class Reference

#include <geant4/tree/geant4-10.6-release/examples/extended/parallel/ThreadsafeScorers/include/TSRun.hh>

+ Inheritance diagram for TSRun:
+ Collaboration diagram for TSRun:

Public Types

typedef std::map< G4int, G4doubleMutexHitsMap_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_tGetMutexHitsMap (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 *)
 
- Public Member Functions inherited from G4Run
 G4Run ()
 
virtual ~G4Run ()
 
G4int GetRunID () const
 
G4int GetNumberOfEvent () const
 
G4int GetNumberOfEventToBeProcessed () const
 
const G4HCtableGetHCtable () const
 
const G4DCtableGetDCtable () const
 
const G4StringGetRandomNumberStatus () const
 
void SetRunID (G4int id)
 
void SetNumberOfEventToBeProcessed (G4int n_ev)
 
void SetHCtable (G4HCtable *HCtbl)
 
void SetDCtable (G4DCtable *DCtbl)
 
void SetRandomNumberStatus (G4String &st)
 
void StoreEvent (G4Event *evt)
 
const std::vector< const
G4Event * > * 
GetEventVector () const
 

Private Attributes

std::vector< G4StringfCollNames
 
std::vector< G4intfCollIDs
 
std::vector< G4THitsMap
< G4double > * > 
fRunMaps
 
std::vector< G4StatContainer
< G4StatAnalysis > * > 
fStatMaps
 

Static Private Attributes

static std::vector
< G4TAtomicHitsMap< G4double > * > 
fAtomicRunMaps
 
static std::map< G4String,
MutexHitsMap_t
fMutexRunMaps
 
static std::vector
< G4StatContainer
< G4ConvergenceTester > * > 
fConvMaps
 

Additional Inherited Members

- Protected Attributes inherited from G4Run
G4int runID
 
G4int numberOfEvent
 
G4int numberOfEventToBeProcessed
 
G4HCtableHCtable
 
G4DCtableDCtable
 
G4String randomNumberStatus
 
std::vector< const G4Event * > * eventVector
 

Detailed Description

Definition at line 76 of file TSRun.hh.

View newest version in sPHENIX GitHub at line 76 of file TSRun.hh

Member Typedef Documentation

typedef std::map<G4int, G4double> TSRun::MutexHitsMap_t

Definition at line 79 of file TSRun.hh.

View newest version in sPHENIX GitHub at line 79 of file TSRun.hh

Constructor & Destructor Documentation

TSRun::TSRun ( const G4String mfd_name)

Definition at line 90 of file TSRun.cc.

View newest version in sPHENIX GitHub at line 90 of file TSRun.cc

References ConstructMFD().

+ Here is the call graph for this function:

TSRun::~TSRun ( )
virtual

Definition at line 98 of file TSRun.cc.

View newest version in sPHENIX GitHub at line 98 of file TSRun.cc

References fAtomicRunMaps, fConvMaps, fMutexRunMaps, fRunMaps, and G4Threading::IsWorkerThread().

+ Here is the call graph for this function:

Member Function Documentation

void TSRun::ConstructMFD ( const G4String mfdName)

Definition at line 121 of file TSRun.cc.

View newest version in sPHENIX GitHub at line 121 of file TSRun.cc

References fAtomicRunMaps, fCollIDs, fCollNames, fConvMaps, G4SDManager::FindSensitiveDetector(), fMutexRunMaps, fRunMaps, fStatMaps, G4cout, G4endl, G4SDManager::GetCollectionID(), G4VPrimitiveScorer::GetName(), G4MultiFunctionalDetector::GetNumberOfPrimitives(), G4MultiFunctionalDetector::GetPrimitive(), G4SDManager::GetSDMpointer(), TSDetectorConstruction::Instance(), and G4Threading::IsWorkerThread().

Referenced by TSRun().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

G4TAtomicHitsMap< G4double > * TSRun::GetAtomicHitsMap ( const G4String collName) const

Definition at line 289 of file TSRun.cc.

View newest version in sPHENIX GitHub at line 289 of file TSRun.cc

References fAtomicRunMaps, fCollNames, G4Exception(), and JustWarning.

Referenced by TSRunAction::EndOfRunAction().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

G4StatContainer< G4ConvergenceTester > * TSRun::GetConvMap ( const G4String collName) const

Definition at line 340 of file TSRun.cc.

View newest version in sPHENIX GitHub at line 340 of file TSRun.cc

References fCollNames, fConvMaps, G4Exception(), and JustWarning.

Referenced by TSRunAction::EndOfRunAction().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

G4THitsMap< G4double > * TSRun::GetHitsMap ( const G4String collname) const

Definition at line 270 of file TSRun.cc.

View newest version in sPHENIX GitHub at line 270 of file TSRun.cc

References fCollNames, fRunMaps, G4Exception(), and JustWarning.

Referenced by TSRunAction::EndOfRunAction().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

TSRun::MutexHitsMap_t * TSRun::GetMutexHitsMap ( const G4String collName) const

Definition at line 308 of file TSRun.cc.

View newest version in sPHENIX GitHub at line 308 of file TSRun.cc

References fMutexRunMaps, G4Exception(), and JustWarning.

Referenced by TSRunAction::EndOfRunAction().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

G4StatContainer< G4StatAnalysis > * TSRun::GetStatMap ( const G4String collname) const

Definition at line 324 of file TSRun.cc.

View newest version in sPHENIX GitHub at line 324 of file TSRun.cc

References fCollNames, fStatMaps, G4Exception(), and JustWarning.

Referenced by TSRunAction::EndOfRunAction().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void TSRun::Merge ( const G4Run aTSRun)
virtual

Reimplemented from G4Run.

Definition at line 252 of file TSRun.cc.

View newest version in sPHENIX GitHub at line 252 of file TSRun.cc

References fRunMaps, fStatMaps, and G4Run::Merge().

+ Here is the call graph for this function:

void TSRun::RecordEvent ( const G4Event aEvent)
virtual

Reimplemented from G4Run.

Definition at line 184 of file TSRun.cc.

View newest version in sPHENIX GitHub at line 184 of file TSRun.cc

References fAtomicRunMaps, fCollIDs, fCollNames, fConvMaps, fMutexRunMaps, fRunMaps, fStatMaps, G4cout, G4endl, G4MUTEX_INITIALIZER, G4HCofThisEvent::GetHC(), G4Event::GetHCofThisEvent(), G4Run::RecordEvent(), TIMEMORY_AUTO_TIMER, and TIMEMORY_BASIC_AUTO_TIMER.

+ Here is the call graph for this function:

Member Data Documentation

std::vector< G4TAtomicHitsMap< G4double > * > TSRun::fAtomicRunMaps
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.

Definition at line 106 of file TSRun.hh.

View newest version in sPHENIX GitHub at line 106 of file TSRun.hh

Referenced by ConstructMFD(), GetAtomicHitsMap(), RecordEvent(), and ~TSRun().

std::vector<G4int> TSRun::fCollIDs
private

Definition at line 103 of file TSRun.hh.

View newest version in sPHENIX GitHub at line 103 of file TSRun.hh

Referenced by ConstructMFD(), and RecordEvent().

std::vector<G4String> TSRun::fCollNames
private

Definition at line 102 of file TSRun.hh.

View newest version in sPHENIX GitHub at line 102 of file TSRun.hh

Referenced by ConstructMFD(), GetAtomicHitsMap(), GetConvMap(), GetHitsMap(), GetStatMap(), and RecordEvent().

std::vector< G4StatContainer< G4ConvergenceTester > * > TSRun::fConvMaps
staticprivate

Definition at line 108 of file TSRun.hh.

View newest version in sPHENIX GitHub at line 108 of file TSRun.hh

Referenced by ConstructMFD(), GetConvMap(), RecordEvent(), and ~TSRun().

std::map< G4String, TSRun::MutexHitsMap_t > TSRun::fMutexRunMaps
staticprivate

Definition at line 107 of file TSRun.hh.

View newest version in sPHENIX GitHub at line 107 of file TSRun.hh

Referenced by ConstructMFD(), GetMutexHitsMap(), RecordEvent(), and ~TSRun().

std::vector<G4THitsMap<G4double>*> TSRun::fRunMaps
private

Definition at line 104 of file TSRun.hh.

View newest version in sPHENIX GitHub at line 104 of file TSRun.hh

Referenced by ConstructMFD(), GetHitsMap(), Merge(), RecordEvent(), and ~TSRun().

std::vector<G4StatContainer<G4StatAnalysis>*> TSRun::fStatMaps
private

Definition at line 105 of file TSRun.hh.

View newest version in sPHENIX GitHub at line 105 of file TSRun.hh

Referenced by ConstructMFD(), GetStatMap(), Merge(), and RecordEvent().


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