|
|
Go to the documentation of this file.
23 #include "fftjet/ProximityClusteringTree.hh"
24 #include "fftjet/ClusteringSequencer.hh"
25 #include "fftjet/ClusteringTreeSparsifier.hh"
26 #include "fftjet/FrequencyKernelConvolver.hh"
27 #include "fftjet/FrequencySequentialConvolver.hh"
28 #include "fftjet/DiscreteGauss1d.hh"
29 #include "fftjet/DiscreteGauss2d.hh"
75 typedef fftjet::SparseClusteringTree<fftjet::Peak, long>
SparseTree;
76 typedef fftjet::ClusteringSequencer<Real>
Sequencer;
77 typedef fftjet::ClusteringTreeSparsifier<fftjet::Peak, long>
Sparsifier;
82 void endJob()
override;
107 std::unique_ptr<fftjet::AbsFrequencyKernel>
kernel2d;
108 std::unique_ptr<fftjet::AbsFrequencyKernel1d>
etaKernel;
109 std::unique_ptr<fftjet::AbsFrequencyKernel1d>
phiKernel;
112 std::unique_ptr<fftjet::AbsConvolverBase<Real> >
convolver;
118 std::unique_ptr<fftjet::AbsDistanceCalculator<fftjet::Peak> >
distanceCalc;
153 clusteringTree(nullptr),
163 produces<reco::PattRecoTree<float, reco::PattRecoPeak<float> > >(
outputLabel);
165 produces<reco::PattRecoTree<double, reco::PattRecoPeak<double> > >(
outputLabel);
168 produces<reco::DiscretizedEnergyFlow>(
outputLabel);
177 <<
"FFTJetPatRecoProducer failed to open file " <<
externalGridFile << std::endl;
182 <<
"FFTJetPatRecoProducer is not configured to produce anything" << std::endl;
200 std::unique_ptr<std::vector<double> > iniScales =
208 throw cms::Exception(
"FFTJetBadConfig") <<
"bad adaptive ratio logarithm limit" << std::endl;
214 const unsigned nscales = iniScales->size();
215 for (
unsigned i = 0;
i < nscales; ++
i)
216 if (
cs >= (*iniScales)[
i])
217 throw cms::Exception(
"FFTJetBadConfig") <<
"incompatible scale for complete event" << std::endl;
247 throw cms::Exception(
"FFTJetBadConfig") <<
"invalid number of eta-dependent scale factors" << std::endl;
253 throw cms::Exception(
"FFTJetBadConfig") <<
"invalid kernel scale" << std::endl;
274 kernel2d = std::unique_ptr<fftjet::AbsFrequencyKernel>(
278 convolver = std::unique_ptr<fftjet::AbsConvolverBase<Real> >(
new fftjet::FrequencyKernelConvolver<Real, Complex>(
293 convolver = std::unique_ptr<fftjet::AbsConvolverBase<Real> >(
294 new fftjet::FrequencySequentialConvolver<Real, Complex>(
engine.get(),
308 throw cms::Exception(
"FFTJetBadConfig") <<
"invalid peak finder eta cut" << std::endl;
309 const double maxMagnitude = ps.
getParameter<
double>(
"peakFinderMaxMagnitude");
316 return fftjet::PeakFinder(maxMagnitude,
true,
minBin,
maxBin);
329 template <
class Real>
333 auto tree = std::make_unique<StoredTree>();
340 const std::vector<double>& scalesUsed(
sequencer->getInitialScales());
343 throw cms::Exception(
"FFTJetInterface") <<
"Data conversion failed for sparse clustering tree" << std::endl;
349 template <
class Real>
353 auto tree = std::make_unique<StoredTree>();
360 const std::vector<double>& scalesUsed(
sequencer->getInitialScales());
363 throw cms::Exception(
"FFTJetInterface") <<
"Data conversion failed for dense clustering tree" << std::endl;
388 buildSparseProduct<float>(
iEvent);
390 buildSparseProduct<double>(
iEvent);
393 buildDenseProduct<float>(
iEvent);
395 buildDenseProduct<double>(
iEvent);
402 auto flow = std::make_unique<reco::DiscretizedEnergyFlow>(
403 g.data(),
g.title(),
g.etaMin(),
g.etaMax(),
g.phiBin0Edge(),
g.nEta(),
g.nPhi());
406 fftjet::Grid2d<Real>
check(
422 <<
"Failed to write grid data into an external file" << std::endl;
void densePeakTreeToStorable(const fftjet::AbsClusteringTree< fftjet::Peak, long > &in, bool writeOutScaleInfo, reco::PattRecoTree< Real, reco::PattRecoPeak< Real > > *out)
constexpr unsigned int minBin
void buildDenseProduct(edm::Event &) const
std::unique_ptr< fftjet::AbsFrequencyKernel1d > phiKernel
void checkConfig(const Ptr &ptr, const char *message)
void loadInputCollection(const edm::Event &)
std::unique_ptr< MyFFTEngine > engine
const std::string outputLabel
unique_ptr< ClusterSequence > cs
const double completeEventDataCutoff
void produce(edm::Event &, const edm::EventSetup &) override
std::unique_ptr< std::vector< double > > fftjet_ScaleSet_parser(const edm::ParameterSet &ps)
const bool verifyDataConversion
std::unique_ptr< fftjet::AbsDistanceCalculator< fftjet::Peak > > distanceCalc
double getEventScale() const
FFTJetPatRecoProducer()=delete
fftjet::PeakFinder buildPeakFinder(const edm::ParameterSet &)
void buildSparseProduct(edm::Event &) const
void densePeakTreeFromStorable(const reco::PattRecoTree< Real, reco::PattRecoPeak< Real > > &in, const std::vector< double > *scaleSetIfNotAdaptive, double completeEventScale, fftjet::AbsClusteringTree< fftjet::Peak, long > *out)
~FFTJetPatRecoProducer() override
std::unique_ptr< fftjet::AbsFrequencyKernel > kernel2d
#define DEFINE_FWK_MODULE(type)
fftjet::ClusteringSequencer< Real > Sequencer
std::unique_ptr< fftjet::AbsFrequencyKernel1d > etaKernel
fftjet::SparseClusteringTree< fftjet::Peak, long > SparseTree
std::unique_ptr< fftjet::AbsConvolverBase< Real > > convolver
fftjet::ProximityClusteringTree< fftjet::Peak, long > ClusteringTree
void sparsePeakTreeToStorable(const fftjet::SparseClusteringTree< fftjet::Peak, long > &in, bool writeOutScaleInfo, reco::PattRecoTree< Real, reco::PattRecoPeak< Real > > *out)
void sparsePeakTreeFromStorable(const reco::PattRecoTree< Real, reco::PattRecoPeak< Real > > &in, const std::vector< double > *scaleSetIfNotAdaptive, double completeEventScale, fftjet::SparseClusteringTree< fftjet::Peak, long > *out)
ClusteringTree * clusteringTree
std::unique_ptr< fftjet::ClusteringTreeSparsifier< fftjet::Peak, long > > fftjet_ClusteringTreeSparsifier_parser(const edm::ParameterSet &ps)
void buildKernelConvolver(const edm::ParameterSet &)
Class for storing FFTJet sparse clustering trees.
std::unique_ptr< fftjet::Functor1< bool, fftjet::Peak > > peakSelector
fftjet::Grid2d< float > * extGrid
bool storeGridsExternally
std::unique_ptr< MyFFTEngine > anotherEngine
constexpr unsigned int maxBin
std::unique_ptr< fftjet::Grid2d< fftjetcms::Real > > energyFlow
const bool makeClusteringTree
std::unique_ptr< Sequencer > sequencer
bool storeInSinglePrecision() const
const bool storeDiscretizationGrid
std::unique_ptr< fftjet::Grid2d< Real > > fftjet_Grid2d_parser(const edm::ParameterSet &ps)
void copy_Grid2d_data(fftjet::Grid2d< F2 > *to, const fftjet::Grid2d< F1 > &from)
std::unique_ptr< Sparsifier > sparsifier
fftjet::ClusteringTreeSparsifier< fftjet::Peak, long > Sparsifier
std::ofstream externalGridStream
fftjet::Grid2d< float > * convert_Grid2d_to_float(const fftjet::Grid2d< Numeric > &grid)
T getParameter(std::string const &) const
void discretizeEnergyFlow()
std::unique_ptr< fftjet::AbsDistanceCalculator< fftjet::Peak > > fftjet_DistanceCalculator_parser(const edm::ParameterSet &ps)
std::unique_ptr< fftjet::Functor1< bool, fftjet::Peak > > fftjet_PeakSelector_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