CMS 3D CMS Logo

Public Member Functions | Private Attributes

fftjetcms::JetToPeakDistance Class Reference

#include <JetToPeakDistance.h>

List of all members.

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.

        : etaBw_(sqrt(etaToPhiBandwidthRatio)),
          phiBw_(1.0/etaBw_)
    {
        assert(etaToPhiBandwidthRatio > 0.0);
    }

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().

    {
        if (peak.membershipFactor() <= 0.0)
            // This peak essentially does not exist...
            return 2.0e300;

        const double deta = (j1.vec().Eta() - peak.eta())/etaBw_;
        double dphi = j1.vec().Phi() - peak.phi();
        if (dphi > M_PI)
            dphi -= (2.0*M_PI);
        else if (dphi < -M_PI)
            dphi += (2.0*M_PI);
        dphi /= phiBw_;
        return sqrt(deta*deta + dphi*dphi);
    }

Member Data Documentation

Definition at line 17 of file JetToPeakDistance.h.

Referenced by operator()().

Definition at line 18 of file JetToPeakDistance.h.

Referenced by operator()().