24 #include "fftjet/FrequencyKernelConvolver.hh" 25 #include "fftjet/DiscreteGauss2d.hh" 26 #include "fftjet/EquidistantSequence.hh" 27 #include "fftjet/interpolate.hh" 65 void endJob()
override;
76 std::unique_ptr<fftjet::AbsFrequencyKernel>
kernel2d;
79 std::unique_ptr<fftjet::AbsConvolverBase<Real>>
convolver;
126 nPercentiles(ps.getParameter<unsigned>(
"nPercentiles")),
142 convolvedFlow = std::make_unique<fftjet::Grid2d<fftjetcms::Real>>(*energyFlow);
147 throw cms::Exception(
"FFTJetBadConfig") <<
"ERROR in FFTJetPileupProcessor constructor:" 148 " number of elements in the \"etaFlatteningFactors\"" 149 " vector is inconsistent with the discretization grid binning" 162 throw cms::Exception(
"FFTJetBadConfig") <<
"invalid filter scales" << std::endl;
168 produces<reco::DiscretizedEnergyFlow>(
outputLabel);
177 throw cms::Exception(
"FFTJetBadConfig") <<
"invalid kernel scales" << std::endl;
181 throw cms::Exception(
"FFTJetBadConfig") <<
"invalid convolver bin range" << std::endl;
191 kernel2d = std::unique_ptr<fftjet::AbsFrequencyKernel>(
195 convolver = std::unique_ptr<fftjet::AbsConvolverBase<Real>>(
new fftjet::FrequencyKernelConvolver<Real, Complex>(
212 double densityAfterMixing = -1.0;
220 const double* scales = &(*filterScales)[0];
232 for (
unsigned iscale = 0; iscale <
nScales; ++iscale) {
248 const double dindex =
q * (dataLen - 1
U);
249 const unsigned ilow =
static_cast<unsigned>(std::floor(dindex));
250 const double percentile =
251 fftjet::lin_interpolate_1d(ilow, ilow + 1
U, sortData[ilow], sortData[ilow + 1
U], dindex);
260 iEvent.put(std::make_unique<reco::DiscretizedEnergyFlow>(
264 iEvent.put(std::make_unique<std::pair<double, double>>(densityBeforeMixing, densityAfterMixing),
outputLabel);
274 throw cms::Exception(
"FFTJetBadConfig") <<
"ERROR in FFTJetPileupProcessor::mixExtraGrid():" 275 " failed to open external grid file " 279 const fftjet::Grid2d<float>*
g =
nullptr;
280 const unsigned maxFail = 100
U;
281 unsigned nEnergyRejected = 0;
292 throw cms::Exception(
"FFTJetBadConfig") <<
"ERROR in FFTJetPileupProcessor::mixExtraGrid():" 293 " failed to open external grid file " 302 if (++nEnergyRejected >= maxFail)
303 throw cms::Exception(
"FFTJetBadConfig") <<
"ERROR in FFTJetPileupProcessor::mixExtraGrid():" 304 " too many grids in a row (" 305 << nEnergyRejected <<
") failed the maximum energy cut" << std::endl;
314 throw cms::Exception(
"FFTJetBadConfig") <<
"ERROR in FFTJetPileupProcessor::mixExtraGrid():" 315 " no valid grid records found"
std::unique_ptr< fftjet::AbsConvolverBase< Real > > convolver
std::vector< std::string > externalGridFiles
T getParameter(std::string const &) const
std::string flatteningTableRecord
#define DEFINE_FWK_MODULE(type)
void loadInputCollection(const edm::Event &)
void checkConfig(const Ptr &ptr, const char *message)
std::unique_ptr< fftjet::Grid2d< Real > > fftjet_Grid2d_parser(const edm::ParameterSet &ps)
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e g
loadFlatteningFactorsFromDB
std::string flatteningTableCategory
FFTJetPileupProcessor()=delete
std::unique_ptr< fftjet::Grid2d< fftjetcms::Real > > convolvedFlow
std::vector< double > percentileData
std::unique_ptr< fftjet::Grid2d< fftjetcms::Real > > energyFlow
~FFTJetPileupProcessor() override
std::unique_ptr< fftjet::EquidistantInLogSpace > filterScales
std::unique_ptr< MyFFTEngine > engine
void buildKernelConvolver(const edm::ParameterSet &)
std::vector< double > etaFlatteningFactors
void loadFlatteningFactors(const edm::EventSetup &iSetup)
std::string flatteningTableName
void produce(edm::Event &, const edm::EventSetup &) override
double externalGridMaxEnergy
void discretizeEnergyFlow()
bool loadFlatteningFactorsFromDB
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
static const Mapper & instance()
void add_Grid2d_data(fftjet::Grid2d< F2 > *to, const fftjet::Grid2d< F1 > &from)
const std::string outputLabel
std::unique_ptr< fftjet::AbsFrequencyKernel > kernel2d