11#include "GaudiKernel/ConcurrencyFlags.h"
14#include "EventInfo/EventInfo.h"
29 m_cnvTool(
"xAODMaker::EventInfoCnvTool/EventInfoCnvTool", this ) {
52 return StatusCode::SUCCESS;
61 <<
"\" is already in StoreGate; "
62 <<
"EventInfoCnvAlg should not be scheduled.");
63 return StatusCode::SUCCESS;
80 auto ei = std::make_unique<xAOD::EventInfo>();
81 auto ei_aux = std::make_unique<xAOD::EventAuxInfo>();
82 ei->setStore (ei_aux.get());
89 auto puei = std::make_unique<xAOD::EventInfoContainer>();
90 auto puei_aux = std::make_unique<xAOD::EventInfoAuxContainer>();
91 puei->setStore (puei_aux.get());
94 std::vector< xAOD::EventInfo::SubEvent > subEvents;
100 PileUpEventInfo::SubEvent::const_iterator pu_itr = paod->
beginSubEvt();
101 PileUpEventInfo::SubEvent::const_iterator pu_end = paod->
endSubEvt();
102 for( ; pu_itr != pu_end; ++pu_itr ) {
105 puei->push_back( ei );
107 CHECK(
m_cnvTool->convert( pu_itr->pSubEvt, ei,
true,
false, ctx ) );
110 switch (pu_itr->type()) {
132 subEvents.emplace_back( pu_itr->time(),
141 ei->setSubEvents( subEvents );
145 CHECK( puei_h.
record (std::move(puei), std::move(puei_aux)) );
153 CHECK( ei_h.
record (std::move(ei), std::move (ei_aux)) );
156 return StatusCode::SUCCESS;
#define ATH_MSG_WARNING(x)
Helpers for checking error return status codes and reporting errors.
#define CHECK(...)
Evaluate an expression and check for errors.
This class provides information about an overlaid event.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
ServiceHandle< StoreGateSvc > & evtStore()
An algorithm that can be simultaneously executed in multiple threads.
ElementLink implementation for ROOT usage.
This class provides information about an overlaid event.
SubEvent::iterator endSubEvt()
SubEvent::iterator beginSubEvt()
const_pointer_type cptr()
Dereference the pointer.
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
virtual StatusCode execute(const EventContext &ctx) const override
Function executing the algorithm.
SG::WriteHandleKey< xAOD::EventInfo > m_xaodKey
Key for the output object.
virtual StatusCode initialize() override
Function initialising the algorithm.
EventInfoCnvAlg(const std::string &name, ISvcLocator *svcLoc)
Regular Algorithm constructor.
SG::WriteHandleKey< xAOD::EventInfoContainer > m_pileupKey
For pileup.
ToolHandle< IEventInfoCnvTool > m_cnvTool
Handle to the converter tool.
SG::ReadHandleKey< EventInfo > m_aodKey
Key for the input object If blank, we do a keyless retrieve from SG instead!
PileUpType
Enumerator describing the types of pileup events.
@ HaloGas
Halo-gas non-collision background.
@ HighPtMinimumBias
High pT Minimum bias pileup event.
@ MinimumBias
(Low pT) Minimum bias pileup event
@ ZeroBias
Zero bias pileup event.
@ Signal
The signal event.
@ Cavern
Cavern background pileup event.
@ Unknown
Type not known/specified.
bool contains(const std::string &s, const std::string ®x)
does a string contain the substring
EventInfo_v1 EventInfo
Definition of the latest event info version.