39 #define init_param(type, varname) varname(ps.getParameter<type>(#varname)) 59 std::unique_ptr<reco::FFTJetPileupSummary> calibrateFromConfig(
double uncalibrated)
const;
61 std::unique_ptr<reco::FFTJetPileupSummary> calibrateFromDB(
double uncalibrated,
const edm::EventSetup& iSetup)
const;
64 inline void checkConfig(
const Ptr& ptr,
const char* message) {
65 if (ptr.get() ==
nullptr)
144 const unsigned nScales =
h.nEtaBins();
145 const unsigned nCdfvalues =
h.nPhiBins();
147 const unsigned fixedCdfvalueBin =
static_cast<unsigned>(std::floor(
cdfvalue * nCdfvalues));
148 if (fixedCdfvalueBin >= nCdfvalues) {
149 throw cms::Exception(
"FFTJetBadConfig") <<
"Bad cdf value" << std::endl;
152 throw cms::Exception(
"FFTJetBadConfig") <<
"Bad filter number" << std::endl;
156 const double curve =
h.data()[
filterNumber * nCdfvalues + fixedCdfvalueBin];
158 std::unique_ptr<reco::FFTJetPileupSummary>
summary;
176 int uncertaintyCode = -1;
179 for (
unsigned i = 0;
i < nZones; ++
i)
181 if (
i == nZones - 1
U) {
191 return std::make_unique<reco::FFTJetPileupSummary>(curve, pileupRho, rhoUncert, uncertaintyCode);
203 const int uncertaintyCode = round((*uz)(&curve, 1
U));
205 return std::make_unique<reco::FFTJetPileupSummary>(curve, pileupRho, rhoUncert, uncertaintyCode);
edm::ESHandle< DataType > load(const std::string &record, const edm::EventSetup &iSetup) const
T getParameter(std::string const &) const
void produce(edm::Event &, const edm::EventSetup &) override
FFTJetPileupEstimator()=delete
FFTJetLookupTableSequenceLoader esLoader
std::string calibTableRecord
void acquireToken(const std::string &record, edm::ConsumesCollector iC)
std::unique_ptr< reco::FFTJetPileupSummary > calibrateFromConfig(double uncalibrated) const
static std::string const input
edm::EDGetTokenT< reco::DiscretizedEnergyFlow > inputToken
std::unique_ptr< fftjet::Functor1< double, double > > calibrationCurve
std::vector< double > uncertaintyZones
#define DEFINE_FWK_MODULE(type)
std::unique_ptr< fftjet::Functor1< double, double > > fftjet_Function_parser(const edm::ParameterSet &ps)
std::string calibTableCategory
std::string uncertaintyZonesName
std::unique_ptr< reco::FFTJetPileupSummary > calibrateFromDB(double uncalibrated, const edm::EventSetup &iSetup) const
std::string calibrationCurveName
std::string uncertaintyCurveName
~FFTJetPileupEstimator() override
std::unique_ptr< fftjet::Functor1< double, double > > uncertaintyCurve
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
#define init_param(type, varname)
void checkConfig(const Ptr &ptr, const char *message)