diff --git a/Event/EventInfo/EventInfo/EventStreamInfo.h b/Event/EventInfo/EventInfo/EventStreamInfo.h index ba3bc1d4680dce1a9369a93ee8a66da59096f3f6..f499e30cdee4a11170de877e3c7a70df27fd3ead 100644 --- a/Event/EventInfo/EventInfo/EventStreamInfo.h +++ b/Event/EventInfo/EventInfo/EventStreamInfo.h @@ -17,6 +17,7 @@ #include <string> #include <set> +#include <iostream> // Forward declarations class MsgStream; @@ -76,6 +77,8 @@ private: std::set<EventType> m_eventTypes; // EventTypes }; +std::ostream& operator<<(std::ostream& os, const EventStreamInfo& esi); + inline EventStreamInfo::EventStreamInfo() : m_numberOfEvents(0), m_runNumbers(), m_lumiBlockNumbers(), diff --git a/Event/EventInfo/src/EventStreamInfo.cxx b/Event/EventInfo/src/EventStreamInfo.cxx index 99842d84c92e7fc07beba0ffbbef373db01f0a63..960370a32ab10e4518264c15d418c676ab41671a 100644 --- a/Event/EventInfo/src/EventStreamInfo.cxx +++ b/Event/EventInfo/src/EventStreamInfo.cxx @@ -87,28 +87,37 @@ EventStreamInfo::insertEventType(const EventType& event) { //______________________________________________________________________________ void EventStreamInfo::print(MsgStream& log) const { - log << MSG::DEBUG << "EventStreamInfo number of events: " << m_numberOfEvents << endmsg; - log << MSG::DEBUG << "EventStreamInfo Run Numbers: "; - for (unsigned int rn : m_runNumbers) { - log << MSG::DEBUG << rn << ", "; + log << MSG::DEBUG << (*this) << endmsg; + return; +} + +//______________________________________________________________________________ +std::ostream& +operator<<(std::ostream& os, const EventStreamInfo& esi){ + os << "EventStreamInfo number of events: " << esi.getNumberOfEvents() << '\n'; + + os << "EventStreamInfo Run Numbers: "; + for (unsigned int rn : esi.getRunNumbers()) { + os << rn << ", "; } - log << MSG::DEBUG << endmsg; - log << MSG::DEBUG << "EventStreamInfo LumiBlock Numbers: "; - for (unsigned int lbn : m_lumiBlockNumbers) { - log << MSG::DEBUG << lbn << ", "; + os << '\n'; + + os << "EventStreamInfo LumiBlock Numbers: "; + for (unsigned int lbn : esi.getLumiBlockNumbers()) { + os << lbn << ", "; } - log << MSG::DEBUG << endmsg; - log << MSG::DEBUG << "EventStreamInfo Processing Tags: "; - for (const std::string& tag : m_processingTags) { - log << MSG::DEBUG << tag << ", "; + os << '\n'; + + os << "EventStreamInfo Processing Tags: "; + for (const std::string& tag : esi.getProcessingTags()) { + os << tag << ", "; } - log << MSG::DEBUG << endmsg; - log << MSG::DEBUG << "EventStreamInfo Event Types: "; - for (const EventType& typ : m_eventTypes) { - log << MSG::DEBUG << typ.typeToString() << ", "; + os << '\n'; + + os << "EventStreamInfo Event Types: "; + for (const EventType& typ : esi.getEventTypes()) { + os << typ.typeToString() << ", "; } - log << MSG::DEBUG << endmsg; - return; -} -//______________________________________________________________________________ + return os; +}