ATLAS Offline Software
Associator_TruthMatch.h
Go to the documentation of this file.
1 /* emacs: this is -*- c++ -*- */
12 #ifndef TIDAUTILS_ASSOCIATOR_TRUTHMATCH_H
13 #define TIDAUTILS_ASSOCIATOR_TRUTHMATCH_H
14 
15 #include <set>
16 #include <map>
17 
18 
22 
23 
24 
25 #if 0
27 
28 public:
30  Associator_MatcherBase( "Truth" )
31  { }
32 
33  virtual double distance( TIDA::Track* refTrack, TIDA::Track* testTrack ) {
34  if (testTrack->match_barcode() == -1) return 1;
35  else if (testTrack->match_barcode() == refTrack->barcode()) return 0;
36  else return 1;
37  }
38 
39 };
40 #endif
41 
42 
43 // class Associator_TruthMatcher : public Associator_MatcherBase{
45 
46 public:
47 
49 
51 
52  virtual TrackAssociator* clone() override { return new Associator_TruthMatcher(*this); }
53 
54  //Fill reference tracks in matching step
55  virtual void match( const std::vector<TIDA::Track*>& refTracks,
56  const std::vector<TIDA::Track*>& testTracks) override {
57 
58  //std::cout<<"refTracks.size() "<<refTracks.size()<<" \t testTracks.size() "<<testTracks.size()<<std::endl;
59 
60  for (unsigned int i = 0; i < refTracks.size(); i++) {
61 
62  // std::cout<<refTracks[i]->author() <<std::endl;
63 
64  for (unsigned int j = 0; j < testTracks.size(); j++) {
65 
66 
67  if ( distance( refTracks[i], testTracks[j] ) < 1. ) {
68  // std::cout<<"MATCHED"<<std::endl;
69  mmatched.insert( map_type::value_type(refTracks[i],testTracks[j]));
70  mrevmatched.insert( map_type::value_type(testTracks[j],refTracks[i]));
71  }
72  }
73  }
74 
75  return;
76  }
77 
78 
79  virtual double distance( TIDA::Track* refTrack, TIDA::Track* testTrack ) {
80  if (testTrack->match_barcode() == -1) return 1;
81  else if (testTrack->match_barcode() == refTrack->barcode()) return 0;
82  else return 1;
83  }
84 
85 private:
86 
87  // double md;
88 
89 };
90 
91 
92 #endif // TIDAUTILS_ASSOCIATOR_TRUTHMATCH_H
93 
TIDA::Associator
Definition: TIDAAssociator.h:24
Track.h
Associator_TruthMatcher::clone
virtual TrackAssociator * clone() override
Definition: Associator_TruthMatch.h:52
TIDA::Associator::mmatched
map_type mmatched
Definition: TIDAAssociator.h:73
Associator_TruthMatcher
Definition: Associator_TruthMatch.h:44
Associator_BestMatch.h
lumiFormat.i
int i
Definition: lumiFormat.py:85
TIDA::Track::barcode
int barcode() const
Definition: Trigger/TrigAnalysis/TrigInDetAnalysis/TrigInDetAnalysis/Track.h:85
TrackAssociator.h
TIDA::Track::match_barcode
int match_barcode() const
Definition: Trigger/TrigAnalysis/TrigInDetAnalysis/TrigInDetAnalysis/Track.h:86
BestMatcher
Definition: BestMatcher.h:29
Associator_TruthMatcher::~Associator_TruthMatcher
virtual ~Associator_TruthMatcher()
Definition: Associator_TruthMatch.h:50
TIDA::Track
Definition: Trigger/TrigAnalysis/TrigInDetAnalysis/TrigInDetAnalysis/Track.h:26
TIDA::Associator::mrevmatched
rmap_type mrevmatched
Definition: TIDAAssociator.h:74
Associator_TruthMatcher::Associator_TruthMatcher
Associator_TruthMatcher()
Definition: Associator_TruthMatch.h:48
Associator_TruthMatcher::match
virtual void match(const std::vector< TIDA::Track * > &refTracks, const std::vector< TIDA::Track * > &testTracks) override
Definition: Associator_TruthMatch.h:55
Associator_TruthMatcher::distance
virtual double distance(TIDA::Track *refTrack, TIDA::Track *testTrack)
Definition: Associator_TruthMatch.h:79