ATLAS Offline Software
Loading...
Searching...
No Matches
DerivationFramework::TVAAugmentationTool Class Reference

#include <TVAAugmentationTool.h>

Inheritance diagram for DerivationFramework::TVAAugmentationTool:
Collaboration diagram for DerivationFramework::TVAAugmentationTool:

Public Member Functions

virtual StatusCode initialize () override final
virtual StatusCode addBranches (const EventContext &ctx) const override final

Private Types

using vtxLink_t = ElementLink<xAOD::VertexContainer>

Private Attributes

SG::ReadHandleKey< xAOD::TrackParticleContainerm_trackName {this, "TrackName", "InDetTrackParticles"}
SG::ReadHandleKey< xAOD::VertexContainerm_vertexName {this, "VertexName", "PrimaryVertices"}
SG::WriteDecorHandleKey< xAOD::TrackParticleContainerm_vtxDec_key {this, "LinkName", m_trackName, "", "Decoration for associated vertex"}
PublicToolHandle< CP::ITrackVertexAssociationToolm_tool {this, "TVATool", ""}

Detailed Description

Definition at line 18 of file TVAAugmentationTool.h.

Member Typedef Documentation

◆ vtxLink_t

Member Function Documentation

◆ addBranches()

StatusCode DerivationFramework::TVAAugmentationTool::addBranches ( const EventContext & ctx) const
finaloverridevirtual

Definition at line 21 of file TVAAugmentationTool.cxx.

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 }
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > m_vtxDec_key
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_trackName
PublicToolHandle< CP::ITrackVertexAssociationTool > m_tool
SG::ReadHandleKey< xAOD::VertexContainer > m_vertexName
std::map< const xAOD::Vertex *, xAOD::TrackVertexAssociationList > TrackVertexAssociationMap
TrackParticle_v1 TrackParticle
Reference the current persistent version:
Vertex_v1 Vertex
Define the latest version of the vertex class.

◆ initialize()

StatusCode DerivationFramework::TVAAugmentationTool::initialize ( )
finaloverridevirtual

Definition at line 10 of file TVAAugmentationTool.cxx.

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 }
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x)

Member Data Documentation

◆ m_tool

PublicToolHandle<CP::ITrackVertexAssociationTool> DerivationFramework::TVAAugmentationTool::m_tool {this, "TVATool", ""}
private

Definition at line 31 of file TVAAugmentationTool.h.

31{this, "TVATool", ""};

◆ m_trackName

SG::ReadHandleKey<xAOD::TrackParticleContainer> DerivationFramework::TVAAugmentationTool::m_trackName {this, "TrackName", "InDetTrackParticles"}
private

Definition at line 28 of file TVAAugmentationTool.h.

28{this, "TrackName", "InDetTrackParticles"};

◆ m_vertexName

SG::ReadHandleKey<xAOD::VertexContainer> DerivationFramework::TVAAugmentationTool::m_vertexName {this, "VertexName", "PrimaryVertices"}
private

Definition at line 29 of file TVAAugmentationTool.h.

29{this, "VertexName", "PrimaryVertices"};

◆ m_vtxDec_key

SG::WriteDecorHandleKey<xAOD::TrackParticleContainer> DerivationFramework::TVAAugmentationTool::m_vtxDec_key {this, "LinkName", m_trackName, "", "Decoration for associated vertex"}
private

Definition at line 30 of file TVAAugmentationTool.h.

30{this, "LinkName", m_trackName, "", "Decoration for associated vertex"};

The documentation for this class was generated from the following files: