gstreamer
Loading...
Searching...
No Matches
publishDigitized.cc
Go to the documentation of this file.
1// gstreamer
4
5// using \n instead of endl so flushing isn't forced at each line
6// Non-Doxygen implementation file: behavior is documented in the header.
7bool GstreamerTextFactory::publishEventDigitizedDataImpl(const std::string& detectorName,
8 const std::vector<const GDigitizedData*>& digitizedData) {
9 if (!ofile.is_open()) { log->error(ERR_CANTOPENOUTPUT, SFUNCTION_NAME, "Error: can't access ", filename()); }
10
11 ofile << GTAB << "Detector <" << detectorName << "> Digitized Bank {\n";
12
13 for (auto dgtzHit : digitizedData) {
14 std::string identifierString = dgtzHit->getIdentityString();
15
16 ofile << GTABTAB << "Hit address: " << identifierString << " {\n";
17
18 // argument passed to getter: 0 = do not get sro vars
19 for (const auto& [variableName, value] : dgtzHit->getIntObservablesMap(0)) {
20 ofile << GTABTABTAB << variableName << ": " << value << "\n";
21 }
22 for (const auto& [variableName, value] : dgtzHit->getDblObservablesMap(0)) {
23 ofile << GTABTABTAB << variableName << ": " << value << "\n";
24 }
25
26 ofile << GTABTAB << "}\n";
27 }
28 ofile << GTAB << "}\n";
29
30 return true;
31}
std::shared_ptr< GLogger > log
void error(int exit_code, Args &&... args) const
Shared constants and error codes for the gstreamer module.
#define ERR_CANTOPENOUTPUT
Output medium could not be opened (file/device not accessible).
#define GTABTABTAB
#define GTAB
#define GTABTAB