ATLAS Offline Software
PhysicsAnalysis
DerivationFramework
DerivationFrameworkJetEtMiss
src
TVAAugmentationTool.cxx
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
TVAAugmentationTool.h
"
6
#include "
StoreGate/WriteDecorHandle.h
"
7
8
namespace
DerivationFramework
{
9
10
TVAAugmentationTool::TVAAugmentationTool
(
11
const
std::string&
t
,
12
const
std::string&
n
,
13
const
IInterface*
p
):
14
base_class(
t
,
n
,
p
)
15
{
16
}
17
18
StatusCode
TVAAugmentationTool::initialize
()
19
{
20
ATH_MSG_DEBUG
(
"Initialising TVAAugmentationTool "
<<
name
() );
21
ATH_CHECK
(
m_trackName
.
initialize
() );
22
ATH_CHECK
(
m_vertexName
.initialize() );
23
ATH_CHECK
(
m_vtxDec_key
.
initialize
());
24
ATH_CHECK
(
m_tool
.retrieve() );
25
26
return
StatusCode::SUCCESS;
27
}
28
29
StatusCode
TVAAugmentationTool::addBranches
(
const
EventContext& ctx)
const
30
{
31
SG::WriteDecorHandle<xAOD::TrackParticleContainer, vtxLink_t>
vtxDec_handle(
m_vtxDec_key
, ctx);
32
33
SG::ReadHandle<xAOD::VertexContainer>
vertices{
m_vertexName
, ctx};
34
SG::ReadHandle<xAOD::TrackParticleContainer>
tracks{
m_trackName
, ctx};
35
36
xAOD::TrackVertexAssociationMap
matchMap =
m_tool
->getMatchMap(*tracks, *vertices);
37
38
for
(
const
xAOD::Vertex
* ivtx : *vertices)
39
for
(
const
xAOD::TrackParticle
* itrk : matchMap[ivtx])
40
vtxDec_handle(*itrk).toContainedElement(*vertices, ivtx);
41
42
return
StatusCode::SUCCESS;
43
}
44
}
//> end namespace DerivationFramework
SG::ReadHandle
Definition:
StoreGate/StoreGate/ReadHandle.h:67
xAOD::TrackVertexAssociationMap
std::map< const xAOD::Vertex *, xAOD::TrackVertexAssociationList > TrackVertexAssociationMap
Definition:
TrackVertexAssociationMap.h:19
read_hist_ntuple.t
t
Definition:
read_hist_ntuple.py:5
DerivationFramework::TVAAugmentationTool::initialize
virtual StatusCode initialize() override final
Definition:
TVAAugmentationTool.cxx:18
python.utils.AtlRunQueryDQUtils.p
p
Definition:
AtlRunQueryDQUtils.py:209
DerivationFramework::TVAAugmentationTool::TVAAugmentationTool
TVAAugmentationTool(const std::string &t, const std::string &n, const IInterface *p)
Definition:
TVAAugmentationTool.cxx:10
beamspotman.n
n
Definition:
beamspotman.py:727
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition:
PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition:
AthMsgStreamMacros.h:29
SG::WriteDecorHandle
Handle class for adding a decoration to an object.
Definition:
StoreGate/StoreGate/WriteDecorHandle.h:100
WriteDecorHandle.h
Handle class for adding a decoration to an object.
ATH_CHECK
#define ATH_CHECK
Definition:
AthCheckMacros.h:40
DerivationFramework
THE reconstruction tool.
Definition:
ParticleSortingAlg.h:24
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition:
AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
DerivationFramework::TVAAugmentationTool::m_vertexName
SG::ReadHandleKey< xAOD::VertexContainer > m_vertexName
Definition:
TVAAugmentationTool.h:28
name
std::string name
Definition:
Control/AthContainers/Root/debug.cxx:240
DerivationFramework::TVAAugmentationTool::m_trackName
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_trackName
Definition:
TVAAugmentationTool.h:27
DerivationFramework::TVAAugmentationTool::m_tool
PublicToolHandle< CP::ITrackVertexAssociationTool > m_tool
Definition:
TVAAugmentationTool.h:30
DerivationFramework::TVAAugmentationTool::m_vtxDec_key
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > m_vtxDec_key
Definition:
TVAAugmentationTool.h:29
SG::WriteDecorHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
xAOD::Vertex_v1
Class describing a Vertex.
Definition:
Vertex_v1.h:42
DerivationFramework::TVAAugmentationTool::addBranches
virtual StatusCode addBranches(const EventContext &ctx) const override final
Definition:
TVAAugmentationTool.cxx:29
TVAAugmentationTool.h
xAOD::TrackParticle_v1
Class describing a TrackParticle.
Definition:
TrackParticle_v1.h:44
Generated on Fri Oct 31 2025 21:23:10 for ATLAS Offline Software by
1.8.18