ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Tracking
TrkVertexFitter
TrkVertexWeightCalculators
src
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
5
#include "
TrkVertexWeightCalculators/DecorateVertexScoreAlg.h
"
6
7
#include "
AsgDataHandles/WriteDecorHandle.h
"
8
#include "
xAODTracking/Vertex.h
"
9
#include "
xAODTracking/VertexContainer.h
"
10
11
DecorateVertexScoreAlg::DecorateVertexScoreAlg
(
const
std::string& name,
12
ISvcLocator* svcLoc)
13
:
EL
::
AnaAlgorithm
(name, svcLoc) {}
14
15
StatusCode
DecorateVertexScoreAlg::initialize
() {
16
ATH_CHECK
(
m_vertexContainer_key
.initialize());
17
ATH_CHECK
(
m_vertexScoreDecor_key
.initialize());
18
ATH_CHECK
(
m_vertexWeightCalculator
.retrieve());
19
return
StatusCode::SUCCESS;
20
}
21
22
StatusCode
DecorateVertexScoreAlg::execute
() {
23
SG::ReadHandle<xAOD::VertexContainer>
vertices{
m_vertexContainer_key
};
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
}
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition
AthMsgStreamMacros.h:33
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
WriteDecorHandle.h
Handle class for adding a decoration to an object.
DecorateVertexScoreAlg.h
Vertex.h
VertexContainer.h
DecorateVertexScoreAlg::execute
StatusCode execute() override
Definition
DecorateVertexScoreAlg.cxx:22
DecorateVertexScoreAlg::m_vertexContainer_key
SG::ReadHandleKey< xAOD::VertexContainer > m_vertexContainer_key
Definition
DecorateVertexScoreAlg.h:34
DecorateVertexScoreAlg::m_vertexScoreDecor_key
SG::WriteDecorHandleKey< xAOD::VertexContainer > m_vertexScoreDecor_key
Definition
DecorateVertexScoreAlg.h:37
DecorateVertexScoreAlg::initialize
virtual StatusCode initialize() override
Definition
DecorateVertexScoreAlg.cxx:15
DecorateVertexScoreAlg::m_vertexWeightCalculator
ToolHandle< Trk::IVertexWeightCalculator > m_vertexWeightCalculator
Definition
DecorateVertexScoreAlg.h:41
DecorateVertexScoreAlg::DecorateVertexScoreAlg
DecorateVertexScoreAlg(const std::string &name, ISvcLocator *svcLoc=nullptr)
Definition
DecorateVertexScoreAlg.cxx:11
EL::AnaAlgorithm::AnaAlgorithm
AnaAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
constructor with parameters
Definition
AnaAlgorithm.cxx:40
SG::ReadHandle
Definition
StoreGate/StoreGate/ReadHandle.h:67
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
EL
This module defines the arguments passed from the BATCH driver to the BATCH worker.
Definition
AsgComponentFactories.h:16
SG::makeHandle
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Definition
ReadCondHandle.h:269
Generated on
for ATLAS Offline Software by
1.17.0