gdata
Loading...
Searching...
No Matches
gRunDataCollection.h
Go to the documentation of this file.
1#pragma once
2
29#include "gRunHeader.h"
31
32// C++
33#include <map>
34#include <string>
35
36constexpr const char* GRUNDATA_LOGGER = "grun_data";
37
64
81class GRunDataCollection : public GBase<GRunDataCollection>
82{
83public:
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
114 void collect_event_data_collection(const std::shared_ptr<GEventDataCollection> edc);
115
120 [[nodiscard]] auto getHeader() const -> const std::unique_ptr<GRunHeader>& { return grun_header; }
121
131 [[nodiscard]] auto getDataCollectionMap() const -> const std::map<std::string, std::unique_ptr<GDataCollection>>& {
132 return gdataCollectionMap;
133 }
134
139 [[nodiscard]] auto getRunNumber() const -> int { return grun_header->getRunID(); }
140
150 [[nodiscard]] auto get_events_processed() const -> int { return grun_header->get_events_processed(); }
151
152private:
153 std::unique_ptr<GRunHeader> grun_header;
154
156 std::map<std::string, std::unique_ptr<GDataCollection>> gdataCollectionMap;
157
168 void collectDetectorTrueInfoData(const std::string& sdName, const std::unique_ptr<GTrueInfoData>& data);
169
180 void collectDetectorDigitizedData(const std::string& sdName, const std::unique_ptr<GDigitizedData>& data);
181};
Per-sensitive-detector container that owns true and digitized hit data.
Run-level container that integrates per-event detector data into per-detector summaries.
auto getDataCollectionMap() const -> const std::map< std::string, std::unique_ptr< GDataCollection > > &
Access the per-detector run summary map.
void collect_event_data_collection(const std::shared_ptr< GEventDataCollection > edc)
Integrate one event data collection into this run summary.
GRunDataCollection(const std::shared_ptr< GOptions > &gopts, std::unique_ptr< GRunHeader > header)
Construct a run data collection.
auto getHeader() const -> const std::unique_ptr< GRunHeader > &
Access the owned run header.
auto get_events_processed() const -> int
Number of events integrated into this run summary.
auto getRunNumber() const -> int
Convenience accessor for the run number.
Minimal run metadata: run ID and integrated-event counter.
Definition gRunHeader.h:62
Defines GEventDataCollection, event-level aggregation of per-detector hit data.
constexpr const char * GRUNDATA_LOGGER
Defines GRunHeader metadata for a run-level data collection.
GOptions defineOptions()
Defines GOptions for the digitized-data logger domain.
auto defineOptions() -> GOptions
Aggregated options for event-level data collection.
GOptions defineOptions()
Defines GOptions for the event-header logger domain.
auto defineOptions() -> GOptions
Aggregated options for run-level data collection.
auto defineOptions() -> GOptions
Defines GOptions for the run-header logger domain.
Definition gRunHeader.h:39
GOptions defineOptions()
GOptions defineOptions()
Defines GOptions for the true-data logger domain.