gdata
Loading...
Searching...
No Matches
gEventDataCollection.cc
Go to the documentation of this file.
1
9// See header for API docs.
10
12
18std::atomic<int> GEventDataCollection::globalEventDataCollectionCounter{1};
19
21std::atomic<int> GEventHeader::globalEventHeaderCounter{1};
22
23void GEventDataCollection::addDetectorTrueInfoData(const std::string& sdName, std::unique_ptr<GTrueInfoData> data) {
24 // Create detector entry if it does not exist.
25 if (gdataCollectionMap.find(sdName) == gdataCollectionMap.end()) {
26 gdataCollectionMap[sdName] = std::make_unique<GDataCollection>();
27 }
28
29 // Event-level: store a new hit entry (ownership transferred).
30 gdataCollectionMap[sdName]->addTrueInfoData(std::move(data));
31 log->info(2, "GEventDataCollection: added new detector TrueInfoData for ", sdName);
32}
33
34void GEventDataCollection::addDetectorDigitizedData(const std::string& sdName, std::unique_ptr<GDigitizedData> data) {
35 // Ensure the per-detector container exists.
36 if (gdataCollectionMap.find(sdName) == gdataCollectionMap.end()) {
37 gdataCollectionMap[sdName] = std::make_unique<GDataCollection>();
38 }
39
40 // Event-level: store a new hit entry (ownership transferred).
41 gdataCollectionMap[sdName]->addDigitizedData(std::move(data));
42 log->info(2, "GEventDataCollection: added new detector DigitizedData for ", sdName);
43}
std::shared_ptr< GLogger > log
void addDetectorTrueInfoData(const std::string &sdName, std::unique_ptr< GTrueInfoData > data)
Append one true-hit entry to the specified detector.
void addDetectorDigitizedData(const std::string &sdName, std::unique_ptr< GDigitizedData > data)
Append one digitized-hit entry to the specified detector.
void info(int level, Args &&... args) const
Defines GEventDataCollection, event-level aggregation of per-detector hit data.