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