1 #ifndef RecoJets_FFTJetAlgorithms_ScaleCalculators_h 2 #define RecoJets_FFTJetAlgorithms_ScaleCalculators_h 7 #include "fftjet/SimpleFunctors.hh" 8 #include "fftjet/RecombinedJet.hh" 14 template <
typename Arg1>
47 const fftjet::Functor1<double,T>*
f,
48 const bool takeOwnership=
false)
49 :
c_(factor), func_(f), ownsPointer_(takeOwnership) {}
58 const fftjet::Functor1<double,T>*
func_;
69 const fftjet::Functor1<double,T>*
f2,
70 const bool takeOwnership=
false)
71 : f1_(f1), f2_(f2), ownsPointers_(takeOwnership) {}
74 {
if (ownsPointers_) {
delete f1_;
delete f2_;}}
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_;
92 const fftjet::Functor1<double,T>*
f2,
93 const bool takeOwnership=
false)
94 : f1_(f1), f2_(f2), ownsPointers_(takeOwnership) {}
97 {
if (ownsPointers_) {
delete f1_;
delete f2_;}}
100 {
return (*f1_)(
r) * (*f2_)(
r);}
104 const fftjet::Functor1<double,T>*
f1_;
105 const fftjet::Functor1<double,T>*
f2_;
116 const bool takeOwnership=
false)
117 : f1_(f1), ownsPointer_(takeOwnership) {}
122 {
return (*f1_)(r.magnitude());}
126 const fftjet::Functor1<double,double>*
f1_;
136 const bool takeOwnership=
false)
137 : f1_(f1), ownsPointer_(takeOwnership) {}
142 {
return (*f1_)(r.eta());}
146 const fftjet::Functor1<double,double>*
f1_;
155 const fftjet::LinearInterpolator2d*
f1,
156 const bool takeOwnership,
157 const fftjet::JetMagnitudeMapper2d<fftjet::Peak>* jmmp,
158 const bool ownjmp,
const double fc)
159 : f1_(f1), ownsPointer_(takeOwnership), jmmp_(jmmp),
160 ownsjmmpPointer_(ownjmp), factor_(fc) {}
164 if (ownsPointer_)
delete f1_;
165 if (ownsjmmpPointer_)
delete jmmp_;
170 const double scale = r.scale();
171 const double magnitude = r.magnitude();
172 const double pt = scale*scale*factor_*magnitude;
173 const double partonpt = (*jmmp_)(
pt,
r);
174 return (*f1_)(
std::abs(r.eta()),partonpt) ;
179 const fftjet::LinearInterpolator2d*
f1_;
181 const fftjet::JetMagnitudeMapper2d <fftjet::Peak>*
jmmp_;
189 public fftjet::Functor1<double,fftjet::RecombinedJet<VectorLike> >
193 const bool takeOwnership=
false)
194 : f1_(f1), ownsPointer_(takeOwnership) {}
199 const fftjet::RecombinedJet<VectorLike>&
r)
const override 200 {
return (*f1_)(r.vec().eta());}
204 const fftjet::Functor1<double,double>*
f1_;
218 coeffs_ =
new double[nCoeffs];
219 std::copy(coeffs.begin(), coeffs.end(), coeffs_);
227 const double*
p = coeffs_ + nCoeffs - 1;
228 for (
unsigned i=0;
i<nCoeffs; ++
i)
243 #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)