#include <memory>
#include <cstdlib>
#include <TFile.h>
#include <TH1.h>
#include <TH1F.h>
#include <TH1D.h>
#include <TError.h>
#include <AsgMessaging/MessageCheck.h>
#include "xAODTracking/TrackParticle.h"
#include "xAODTracking/Vertex.h"
#include "xAODTracking/TrackParticleContainer.h"
#include "xAODTracking/VertexContainer.h"
#include "TrackVertexAssociationTool/TrackVertexAssociationTool.h"
Go to the source code of this file.
◆ main()
Definition at line 36 of file TrackVertexAssoValidator.cxx.
38 using namespace asg::msgUserCode;
41 static const char*
APP_NAME =
"TrackVertexAssoValidator";
47 std::unique_ptr< TFile >
infile( TFile::Open(
"$ASG_TEST_FILE_MC",
60 trktovxtool(
"TrackVertexAssociationTool" );
67 const Long64_t
nentries =
event.getEntries();
74 ATH_MSG_INFO(
"Running over first " << maxEntries <<
" events" );
87 "InDetTrackParticles" ) );
91 if( ! vxCont->
size() ) {
97 ATH_MSG_INFO(
"Testing TrackVertexAssociationTool::isCompatible...");
98 if(trkCont->
size()!=0 && vxCont->
size()!=0)
100 bool isMatched = trktovxtool.isCompatible(*(trkCont->
at(0)), *(vxCont->
at(0)));
105 ATH_MSG_INFO(
"Testing TrackVertexAssociationTool::getMatchMap...");
107 ATH_MSG_INFO(
"Number of vertices for track-vertex association: " << trkvxassoMap.size());
108 for (
const auto& assoc: trkvxassoMap) {
110 ATH_MSG_INFO(
"vertex at x, y, z " << vx->
x() <<
", " << vx->
y() <<
", " << vx->
z() <<
111 " has " << assoc.second.size() <<
" associated tracks");
114 ATH_MSG_INFO(
"Testing TrackVertexAssociationTool::getUniqueMatchVertex...");
115 std::vector<const xAOD::Vertex* > v_vx;
117 for(
auto *
vertex : *vxCont) {
120 if(trkCont->
size()!=0)
122 const xAOD::Vertex *vx = trktovxtool.getUniqueMatchVertex(*(trkCont->
at(0)), v_vx);
123 ATH_MSG_INFO(
"Unique match vertex for first track: " << vx);
127 ATH_MSG_INFO(
"Testing TrackVertexAssociationTool::getUniqueMatchVertexLink...");
128 if(trkCont->
size() > 2)
134 ATH_MSG_INFO(
"Uniquely matched vertex for third track - ");
135 ATH_MSG_INFO(
"Vertex ElementLink address: " << match_vx );
142 ATH_MSG_INFO(
"Testing TrackVertexAssociationTool::getUniqueMatchMap...");
144 ATH_MSG_INFO(
"Number of vertices for track-vertex association: " << trkvxassoUniqueMap.size());
145 for (
const auto& assoc: trkvxassoUniqueMap) {
147 ATH_MSG_INFO(
"vertex at x, y, z " << vx->
x() <<
", " << vx->
y() <<
", " << vx->
z() <<
148 " has " << assoc.second.size() <<
" uniquely associated tracks");