22 #include "fftjet/FrequencyKernelConvolver.hh" 23 #include "fftjet/DiscreteGauss2d.hh" 24 #include "fftjet/EquidistantSequence.hh" 25 #include "fftjet/interpolate.hh" 26 #include "fftjet/FrequencyKernelConvolver.hh" 27 #include "fftjet/FrequencySequentialConvolver.hh" 28 #include "fftjet/DiscreteGauss1d.hh" 29 #include "fftjet/DiscreteGauss2d.hh" 60 void endJob()
override ;
80 std::unique_ptr<fftjet::AbsFrequencyKernel>
kernel2d;
81 std::unique_ptr<fftjet::AbsFrequencyKernel1d>
etaKernel;
82 std::unique_ptr<fftjet::AbsFrequencyKernel1d>
phiKernel;
85 std::unique_ptr<fftjet::AbsConvolverBase<Real> >
convolver;
99 scalePower(ps.getParameter<double>(
"scalePower")),
108 convolvedFlow = std::unique_ptr<fftjet::Grid2d<fftjetcms::Real> >(
109 new fftjet::Grid2d<fftjetcms::Real>(*energyFlow));
130 ps.
getParameter<std::vector<double> >(
"etaDependentScaleFactors"));
133 const bool use2dKernel = etaDependentScaleFactors.empty();
135 if (etaDependentScaleFactors.size() !=
energyFlow->nEta())
137 <<
"invalid number of eta-dependent scale factors" 143 if (kernelEtaScale <= 0.0 || kernelPhiScale <= 0.0)
145 <<
"invalid kernel scale" << std::endl;
156 if (fixEfficiency || !use2dKernel)
158 convolverMinBin = ps.
getParameter<
unsigned>(
"convolverMinBin");
165 engine = std::unique_ptr<MyFFTEngine>(
169 kernel2d = std::unique_ptr<fftjet::AbsFrequencyKernel>(
170 new fftjet::DiscreteGauss2d(
171 kernelEtaScale, kernelPhiScale,
175 convolver = std::unique_ptr<fftjet::AbsConvolverBase<Real> >(
176 new fftjet::FrequencyKernelConvolver<Real,Complex>(
183 engine = std::unique_ptr<MyFFTEngine>(
189 etaKernel = std::unique_ptr<fftjet::AbsFrequencyKernel1d>(
190 new fftjet::DiscreteGauss1d(kernelEtaScale,
energyFlow->nEta()));
192 phiKernel = std::unique_ptr<fftjet::AbsFrequencyKernel1d>(
193 new fftjet::DiscreteGauss1d(kernelPhiScale,
energyFlow->nPhi()));
196 convolver = std::unique_ptr<fftjet::AbsConvolverBase<Real> >(
197 new fftjet::FrequencySequentialConvolver<Real,Complex>(
221 const double* scales = &(*iniScales)[0];
223 const unsigned nEta = g.nEta();
224 const unsigned nPhi = g.nPhi();
225 const double bin0edge = g.phiBin0Edge();
228 auto pTable = std::make_unique<TH3F>(
229 "FFTJetEFlowSmoother",
"FFTJetEFlowSmoother",
230 nScales+1
U, -1.5, nScales-0.5,
231 nEta, g.etaMin(), g.etaMax(),
233 TH3F*
h = pTable.get();
234 h->SetDirectory(
nullptr);
235 h->GetXaxis()->SetTitle(
"Scale");
236 h->GetYaxis()->SetTitle(
"Eta");
237 h->GetZaxis()->SetTitle(
"Phi");
241 for (
unsigned ieta=0; ieta<
nEta; ++ieta)
242 for (
unsigned iphi=0; iphi<
nPhi; ++iphi)
243 h->SetBinContent(1U, ieta+1U, iphi+1U,
244 factor*g.binValue(ieta, iphi));
248 for (
unsigned iscale=0; iscale<
nScales; ++iscale)
254 scales[iscale], convData,
258 for (
unsigned ieta=0; ieta<
nEta; ++ieta)
260 const Real* etaData = convData + ieta*
nPhi;
261 for (
unsigned iphi=0; iphi<
nPhi; ++iphi)
262 h->SetBinContent(iscale+2U, ieta+1U, iphi+1U,
263 factor*etaData[iphi]);
std::unique_ptr< MyFFTEngine > engine
T getParameter(std::string const &) const
std::unique_ptr< fftjet::AbsFrequencyKernel1d > etaKernel
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
std::unique_ptr< fftjet::AbsConvolverBase< Real > > convolver
#define DEFINE_FWK_MODULE(type)
void loadInputCollection(const edm::Event &)
std::unique_ptr< MyFFTEngine > anotherEngine
FFTJetEFlowSmoother()=delete
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
double etConversionFactor
double getEventScale() const
std::unique_ptr< std::vector< double > > iniScales
std::unique_ptr< fftjet::Grid2d< fftjetcms::Real > > convolvedFlow
std::unique_ptr< fftjet::Grid2d< fftjetcms::Real > > energyFlow
void produce(edm::Event &, const edm::EventSetup &) override
std::unique_ptr< fftjet::AbsFrequencyKernel > kernel2d
~FFTJetEFlowSmoother() override
void discretizeEnergyFlow()
fftjet::FFTWDoubleEngine MyFFTEngine
void buildKernelConvolver(const edm::ParameterSet &)
std::unique_ptr< fftjet::AbsFrequencyKernel1d > phiKernel
std::unique_ptr< std::vector< double > > fftjet_ScaleSet_parser(const edm::ParameterSet &ps)
const std::string outputLabel
Power< A, B >::type pow(const A &a, const B &b)