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
22
23
24class VertexNewMatcher : public BestMatcher<TIDA::Vertex> {
25
26public:
27
28 VertexNewMatcher( const std::string& s, double d=0.5 ) : BestMatcher<TIDA::Vertex>( s, d*d ) { }
29
31
32
33 virtual std::unique_ptr<VertexAssociator> uclone() const override { return std::make_unique<VertexNewMatcher>(*this); }
34
35 virtual double distance( const TIDA::Vertex* v0, const TIDA::Vertex* v1 ) const override {
36
37 // vectors of pointers to tracks belonging to ref and test vertices
38 const std::vector<TIDA::Track*>& refTracks= v0->tracks();
39 const std::vector<TIDA::Track*>& testTracks = v1->tracks();
40
41 // match offline to trigger tracks using delta R
42 Associator_DeltaRMatcher track_matcher( "track_matcher", 0.05 );
43 track_matcher.match( refTracks, testTracks );
44
45 double n_matches = (double)track_matcher.size();
46 double eff = n_matches/refTracks.size();
47
48 // 1-eff as BestMatcher uses lower than threshold, squared as BestMatcher takes d*d
49 return (1-eff)*(1-eff);
50 };
51
52};
53
54inline std::ostream& operator<<( std::ostream& s, const VertexNewMatcher& /* _v */ ) {
55 return s;
56}
57
58#endif // VERTEXNEWMATCHER_H
59
60
61
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
TIDA::Associator< TIDA::Vertex > VertexAssociator
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)
virtual std::unique_ptr< VertexAssociator > uclone() const override
virtual double distance(const TIDA::Vertex *v0, const TIDA::Vertex *v1) const override
Test for xAOD.