|
ATLAS Offline Software
|
Go to the documentation of this file.
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)
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)
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");
float x() const
Returns the x position.
#define RETURN_CHECK(CONTEXT, EXP)
Helper macro for checking return codes in a compact form in the code.
bool isMatched(int matchInfo)
std::map< const xAOD::Vertex *, xAOD::TrackVertexAssociationList > TrackVertexAssociationMap
bool isValid() const
Test to see if the link can be dereferenced.
StatusCode readFrom(TFile *file)
POOL::TEvent event(POOL::TEvent::kClassAccess)
float z() const
Returns the z position.
ElementLink implementation for ROOT usage.
Class describing a Vertex.
#define ATH_MSG_WARNING(x)
StatusCode retrieve(const T *&obj)
float y() const
Returns the y position.
const T * at(size_type n) const
Access an element, as an rvalue.
size_type size() const noexcept
Returns the number of elements in the collection.
Tool for accessing xAOD files outside of Athena.
StatusCode Init(const char *appname)
Function initialising ROOT/PyROOT for using the ATLAS EDM.