ATLAS Offline Software
Loading...
Searching...
No Matches
DecorateVertexScoreAlg.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
6
10
12 ISvcLocator* svcLoc)
13 : EL::AnaAlgorithm(name, svcLoc) {}
14
16 ATH_CHECK(m_vertexContainer_key.initialize());
19 return StatusCode::SUCCESS;
20}
21
24 if (!vertices.isValid()) {
25 ATH_MSG_ERROR(m_vertexContainer_key.key() << " not found");
26 return StatusCode::FAILURE;
27 }
28
29 auto vertexScoreDecor = SG::makeHandle<float>(m_vertexScoreDecor_key);
30
31 ATH_MSG_DEBUG("Decorating " << vertices->size() << " vertices with scores");
32 for (const auto* vertex : *vertices) {
33 const float score = m_vertexWeightCalculator->estimateSignalCompatibility(*vertex);
34 vertexScoreDecor(*vertex) = score;
35 ATH_MSG_DEBUG("Decorated vertex with score: " << score);
36 }
37 return StatusCode::SUCCESS;
38}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_DEBUG(x)
Handle class for adding a decoration to an object.
StatusCode execute() override
SG::ReadHandleKey< xAOD::VertexContainer > m_vertexContainer_key
SG::WriteDecorHandleKey< xAOD::VertexContainer > m_vertexScoreDecor_key
virtual StatusCode initialize() override
ToolHandle< Trk::IVertexWeightCalculator > m_vertexWeightCalculator
DecorateVertexScoreAlg(const std::string &name, ISvcLocator *svcLoc=nullptr)
AnaAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
constructor with parameters
virtual bool isValid() override final
Can the handle be successfully dereferenced?
This module defines the arguments passed from the BATCH driver to the BATCH worker.
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())