ATLAS Offline Software
Public Types | Public Member Functions | Protected Attributes | List of all members
Associator_TruthMatcher Class Referenceabstract

#include <Associator_TruthMatch.h>

Inheritance diagram for Associator_TruthMatcher:
Collaboration diagram for Associator_TruthMatcher:

Public Types

typedef std::map< T *, S * > map_type
 
typedef std::map< S *, T * > rmap_type
 

Public Member Functions

 Associator_TruthMatcher ()
 
virtual ~Associator_TruthMatcher ()
 
virtual TrackAssociatorclone () override
 
virtual void match (const std::vector< TIDA::Track * > &refTracks, const std::vector< TIDA::Track * > &testTracks) override
 
virtual double distance (TIDA::Track *refTrack, TIDA::Track *testTrack)
 
virtual void match (const std::vector< T * > &s1, const std::vector< S * > &s2)=0
 
virtual const S * matched (T *t)
 
const map_typematched () const
 
virtual const T * revmatched (S *t)
 
const rmap_typerevmatched () const
 
void clear ()
 
unsigned size () const
 

Protected Attributes

std::string mname
 
map_type mmatched
 
rmap_type mrevmatched
 

Detailed Description

Definition at line 44 of file Associator_TruthMatch.h.

Member Typedef Documentation

◆ map_type

template<typename T , typename S = T>
typedef std::map<T*, S*> TIDA::Associator< T, S >::map_type
inherited

Definition at line 28 of file TIDAAssociator.h.

◆ rmap_type

template<typename T , typename S = T>
typedef std::map<S*, T*> TIDA::Associator< T, S >::rmap_type
inherited

Definition at line 29 of file TIDAAssociator.h.

Constructor & Destructor Documentation

◆ Associator_TruthMatcher()

Associator_TruthMatcher::Associator_TruthMatcher ( )
inline

Definition at line 48 of file Associator_TruthMatch.h.

48 : TrackAssociator("Truth") { }

◆ ~Associator_TruthMatcher()

virtual Associator_TruthMatcher::~Associator_TruthMatcher ( )
inlinevirtual

Definition at line 50 of file Associator_TruthMatch.h.

50 { }

Member Function Documentation

◆ clear()

template<typename T , typename S = T>
void TIDA::Associator< T, S >::clear ( )
inlineinherited

Definition at line 63 of file TIDAAssociator.h.

63 { mmatched.clear(); mrevmatched.clear(); }

◆ clone()

virtual TrackAssociator* Associator_TruthMatcher::clone ( )
inlineoverridevirtual

Implements TIDA::Associator< T, S >.

Definition at line 52 of file Associator_TruthMatch.h.

52 { return new Associator_TruthMatcher(*this); }

◆ distance()

virtual double Associator_TruthMatcher::distance ( TIDA::Track refTrack,
TIDA::Track testTrack 
)
inlinevirtual

Definition at line 79 of file Associator_TruthMatch.h.

79  {
80  if (testTrack->match_barcode() == -1) return 1;
81  else if (testTrack->match_barcode() == refTrack->barcode()) return 0;
82  else return 1;
83  }

◆ match() [1/2]

template<typename T , typename S = T>
virtual void TIDA::Associator< T, S >::match ( const std::vector< T * > &  s1,
const std::vector< S * > &  s2 
)
pure virtualinherited

Implemented in BestMatcher< TIDA::Vertex >.

◆ match() [2/2]

virtual void Associator_TruthMatcher::match ( const std::vector< TIDA::Track * > &  refTracks,
const std::vector< TIDA::Track * > &  testTracks 
)
inlineoverridevirtual

Definition at line 55 of file Associator_TruthMatch.h.

56  {
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  }

◆ matched() [1/2]

template<typename T , typename S = T>
const map_type& TIDA::Associator< T, S >::matched ( ) const
inlineinherited

Definition at line 59 of file TIDAAssociator.h.

59 { return mmatched; }

◆ matched() [2/2]

template<typename T , typename S = T>
virtual const S* TIDA::Associator< T, S >::matched ( T *  t)
inlinevirtualinherited

Definition at line 45 of file TIDAAssociator.h.

45  {
46  typename map_type::const_iterator titr = mmatched.find(t);
47  if ( titr != mmatched.end() ) return titr->second;
48  else return 0;
49  }

◆ revmatched() [1/2]

template<typename T , typename S = T>
const rmap_type& TIDA::Associator< T, S >::revmatched ( ) const
inlineinherited

Definition at line 60 of file TIDAAssociator.h.

60 { return mrevmatched; }

◆ revmatched() [2/2]

template<typename T , typename S = T>
virtual const T* TIDA::Associator< T, S >::revmatched ( S *  t)
inlinevirtualinherited

Definition at line 52 of file TIDAAssociator.h.

52  {
53  typename rmap_type::const_iterator titr = mrevmatched.find(t);
54  if ( titr != mrevmatched.end() ) return titr->second;
55  else return 0;
56  }

◆ size()

template<typename T , typename S = T>
unsigned TIDA::Associator< T, S >::size ( ) const
inlineinherited

Definition at line 66 of file TIDAAssociator.h.

66 { return mmatched.size(); }

Member Data Documentation

◆ mmatched

template<typename T , typename S = T>
map_type TIDA::Associator< T, S >::mmatched
protectedinherited

Definition at line 73 of file TIDAAssociator.h.

◆ mname

template<typename T , typename S = T>
std::string TIDA::Associator< T, S >::mname
protectedinherited

Definition at line 71 of file TIDAAssociator.h.

◆ mrevmatched

template<typename T , typename S = T>
rmap_type TIDA::Associator< T, S >::mrevmatched
protectedinherited

Definition at line 74 of file TIDAAssociator.h.


The documentation for this class was generated from the following file:
TIDA::Associator::mmatched
map_type mmatched
Definition: TIDAAssociator.h:73
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
lumiFormat.i
int i
Definition: lumiFormat.py:85
TIDA::Track::barcode
int barcode() const
Definition: Trigger/TrigAnalysis/TrigInDetAnalysis/TrigInDetAnalysis/Track.h:85
TIDA::Track::match_barcode
int match_barcode() const
Definition: Trigger/TrigAnalysis/TrigInDetAnalysis/TrigInDetAnalysis/Track.h:86
TIDA::Associator::mrevmatched
rmap_type mrevmatched
Definition: TIDAAssociator.h:74
TrackAssociator
TIDA::Associator< TIDA::Track > TrackAssociator
Definition: TrackAssociator.h:26
Associator_TruthMatcher::Associator_TruthMatcher
Associator_TruthMatcher()
Definition: Associator_TruthMatch.h:48
Associator_TruthMatcher::distance
virtual double distance(TIDA::Track *refTrack, TIDA::Track *testTrack)
Definition: Associator_TruthMatch.h:79