00001 #ifndef RecoJets_FFTJetAlgorithm_EtaAndPtDependentPeakSelector_h 00002 #define RecoJets_FFTJetAlgorithm_EtaAndPtDependentPeakSelector_h 00003 00004 #include "fftjet/Peak.hh" 00005 #include "fftjet/SimpleFunctors.hh" 00006 #include "fftjet/LinearInterpolator2d.hh" 00007 00008 #include "RecoJets/FFTJetAlgorithms/interface/LookupTable2d.h" 00009 00010 namespace fftjetcms { 00011 // 00012 // Interpolation is linear in eta, log(scale), and log(magnitude). 00013 // It is assumed that the first variable in the table is eta and 00014 // the second is log(scale). It is assumed that the table value 00015 // is log(magnitude). 00016 // 00017 class EtaAndPtDependentPeakSelector : 00018 public fftjet::Functor1<bool,fftjet::Peak> 00019 { 00020 public: 00021 explicit EtaAndPtDependentPeakSelector(std::istream& in); 00022 ~EtaAndPtDependentPeakSelector(); 00023 00024 bool operator()(const fftjet::Peak& peak) const; 00025 inline bool isValid() const {return ip_;} 00026 00027 private: 00028 EtaAndPtDependentPeakSelector(); 00029 EtaAndPtDependentPeakSelector(const EtaAndPtDependentPeakSelector&); 00030 EtaAndPtDependentPeakSelector& operator=( 00031 const EtaAndPtDependentPeakSelector&); 00032 00033 fftjet::LinearInterpolator2d* ip_; 00034 }; 00035 00036 // Similar class which does not perform linear interpolation but 00037 // simply looks up in a histogram-like table 00038 class EtaAndPtLookupPeakSelector : 00039 public fftjet::Functor1<bool,fftjet::Peak> 00040 { 00041 public: 00042 EtaAndPtLookupPeakSelector(unsigned nx, double xmin, double xmax, 00043 unsigned ny, double ymin, double ymax, 00044 const std::vector<double>& data); 00045 00046 bool operator()(const fftjet::Peak& peak) const; 00047 00048 private: 00049 LookupTable2d lookupTable_; 00050 }; 00051 } 00052 00053 #endif // RecoJets_FFTJetAlgorithm_EtaAndPtDependentPeakSelector_h