RecoJets
FFTJetAlgorithms
src
EtaDependentPileup.cc
Go to the documentation of this file.
1
#include <fstream>
2
3
#include "
RecoJets/FFTJetAlgorithms/interface/EtaDependentPileup.h
"
4
5
namespace
fftjetcms
{
6
EtaDependentPileup::EtaDependentPileup
(
const
fftjet::LinearInterpolator2d& interp,
7
const
double
inputRhoFactor,
8
const
double
outputRhoFactor)
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;
22
assert
(
etaMin_
<
etaMax_
);
23
assert
(
rhoMin_
<
rhoMax_
);
24
}
25
26
double
EtaDependentPileup::operator()
(
double
eta
,
double
/* phi */
,
const
reco::FFTJetPileupSummary
&
summary
)
const
{
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
}
50
}
// namespace fftjetcms
fftjetcms
Definition:
AbsPileupCalculator.h:15
cms::cuda::assert
assert(be >=bs)
EtaDependentPileup.h
fftjetcms::EtaDependentPileup::outputRhoFactor_
double outputRhoFactor_
Definition:
EtaDependentPileup.h:30
photonAnalyzer_cfi.yMin
yMin
Definition:
photonAnalyzer_cfi.py:86
fftjetcms::EtaDependentPileup::rhoMin_
double rhoMin_
Definition:
EtaDependentPileup.h:33
fftjetcms::EtaDependentPileup::rhoStep_
double rhoStep_
Definition:
EtaDependentPileup.h:35
photonAnalyzer_cfi.xMin
xMin
Definition:
photonAnalyzer_cfi.py:82
testProducerWithPsetDescEmpty_cfi.x1
x1
Definition:
testProducerWithPsetDescEmpty_cfi.py:33
fftjetcms::EtaDependentPileup::inputRhoFactor_
double inputRhoFactor_
Definition:
EtaDependentPileup.h:29
PVValHelper::eta
Definition:
PVValidationHelpers.h:70
fftjetcms::EtaDependentPileup::EtaDependentPileup
EtaDependentPileup(const fftjet::LinearInterpolator2d &i, double inputRhoFactor, double outputRhoFactor)
Definition:
EtaDependentPileup.cc:6
reco::FFTJetPileupSummary
Summary info for pile-up determined by Gaussian filtering.
Definition:
FFTJetPileupSummary.h:13
HcalResponse_cfi.etaStep
etaStep
Definition:
HcalResponse_cfi.py:21
HLTMuonOfflineAnalyzer_cfi.z0
z0
Definition:
HLTMuonOfflineAnalyzer_cfi.py:98
multiplicitycorr_cfi.yMax
yMax
Definition:
multiplicitycorr_cfi.py:6
fftjetcms::EtaDependentPileup::etaMin_
double etaMin_
Definition:
EtaDependentPileup.h:31
fftjetcms::EtaDependentPileup::etaMax_
double etaMax_
Definition:
EtaDependentPileup.h:32
edmLumisInFiles.summary
summary
Definition:
edmLumisInFiles.py:39
value
Definition:
value.py:1
multiplicitycorr_cfi.xMax
xMax
Definition:
multiplicitycorr_cfi.py:5
fftjetcms::EtaDependentPileup::rhoMax_
double rhoMax_
Definition:
EtaDependentPileup.h:34
fftjetcms::EtaDependentPileup::interp_
fftjet::LinearInterpolator2d interp_
Definition:
EtaDependentPileup.h:28
fftjetcms::EtaDependentPileup::operator()
double operator()(double eta, double phi, const reco::FFTJetPileupSummary &summary) const override
Definition:
EtaDependentPileup.cc:26
Generated for CMSSW Reference Manual by
1.8.16