13 #ifndef TrigInDetAnalysisUtils_Associator_DeltaR_H
14 #define TrigInDetAnalysisUtils_Associator_DeltaR_H
38 ~Associator_DeltaR() { }
42 virtual void match(
const std::vector<TIDA::Track*>& referenceTracks,
43 const std::vector<TIDA::Track*>& testTracks) {
49 std::vector<TIDA::Track*>::const_iterator
reference, referenceEnd=referenceTracks.end();
54 double bestDeltaR=1000;
56 std::vector<TIDA::Track*>::const_iterator
test, testEnd=testTracks.end();
60 double deta = (*reference)->eta() - (*test)->eta();
61 double dphi = (*reference)->phi() - (*test)->phi();
64 double deltaR = deta*deta+dphi*dphi;
67 if(bestMatch==NULL ||
deltaR<bestDeltaR) {
74 if(bestMatch && bestDeltaR<m_deltaR2) {
76 mmatched.insert(map_type::value_type(*
reference, bestMatch));
77 mrevmatched.insert(map_type::value_type(bestMatch, *
reference));
89 #endif // TrigInDetAnalysisUtils_Associator_DeltaR_H