Skip to content
Snippets Groups Projects
Commit 6bf50f31 authored by scott snyder's avatar scott snyder Committed by scott snyder
Browse files

TrigOutputHandling: Fix compilation to clang.

Streaming operators should live within the namespace of the class they're streaming.
Best not to define stream operators for types in std::; use formatting
functions instead.
parent 5ee166ca
No related branches found
No related tags found
No related merge requests found
......@@ -5,6 +5,7 @@
#include "TrigOutputHandling/HLTResultMTMaker.h"
#include "AthenaMonitoring/Monitored.h"
#include "GaudiKernel/IJobOptionsSvc.h"
#include <sstream>
// Local helpers
namespace {
......@@ -32,15 +33,17 @@ namespace {
return removedIds;
}
/// Print helper for set<uint32_t>
std::ostream& operator<<(std::ostream& str, const std::set<uint32_t>& set) {
std::string format(const std::set<uint32_t>& set) {
std::ostringstream ss;
for (const uint32_t id : set)
str << "0x" << std::hex << std::setfill('0') << std::setw(8) << id << std::dec << " ";
return str;
ss << "0x" << std::hex << std::setfill('0') << std::setw(8) << id << std::dec << " ";
return ss.str();
}
/// Print helper for set<eformat::SubDetector>
std::ostream& operator<<(std::ostream& str, const std::set<eformat::SubDetector>& set) {
for (const eformat::SubDetector id : set) str << eformat::helper::SubDetectorDictionary.string(id) << " ";
return str;
std::string format(const std::set<eformat::SubDetector>& set) {
std::ostringstream ss;
for (const eformat::SubDetector id : set) ss << eformat::helper::SubDetectorDictionary.string(id) << " ";
return ss.str();
}
}
......@@ -161,14 +164,14 @@ void HLTResultMTMaker::validatePEBInfo(HLT::HLTResultMT& hltResult) const {
for (eformat::helper::StreamTag& st : hltResult.getStreamTagsNonConst()) {
std::set<uint32_t> removedROBs = removeDisabled(st.robs,m_enabledROBs);
if (!removedROBs.empty())
ATH_MSG_WARNING("StreamTag " << st.type << "_" << st.name << " requested disabled ROBs: " << removedROBs
ATH_MSG_WARNING("StreamTag " << st.type << "_" << st.name << " requested disabled ROBs: " << format(removedROBs)
<< " - these ROBs were removed from the StreamTag by " << name());
else
ATH_MSG_VERBOSE("No disabled ROBs were requested by StreamTag " << st.type << "_" << st.name);
std::set<eformat::SubDetector> removedSubDets = removeDisabled(st.dets,m_enabledSubDets);
if (!removedSubDets.empty())
ATH_MSG_WARNING("StreamTag " << st.type << "_" << st.name << " requested disabled SubDets: " << removedSubDets
ATH_MSG_WARNING("StreamTag " << st.type << "_" << st.name << " requested disabled SubDets: " << format(removedSubDets)
<< " - these SubDets were removed from the StreamTag by " << name());
else
ATH_MSG_VERBOSE("No disabled SubDets were requested by StreamTag " << st.type << "_" << st.name);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment