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()) { log->error(ERR_CANTOPENOUTPUT, SFUNCTION_NAME, "Error: can't access ", filename()); }
13
14 ofile << GTAB << "Detector <" << detectorName << "> Digitized Bank {\n";
15
16 for (auto dgtzHit : digitizedData) {
17 std::string identifierString = dgtzHit->getIdentityString();
18
19 ofile << GTABTAB << "Hit address: " << identifierString << " {\n";
20
21 // Argument passed to getter:
22 // 0 means "do not include SRO variables".
23 for (const auto& [variableName, value] : dgtzHit->getIntObservablesMap(0)) {
24 ofile << GTABTABTAB << variableName << ": " << value << "\n";
25 }
26 for (const auto& [variableName, value] : dgtzHit->getDblObservablesMap(0)) {
27 ofile << GTABTABTAB << variableName << ": " << value << "\n";
28 }
29
30 ofile << GTABTAB << "}\n";
31 }
32 ofile << GTAB << "}\n";
33
34 return true;
35}
std::shared_ptr< GLogger > log
void error(int exit_code, Args &&... args) const
ASCII streamer plugin declarations.
Shared constants and error codes for the gstreamer module.
#define ERR_CANTOPENOUTPUT
Output medium could not be opened successfully.
#define GTABTABTAB
#define GTAB
#define GTABTAB