18#include "Gaudi/Property.h"
34 ISvcLocator* pSvcLocator ) :
54 return StatusCode::SUCCESS;
61 return StatusCode::SUCCESS;
76 return StatusCode::FAILURE;
80 ATH_MSG_INFO(
"Testing TrackVertexAssociationTool::isCompatible...");
81 if(!trkCont->empty() && !vxCont->empty())
83 bool isMatched =
m_TVATool->isCompatible(*(trkCont->at(0)), *(vxCont->at(0)));
84 ATH_MSG_INFO(
"Is the first track compatible with the first vertex (the PriVx)? "<< isMatched);
88 ATH_MSG_INFO(
"Testing TrackVertexAssociationTool::getMatchMap...");
90 ATH_MSG_INFO(
"Number of vertices for track-vertex association: " << trkvxassoMap.size());
91 for (
const auto& assoc: trkvxassoMap) {
94 setprecision(4) << setfill(
' ') <<
95 setw(10) << vx->
x() <<
", " << setw(10) << vx->
y() <<
", " << setw(10) << vx->
z() <<
96 " has " << assoc.second.size() <<
" associated tracks");
100 ATH_MSG_INFO(
"Testing TrackVertexAssociationTool::getUniqueMatchVertex...");
101 std::vector<const xAOD::Vertex* > v_vx;
103 for(
const auto *vertex : *vxCont) {
104 v_vx.push_back(vertex);
106 if(!trkCont->empty())
109 ATH_MSG_INFO(
"Unique match vertex for first track: " << vx);
113 ATH_MSG_INFO(
"Testing TrackVertexAssociationTool::getUniqueMatchVertexLink...");
114 if(trkCont->size() > 2)
120 ATH_MSG_INFO(
"Uniquely matched vertex for third track - ");
121 ATH_MSG_INFO(
"Vertex ElementLink address: " << match_vx );
128 ATH_MSG_INFO(
"Testing TrackVertexAssociationTool::getUniqueMatchMap...");
130 ATH_MSG_INFO(
"Number of vertices for track-vertex association: " << trkvxassoUniqueMap.size());
131 for (
const auto& assoc: trkvxassoUniqueMap) {
134 setprecision(4) << setfill(
' ') <<
135 setw(10) << vx->
x() <<
", " << setw(10) << vx->
y() <<
", " << setw(10) << vx->
z() <<
136 " has " << assoc.second.size() <<
" uniquely associated tracks");
147 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define CHECK(...)
Evaluate an expression and check for errors.
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
ElementLink implementation for ROOT usage.
bool isValid() const
Check if the element can be found.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
SG::ReadHandleKey< xAOD::VertexContainer > m_vertexContname
virtual StatusCode execute()
Execute method without EventContext (deprecated).
virtual StatusCode initialize()
TrackVertexAssoTestAlg()
Default constructor:
ToolHandle< CP::ITrackVertexAssociationTool > m_TVATool
virtual StatusCode finalize()
virtual ~TrackVertexAssoTestAlg()
Destructor:
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_trkContname
Containers.
float z() const
Returns the z position.
float y() const
Returns the y position.
float x() const
Returns the x position.
std::map< const xAOD::Vertex *, xAOD::TrackVertexAssociationList > TrackVertexAssociationMap
Vertex_v1 Vertex
Define the latest version of the vertex class.