ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
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
StatusCode
TVAAugmentationTool::initialize
()
11
{
12
ATH_MSG_DEBUG
(
"Initialising TVAAugmentationTool "
<< name() );
13
ATH_CHECK
(
m_trackName
.initialize() );
14
ATH_CHECK
(
m_vertexName
.initialize() );
15
ATH_CHECK
(
m_vtxDec_key
.initialize());
16
ATH_CHECK
(
m_tool
.retrieve() );
17
18
return
StatusCode::SUCCESS;
19
}
20
21
StatusCode
TVAAugmentationTool::addBranches
(
const
EventContext& ctx)
const
22
{
23
SG::WriteDecorHandle<xAOD::TrackParticleContainer, vtxLink_t>
vtxDec_handle(
m_vtxDec_key
, ctx);
24
25
SG::ReadHandle<xAOD::VertexContainer>
vertices{
m_vertexName
, ctx};
26
SG::ReadHandle<xAOD::TrackParticleContainer>
tracks{
m_trackName
, ctx};
27
28
xAOD::TrackVertexAssociationMap
matchMap =
m_tool
->getMatchMap(*tracks, *vertices);
29
30
for
(
const
xAOD::Vertex
* ivtx : *vertices)
31
for
(
const
xAOD::TrackParticle
* itrk : matchMap[ivtx])
32
vtxDec_handle(*itrk).toContainedElement(*vertices, ivtx);
33
34
return
StatusCode::SUCCESS;
35
}
36
}
//> end namespace DerivationFramework
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
WriteDecorHandle.h
Handle class for adding a decoration to an object.
TVAAugmentationTool.h
DerivationFramework::TVAAugmentationTool::m_vtxDec_key
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > m_vtxDec_key
Definition
TVAAugmentationTool.h:30
DerivationFramework::TVAAugmentationTool::m_trackName
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_trackName
Definition
TVAAugmentationTool.h:28
DerivationFramework::TVAAugmentationTool::initialize
virtual StatusCode initialize() override final
Definition
TVAAugmentationTool.cxx:10
DerivationFramework::TVAAugmentationTool::addBranches
virtual StatusCode addBranches(const EventContext &ctx) const override final
Definition
TVAAugmentationTool.cxx:21
DerivationFramework::TVAAugmentationTool::m_tool
PublicToolHandle< CP::ITrackVertexAssociationTool > m_tool
Definition
TVAAugmentationTool.h:31
DerivationFramework::TVAAugmentationTool::m_vertexName
SG::ReadHandleKey< xAOD::VertexContainer > m_vertexName
Definition
TVAAugmentationTool.h:29
SG::ReadHandle
Definition
StoreGate/StoreGate/ReadHandle.h:67
SG::WriteDecorHandle
Handle class for adding a decoration to an object.
Definition
StoreGate/StoreGate/WriteDecorHandle.h:100
DerivationFramework
THE reconstruction tool.
Definition
CascadeTools.h:16
xAOD::TrackVertexAssociationMap
std::map< const xAOD::Vertex *, xAOD::TrackVertexAssociationList > TrackVertexAssociationMap
Definition
TrackVertexAssociationMap.h:19
xAOD::TrackParticle
TrackParticle_v1 TrackParticle
Reference the current persistent version:
Definition
Event/xAOD/xAODTracking/xAODTracking/TrackParticle.h:13
xAOD::Vertex
Vertex_v1 Vertex
Define the latest version of the vertex class.
Definition
Event/xAOD/xAODTracking/xAODTracking/Vertex.h:16
Generated on
for ATLAS Offline Software by
1.17.0