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);
T getParameter(std::string const &) const
void produce(edm::Event &, const edm::EventSetup &) override
FFTJetPileupEstimator()=delete
#define DEFINE_FWK_MODULE(type)
std::string calibTableRecord
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
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.
static const Mapper & instance()
#define init_param(type, varname)
void checkConfig(const Ptr &ptr, const char *message)