64 std::vector<G4TAtomicHitsMap<G4double>*> TSRun::fAtomicRunMaps;
66 std::map<G4String, TSRun::MutexHitsMap_t> TSRun::fMutexRunMaps;
81 for(
unsigned i = 0; i < fRunMaps.size(); ++i)
85 for(
unsigned i = 0; i < fAtomicRunMaps.size(); ++i)
86 fAtomicRunMaps[i]->clear();
116 G4String fullCollectionName = mfdName+
"/"+collectionName;
119 if ( collectionID >= 0 ){
120 G4cout <<
"++ " << fullCollectionName<<
" id " << collectionID
124 fCollNames.push_back(fullCollectionName);
125 fCollIDs.push_back(collectionID);
131 (mfdName, collectionName));
134 G4cout <<
"** collection " << fullCollectionName <<
" not found. "
157 for(
unsigned i = 0; i < fCollIDs.size(); ++i)
159 G4int fCollID = fCollIDs.at(i);
172 *fRunMaps[fCollID] += *EvtMap;
174 *fAtomicRunMaps[fCollID] += *EvtMap;
179 auto itr = EvtMap->
GetMap()->begin();
180 for(; itr != EvtMap->
GetMap()->end(); itr++)
182 fMutexRunMaps[fCollNames[fCollID]][itr->first] += *itr->second;
199 const TSRun* localTSRun =
static_cast<const TSRun*
>(aTSRun);
201 for(
unsigned i = 0; i < fRunMaps.size(); ++i)
202 *fRunMaps[i] += *localTSRun->fRunMaps[i];
214 for(
unsigned i = 0; i < fCollNames.size(); ++i)
216 if(collName == fCollNames[i])
221 "GetHitsMap failed to locate the requested HitsMap");
233 for(
unsigned i = 0; i < fCollNames.size(); ++i)
235 if(collName == fCollNames[i])
236 return fAtomicRunMaps[i];
240 "GetHitsMap failed to locate the requested AtomicHitsMap");
252 if(fMutexRunMaps.find(collName) != fMutexRunMaps.end())
253 return &fMutexRunMaps[collName];
256 "GetHitsMap failed to locate the requested MutexHitsMap");
virtual void Merge(const G4Run *)
G4VHitsCollection * GetHC(G4int i)
G4int GetCollectionID(G4String colName)
MutexHitsMap_t * GetMutexHitsMap(const G4String &) const
Definition of the TSRun class.
virtual void RecordEvent(const G4Event *)
#define G4MUTEX_INITIALIZER
G4THitsMap< G4double > * GetHitsMap(const G4String &collname) const
G4GLOB_DLL std::ostream G4cout
G4VPrimitiveScorer * GetPrimitive(G4int id) const
std::map< G4int, G4double > MutexHitsMap_t
virtual void Merge(const G4Run *)
void ConstructMFD(const G4String &)
G4VSensitiveDetector * FindSensitiveDetector(G4String dName, G4bool warning=true)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
static G4SDManager * GetSDMpointer()
virtual void RecordEvent(const G4Event *)
std::map< G4int, T * > * GetMap() const
G4HCofThisEvent * GetHCofThisEvent() const
G4TAtomicHitsMap< G4double > * GetAtomicHitsMap(const G4String &) const
G4int GetNumberOfPrimitives() const