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