ATLAS Offline Software
PFMatchDistance.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 /*
6  * PFMatchDistance.cxx
7  *
8  * Created on: 28.03.2014
9  * Author: tlodd
10  */
11 
14 
15 namespace PFMatch {
16 
17 //double EtaPhiSqDistanceCalculator::distanceBetween(IPosition* position1,
18 // IPosition* position2) {
19 // EtaPhi* etaphi1 = convertPosition<EtaPhi>(position1);
20 // EtaPhi* etaphi2 = convertPosition<EtaPhi>(position2);
21 //
22 // return etaphi1->dRSq(*etaphi2);
23 //}
24 
25 double EtaPhiSqDistanceCalculator::distanceBetween(const EtaPhi& position1, const EtaPhi& position2) const {
26  return position1.dRSq(position2);
27 }
28 
29 double EtaPhiSqSignificanceCalculator::distanceBetween(const EtaPhi& position1, const EtaPhiWithVariance& position2) const{
30  double dEta = position1.getEta() - position2.getEta();
31  double dPhi = position1.getPhi().getAbsDifference(position2.getPhi());
32  return dEta*dEta/position2.m_etaVariance + dPhi*dPhi/position2.m_phiVariance;
33 }
34 //
35 //double EtaPhiSqSignificanceCalculator::distanceBetween(IPosition* position1,
36 // IPosition* position2) {
37 // EtaPhi* etaphi1 = convertPosition<EtaPhi>(position1);
38 // EtaPhiWithVariance* etaphi2 = convertPosition<EtaPhiWithVariance>(position2);
39 //
40 // double dEta = etaphi1->getEta() - etaphi2->getEta();
41 // double dPhi = etaphi1->getPhi().getAbsDifference(etaphi2->getPhi());
42 // return dEta*dEta/etaphi2->_etaVariance + dPhi*dPhi/etaphi2->_phiVariance;
43 //}
44 
45 }
eflowEtaPhiPosition::dRSq
double dRSq(const eflowEtaPhiPosition &other) const
Definition: eflowUtil.h:94
eflowEtaPhiPosition::getEta
double getEta() const
Definition: eflowUtil.h:90
PFMatch::EtaPhi
Definition: PFMatchPositions.h:23
PFMatch::EtaPhiSqDistanceCalculator::distanceBetween
virtual double distanceBetween(const EtaPhi &position1, const EtaPhi &position2) const
Definition: PFMatchDistance.cxx:25
eflowAzimuth::getAbsDifference
double getAbsDifference(const eflowAzimuth &other) const
Definition: eflowUtil.h:46
PFMatch::EtaPhiWithVariance
Definition: PFMatchPositions.h:41
eflowEtaPhiPosition::getPhi
eflowAzimuth getPhi() const
Definition: eflowUtil.h:91
TauGNNUtils::Variables::Track::dPhi
bool dPhi(const xAOD::TauJet &tau, const xAOD::TauTrack &track, double &out)
Definition: TauGNNUtils.cxx:538
PFMatch
Definition: PFMatchDistance.h:17
PFMatch::EtaPhiWithVariance::m_phiVariance
double m_phiVariance
Definition: PFMatchPositions.h:49
PFMatchPositions.h
PFMatch::EtaPhiSqSignificanceCalculator::distanceBetween
virtual double distanceBetween(const EtaPhi &position1, const EtaPhiWithVariance &position2) const
Definition: PFMatchDistance.cxx:29
TauGNNUtils::Variables::Track::dEta
bool dEta(const xAOD::TauJet &tau, const xAOD::TauTrack &track, double &out)
Definition: TauGNNUtils.cxx:527
PFMatchDistance.h
PFMatch::EtaPhiWithVariance::m_etaVariance
double m_etaVariance
Definition: PFMatchPositions.h:48