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>
49 const fftjet::Functor1<double,T>*
f,
50 const bool takeOwnership=
false)
51 :
c_(factor), func_(f), ownsPointer_(takeOwnership) {}
60 const fftjet::Functor1<double,T>*
func_;
71 const fftjet::Functor1<double,T>*
f2,
72 const bool takeOwnership=
false)
73 : f1_(f1), f2_(f2), ownsPointers_(takeOwnership) {}
76 {
if (ownsPointers_) {
delete f1_;
delete f2_;}}
78 inline double operator()(
const T&
r)
const override {
return (*f1_)((*f2_)(
r));}
82 const fftjet::Functor1<double,double>*
f1_;
83 const fftjet::Functor1<double,T>*
f2_;
94 const fftjet::Functor1<double,T>*
f2,
95 const bool takeOwnership=
false)
96 : f1_(f1), f2_(f2), ownsPointers_(takeOwnership) {}
99 {
if (ownsPointers_) {
delete f1_;
delete f2_;}}
102 {
return (*f1_)(
r) * (*f2_)(
r);}
106 const fftjet::Functor1<double,T>*
f1_;
107 const fftjet::Functor1<double,T>*
f2_;
118 const bool takeOwnership=
false)
119 : f1_(f1), ownsPointer_(takeOwnership) {}
124 {
return (*f1_)(r.magnitude());}
128 const fftjet::Functor1<double,double>*
f1_;
138 const bool takeOwnership=
false)
139 : f1_(f1), ownsPointer_(takeOwnership) {}
144 {
return (*f1_)(r.eta());}
148 const fftjet::Functor1<double,double>*
f1_;
157 const fftjet::LinearInterpolator2d*
f1,
158 const bool takeOwnership,
159 const fftjet::JetMagnitudeMapper2d<fftjet::Peak>* jmmp,
160 const bool ownjmp,
const double fc)
161 : f1_(f1), ownsPointer_(takeOwnership), jmmp_(jmmp),
162 ownsjmmpPointer_(ownjmp), factor_(fc) {}
166 if (ownsPointer_)
delete f1_;
167 if (ownsjmmpPointer_)
delete jmmp_;
172 const double scale = r.scale();
173 const double magnitude = r.magnitude();
174 const double pt = scale*scale*factor_*magnitude;
175 const double partonpt = (*jmmp_)(
pt,
r);
176 return (*f1_)(
std::abs(r.eta()),partonpt) ;
181 const fftjet::LinearInterpolator2d*
f1_;
183 const fftjet::JetMagnitudeMapper2d <fftjet::Peak>*
jmmp_;
191 public fftjet::Functor1<double,fftjet::RecombinedJet<VectorLike> >
195 const bool takeOwnership=
false)
196 : f1_(f1), ownsPointer_(takeOwnership) {}
201 const fftjet::RecombinedJet<VectorLike>&
r)
const override 202 {
return (*f1_)(r.vec().eta());}
206 const fftjet::Functor1<double,double>*
f1_;
220 coeffs_ =
new double[nCoeffs];
221 std::copy(coeffs.begin(), coeffs.end(), coeffs_);
229 const double*
p = coeffs_ + nCoeffs - 1;
230 for (
unsigned i=0;
i<nCoeffs; ++
i)
245 #endif // RecoJets_FFTJetAlgorithms_ScaleCalculators_h
~PeakEtaMagSsqDependent() override
~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, double > * 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
const fftjet::Functor1< double, double > * f1_
ProportionalToScale(const double value)
const fftjet::Functor1< double, T > * f2_
MagnitudeDependent(const fftjet::Functor1< double, double > *f1, const bool takeOwnership=false)
~ProductFunctor() override
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)
const fftjet::Functor1< double, T > * f1_
PeakEtaMagSsqDependent(const fftjet::LinearInterpolator2d *f1, const bool takeOwnership, const fftjet::JetMagnitudeMapper2d< fftjet::Peak > *jmmp, const bool ownjmp, const double fc)
const fftjet::Functor1< double, T > * func_
Abs< T >::type abs(const T &t)
const fftjet::LinearInterpolator2d * f1_
PeakEtaDependent(const fftjet::Functor1< double, double > *f1, const bool takeOwnership=false)
~MagnitudeDependent() override
double operator()(const T &r) const override
double operator()(const T &r) const override
const fftjet::JetMagnitudeMapper2d< fftjet::Peak > * jmmp_
const fftjet::Functor1< double, double > * f1_
~MultiplyByConst() override
double operator()(const T &r) const override
double operator()(const T &r) const override
const fftjet::Functor1< double, T > * f2_
double operator()(const T &r) const override
ConstDouble(const double value)