39 #define init_param(type, varname) varname(ps.getParameter<type>(#varname))
55 void endJob()
override;
62 std::unique_ptr<reco::FFTJetPileupSummary> calibrateFromConfig(
double uncalibrated)
const;
64 std::unique_ptr<reco::FFTJetPileupSummary> calibrateFromDB(
double uncalibrated,
const edm::EventSetup& iSetup)
const;
67 inline void checkConfig(
const Ptr& ptr,
const char* message) {
68 if (ptr.get() ==
nullptr)
143 const unsigned nScales =
h.nEtaBins();
144 const unsigned nCdfvalues =
h.nPhiBins();
146 const unsigned fixedCdfvalueBin = static_cast<unsigned>(std::floor(
cdfvalue * nCdfvalues));
147 if (fixedCdfvalueBin >= nCdfvalues) {
148 throw cms::Exception(
"FFTJetBadConfig") <<
"Bad cdf value" << std::endl;
151 throw cms::Exception(
"FFTJetBadConfig") <<
"Bad filter number" << std::endl;
155 const double curve =
h.data()[
filterNumber * nCdfvalues + fixedCdfvalueBin];
157 std::unique_ptr<reco::FFTJetPileupSummary>
summary;
179 int uncertaintyCode = -1;
182 for (
unsigned i = 0;
i < nZones; ++
i)
184 if (
i == nZones - 1
U) {
194 return std::make_unique<reco::FFTJetPileupSummary>(curve, pileupRho, rhoUncert, uncertaintyCode);
207 const int uncertaintyCode = round((*uz)(&curve, 1
U));
209 return std::make_unique<reco::FFTJetPileupSummary>(curve, pileupRho, rhoUncert, uncertaintyCode);