CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
fftjetcms::JetToPeakDistance Class Reference

#include <JetToPeakDistance.h>

Public Member Functions

 JetToPeakDistance (double etaToPhiBandwidthRatio=1.0)
 
double operator() (const fftjet::RecombinedJet< VectorLike > &jet, const fftjet::Peak &peak) const
 

Private Attributes

double etaBw_
 
double phiBw_
 

Detailed Description

Definition at line 9 of file JetToPeakDistance.h.

Constructor & Destructor Documentation

fftjetcms::JetToPeakDistance::JetToPeakDistance ( double  etaToPhiBandwidthRatio = 1.0)
explicit

Definition at line 7 of file JetToPeakDistance.cc.

References assert().

8  : etaBw_(sqrt(etaToPhiBandwidthRatio)),
9  phiBw_(1.0/etaBw_)
10  {
11  assert(etaToPhiBandwidthRatio > 0.0);
12  }
assert(m_qm.get())
T sqrt(T t)
Definition: SSEVec.h:18

Member Function Documentation

double fftjetcms::JetToPeakDistance::operator() ( const fftjet::RecombinedJet< VectorLike > &  jet,
const fftjet::Peak &  peak 
) const

Definition at line 14 of file JetToPeakDistance.cc.

References etaBw_, M_PI, phiBw_, and mathSSE::sqrt().

17  {
18  if (peak.membershipFactor() <= 0.0)
19  // This peak essentially does not exist...
20  return 2.0e300;
21 
22  const double deta = (j1.vec().Eta() - peak.eta())/etaBw_;
23  double dphi = j1.vec().Phi() - peak.phi();
24  if (dphi > M_PI)
25  dphi -= (2.0*M_PI);
26  else if (dphi < -M_PI)
27  dphi += (2.0*M_PI);
28  dphi /= phiBw_;
29  return sqrt(deta*deta + dphi*dphi);
30  }
T sqrt(T t)
Definition: SSEVec.h:18
#define M_PI

Member Data Documentation

double fftjetcms::JetToPeakDistance::etaBw_
private

Definition at line 17 of file JetToPeakDistance.h.

Referenced by operator()().

double fftjetcms::JetToPeakDistance::phiBw_
private

Definition at line 18 of file JetToPeakDistance.h.

Referenced by operator()().