Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:34:49

0001 #include <cmath>
0002 
0003 #include "RecoJets/FFTJetAlgorithms/interface/EtaAndPtDependentPeakSelector.h"
0004 
0005 namespace fftjetcms {
0006   EtaAndPtDependentPeakSelector::EtaAndPtDependentPeakSelector(std::istream& in)
0007       : ip_(fftjet::LinearInterpolator2d::read(in)) {}
0008 
0009   EtaAndPtDependentPeakSelector::~EtaAndPtDependentPeakSelector() { delete ip_; }
0010 
0011   bool EtaAndPtDependentPeakSelector::operator()(const fftjet::Peak& peak) const {
0012     const double lookup = (*ip_)(peak.eta(), log(peak.scale()));
0013     return peak.magnitude() > exp(lookup);
0014   }
0015 
0016   EtaAndPtLookupPeakSelector::EtaAndPtLookupPeakSelector(
0017       unsigned nx, double xmin, double xmax, unsigned ny, double ymin, double ymax, const std::vector<double>& data)
0018       : lookupTable_(nx, xmin, xmax, ny, ymin, ymax, data) {}
0019 
0020   bool EtaAndPtLookupPeakSelector::operator()(const fftjet::Peak& peak) const {
0021     const double lookup = lookupTable_.closest(peak.eta(), log(peak.scale()));
0022     return peak.magnitude() > exp(lookup);
0023   }
0024 }  // namespace fftjetcms