CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
fftjetcms::EtaDependentPileup Class Reference

#include <EtaDependentPileup.h>

Inheritance diagram for fftjetcms::EtaDependentPileup:
fftjetcms::AbsPileupCalculator

Public Member Functions

 EtaDependentPileup (const fftjet::LinearInterpolator2d &i, double inputRhoFactor, double outputRhoFactor)
 
bool isPhiDependent () const override
 
double operator() (double eta, double phi, const reco::FFTJetPileupSummary &summary) const override
 
 ~EtaDependentPileup () override
 
- Public Member Functions inherited from fftjetcms::AbsPileupCalculator
virtual ~AbsPileupCalculator ()
 

Private Attributes

double etaMax_
 
double etaMin_
 
double inputRhoFactor_
 
fftjet::LinearInterpolator2d interp_
 
double outputRhoFactor_
 
double rhoMax_
 
double rhoMin_
 
double rhoStep_
 

Detailed Description

Definition at line 17 of file EtaDependentPileup.h.

Constructor & Destructor Documentation

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_.

9  : interp_(interp),
10  inputRhoFactor_(inputRhoFactor),
11  outputRhoFactor_(outputRhoFactor),
12  etaMin_(interp.xMin()),
13  etaMax_(interp.xMax()),
14  rhoMin_(interp.yMin()),
15  rhoMax_(interp.yMax()),
16  rhoStep_((rhoMax_ - rhoMin_)/interp.ny())
17  {
18  const double etaStep = (etaMax_ - etaMin_)/interp.nx();
19  etaMin_ += etaStep*0.5;
20  etaMax_ -= etaStep*0.5;
21  rhoMin_ += rhoStep_*0.5;
22  rhoMax_ -= rhoStep_*0.5;
23  assert(etaMin_ < etaMax_);
24  assert(rhoMin_ < rhoMax_);
25  }
fftjet::LinearInterpolator2d interp_
fftjetcms::EtaDependentPileup::~EtaDependentPileup ( )
inlineoverride

Definition at line 23 of file EtaDependentPileup.h.

References PVValHelper::eta, operator()(), and heppy_report::summary.

23 {}

Member Function Documentation

bool fftjetcms::EtaDependentPileup::isPhiDependent ( ) const
inlineoverridevirtual

Implements fftjetcms::AbsPileupCalculator.

Definition at line 29 of file EtaDependentPileup.h.

29 {return false;}
double fftjetcms::EtaDependentPileup::operator() ( double  eta,
double  phi,
const reco::FFTJetPileupSummary summary 
) const
overridevirtual

Implements fftjetcms::AbsPileupCalculator.

Definition at line 27 of file EtaDependentPileup.cc.

References etaMax_, etaMin_, inputRhoFactor_, interp_, outputRhoFactor_, reco::FFTJetPileupSummary::pileupRho(), rhoMax_, rhoMin_, rhoStep_, and globals_cff::x1.

Referenced by ~EtaDependentPileup().

30  {
31  double value = 0.0;
32  const double rho = summary.pileupRho()*inputRhoFactor_;
33  if (eta < etaMin_)
34  eta = etaMin_;
35  if (eta > etaMax_)
36  eta = etaMax_;
37  if (rho >= rhoMin_ && rho <= rhoMax_)
38  value = interp_(eta, rho);
39  else
40  {
41  double x0, x1;
42  if (rho < rhoMin_)
43  {
44  x0 = rhoMin_;
45  x1 = rhoMin_ + rhoStep_*0.5;
46  }
47  else
48  {
49  x0 = rhoMax_;
50  x1 = rhoMax_ - rhoStep_*0.5;
51  }
52  const double z0 = interp_(eta, x0);
53  const double z1 = interp_(eta, x1);
54  value = z0 + (z1 - z0)*((rho - x0)/(x1 - x0));
55  }
56  return (value > 0.0 ? value : 0.0)*outputRhoFactor_;
57  }
fftjet::LinearInterpolator2d interp_
Definition: value.py:1

Member Data Documentation

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()().