gstreamer
Loading...
Searching...
No Matches
gstreamerCSVFactory.h
Go to the documentation of this file.
1#pragma once
2
3// gstreamer
4#include "gstreamer.h"
5
6// c++
7#include <fstream>
8
41{
42public:
45
50
51private:
57 bool openConnection() override;
58
64 bool closeConnectionImpl() override;
65
75 bool startEventImpl([[maybe_unused]] const std::shared_ptr<GEventDataCollection>& event_data) override;
76
83 bool endEventImpl([[maybe_unused]] const std::shared_ptr<GEventDataCollection>& event_data) override;
84
91 bool publishEventHeaderImpl([[maybe_unused]] const std::unique_ptr<GEventHeader>& gevent_header) override;
92
100 bool publishEventTrueInfoDataImpl(const std::string& detectorName,
101 const std::vector<const GTrueInfoData*>& trueInfoData) override;
102
110 bool publishEventDigitizedDataImpl(const std::string& detectorName,
111 const std::vector<const GDigitizedData*>& digitizedData) override;
112
121 bool startRunImpl([[maybe_unused]] const std::shared_ptr<GRunDataCollection>& run_data) override;
122
129 bool endRunImpl([[maybe_unused]] const std::shared_ptr<GRunDataCollection>& run_data) override;
130
138 bool publishRunDigitizedDataImpl(const std::string& detectorName,
139 const std::vector<const GDigitizedData*>& digitizedData) override;
140
149 bool startStreamImpl(const GFrameDataCollection* frameRunData) override;
150
157 bool endStreamImpl(const GFrameDataCollection* frameRunData) override;
158
167 bool publishFrameHeaderImpl(const GFrameHeader* gframeHeader) override;
168
177 bool publishPayloadImpl(const std::vector<GIntegralPayload*>* payload) override;
178
180 std::ofstream ofile_true_info;
181
183 std::ofstream ofile_digitized;
184
193 [[nodiscard]] std::string filename() const override { return gstreamer_definitions.rootname + ".csv"; }
194
200 [[nodiscard]] std::string filename_true_info() const { return gstreamer_definitions.rootname + "_true_info.csv"; }
201
207 [[nodiscard]] std::string filename_digitized() const { return gstreamer_definitions.rootname + "_digitized.csv"; }
208
210 bool is_first_event_with_truedata = false;
211
213 bool is_first_event_with_digidata = false;
214
216 std::string timestamp;
217
219 int event_number;
220
222 int runId;
223
225 int thread_id;
226};
Abstract base class for all gstreamer output plugins.
Definition gstreamer.h:77
GStreamer(const std::shared_ptr< GOptions > &g)
Construct the streamer base and initialize module logging.
Definition gstreamer.h:84
GStreamerDefinition gstreamer_definitions
Output definition currently bound to this streamer instance.
Definition gstreamer.h:206
CSV plugin writing flattened per-hit event and run data into two CSV files.
GstreamerCsvFactory & operator=(const GstreamerCsvFactory &)=delete
GstreamerCsvFactory & operator=(GstreamerCsvFactory &&)=delete
GstreamerCsvFactory(GstreamerCsvFactory &&)=delete
GstreamerCsvFactory(const GstreamerCsvFactory &)=delete
Core streaming interface and helper utilities for the gstreamer module.
std::string rootname
Base output filename without extension, optionally specialized by thread id.