gdata
Loading...
Searching...
No Matches
gEventDataCollection.cc
Go to the documentation of this file.
1
12
13// Counter reserved for tests and future example helpers.
14std::atomic<int> GEventDataCollection::globalEventDataCollectionCounter{1};
15
16// Counter used by GEventHeader::create() to generate unique event numbers in examples/tests.
17std::atomic<int> GEventHeader::globalEventHeaderCounter{1};
18
19void GEventDataCollection::addDetectorTrueInfoData(const std::string& sdName, std::unique_ptr<GTrueInfoData> data) {
20 // Create the detector entry on first insertion.
21 if (gdataCollectionMap.find(sdName) == gdataCollectionMap.end()) {
22 gdataCollectionMap[sdName] = std::make_unique<GDataCollection>();
23 }
24
25 // Event-level insertion transfers ownership of the hit-side object to the detector container.
26 gdataCollectionMap[sdName]->addTrueInfoData(std::move(data));
27 log->info(2, "GEventDataCollection: added new detector TrueInfoData for ", sdName);
28}
29
30void GEventDataCollection::addDetectorDigitizedData(const std::string& sdName, std::unique_ptr<GDigitizedData> data) {
31 // Create the detector entry on first insertion.
32 if (gdataCollectionMap.find(sdName) == gdataCollectionMap.end()) {
33 gdataCollectionMap[sdName] = std::make_unique<GDataCollection>();
34 }
35
36 // Event-level insertion transfers ownership of the hit-side object to the detector container.
37 gdataCollectionMap[sdName]->addDigitizedData(std::move(data));
38 log->info(2, "GEventDataCollection: added new detector DigitizedData for ", sdName);
39}
std::shared_ptr< GLogger > log
void addDetectorTrueInfoData(const std::string &sdName, std::unique_ptr< GTrueInfoData > data)
Appends one truth object to the specified detector entry.
void addDetectorDigitizedData(const std::string &sdName, std::unique_ptr< GDigitizedData > data)
Appends one digitized object to the specified detector entry.
void info(int level, Args &&... args) const
Defines GEventDataCollection, the event-level aggregation of detector hit data.