Go to the documentation of this file.00001 #include <cmath>
00002
00003 #include "RecoJets/FFTJetAlgorithms/interface/EtaAndPtDependentPeakSelector.h"
00004
00005 namespace fftjetcms {
00006 EtaAndPtDependentPeakSelector::EtaAndPtDependentPeakSelector(
00007 std::istream& in) : ip_(fftjet::LinearInterpolator2d::read(in))
00008 {
00009 }
00010
00011 EtaAndPtDependentPeakSelector::~EtaAndPtDependentPeakSelector()
00012 {
00013 delete ip_;
00014 }
00015
00016 bool EtaAndPtDependentPeakSelector::operator()(const fftjet::Peak& peak)
00017 const
00018 {
00019 const double lookup = (*ip_)(peak.eta(), log(peak.scale()));
00020 return peak.magnitude() > exp(lookup);
00021 }
00022
00023 EtaAndPtLookupPeakSelector::EtaAndPtLookupPeakSelector(
00024 unsigned nx, double xmin, double xmax,
00025 unsigned ny, double ymin, double ymax,
00026 const std::vector<double>& data)
00027 : lookupTable_(nx, xmin, xmax, ny, ymin, ymax, data)
00028 {
00029 }
00030
00031 bool EtaAndPtLookupPeakSelector::operator()(const fftjet::Peak& peak)
00032 const
00033 {
00034 const double lookup = lookupTable_.closest(peak.eta(),
00035 log(peak.scale()));
00036 return peak.magnitude() > exp(lookup);
00037 }
00038 }