ATLAS Offline Software
Loading...
Searching...
No Matches
VertexNewMatcher.h
Go to the documentation of this file.
1/* emacs: this is -*- c++ -*- */
10
11#ifndef VERTEXNEWMATCHER_H
12#define VERTEXNEWMATCHER_H
13
14#include <iostream>
15
18
20
21
22class VertexNewMatcher : public BestMatcher<TIDA::Vertex> {
23
24public:
25
26 VertexNewMatcher( const std::string& s, double d=0.5 ) : BestMatcher<TIDA::Vertex>( s, d*d ) { }
27
29
30 BestMatcher<TIDA::Vertex>* clone() override { return new VertexNewMatcher(*this); }
31
32 virtual double distance( const TIDA::Vertex* v0, const TIDA::Vertex* v1 ) const override {
33
34 // vectors of pointers to tracks belonging to ref and test vertices
35 const std::vector<TIDA::Track*>& refTracks= v0->tracks();
36 const std::vector<TIDA::Track*>& testTracks = v1->tracks();
37
38 // match offline to trigger tracks using delta R
39 Associator_DeltaRMatcher track_matcher( "track_matcher", 0.05 );
40 track_matcher.match( refTracks, testTracks );
41
42 double n_matches = (double)track_matcher.size();
43 double eff = n_matches/refTracks.size();
44
45 // 1-eff as BestMatcher uses lower than threshold, squared as BestMatcher takes d*d
46 return (1-eff)*(1-eff);
47 };
48
49};
50
51inline std::ostream& operator<<( std::ostream& s, const VertexNewMatcher& /* _v */ ) {
52 return s;
53}
54
55#endif // VERTEXNEWMATCHER_H
56
57
58
Erkcan's track matchers.
truely generic template class of a best matching algorithm based on an efficient implementation of th...
boost::graph_traits< boost::adjacency_list< boost::vecS, boost::vecS, boost::bidirectionalS > >::vertex_descriptor Vertex
std::ostream & operator<<(std::ostream &s, const VertexNewMatcher &)
virtual void match(const std::vector< T * > &ref, const std::vector< S * > &test)
Definition BestMatcher.h:68
BestMatcher(const std::string &name, double d)
Definition BestMatcher.h:61
unsigned size() const
const std::vector< TIDA::Track * > & tracks() const
Definition TIDAVertex.h:67
VertexNewMatcher(const std::string &s, double d=0.5)
BestMatcher< TIDA::Vertex > * clone() override
virtual double distance(const TIDA::Vertex *v0, const TIDA::Vertex *v1) const override
Test for xAOD.