CMS 3D CMS Logo

AbsFFTJetScaleCalculator.h
Go to the documentation of this file.
1 #ifndef JetMETCorrections_FFTJetObjects_AbsFFTJetScaleCalculator_h
2 #define JetMETCorrections_FFTJetObjects_AbsFFTJetScaleCalculator_h
3 
5 
6 #include <memory>
7 #include <vector>
8 
9 template <class Jet, class Adjustable>
11 public:
12  typedef Jet jet_type;
13  typedef Adjustable adjustable_type;
14 
15  inline explicit AbsFFTJetScaleCalculator(std::shared_ptr<npstat::AbsMultivariateFunctor> f)
16  : functor(f), buffer_(f->minDim()) {}
17 
18  inline virtual ~AbsFFTJetScaleCalculator() {}
19 
20  inline double scale(const Jet& jet, const Adjustable& current) const {
21  const unsigned dim = buffer_.size();
22  double* buf = dim ? &buffer_[0] : static_cast<double*>(nullptr);
23  this->map(jet, current, buf, dim);
24  return (*functor)(buf, dim);
25  }
26 
27 private:
28  AbsFFTJetScaleCalculator() = delete;
29 
30  virtual void map(const Jet& jet, const Adjustable& current, double* buf, unsigned dim) const = 0;
31 
32  std::shared_ptr<npstat::AbsMultivariateFunctor> functor;
33  mutable std::vector<double> buffer_;
34 };
35 
36 #endif // JetMETCorrections_FFTJetObjects_AbsFFTJetScaleCalculator_h
AbsFFTJetScaleCalculator::functor
std::shared_ptr< npstat::AbsMultivariateFunctor > functor
Definition: AbsFFTJetScaleCalculator.h:32
AbsFFTJetScaleCalculator::AbsFFTJetScaleCalculator
AbsFFTJetScaleCalculator()=delete
AbsFFTJetScaleCalculator::~AbsFFTJetScaleCalculator
virtual ~AbsFFTJetScaleCalculator()
Definition: AbsFFTJetScaleCalculator.h:18
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
AbsFFTJetScaleCalculator::AbsFFTJetScaleCalculator
AbsFFTJetScaleCalculator(std::shared_ptr< npstat::AbsMultivariateFunctor > f)
Definition: AbsFFTJetScaleCalculator.h:15
AbsFFTJetScaleCalculator::jet_type
Jet jet_type
Definition: AbsFFTJetScaleCalculator.h:12
Jet
Definition: Jet.py:1
AbsMultivariateFunctor.h
Interface definition for multidimensional functors.
AbsFFTJetScaleCalculator
Definition: AbsFFTJetScaleCalculator.h:10
visDQMUpload.buf
buf
Definition: visDQMUpload.py:154
metsig::jet
Definition: SignAlgoResolutions.h:47
AbsFFTJetScaleCalculator::adjustable_type
Adjustable adjustable_type
Definition: AbsFFTJetScaleCalculator.h:13
AbsFFTJetScaleCalculator::buffer_
std::vector< double > buffer_
Definition: AbsFFTJetScaleCalculator.h:33
AbsFFTJetScaleCalculator::map
virtual void map(const Jet &jet, const Adjustable &current, double *buf, unsigned dim) const =0
AbsFFTJetScaleCalculator::scale
double scale(const Jet &jet, const Adjustable &current) const
Definition: AbsFFTJetScaleCalculator.h:20