23 #include "fftjet/FrequencyKernelConvolver.hh"
24 #include "fftjet/DiscreteGauss2d.hh"
25 #include "fftjet/EquidistantSequence.hh"
26 #include "fftjet/interpolate.hh"
27 #include "fftjet/FrequencyKernelConvolver.hh"
28 #include "fftjet/FrequencySequentialConvolver.hh"
29 #include "fftjet/DiscreteGauss1d.hh"
30 #include "fftjet/DiscreteGauss2d.hh"
48 using namespace fftjetcms;
83 std::auto_ptr<fftjet::AbsFrequencyKernel>
kernel2d;
84 std::auto_ptr<fftjet::AbsFrequencyKernel1d>
etaKernel;
85 std::auto_ptr<fftjet::AbsFrequencyKernel1d>
phiKernel;
88 std::auto_ptr<fftjet::AbsConvolverBase<Real> >
convolver;
102 scalePower(ps.getParameter<double>(
"scalePower")),
103 etConversionFactor(ps.getParameter<double>(
"etConversionFactor"))
111 convolvedFlow = std::auto_ptr<fftjet::Grid2d<fftjetcms::Real> >(
112 new fftjet::Grid2d<fftjetcms::Real>(*energyFlow));
132 const std::vector<double> etaDependentScaleFactors(
133 ps.
getParameter<std::vector<double> >(
"etaDependentScaleFactors"));
136 const bool use2dKernel = etaDependentScaleFactors.empty();
138 if (etaDependentScaleFactors.size() !=
energyFlow->nEta())
140 <<
"invalid number of eta-dependent scale factors"
144 double kernelEtaScale = ps.
getParameter<
double>(
"kernelEtaScale");
145 const double kernelPhiScale = ps.
getParameter<
double>(
"kernelPhiScale");
146 if (kernelEtaScale <= 0.0 || kernelPhiScale <= 0.0)
148 <<
"invalid kernel scale" << std::endl;
155 const bool fixEfficiency = ps.
getParameter<
bool>(
"fixEfficiency");
158 unsigned convolverMinBin = 0, convolverMaxBin = 0;
159 if (fixEfficiency || !use2dKernel)
161 convolverMinBin = ps.
getParameter<
unsigned>(
"convolverMinBin");
162 convolverMaxBin = ps.
getParameter<
unsigned>(
"convolverMaxBin");
168 engine = std::auto_ptr<MyFFTEngine>(
172 kernel2d = std::auto_ptr<fftjet::AbsFrequencyKernel>(
173 new fftjet::DiscreteGauss2d(
174 kernelEtaScale, kernelPhiScale,
178 convolver = std::auto_ptr<fftjet::AbsConvolverBase<Real> >(
179 new fftjet::FrequencyKernelConvolver<Real,Complex>(
181 convolverMinBin, convolverMaxBin));
186 engine = std::auto_ptr<MyFFTEngine>(
192 etaKernel = std::auto_ptr<fftjet::AbsFrequencyKernel1d>(
193 new fftjet::DiscreteGauss1d(kernelEtaScale,
energyFlow->nEta()));
195 phiKernel = std::auto_ptr<fftjet::AbsFrequencyKernel1d>(
196 new fftjet::DiscreteGauss1d(kernelPhiScale,
energyFlow->nPhi()));
199 convolver = std::auto_ptr<fftjet::AbsConvolverBase<Real> >(
200 new fftjet::FrequencySequentialConvolver<Real,Complex>(
203 etaDependentScaleFactors, convolverMinBin,
204 convolverMaxBin, fixEfficiency));
223 const unsigned nScales =
iniScales->size();
224 const double* scales = &(*iniScales)[0];
226 const unsigned nEta = g.nEta();
227 const unsigned nPhi = g.nPhi();
228 const double bin0edge = g.phiBin0Edge();
231 std::auto_ptr<TH3F> pTable(
232 new TH3F(
"FFTJetEFlowSmoother",
"FFTJetEFlowSmoother",
233 nScales+1U, -1.5, nScales-0.5,
234 nEta, g.etaMin(), g.etaMax(),
235 nPhi, bin0edge, bin0edge+2.0*
M_PI));
236 TH3F*
h = pTable.get();
238 h->GetXaxis()->SetTitle(
"Scale");
239 h->GetYaxis()->SetTitle(
"Eta");
240 h->GetZaxis()->SetTitle(
"Phi");
244 for (
unsigned ieta=0; ieta<nEta; ++ieta)
245 for (
unsigned iphi=0; iphi<nPhi; ++iphi)
246 h->SetBinContent(1U, ieta+1U, iphi+1U,
247 factor*g.binValue(ieta, iphi));
250 convolver->setEventData(g.data(), nEta, nPhi);
251 for (
unsigned iscale=0; iscale<nScales; ++iscale)
257 scales[iscale], convData,
261 for (
unsigned ieta=0; ieta<nEta; ++ieta)
263 const Real* etaData = convData + ieta*nPhi;
264 for (
unsigned iphi=0; iphi<nPhi; ++iphi)
265 h->SetBinContent(iscale+2U, ieta+1U, iphi+1U,
266 factor*etaData[iphi]);
T getParameter(std::string const &) const
std::auto_ptr< fftjet::Grid2d< fftjetcms::Real > > energyFlow
std::auto_ptr< MyFFTEngine > anotherEngine
std::auto_ptr< fftjet::AbsFrequencyKernel1d > etaKernel
std::auto_ptr< fftjet::Grid2d< Real > > fftjet_Grid2d_parser(const edm::ParameterSet &ps)
std::auto_ptr< fftjet::AbsFrequencyKernel1d > phiKernel
#define DEFINE_FWK_MODULE(type)
void loadInputCollection(const edm::Event &)
std::auto_ptr< MyFFTEngine > engine
void checkConfig(const Ptr &ptr, const char *message)
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::auto_ptr< fftjet::AbsFrequencyKernel > kernel2d
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
std::auto_ptr< fftjet::Grid2d< fftjetcms::Real > > convolvedFlow
std::auto_ptr< std::vector< double > > iniScales
void produce(edm::Event &, const edm::EventSetup &)
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
void discretizeEnergyFlow()
fftjet::FFTWDoubleEngine MyFFTEngine
void buildKernelConvolver(const edm::ParameterSet &)
std::auto_ptr< fftjet::AbsConvolverBase< Real > > convolver
const std::string outputLabel
Power< A, B >::type pow(const A &a, const B &b)
std::auto_ptr< std::vector< double > > fftjet_ScaleSet_parser(const edm::ParameterSet &ps)