8#include <mdst/dataobjects/SoftwareTriggerResult.h>
9#include <boost/algorithm/string/replace.hpp>
20 m_results[triggerIdentifier] = std::make_pair(
static_cast<int>(result),
static_cast<int>(nonPrescalesResult));
24 const std::string& triggerIdentifier)
const
26 auto pair =
m_results.at(triggerIdentifier);
43 std::map<std::string, int> result;
45 for (
const auto& [key, valuePair] :
m_results) {
46 result[key] = valuePair.first;
53 std::map<std::string, int> result;
55 for (
const auto& [key, valuePair] :
m_results) {
56 result[key] = valuePair.second;
69 std::stringstream out;
72 const std::string colorNeutral = gROOT->GetColor(kWhite)->AsHexString();
73 const std::string colorReject = gROOT->GetColor(kRed)->AsHexString();
74 const std::string colorAccept = gROOT->GetColor(kGreen)->AsHexString();
78 std::string name = result.first;
79 boost::replace_all(name,
"software_trigger_cut&",
"");
80 boost::replace_all(name,
"&",
"/");
81 const int value = result.second.first;
83 auto thisColor = colorNeutral;
85 thisColor = colorAccept;
86 }
else if (value < 0) {
87 thisColor = colorReject;
90 out <<
"<td>" << name <<
"</td>";
91 out <<
"<td bgcolor=\"" << thisColor <<
"\">" << value <<
"</td>";
SoftwareTriggerCutResult getNonPrescaledResult(const std::string &triggerIdentifier) const
Return the non-prescaled cut result with the given name or throw an error if no result is there.
std::map< std::string, std::pair< int, int > > m_results
Internal storage of the cut decisions with names.
SoftwareTriggerCutResult getResult(const std::string &triggerIdentifier) const
Return the cut result with the given name or throw an error if no result is there.
std::string getInfoHTML() const override
Return a short summary of this object's contents in HTML format.
std::map< std::string, int > getResults() const
Return all stored cut tags with their results as a map identifier -> cut result.
void addResult(const std::string &triggerIdentifier, SoftwareTriggerCutResult result, SoftwareTriggerCutResult nonPrescaledResult=SoftwareTriggerCutResult::c_noResult)
Add a new cut result to the storage or override the result with the same name.
std::map< std::string, int > getNonPrescaledResults() const
Return all stored cut tags with their non-prescaled results as a map identifier -> cut result.
void clear()
Clear all results.
std::pair< SoftwareTriggerCutResult, SoftwareTriggerCutResult > getResultPair(const std::string &triggerIdentifier) const
Return the cut result and the non-prescaled cut result with the given name or throw an error if no re...
SoftwareTriggerCutResult
Enumeration with all possible results of the SoftwareTriggerCut.
Abstract base class for different kinds of events.