18 const std::string& name, ISvcLocator* loc)
29 return StatusCode::SUCCESS;
33 const EventContext& ctx)
const {
36 constexpr float NaN = std::numeric_limits<float>::quiet_NaN();
50 if (vertices->empty()) {
52 dec_nPV(*eventInfo) = 0;
53 dec_pvZ(*eventInfo) = NaN;
54 return StatusCode::SUCCESS;
60 for (
const auto* vertex : *vertices) {
67 pv = vertices->front();
70 dec_nPV(*eventInfo) =
static_cast<int>(vertices->size());
71 dec_pvZ(*eventInfo) =
static_cast<float>(pv->z());
74 <<
" primaryVertexZ=" << pv->z());
76 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
Handle class for adding a decoration to an object.
An algorithm that can be simultaneously executed in multiple threads.
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
SG::WriteDecorHandleKey< xAOD::EventInfo > m_dec_nPrimaryVertices
PrimaryVertexDecoratorAlg(const std::string &name, ISvcLocator *pSvcLocator)
SG::WriteDecorHandleKey< xAOD::EventInfo > m_dec_primaryVertexZ
virtual StatusCode initialize() override
virtual StatusCode execute(const EventContext &ctx) const override
SG::ReadHandleKey< xAOD::VertexContainer > m_vertexContainerKey
virtual bool isValid() override final
Can the handle be successfully dereferenced?
Handle class for adding a decoration to an object.
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Vertex_v1 Vertex
Define the latest version of the vertex class.