39 #define init_param(type, varname) varname(ps.getParameter<type>(#varname))
41 using namespace fftjetcms;
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 - 1U) {
193 return std::make_unique<reco::FFTJetPileupSummary>(curve, pileupRho, rhoUncert, uncertaintyCode);
206 const int uncertaintyCode = round((*uz)(&curve, 1U));
208 return std::make_unique<reco::FFTJetPileupSummary>(curve, pileupRho, rhoUncert, uncertaintyCode);
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
void produce(edm::Event &, const edm::EventSetup &) override
FFTJetPileupEstimator()=delete
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
unsigned nEtaBins() const
std::string calibTableRecord
std::unique_ptr< reco::FFTJetPileupSummary > calibrateFromDB(double uncalibrated, const edm::EventSetup &iSetup) const
static std::string const input
edm::EDGetTokenT< reco::DiscretizedEnergyFlow > inputToken
const double * data() const
std::unique_ptr< fftjet::Functor1< double, double > > calibrationCurve
unsigned nPhiBins() const
std::vector< double > uncertaintyZones
std::unique_ptr< fftjet::Functor1< double, double > > fftjet_Function_parser(const edm::ParameterSet &ps)
std::string calibTableCategory
T getParameter(std::string const &) const
std::string uncertaintyZonesName
std::string calibrationCurveName
std::string uncertaintyCurveName
~FFTJetPileupEstimator() override
std::unique_ptr< fftjet::Functor1< double, double > > uncertaintyCurve
std::unique_ptr< reco::FFTJetPileupSummary > calibrateFromConfig(double uncalibrated) const
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)