18 #ifndef JETUTIL_JETDISTANCES_H
19 #define JETUTIL_JETDISTANCES_H
26 #include <fastjet/internal/base.hh>
28 FASTJET_BEGIN_NAMESPACE
36 inline static double deltaEta(
const Jet& jet1,
const Jet& jet2)
37 {
return jet1.eta() - jet2.eta(); }
38 inline static double deltaEta(
const Jet* jet1,
40 {
return jet1->eta() - jet2->eta(); }
41 inline static double deltaEta(
const double eta1,
43 {
return (eta1 - eta2); }
47 inline static double deltaPhi(
const Jet& jet1,
50 return fixedPhi(jet1.phi() - jet2.phi());
52 inline static double deltaPhi(
const Jet* jet1,
55 return fixedPhi(jet1->phi()-jet2->phi());
57 inline static double deltaPhi(
const double phi1,
60 return fixedPhi( phi1 - phi2 );
65 inline static double deltaR(
const Jet& jet1,
67 {
return sqrt( deltaEta(jet1,jet2) * deltaEta(jet1,jet2) +
68 deltaPhi(jet1,jet2) * deltaPhi(jet1,jet2) ); }
69 inline static double deltaR(
const Jet* jet1,
71 {
return sqrt( deltaEta(jet1,jet2) * deltaEta(jet1,jet2) +
72 deltaPhi(jet1,jet2) * deltaPhi(jet1,jet2) ); }
74 inline static double deltaR(
const double eta1,
const double phi1,
75 const double eta2,
const double phi2 )
76 {
return sqrt( deltaEta(eta1,eta2) * deltaEta(eta1,eta2) +
77 deltaPhi(phi1,phi2) * deltaPhi(phi1,phi2) ); }
82 inline static double fixedPhi(
double aPhi)
84 while ( aPhi < -M_PI )