39 #define init_param(type, varname) varname(ps.getParameter<type>(#varname))
58 void endJob()
override;
61 std::unique_ptr<reco::FFTJetPileupSummary> calibrateFromConfig(
double uncalibrated)
const;
63 std::unique_ptr<reco::FFTJetPileupSummary> calibrateFromDB(
double uncalibrated,
const edm::EventSetup& iSetup)
const;
66 inline void checkConfig(
const Ptr& ptr,
const char* message) {
67 if (ptr.get() ==
nullptr)
142 const unsigned nScales =
h.nEtaBins();
143 const unsigned nCdfvalues =
h.nPhiBins();
145 const unsigned fixedCdfvalueBin = static_cast<unsigned>(std::floor(
cdfvalue * nCdfvalues));
146 if (fixedCdfvalueBin >= nCdfvalues) {
147 throw cms::Exception(
"FFTJetBadConfig") <<
"Bad cdf value" << std::endl;
150 throw cms::Exception(
"FFTJetBadConfig") <<
"Bad filter number" << std::endl;
154 const double curve =
h.data()[
filterNumber * nCdfvalues + fixedCdfvalueBin];
156 std::unique_ptr<reco::FFTJetPileupSummary>
summary;
178 int uncertaintyCode = -1;
181 for (
unsigned i = 0;
i < nZones; ++
i)
183 if (
i == nZones - 1
U) {
193 return std::make_unique<reco::FFTJetPileupSummary>(curve, pileupRho, rhoUncert, uncertaintyCode);
206 const int uncertaintyCode = round((*uz)(&curve, 1
U));
208 return std::make_unique<reco::FFTJetPileupSummary>(curve, pileupRho, rhoUncert, uncertaintyCode);