73#include "G4SDManager.hh"
74#include "G4MultiFunctionalDetector.hh"
75#include "G4VPrimitiveScorer.hh"
76#include "G4TiMemory.hh"
100 for(
unsigned i = 0; i <
fRunMaps.size(); ++i)
103 if(!G4Threading::IsWorkerThread())
133 for(G4int icol = 0; icol < mfd->GetNumberOfPrimitives(); icol++)
142 G4String collectionName = scorer->GetName();
143 G4String fullCollectionName = mfdName +
"/" + collectionName;
144 G4int collectionID = SDman->GetCollectionID(fullCollectionName);
146 if(collectionID >= 0)
148 G4cout <<
"++ " << fullCollectionName <<
" id " << collectionID
156 mfdName, collectionName,
158 if(!G4Threading::IsWorkerThread())
164 mfdName, collectionName,
170 G4cout <<
"** collection " << fullCollectionName <<
" not found. "
184 G4Run::RecordEvent(aEvent);
193 for(
unsigned i = 0; i <
fCollIDs.size(); ++i)
203 G4cout <<
" Error EvtMap Not Found " << G4endl;
210 G4USER_SCOPED_PROFILE(
"ThreadLocal");
215 G4USER_SCOPED_PROFILE(
"ThreadLocal/G4StatAnalysis");
221 G4USER_SCOPED_PROFILE(
"Global/Atomic");
226 G4USER_SCOPED_PROFILE(
"Global/Mutex");
228 static G4Mutex mtx = G4MUTEX_INITIALIZER;
229 G4AutoLock lock(&mtx);
230 for(
const auto& itr : *EvtMap)
235 G4USER_SCOPED_PROFILE(
"Global/Mutex/G4ConvergenceTester");
237 static G4Mutex mtx = G4MUTEX_INITIALIZER;
238 G4AutoLock lock(&mtx);
250 const TSRun* localTSRun =
static_cast<const TSRun*
>(aTSRun);
252 for(
unsigned i = 0; i <
fRunMaps.size(); ++i)
258 G4Run::Merge(aTSRun);
268 for(
unsigned i = 0; i <
fCollNames.size(); ++i)
274 G4Exception(
"TSRun", collName.c_str(), JustWarning,
275 "GetHitsMap failed to locate the requested HitsMap");
287 for(
unsigned i = 0; i <
fCollNames.size(); ++i)
293 G4Exception(
"TSRun", collName.c_str(), JustWarning,
294 "GetHitsMap failed to locate the requested AtomicHitsMap");
308 G4Exception(
"TSRun", collName.c_str(), JustWarning,
309 "GetHitsMap failed to locate the requested MutexHitsMap");
321 for(
unsigned i = 0; i <
fCollNames.size(); ++i)
327 G4Exception(
"TSRun", collName.c_str(), JustWarning,
328 "GetStatMap failed to locate the requested StatMap");
337 for(
unsigned i = 0; i <
fCollNames.size(); ++i)
343 G4Exception(
"TSRun", collName.c_str(), JustWarning,
344 "GetHitsMap failed to locate the requested AtomicHitsMap");
Definition of the TSDetectorConstruction class.
Definition of the TSRun class.
G4THitsDeque< _Tp > G4StatContainer
This is an implementation of G4THitsMap<T> where the underlying type is G4atomic<T>,...
static TSDetectorConstruction * Instance()
std::vector< G4String > fCollNames
static std::map< G4String, MutexHitsMap_t > fMutexRunMaps
MutexHitsMap_t * GetMutexHitsMap(const G4String &) const
virtual void Merge(const G4Run *)
G4TAtomicHitsMap< G4double > * GetAtomicHitsMap(const G4String &) const
G4StatContainer< G4StatAnalysis > * GetStatMap(const G4String &collname) const
std::map< G4int, G4double > MutexHitsMap_t
virtual void RecordEvent(const G4Event *)
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...
std::vector< G4int > fCollIDs
G4THitsMap< G4double > * GetHitsMap(const G4String &collname) const
void ConstructMFD(const G4String &)
std::vector< G4StatContainer< G4StatAnalysis > * > fStatMaps
G4StatContainer< G4ConvergenceTester > * GetConvMap(const G4String &) const
std::vector< G4THitsMap< G4double > * > fRunMaps
static std::vector< G4StatContainer< G4ConvergenceTester > * > fConvMaps