#include <EtaDependentPileup.h>
Public Member Functions | |
EtaDependentPileup (const fftjet::LinearInterpolator2d &i, double inputRhoFactor, double outputRhoFactor) | |
virtual bool | isPhiDependent () const |
virtual double | operator() (double eta, double phi, const reco::FFTJetPileupSummary &summary) const |
virtual | ~EtaDependentPileup () |
Private Attributes | |
double | etaMax_ |
double | etaMin_ |
double | inputRhoFactor_ |
fftjet::LinearInterpolator2d | interp_ |
double | outputRhoFactor_ |
double | rhoMax_ |
double | rhoMin_ |
double | rhoStep_ |
Definition at line 17 of file EtaDependentPileup.h.
fftjetcms::EtaDependentPileup::EtaDependentPileup | ( | const fftjet::LinearInterpolator2d & | i, |
double | inputRhoFactor, | ||
double | outputRhoFactor | ||
) |
Definition at line 6 of file EtaDependentPileup.cc.
References etaMax_, etaMin_, rhoMax_, rhoMin_, and rhoStep_.
: interp_(interp), inputRhoFactor_(inputRhoFactor), outputRhoFactor_(outputRhoFactor), etaMin_(interp.xMin()), etaMax_(interp.xMax()), rhoMin_(interp.yMin()), rhoMax_(interp.yMax()), rhoStep_((rhoMax_ - rhoMin_)/interp.ny()) { const double etaStep = (etaMax_ - etaMin_)/interp.nx(); etaMin_ += etaStep*0.5; etaMax_ -= etaStep*0.5; rhoMin_ += rhoStep_*0.5; rhoMax_ -= rhoStep_*0.5; assert(etaMin_ < etaMax_); assert(rhoMin_ < rhoMax_); }
virtual fftjetcms::EtaDependentPileup::~EtaDependentPileup | ( | ) | [inline, virtual] |
Definition at line 23 of file EtaDependentPileup.h.
{}
virtual bool fftjetcms::EtaDependentPileup::isPhiDependent | ( | ) | const [inline, virtual] |
Implements fftjetcms::AbsPileupCalculator.
Definition at line 29 of file EtaDependentPileup.h.
{return false;}
double fftjetcms::EtaDependentPileup::operator() | ( | double | eta, |
double | phi, | ||
const reco::FFTJetPileupSummary & | summary | ||
) | const [virtual] |
Implements fftjetcms::AbsPileupCalculator.
Definition at line 27 of file EtaDependentPileup.cc.
References etaMax_, etaMin_, inputRhoFactor_, interp_, outputRhoFactor_, reco::FFTJetPileupSummary::pileupRho(), rho, rhoMax_, rhoMin_, rhoStep_, and relativeConstraints::value.
{ double value = 0.0; const double rho = summary.pileupRho()*inputRhoFactor_; if (eta < etaMin_) eta = etaMin_; if (eta > etaMax_) eta = etaMax_; if (rho >= rhoMin_ && rho <= rhoMax_) value = interp_(eta, rho); else { double x0, x1; if (rho < rhoMin_) { x0 = rhoMin_; x1 = rhoMin_ + rhoStep_*0.5; } else { x0 = rhoMax_; x1 = rhoMax_ - rhoStep_*0.5; } const double z0 = interp_(eta, x0); const double z1 = interp_(eta, x1); value = z0 + (z1 - z0)*((rho - x0)/(x1 - x0)); } return (value > 0.0 ? value : 0.0)*outputRhoFactor_; }
double fftjetcms::EtaDependentPileup::etaMax_ [private] |
Definition at line 36 of file EtaDependentPileup.h.
Referenced by EtaDependentPileup(), and operator()().
double fftjetcms::EtaDependentPileup::etaMin_ [private] |
Definition at line 35 of file EtaDependentPileup.h.
Referenced by EtaDependentPileup(), and operator()().
double fftjetcms::EtaDependentPileup::inputRhoFactor_ [private] |
Definition at line 33 of file EtaDependentPileup.h.
Referenced by operator()().
fftjet::LinearInterpolator2d fftjetcms::EtaDependentPileup::interp_ [private] |
Definition at line 32 of file EtaDependentPileup.h.
Referenced by operator()().
double fftjetcms::EtaDependentPileup::outputRhoFactor_ [private] |
Definition at line 34 of file EtaDependentPileup.h.
Referenced by operator()().
double fftjetcms::EtaDependentPileup::rhoMax_ [private] |
Definition at line 38 of file EtaDependentPileup.h.
Referenced by EtaDependentPileup(), and operator()().
double fftjetcms::EtaDependentPileup::rhoMin_ [private] |
Definition at line 37 of file EtaDependentPileup.h.
Referenced by EtaDependentPileup(), and operator()().
double fftjetcms::EtaDependentPileup::rhoStep_ [private] |
Definition at line 39 of file EtaDependentPileup.h.
Referenced by EtaDependentPileup(), and operator()().