ATLAS Offline Software
Loading...
Searching...
No Matches
Associator_TruthMatcher Class Reference

#include <Associator_TruthMatch.h>

Inheritance diagram for Associator_TruthMatcher:
Collaboration diagram for Associator_TruthMatcher:

Public Types

typedef std::map< TIDA::Track *, TIDA::Track * > map_type
typedef std::map< TIDA::Track *, TIDA::Track * > 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 const TIDA::Trackmatched (TIDA::Track *t)
const map_typematched () const
virtual const TIDA::Trackrevmatched (TIDA::Track *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

typedef std::map<TIDA::Track*, TIDA::Track*> TIDA::Associator< TIDA::Track, TIDA::Track >::map_type
inherited

Definition at line 28 of file TIDAAssociator.h.

◆ rmap_type

typedef std::map<TIDA::Track*, TIDA::Track*> TIDA::Associator< TIDA::Track, TIDA::Track >::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") { }
TIDA::Associator< TIDA::Track > TrackAssociator

◆ ~Associator_TruthMatcher()

virtual Associator_TruthMatcher::~Associator_TruthMatcher ( )
inlinevirtual

Definition at line 50 of file Associator_TruthMatch.h.

50{ }

Member Function Documentation

◆ clear()

void TIDA::Associator< TIDA::Track, TIDA::Track >::clear ( )
inlineinherited

Definition at line 63 of file TIDAAssociator.h.

◆ clone()

virtual TrackAssociator * Associator_TruthMatcher::clone ( )
inlineoverridevirtual

Implements TIDA::Associator< TIDA::Track >.

Definition at line 52 of file Associator_TruthMatch.h.

◆ 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()

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

Implements TIDA::Associator< TIDA::Track >.

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 }
virtual double distance(TIDA::Track *refTrack, TIDA::Track *testTrack)

◆ matched() [1/2]

const map_type & TIDA::Associator< TIDA::Track, TIDA::Track >::matched ( ) const
inlineinherited

Definition at line 59 of file TIDAAssociator.h.

59{ return mmatched; }

◆ matched() [2/2]

virtual const TIDA::Track * TIDA::Associator< TIDA::Track, TIDA::Track >::matched ( TIDA::Track * 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]

const rmap_type & TIDA::Associator< TIDA::Track, TIDA::Track >::revmatched ( ) const
inlineinherited

Definition at line 60 of file TIDAAssociator.h.

60{ return mrevmatched; }

◆ revmatched() [2/2]

virtual const TIDA::Track * TIDA::Associator< TIDA::Track, TIDA::Track >::revmatched ( TIDA::Track * t)
inlinevirtualinherited

Definition at line 52 of file TIDAAssociator.h.

52 {
54 if ( titr != mrevmatched.end() ) return titr->second;
55 else return 0;
56 }

◆ size()

unsigned TIDA::Associator< TIDA::Track, TIDA::Track >::size ( ) const
inlineinherited

Definition at line 66 of file TIDAAssociator.h.

66{ return mmatched.size(); }
unsigned size() const

Member Data Documentation

◆ mmatched

map_type TIDA::Associator< TIDA::Track, TIDA::Track >::mmatched
protectedinherited

Definition at line 73 of file TIDAAssociator.h.

◆ mname

std::string TIDA::Associator< TIDA::Track, TIDA::Track >::mname
protectedinherited

Definition at line 71 of file TIDAAssociator.h.

◆ mrevmatched

rmap_type TIDA::Associator< TIDA::Track, TIDA::Track >::mrevmatched
protectedinherited

Definition at line 74 of file TIDAAssociator.h.


The documentation for this class was generated from the following file: