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

#include <TrackMatchDeltaR.h>

Inheritance diagram for TrackMatchDeltaR:
Collaboration diagram for TrackMatchDeltaR:

Public Types

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

Public Member Functions

 TrackMatchDeltaR (const std::string &name, double R)
 
 ~TrackMatchDeltaR ()
 
virtual void match (const std::vector< TIDA::Track * > &s1, const std::vector< TIDA::Track * > &s2)
 
virtual double deltaR2 (const TIDA::Track *reftrack, const TIDA::Track *testtrack)
 
virtual Associatorclone ()=0
 
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
 

Private Attributes

double m_R2
 

Detailed Description

Definition at line 25 of file TrackMatchDeltaR.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

◆ TrackMatchDeltaR()

TrackMatchDeltaR::TrackMatchDeltaR ( const std::string &  name,
double  R 
)
inline

Definition at line 29 of file TrackMatchDeltaR.h.

29  :
31  { }

◆ ~TrackMatchDeltaR()

TrackMatchDeltaR::~TrackMatchDeltaR ( )
inline

Definition at line 33 of file TrackMatchDeltaR.h.

33 { }

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

template<typename T , typename S = T>
virtual Associator* TIDA::Associator< T, S >::clone ( )
pure virtualinherited

◆ deltaR2()

virtual double TrackMatchDeltaR::deltaR2 ( const TIDA::Track reftrack,
const TIDA::Track testtrack 
)
inlinevirtual

Definition at line 78 of file TrackMatchDeltaR.h.

78  {
79  double deta = reftrack->eta()-testtrack->eta();
80  double dphi = reftrack->phi()-testtrack->phi();
81  if ( dphi> M_PI ) dphi-=2*M_PI;
82  if ( dphi<-M_PI ) dphi+=2*M_PI;
83  return deta*deta+dphi*dphi;
84  }

◆ 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 TrackMatchDeltaR::match ( const std::vector< TIDA::Track * > &  s1,
const std::vector< TIDA::Track * > &  s2 
)
inlinevirtual

Definition at line 36 of file TrackMatchDeltaR.h.

38  {
39  clear();
40 
41  const std::vector<TIDA::Track*>& ref = s1;
42  const std::vector<TIDA::Track*>& test = s2;
43 
44  // loop over reference tracks
45  for ( int i=ref.size() ; i-- ; ) {
46 
47  TIDA::Track* reftrack = ref[i];
48 
49  // find the closest track
50  TIDA::Track* tmptrack = NULL;
51  double R2min = 0;
52 
53  // loop over test tracks
54  for ( int j=test.size() ; j-- ; ) {
55 
56  TIDA::Track* testtrack = test[j];
57 
58  double R2tmp = deltaR2( reftrack, testtrack );
59 
60  // found a close track
61  if ( tmptrack==NULL || R2tmp<R2min ) {
62  R2min = R2tmp;
63  tmptrack = testtrack;
64  }
65  }
66 
67  // is this inside the delta R specification?
68  if ( tmptrack && R2min<m_R2 ) {
69  mmatched.insert( map_type::value_type(reftrack,tmptrack) );
70  mrevmatched.insert( map_type::value_type(tmptrack,reftrack) );
71 
72  std::cout << "\t\tSUTT matched " << *reftrack << "\t -> \t" << *tmptrack << "\tDr=" << R2min << std::endl;
73  }
74  }
75  }

◆ 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

◆ m_R2

double TrackMatchDeltaR::m_R2
private

Definition at line 88 of file TrackMatchDeltaR.h.

◆ 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:
ReadCellNoiseFromCoolCompare.s1
s1
Definition: ReadCellNoiseFromCoolCompare.py:378
IDTPM::R
float R(const U &p)
Definition: TrackParametersHelper.h:101
M_PI
#define M_PI
Definition: ActiveFraction.h:11
TIDA::Associator::mmatched
map_type mmatched
Definition: TIDAAssociator.h:73
TrigInDetValidation_Base.test
test
Definition: TrigInDetValidation_Base.py:146
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
TIDA::Associator::clear
void clear()
Definition: TIDAAssociator.h:63
lumiFormat.i
int i
Definition: lumiFormat.py:92
TIDA::Track::phi
double phi() const
Definition: Trigger/TrigAnalysis/TrigInDetAnalysis/TrigInDetAnalysis/Track.h:47
TrackMatchDeltaR::deltaR2
virtual double deltaR2(const TIDA::Track *reftrack, const TIDA::Track *testtrack)
Definition: TrackMatchDeltaR.h:78
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
TIDA::Track::eta
double eta() const
Definition: Trigger/TrigAnalysis/TrigInDetAnalysis/TrigInDetAnalysis/Track.h:46
ref
const boost::regex ref(r_ef)
ReadCellNoiseFromCoolCompare.s2
s2
Definition: ReadCellNoiseFromCoolCompare.py:379
TrackMatchDeltaR::m_R2
double m_R2
Definition: TrackMatchDeltaR.h:88
TIDA::Track
Definition: Trigger/TrigAnalysis/TrigInDetAnalysis/TrigInDetAnalysis/Track.h:26
TIDA::Associator::mrevmatched
rmap_type mrevmatched
Definition: TIDAAssociator.h:74
TrackAssociator
TIDA::Associator< TIDA::Track > TrackAssociator
Definition: TrackAssociator.h:26