Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-07-30 02:33:21

0001 #ifndef RecoJets_FFTJetAlgorithm_EtaAndPtDependentPeakSelector_h
0002 #define RecoJets_FFTJetAlgorithm_EtaAndPtDependentPeakSelector_h
0003 
0004 #include "fftjet/Peak.hh"
0005 #include "fftjet/SimpleFunctors.hh"
0006 #include "fftjet/LinearInterpolator2d.hh"
0007 
0008 #include "RecoJets/FFTJetAlgorithms/interface/LookupTable2d.h"
0009 
0010 namespace fftjetcms {
0011   //
0012   // Interpolation is linear in eta, log(scale), and log(magnitude).
0013   // It is assumed that the first variable in the table is eta and
0014   // the second is log(scale). It is assumed that the table value
0015   // is log(magnitude).
0016   //
0017   class EtaAndPtDependentPeakSelector : public fftjet::Functor1<bool, fftjet::Peak> {
0018   public:
0019     explicit EtaAndPtDependentPeakSelector(std::istream& in);
0020     EtaAndPtDependentPeakSelector() = delete;
0021     EtaAndPtDependentPeakSelector(const EtaAndPtDependentPeakSelector&) = delete;
0022     EtaAndPtDependentPeakSelector& operator=(const EtaAndPtDependentPeakSelector&) = delete;
0023     ~EtaAndPtDependentPeakSelector() override;
0024 
0025     bool operator()(const fftjet::Peak& peak) const override;
0026     inline bool isValid() const { return ip_; }
0027 
0028   private:
0029     fftjet::LinearInterpolator2d* ip_;
0030   };
0031 
0032   // Similar class which does not perform linear interpolation but
0033   // simply looks up in a histogram-like table
0034   class EtaAndPtLookupPeakSelector : public fftjet::Functor1<bool, fftjet::Peak> {
0035   public:
0036     EtaAndPtLookupPeakSelector(
0037         unsigned nx, double xmin, double xmax, unsigned ny, double ymin, double ymax, const std::vector<double>& data);
0038 
0039     bool operator()(const fftjet::Peak& peak) const override;
0040 
0041   private:
0042     LookupTable2d lookupTable_;
0043   };
0044 }  // namespace fftjetcms
0045 
0046 #endif  // RecoJets_FFTJetAlgorithm_EtaAndPtDependentPeakSelector_h