gstreamer
Loading...
Searching...
No Matches
publishTrueInfo.cc
Go to the documentation of this file.
1// gstreamer
4
5// Implementation summary:
6// Write one detector true-information bank for the current event in text form.
7// Use '\n' instead of std::endl so each line does not force a flush.
8
9bool GstreamerTextFactory::publishEventTrueInfoDataImpl(const std::string& detectorName,
10 const std::vector<const GTrueInfoData*>& trueInfoData) {
11 if (!ofile.is_open()) { log->error(ERR_CANTOPENOUTPUT, SFUNCTION_NAME, "Error: can't access ", filename()); }
12
13 ofile << GTAB << "Detector <" << detectorName << "> True Info Bank {\n";
14
15 for (auto trueInfoHit : trueInfoData) {
16 std::string identifierString = trueInfoHit->getIdentityString();
17
18 ofile << GTABTAB << "Hit address: " << identifierString << " {\n";
19
20 for (const auto& [variableName, value] : trueInfoHit->getDoubleVariablesMap()) {
21 ofile << GTABTABTAB << variableName << ": " << value << "\n";
22 }
23 for (const auto& [variableName, value] : trueInfoHit->getStringVariablesMap()) {
24 ofile << GTABTABTAB << variableName << ": " << value << "\n";
25 }
26
27 ofile << GTABTAB << "}\n";
28 }
29 ofile << GTAB << "}\n";
30
31 return true;
32}
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