1 #ifndef RecoJets_FFTJetAlgorithms_ScaleCalculators_h 2 #define RecoJets_FFTJetAlgorithms_ScaleCalculators_h 7 #include "fftjet/SimpleFunctors.hh" 8 #include "fftjet/RecombinedJet.hh" 9 #include "fftjet/LinearInterpolator2d.hh" 10 #include "fftjet/JetMagnitudeMapper2d.hh" 16 template <
typename Arg1>
20 inline double operator()(
const Arg1&)
const override {
return c_; }
32 inline double operator()(
const T&
r)
const override {
return r.scale() *
c_; }
44 :
c_(factor), func_(f), ownsPointer_(takeOwnership) {}
56 const fftjet::Functor1<double, T>*
func_;
65 const fftjet::Functor1<double, T>*
f2,
66 const bool takeOwnership =
false)
67 : f1_(f1), f2_(f2), ownsPointers_(takeOwnership) {}
76 inline double operator()(
const T&
r)
const override {
return (*f1_)((*f2_)(
r)); }
80 const fftjet::Functor1<double, double>*
f1_;
81 const fftjet::Functor1<double, T>*
f2_;
90 const fftjet::Functor1<double, T>*
f2,
91 const bool takeOwnership =
false)
92 : f1_(f1), f2_(f2), ownsPointers_(takeOwnership) {}
101 inline double operator()(
const T&
r)
const override {
return (*f1_)(
r) * (*f2_)(
r); }
105 const fftjet::Functor1<double, T>*
f1_;
106 const fftjet::Functor1<double, T>*
f2_;
115 : f1_(f1), ownsPointer_(takeOwnership) {}
122 inline double operator()(
const T&
r)
const override {
return (*f1_)(r.magnitude()); }
126 const fftjet::Functor1<double, double>*
f1_;
133 inline PeakEtaDependent(
const fftjet::Functor1<double, double>*
f1,
const bool takeOwnership =
false)
134 : f1_(f1), ownsPointer_(takeOwnership) {}
141 inline double operator()(
const fftjet::Peak&
r)
const override {
return (*f1_)(r.eta()); }
145 const fftjet::Functor1<double, double>*
f1_;
152 const bool takeOwnership,
153 const fftjet::JetMagnitudeMapper2d<fftjet::Peak>* jmmp,
156 : f1_(f1), ownsPointer_(takeOwnership), jmmp_(jmmp), ownsjmmpPointer_(ownjmp), factor_(fc) {}
161 if (ownsjmmpPointer_)
166 const double scale = r.scale();
167 const double magnitude = r.magnitude();
168 const double pt = scale * scale * factor_ * magnitude;
169 const double partonpt = (*jmmp_)(
pt,
r);
170 return (*f1_)(
std::abs(r.eta()), partonpt);
175 const fftjet::LinearInterpolator2d*
f1_;
177 const fftjet::JetMagnitudeMapper2d<fftjet::Peak>*
jmmp_;
183 class JetEtaDependent :
public fftjet::Functor1<double, fftjet::RecombinedJet<VectorLike> > {
185 inline JetEtaDependent(
const fftjet::Functor1<double, double>*
f1,
const bool takeOwnership =
false)
186 : f1_(f1), ownsPointer_(takeOwnership) {}
193 inline double operator()(
const fftjet::RecombinedJet<VectorLike>&
r)
const override {
194 return (*f1_)(r.vec().eta());
199 const fftjet::Functor1<double, double>*
f1_;
208 coeffs_ =
new double[nCoeffs];
209 std::copy(coeffs.begin(), coeffs.end(), coeffs_);
216 const double*
p = coeffs_ + nCoeffs - 1;
217 for (
unsigned i = 0;
i < nCoeffs; ++
i) {
231 #endif // RecoJets_FFTJetAlgorithms_ScaleCalculators_h
const fftjet::Functor1< double, double > * f1_
~PeakEtaMagSsqDependent() override
const fftjet::Functor1< double, T > * func_
~JetEtaDependent() override
MultiplyByConst(const double factor, const fftjet::Functor1< double, T > *f, const bool takeOwnership=false)
double operator()(const fftjet::Peak &r) const override
JetEtaDependent(const fftjet::Functor1< double, double > *f1, const bool takeOwnership=false)
const fftjet::Functor1< double, T > * f1_
const bool ownsjmmpPointer_
double operator()(const fftjet::Peak &r) const override
~PeakEtaDependent() override
~CompositeFunctor() override
const fftjet::Functor1< double, double > * f1_
double operator()(const double &x) const override
ProportionalToScale(const double value)
MagnitudeDependent(const fftjet::Functor1< double, double > *f1, const bool takeOwnership=false)
~ProductFunctor() override
const fftjet::Functor1< double, T > * f2_
double operator()(const Arg1 &) const override
CompositeFunctor(const fftjet::Functor1< double, double > *f1, const fftjet::Functor1< double, T > *f2, const bool takeOwnership=false)
ProductFunctor(const fftjet::Functor1< double, T > *f1, const fftjet::Functor1< double, T > *f2, const bool takeOwnership=false)
double operator()(const fftjet::RecombinedJet< VectorLike > &r) const override
Polynomial(const std::vector< double > &coeffs)
PeakEtaMagSsqDependent(const fftjet::LinearInterpolator2d *f1, const bool takeOwnership, const fftjet::JetMagnitudeMapper2d< fftjet::Peak > *jmmp, const bool ownjmp, const double fc)
Abs< T >::type abs(const T &t)
const fftjet::LinearInterpolator2d * f1_
PeakEtaDependent(const fftjet::Functor1< double, double > *f1, const bool takeOwnership=false)
const fftjet::Functor1< double, double > * f1_
~MagnitudeDependent() override
double operator()(const T &r) const override
double operator()(const T &r) const override
const fftjet::Functor1< double, T > * f2_
const fftjet::JetMagnitudeMapper2d< fftjet::Peak > * jmmp_
~MultiplyByConst() override
double operator()(const T &r) const override
double operator()(const T &r) const override
const fftjet::Functor1< double, double > * f1_
double operator()(const T &r) const override
ConstDouble(const double value)