|
|
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"
72 typedef fftjet::SparseClusteringTree<fftjet::Peak, long>
SparseTree;
73 typedef fftjet::ClusteringSequencer<Real>
Sequencer;
74 typedef fftjet::ClusteringTreeSparsifier<fftjet::Peak, long>
Sparsifier;
79 void endJob()
override;
104 std::unique_ptr<fftjet::AbsFrequencyKernel>
kernel2d;
105 std::unique_ptr<fftjet::AbsFrequencyKernel1d>
etaKernel;
106 std::unique_ptr<fftjet::AbsFrequencyKernel1d>
phiKernel;
109 std::unique_ptr<fftjet::AbsConvolverBase<Real> >
convolver;
115 std::unique_ptr<fftjet::AbsDistanceCalculator<fftjet::Peak> >
distanceCalc;
154 clusteringTree(nullptr),
164 produces<reco::PattRecoTree<float, reco::PattRecoPeak<float> > >(
outputLabel);
166 produces<reco::PattRecoTree<double, reco::PattRecoPeak<double> > >(
outputLabel);
169 produces<reco::DiscretizedEnergyFlow>(
outputLabel);
178 <<
"FFTJetPatRecoProducer failed to open file " <<
externalGridFile << std::endl;
183 <<
"FFTJetPatRecoProducer is not configured to produce anything" << std::endl;
201 std::unique_ptr<std::vector<double> > iniScales =
209 throw cms::Exception(
"FFTJetBadConfig") <<
"bad adaptive ratio logarithm limit" << std::endl;
215 const unsigned nscales = iniScales->size();
216 for (
unsigned i = 0;
i < nscales; ++
i)
217 if (
cs >= (*iniScales)[
i])
218 throw cms::Exception(
"FFTJetBadConfig") <<
"incompatible scale for complete event" << std::endl;
248 throw cms::Exception(
"FFTJetBadConfig") <<
"invalid number of eta-dependent scale factors" << std::endl;
254 throw cms::Exception(
"FFTJetBadConfig") <<
"invalid kernel scale" << std::endl;
275 kernel2d = std::unique_ptr<fftjet::AbsFrequencyKernel>(
279 convolver = std::unique_ptr<fftjet::AbsConvolverBase<Real> >(
new fftjet::FrequencyKernelConvolver<Real, Complex>(
294 convolver = std::unique_ptr<fftjet::AbsConvolverBase<Real> >(
295 new fftjet::FrequencySequentialConvolver<Real, Complex>(
engine.get(),
309 throw cms::Exception(
"FFTJetBadConfig") <<
"invalid peak finder eta cut" << std::endl;
310 const double maxMagnitude = ps.
getParameter<
double>(
"peakFinderMaxMagnitude");
317 return fftjet::PeakFinder(maxMagnitude,
true,
minBin,
maxBin);
330 template <
class Real>
334 auto tree = std::make_unique<StoredTree>();
341 const std::vector<double>& scalesUsed(
sequencer->getInitialScales());
344 throw cms::Exception(
"FFTJetInterface") <<
"Data conversion failed for sparse clustering tree" << std::endl;
350 template <
class Real>
354 auto tree = std::make_unique<StoredTree>();
361 const std::vector<double>& scalesUsed(
sequencer->getInitialScales());
364 throw cms::Exception(
"FFTJetInterface") <<
"Data conversion failed for dense clustering tree" << std::endl;
389 buildSparseProduct<float>(
iEvent);
391 buildSparseProduct<double>(
iEvent);
394 buildDenseProduct<float>(
iEvent);
396 buildDenseProduct<double>(
iEvent);
403 auto flow = std::make_unique<reco::DiscretizedEnergyFlow>(
404 g.data(),
g.title(),
g.etaMin(),
g.etaMax(),
g.phiBin0Edge(),
g.nEta(),
g.nPhi());
407 fftjet::Grid2d<Real>
check(
423 <<
"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