gstreamer
Loading...
Searching...
No Matches
publishDigitized.cc
Go to the documentation of this file.
1// gstreamer
4
5// Implementation summary:
6// Write one detector digitized bank for the current event in human-readable text form.
7// Use '\n' instead of std::endl so each line does not force a flush.
8
9bool GstreamerTextFactory::publishEventDigitizedDataImpl(const std::string& detectorName,
10 const std::vector<const GDigitizedData*>& digitizedData) {
11 if (!ofile.is_open()) {
12 log->error(gstreamer::ERR_CANTOPENOUTPUT, SFUNCTION_NAME, "Error: can't access ", filename());
13 }
14
15 ofile << guts::GTAB << "Detector <" << detectorName << "> Digitized Bank {\n";
16
17 for (auto dgtzHit : digitizedData) {
18 auto identifierString = getIdentityString(dgtzHit->getIdentity());
19
20 ofile << guts::GTABTAB << "Hit address: " << identifierString << " {\n";
21
22 // Argument passed to getter:
23 // 0 means "do not include SRO variables".
24 for (const auto& [variableName, value] : dgtzHit->getIntObservablesMap(0)) {
25 ofile << guts::GTABTABTAB << variableName << ": " << value << "\n";
26 }
27 for (const auto& [variableName, value] : dgtzHit->getDblObservablesMap(0)) {
28 ofile << guts::GTABTABTAB << variableName << ": " << value << "\n";
29 }
30
31 ofile << guts::GTABTAB << "}\n";
32 }
33 ofile << guts::GTAB << "}\n";
34
35 return true;
36}
std::shared_ptr< GLogger > log
std::string getIdentityString(std::vector< GIdentifier > gidentity)
ASCII streamer plugin declarations.
Shared constants and error codes for the gstreamer module.
constexpr int ERR_CANTOPENOUTPUT
Output medium could not be opened successfully.
constexpr char GTABTAB[]
constexpr char GTABTABTAB[]
constexpr char GTAB[]