gdata
Loading...
Searching...
No Matches
gRunDataCollection.h
Go to the documentation of this file.
1#pragma once
2
25#include "gRunHeader.h"
26
27// C++
28#include <map>
29#include <string>
30
31constexpr const char* GRUNDATA_LOGGER = "grun_data";
32
59
84class GRunDataCollection : public GBase<GRunDataCollection>
85{
86public:
96 GRunDataCollection(const std::shared_ptr<GOptions>& gopts, std::unique_ptr<GRunHeader> header)
97 : GBase(gopts, GRUNDATA_LOGGER), grun_header(std::move(header)) {
98 }
99
115 void collect_event_data_collection(const std::shared_ptr<GEventDataCollection> edc);
116
127 void collect_event_data_collections(const std::string& sdName, std::unique_ptr<GDigitizedData> ddata);
128
134 [[nodiscard]] auto getHeader() const -> const std::unique_ptr<GRunHeader>& { return grun_header; }
135
144 [[nodiscard]] auto getDataCollectionMap() const -> const std::map<std::string, std::unique_ptr<GDataCollection>>& {
145 return gdataCollectionMap;
146 }
147
157 [[nodiscard]] auto getMutableDataCollectionMap() -> std::map<std::string, std::unique_ptr<GDataCollection>>& {
158 return gdataCollectionMap;
159 }
160
166 [[nodiscard]] auto getRunNumber() const -> int { return grun_header->getRunID(); }
167
173 [[nodiscard]] auto get_events_processed() const -> int { return grun_header->get_events_processed(); }
174
180 [[nodiscard]] auto get_events_with_payload() const -> int { return grun_header->get_events_with_payload(); }
181
195 void merge(const GRunDataCollection& other);
196
197private:
199 std::unique_ptr<GRunHeader> grun_header;
200
202 std::map<std::string, std::unique_ptr<GDataCollection>> gdataCollectionMap;
203
214 void collectDetectorDigitizedData(const std::string& sdName, const std::unique_ptr<GDigitizedData>& data);
215};
Per-sensitive-detector container that owns truth and digitized data objects.
Owns and updates the run-level detector summary map.
auto getDataCollectionMap() const -> const std::map< std::string, std::unique_ptr< GDataCollection > > &
Returns read-only access to the detector summary map.
void collect_event_data_collection(const std::shared_ptr< GEventDataCollection > edc)
Integrates one event collection into the run summary.
GRunDataCollection(const std::shared_ptr< GOptions > &gopts, std::unique_ptr< GRunHeader > header)
Constructs a run data collection with an owned run header.
void collect_event_data_collections(const std::string &sdName, std::unique_ptr< GDigitizedData > ddata)
Integrates one digitized object into the named detector entry.
void merge(const GRunDataCollection &other)
Merges another run accumulator into this one.
auto getHeader() const -> const std::unique_ptr< GRunHeader > &
Returns read-only access to the owned run header.
auto get_events_processed() const -> int
Returns the total processed-event count stored in the header.
auto get_events_with_payload() const -> int
Returns the number of processed events that contributed payload.
auto getMutableDataCollectionMap() -> std::map< std::string, std::unique_ptr< GDataCollection > > &
Returns mutable access to the detector summary map.
auto getRunNumber() const -> int
Returns the run number stored in the owned header.
Stores minimal run metadata and run-level event counters.
Definition gRunHeader.h:69
Defines GEventDataCollection, the event-level aggregation of detector hit data.
constexpr const char * GRUNDATA_LOGGER
Defines GRunHeader, the metadata header associated with one run-level collection.
GOptions defineOptions()
Defines the options subtree used by the digitized-data logger domain.
auto defineOptions() -> GOptions
Aggregates the option groups needed by event-level data containers.
GOptions defineOptions()
Defines the options subtree used by the event-header logger domain.
auto defineOptions() -> GOptions
Aggregates the option groups needed by run-level data containers.
auto defineOptions() -> GOptions
Defines the options subtree used by the run-header logger domain.
Definition gRunHeader.h:35
GOptions defineOptions()