CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
AbsFFTJetScaleCalculator.h
Go to the documentation of this file.
1 #ifndef JetMETCorrections_FFTJetObjects_AbsFFTJetScaleCalculator_h
2 #define JetMETCorrections_FFTJetObjects_AbsFFTJetScaleCalculator_h
3 
4 #include <vector>
5 #include "Alignment/Geners/interface/CPP11_shared_ptr.hh"
7 
8 template<class Jet, class Adjustable>
10 {
11 public:
12  typedef Jet jet_type;
13  typedef Adjustable adjustable_type;
14 
15  inline explicit AbsFFTJetScaleCalculator(
16  CPP11_shared_ptr<npstat::AbsMultivariateFunctor> f)
17  : functor(f), buffer_(f->minDim()) {}
18 
19  inline virtual ~AbsFFTJetScaleCalculator() {}
20 
21  inline double scale(const Jet& jet, const Adjustable& current) const
22  {
23  const unsigned dim = buffer_.size();
24  double* buf = dim ? &buffer_[0] : static_cast<double*>(0);
25  this->map(jet, current, buf, dim);
26  return (*functor)(buf, dim);
27  }
28 
29 private:
31 
32  virtual void map(const Jet& jet,
33  const Adjustable& current,
34  double* buf, unsigned dim) const = 0;
35 
36  CPP11_shared_ptr<npstat::AbsMultivariateFunctor> functor;
37  mutable std::vector<double> buffer_;
38 };
39 
40 #endif // JetMETCorrections_FFTJetObjects_AbsFFTJetScaleCalculator_h
AbsFFTJetScaleCalculator(CPP11_shared_ptr< npstat::AbsMultivariateFunctor > f)
CPP11_shared_ptr< npstat::AbsMultivariateFunctor > functor
double scale(const Jet &jet, const Adjustable &current) const
double f[11][100]
virtual void map(const Jet &jet, const Adjustable &current, double *buf, unsigned dim) const =0
Interface definition for multidimensional functors.