24 #include "fftjet/FrequencyKernelConvolver.hh" 25 #include "fftjet/DiscreteGauss2d.hh" 26 #include "fftjet/EquidistantSequence.hh" 27 #include "fftjet/interpolate.hh" 74 std::unique_ptr<fftjet::AbsFrequencyKernel>
kernel2d;
77 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);
179 throw cms::Exception(
"FFTJetBadConfig") <<
"invalid kernel scales" << std::endl;
183 throw cms::Exception(
"FFTJetBadConfig") <<
"invalid convolver bin range" << std::endl;
193 kernel2d = std::unique_ptr<fftjet::AbsFrequencyKernel>(
197 convolver = std::unique_ptr<fftjet::AbsConvolverBase<Real>>(
new fftjet::FrequencyKernelConvolver<Real, Complex>(
214 double densityAfterMixing = -1.0;
222 const double* scales = &(*filterScales)[0];
234 for (
unsigned iscale = 0; iscale <
nScales; ++iscale) {
250 const double dindex =
q * (dataLen - 1
U);
251 const unsigned ilow =
static_cast<unsigned>(std::floor(dindex));
252 const double percentile =
253 fftjet::lin_interpolate_1d(ilow, ilow + 1
U, sortData[ilow], sortData[ilow + 1
U], dindex);
262 iEvent.put(std::make_unique<reco::DiscretizedEnergyFlow>(
266 iEvent.put(std::make_unique<std::pair<double, double>>(densityBeforeMixing, densityAfterMixing),
outputLabel);
276 throw cms::Exception(
"FFTJetBadConfig") <<
"ERROR in FFTJetPileupProcessor::mixExtraGrid():" 277 " failed to open external grid file " 281 const fftjet::Grid2d<float>*
g =
nullptr;
282 const unsigned maxFail = 100
U;
283 unsigned nEnergyRejected = 0;
294 throw cms::Exception(
"FFTJetBadConfig") <<
"ERROR in FFTJetPileupProcessor::mixExtraGrid():" 295 " failed to open external grid file " 304 if (++nEnergyRejected >= maxFail)
305 throw cms::Exception(
"FFTJetBadConfig") <<
"ERROR in FFTJetPileupProcessor::mixExtraGrid():" 306 " too many grids in a row (" 307 << nEnergyRejected <<
") failed the maximum energy cut" << std::endl;
316 throw cms::Exception(
"FFTJetBadConfig") <<
"ERROR in FFTJetPileupProcessor::mixExtraGrid():" 317 " no valid grid records found"
edm::ESHandle< DataType > load(const std::string &record, const edm::EventSetup &iSetup) const
std::unique_ptr< fftjet::AbsConvolverBase< Real > > convolver
std::vector< std::string > externalGridFiles
T getParameter(std::string const &) const
std::string flatteningTableRecord
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)
void acquireToken(const std::string &record, edm::ConsumesCollector iC)
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
FFTJetLookupTableSequenceLoader esLoader
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
#define DEFINE_FWK_MODULE(type)
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.
void add_Grid2d_data(fftjet::Grid2d< F2 > *to, const fftjet::Grid2d< F1 > &from)
const std::string outputLabel
std::unique_ptr< fftjet::AbsFrequencyKernel > kernel2d