12#include "GaudiKernel/IAlgorithm.h"
21 const std::string& name,
22 const IInterface* parent) : base_class(
type, name, parent)
34 if (
const auto* parentAlg =
dynamic_cast<const IAlgorithm*
>(this->parent()); parentAlg) {
38 return StatusCode::FAILURE;
42 return StatusCode::SUCCESS;
47 bool ignoreIfAbsent =
true;
50 return StatusCode::FAILURE;
52 return StatusCode::SUCCESS;
56 return StatusCode::SUCCESS;
60 return StatusCode::SUCCESS;
66 return StatusCode::SUCCESS;
70 unsigned long long runN = 0;
74 runN = xEventInfo->runNumber();
75 lumiN = xEventInfo->lumiBlock();
79 return StatusCode::FAILURE;
84 auto esinfo_up = std::make_unique<EventStreamInfo>();
85 pEventStream = esinfo_up.get();
88 return StatusCode::FAILURE;
91 static std::once_flag resetNumberOfEventsFlag;
92 std::call_once(resetNumberOfEventsFlag, [
this, pEventStream]() ->
void {
93 ATH_MSG_DEBUG(
"Resetting the EventStreamInfo payload at the first event");
94 pEventStream->
reset();
101 pEventStream->
insertItemList(dhe.getPrimaryClassID(), dhe.getKey());
107 return StatusCode::SUCCESS;
113 auto esinfo_up = std::make_unique<EventStreamInfo>();
114 pEventStream = esinfo_up.get();
125 "Event count mismatch in EventStreamInfo (likely due to "
126 "multi-file processing). MakeEventStreamInfo processed: "
127 <<
m_eventCounter <<
" events, existing EventStreamInfo object has "
129 <<
" events. Setting number of events to what "
130 "MakeEventStreamInfo processed.");
136 return (StatusCode::SUCCESS);
141 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
EventType eventTypeFromxAOD(const xAOD::EventInfo *xaod)
Create EventType object from xAOD::EventInfo.
This file contains the class definition for the EventStreamInfo class.
This file contains the class definition for the MakeEventStreamInfo class.
This class provides the summary information stored for data written as a Event Stream.
void insertEventType(const EventType &event)
Insert new Event Type into a set.
void insertLumiBlockNumber(unsigned int lumiBlock)
Insert new Luminosity Block Number into a set.
void insertRunNumber(unsigned int run)
Insert new Run Number into a set.
void addEvent(unsigned int number=1)
Increase Event Counter.
void insertProcessingTag(const std::string &process)
Insert new Processing Tag into a set.
void insertItemList(CLID type, const std::string &key)
Insert new ItemList Entry into a set.
unsigned int getNumberOfEvents() const
void setNumberOfEvents(unsigned int number)
Set number of events.
This class represents the "type of event" where the type is given by one or more "characteristics".
MakeEventStreamInfo(const std::string &type, const std::string &name, const IInterface *parent)
Standard AlgTool Constructor.
Gaudi::Property< std::string > m_key
Key, the StoreGate key for the EventStreamInfo object.
ServiceHandle< StoreGateSvc > m_eventStore
virtual StatusCode finalize() override
Called at the end of AthenaOutputStream::finalize() (via release()).
Gaudi::Property< std::string > m_eventInfoKey
Key, the StoreGate key for the xAOD::EventInfo object.
ServiceHandle< IAthMetaDataSvc > m_metaDataSvc
Pointer to the data stores.
virtual StatusCode preFinalize() override
Called at the beginning of AthenaOutputStream::finalize().
Gaudi::Property< std::string > m_dataHeaderKey
Name of DataHeader key.
virtual StatusCode preStream() override
Called before actually streaming objects.
virtual StatusCode postExecute() override
Called at the end of AthenaOutputStream::execute().
virtual StatusCode initialize() override
Required of all IAthenaOutputTools: Called by AthenaOutputStream::initialize() (via ToolSvc retrieve(...
std::atomic< unsigned int > m_eventCounter
Counter of the events in the stream.
virtual StatusCode preExecute() override
Called at the beginning of AthenaOutputStream::execute().
virtual StatusCode postInitialize() override
Called at the end of AthenaOutputStream::initialize().
virtual bool isValid() override final
Can the handle be successfully dereferenced?
const_pointer_type get() const
Dereference the pointer, but don't cache anything.