|
ATLAS Offline Software
|
Go to the documentation of this file.
12 #include "GaudiKernel/IAlgorithm.h"
16 #include "EventInfo/EventInfo.h"
24 const std::string&
name,
37 return(StatusCode::FAILURE);
41 return(StatusCode::FAILURE);
46 const IAlgorithm* parentAlg =
dynamic_cast<const IAlgorithm*
>(this->
parent());
47 if (parentAlg ==
nullptr) {
49 return(StatusCode::FAILURE);
54 return(StatusCode::SUCCESS);
59 bool ignoreIfAbsent =
true;
62 return StatusCode::FAILURE;
64 return(StatusCode::SUCCESS);
68 return(StatusCode::SUCCESS);
72 return(StatusCode::SUCCESS);
78 return(StatusCode::SUCCESS);
82 unsigned long long runN = 0;
92 runN = oEventInfo->
event_ID()->run_number();
93 lumiN = oEventInfo->
event_ID()->lumi_block();
97 return(StatusCode::FAILURE);
102 if( !pEventStream ) {
103 auto esinfo_up = std::make_unique<EventStreamInfo>();
104 pEventStream = esinfo_up.get();
107 return(StatusCode::FAILURE);
110 static std::once_flag resetNumberOfEventsFlag;
111 std::call_once(resetNumberOfEventsFlag, [
this, pEventStream]() ->
void {
112 ATH_MSG_DEBUG(
"Resetting the EventStreamInfo payload at the first event");
113 pEventStream->
reset();
120 pEventStream->
insertItemList(dhe.getPrimaryClassID(), dhe.getKey());
126 return(StatusCode::SUCCESS);
132 auto esinfo_up = std::make_unique<EventStreamInfo>();
133 pEventStream = esinfo_up.get();
137 m_eventCounter < pEventStream->getNumberOfEvents()) {
144 "Event count mismatch in EventStreamInfo (likely due to "
145 "multi-file processing). MakeEventStreamInfo processed: "
146 <<
m_eventCounter <<
" events, existing EventStreamInfo object has "
148 <<
" events. Setting number of events to what "
149 "MakeEventStreamInfo processed.");
155 return (StatusCode::SUCCESS);
167 return(StatusCode::SUCCESS);
ServiceHandle< StoreGateSvc > m_eventStore
This class represents the "type of event" where the type is given by one or more "characteristics".
ServiceHandle< IAthMetaDataSvc > m_metaDataSvc
Pointer to the data stores.
uint32_t runNumber() const
The current event's run number.
StringProperty m_oEventInfoKey
Key, the StoreGate key for the old EventInfo object, ix there is no xAOD::EventInfo.
This file contains the class definition for the EventStreamInfo class.
void setNumberOfEvents(unsigned int number)
Set number of events.
This class provides a unique identification for each event, in terms of run/event number and/or a tim...
std::atomic< unsigned int > m_eventCounter
Counter of the events in the stream.
void insertRunNumber(unsigned int run)
Insert new Run Number into a set.
virtual StatusCode postInitialize() override
Called at the end of AthenaOutputStream::initialize().
StringProperty m_dataHeaderKey
Name of DataHeader key.
::StatusCode StatusCode
StatusCode definition for legacy code.
const_pointer_type get() const
Dereference the pointer, but don't cache anything.
EventID * event_ID()
the unique identification of the event.
MakeEventStreamInfo(const std::string &type, const std::string &name, const IInterface *parent)
Standard AlgTool Constructor.
void addEvent(unsigned int number=1)
Increase Event Counter.
uint32_t lumiBlock() const
The current event's luminosity block number.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
virtual StatusCode finalize() override
Called at the end of AthenaOutputStream::finalize() (via release()).
void insertProcessingTag(const std::string &process)
Insert new Processing Tag into a set.
unsigned int getNumberOfEvents() const
virtual StatusCode postExecute() override
Called at the end of AthenaOutputStream::execute().
virtual StatusCode preExecute() override
Called at the beginning of AthenaOutputStream::execute().
virtual ~MakeEventStreamInfo()
Destructor.
StringProperty m_eventInfoKey
Key, the StoreGate key for the xAOD::EventInfo object.
This class provides the summary information stored for data written as a Event Stream.
#define ATH_MSG_WARNING(x)
virtual StatusCode preFinalize() override
Called at the beginning of AthenaOutputStream::finalize().
virtual StatusCode preStream() override
Called before actually streaming objects.
void insertItemList(CLID type, const std::string &key)
Insert new ItemList Entry into a set.
virtual StatusCode initialize() override
Required of all IAthenaOutputTools: Called by AthenaOutputStream::initialize() (via ToolSvc retrieve(...
EventType eventTypeFromxAOD(const xAOD::EventInfo *xaod)
Create EventType object from xAOD::EventInfo.
StringProperty m_key
Key, the StoreGate key for the EventStreamInfo object.
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.
EventType * event_type()
the type of the event, e.g. simulation, testbeam, etc
This file contains the class definition for the MakeEventStreamInfo class.