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

◆ EtaDependentPileup()

fftjetcms::EtaDependentPileup::EtaDependentPileup ( const fftjet::LinearInterpolator2d &  i,
double  inputRhoFactor,
double  outputRhoFactor 
)

Definition at line 6 of file EtaDependentPileup.cc.

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  const double etaStep = (etaMax_ - etaMin_) / interp.nx();
18  etaMin_ += etaStep * 0.5;
19  etaMax_ -= etaStep * 0.5;
20  rhoMin_ += rhoStep_ * 0.5;
21  rhoMax_ -= rhoStep_ * 0.5;
24  }

References cms::cuda::assert(), etaMax_, etaMin_, HcalResponse_cfi::etaStep, rhoMax_, rhoMin_, and rhoStep_.

◆ ~EtaDependentPileup()

fftjetcms::EtaDependentPileup::~EtaDependentPileup ( )
inlineoverride

Definition at line 21 of file EtaDependentPileup.h.

21 {}

Member Function Documentation

◆ isPhiDependent()

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

Implements fftjetcms::AbsPileupCalculator.

Definition at line 25 of file EtaDependentPileup.h.

25 { return false; }

◆ operator()()

double fftjetcms::EtaDependentPileup::operator() ( double  eta,
double  phi,
const reco::FFTJetPileupSummary summary 
) const
overridevirtual

Implements fftjetcms::AbsPileupCalculator.

Definition at line 26 of file EtaDependentPileup.cc.

26  {
27  double value = 0.0;
28  const double rho = summary.pileupRho() * inputRhoFactor_;
29  if (eta < etaMin_)
30  eta = etaMin_;
31  if (eta > etaMax_)
32  eta = etaMax_;
33  if (rho >= rhoMin_ && rho <= rhoMax_)
34  value = interp_(eta, rho);
35  else {
36  double x0, x1;
37  if (rho < rhoMin_) {
38  x0 = rhoMin_;
39  x1 = rhoMin_ + rhoStep_ * 0.5;
40  } else {
41  x0 = rhoMax_;
42  x1 = rhoMax_ - rhoStep_ * 0.5;
43  }
44  const double z0 = interp_(eta, x0);
45  const double z1 = interp_(eta, x1);
46  value = z0 + (z1 - z0) * ((rho - x0) / (x1 - x0));
47  }
48  return (value > 0.0 ? value : 0.0) * outputRhoFactor_;
49  }

References PVValHelper::eta, etaMax_, etaMin_, inputRhoFactor_, interp_, outputRhoFactor_, rhoMax_, rhoMin_, rhoStep_, edmLumisInFiles::summary, testProducerWithPsetDescEmpty_cfi::x1, and HLTMuonOfflineAnalyzer_cfi::z0.

Member Data Documentation

◆ etaMax_

double fftjetcms::EtaDependentPileup::etaMax_
private

Definition at line 32 of file EtaDependentPileup.h.

Referenced by EtaDependentPileup(), and operator()().

◆ etaMin_

double fftjetcms::EtaDependentPileup::etaMin_
private

Definition at line 31 of file EtaDependentPileup.h.

Referenced by EtaDependentPileup(), and operator()().

◆ inputRhoFactor_

double fftjetcms::EtaDependentPileup::inputRhoFactor_
private

Definition at line 29 of file EtaDependentPileup.h.

Referenced by operator()().

◆ interp_

fftjet::LinearInterpolator2d fftjetcms::EtaDependentPileup::interp_
private

Definition at line 28 of file EtaDependentPileup.h.

Referenced by operator()().

◆ outputRhoFactor_

double fftjetcms::EtaDependentPileup::outputRhoFactor_
private

Definition at line 30 of file EtaDependentPileup.h.

Referenced by operator()().

◆ rhoMax_

double fftjetcms::EtaDependentPileup::rhoMax_
private

Definition at line 34 of file EtaDependentPileup.h.

Referenced by EtaDependentPileup(), and operator()().

◆ rhoMin_

double fftjetcms::EtaDependentPileup::rhoMin_
private

Definition at line 33 of file EtaDependentPileup.h.

Referenced by EtaDependentPileup(), and operator()().

◆ rhoStep_

double fftjetcms::EtaDependentPileup::rhoStep_
private

Definition at line 35 of file EtaDependentPileup.h.

Referenced by EtaDependentPileup(), and operator()().

cms::cuda::assert
assert(be >=bs)
fftjetcms::EtaDependentPileup::outputRhoFactor_
double outputRhoFactor_
Definition: EtaDependentPileup.h:30
fftjetcms::EtaDependentPileup::rhoMin_
double rhoMin_
Definition: EtaDependentPileup.h:33
fftjetcms::EtaDependentPileup::rhoStep_
double rhoStep_
Definition: EtaDependentPileup.h:35
testProducerWithPsetDescEmpty_cfi.x1
x1
Definition: testProducerWithPsetDescEmpty_cfi.py:33
fftjetcms::EtaDependentPileup::inputRhoFactor_
double inputRhoFactor_
Definition: EtaDependentPileup.h:29
PVValHelper::eta
Definition: PVValidationHelpers.h:70
HcalResponse_cfi.etaStep
etaStep
Definition: HcalResponse_cfi.py:21
HLTMuonOfflineAnalyzer_cfi.z0
z0
Definition: HLTMuonOfflineAnalyzer_cfi.py:98
fftjetcms::EtaDependentPileup::etaMin_
double etaMin_
Definition: EtaDependentPileup.h:31
DDAxes::rho
fftjetcms::EtaDependentPileup::etaMax_
double etaMax_
Definition: EtaDependentPileup.h:32
edmLumisInFiles.summary
summary
Definition: edmLumisInFiles.py:39
value
Definition: value.py:1
fftjetcms::EtaDependentPileup::rhoMax_
double rhoMax_
Definition: EtaDependentPileup.h:34
fftjetcms::EtaDependentPileup::interp_
fftjet::LinearInterpolator2d interp_
Definition: EtaDependentPileup.h:28