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()) { log->error(ERR_CANTOPENOUTPUT, SFUNCTION_NAME, "Error: can't access ", filename()); }
12
13 ofile << GTAB << "Detector <" << detectorName << "> Digitized Bank {\n";
14
15 for (auto dgtzHit : digitizedData) {
16 std::string identifierString = dgtzHit->getIdentityString();
17
18 ofile << GTABTAB << "Hit address: " << identifierString << " {\n";
19
20 // Argument passed to getter:
21 // 0 means "do not include SRO variables".
22 for (const auto& [variableName, value] : dgtzHit->getIntObservablesMap(0)) {
23 ofile << GTABTABTAB << variableName << ": " << value << "\n";
24 }
25 for (const auto& [variableName, value] : dgtzHit->getDblObservablesMap(0)) {
26 ofile << GTABTABTAB << variableName << ": " << value << "\n";
27 }
28
29 ofile << GTABTAB << "}\n";
30 }
31 ofile << GTAB << "}\n";
32
33 return true;
34}
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