ATLAS Offline Software
TVAAugmentationTool.cxx
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3  */
4 
5 #include "TVAAugmentationTool.h"
8 
9 namespace DerivationFramework {
10 
12  const std::string& t,
13  const std::string& n,
14  const IInterface* p):
15  base_class(t, n, p)
16  {
17  declareProperty("LinkName", m_linkName, "The name of the output links");
18  declareProperty("TrackName", m_trackName="InDetTrackParticles");
19  declareProperty("VertexName", m_vertexName="PrimaryVertices");
20  declareProperty("TVATool", m_tool);
21  }
22 
24  {
25  ATH_MSG_INFO("Initialising TVAAugmentationTool " << name() );
26  ATH_CHECK( m_tool.retrieve() );
27 
30 
31  return StatusCode::SUCCESS;
32  }
33 
35  {
36 
38 
39  const xAOD::VertexContainer* vertices = nullptr;
40  ATH_CHECK(evtStore()->retrieve(vertices, m_vertexName) );
41  const xAOD::TrackParticleContainer* tracks = nullptr;
42  ATH_CHECK(evtStore()->retrieve(tracks, m_trackName) );
43 
44  xAOD::TrackVertexAssociationMap matchMap = m_tool->getMatchMap(*tracks, *vertices);
45 
46  for (const xAOD::Vertex* ivtx : *vertices)
47  for (const xAOD::TrackParticle* itrk : matchMap[ivtx])
48  vtxDec_handle(*itrk).toContainedElement(*vertices, ivtx);
49 
50  return StatusCode::SUCCESS;
51  }
52 } //> end namespace DerivationFramework
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
DerivationFramework::TVAAugmentationTool::addBranches
virtual StatusCode addBranches() const
Definition: TVAAugmentationTool.cxx:34
DerivationFramework::TVAAugmentationTool::m_vertexName
std::string m_vertexName
Definition: TVAAugmentationTool.h:28
DerivationFramework::TVAAugmentationTool::m_tool
ToolHandle< CP::ITrackVertexAssociationTool > m_tool
Definition: TVAAugmentationTool.h:29
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::m_linkName
std::string m_linkName
Definition: TVAAugmentationTool.h:26
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:209
DerivationFramework::TVAAugmentationTool::initialize
virtual StatusCode initialize()
Definition: TVAAugmentationTool.cxx:23
DerivationFramework::TVAAugmentationTool::TVAAugmentationTool
TVAAugmentationTool(const std::string &t, const std::string &n, const IInterface *p)
Definition: TVAAugmentationTool.cxx:11
beamspotman.n
n
Definition: beamspotman.py:727
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
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
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
DerivationFramework::TVAAugmentationTool::m_vtxDec_key
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > m_vtxDec_key
Definition: TVAAugmentationTool.h:32
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
TVAAugmentationTool.h
xAOD::TrackParticle_v1
Class describing a TrackParticle.
Definition: TrackParticle_v1.h:43
TrackParticleContainer.h
DerivationFramework::TVAAugmentationTool::m_trackName
std::string m_trackName
Definition: TVAAugmentationTool.h:27