CMS 3D CMS Logo

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

◆ JetToPeakDistance()

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

Member Function Documentation

◆ operator()()

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

Definition at line 12 of file JetToPeakDistance.cc.

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

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

Member Data Documentation

◆ etaBw_

double fftjetcms::JetToPeakDistance::etaBw_
private

Definition at line 16 of file JetToPeakDistance.h.

Referenced by operator()().

◆ phiBw_

double fftjetcms::JetToPeakDistance::phiBw_
private

Definition at line 17 of file JetToPeakDistance.h.

Referenced by operator()().