CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes
FFTJetProducer Class Reference

#include <RecoJets/FFTJetProducers/plugins/FFTJetProducer.h>

Inheritance diagram for FFTJetProducer:
fftjetcms::FFTJetInterface edm::stream::EDProducer<>

Public Types

typedef fftjet::RecombinedJet< fftjetcms::VectorLikeRecoFFTJet
 
enum  Resolution {
  FIXED = 0, MAXIMALLY_STABLE, GLOBALLY_ADAPTIVE, LOCALLY_ADAPTIVE,
  FROM_GENJETS
}
 
typedef fftjet::SparseClusteringTree< fftjet::Peak, long > SparseTree
 
enum  StatusBits {
  RESOLUTION = 0xff, CONSTITUENTS_RESUMMED = 0x100, PILEUP_CALCULATED = 0x200, PILEUP_SUBTRACTED_4VEC = 0x400,
  PILEUP_SUBTRACTED_PT = 0x800
}
 
- Public Types inherited from edm::stream::EDProducer<>
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Public Member Functions

 FFTJetProducer (const edm::ParameterSet &)
 
 FFTJetProducer ()=delete
 
 FFTJetProducer (const FFTJetProducer &)=delete
 
template<class Real >
void loadSparseTreeData (const edm::Event &iEvent, const edm::EDGetTokenT< reco::PattRecoTree< Real, reco::PattRecoPeak< Real > > > &tok)
 
FFTJetProduceroperator= (const FFTJetProducer &)=delete
 
 ~FFTJetProducer () override
 
- Public Member Functions inherited from fftjetcms::FFTJetInterface
 FFTJetInterface ()=delete
 
 FFTJetInterface (const FFTJetInterface &)=delete
 
FFTJetInterfaceoperator= (const FFTJetInterface &)=delete
 
 ~FFTJetInterface () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Static Public Member Functions

static Resolution parse_resolution (const std::string &name)
 

Protected Member Functions

virtual void assignMembershipFunctions (std::vector< fftjet::Peak > *preclusters)
 
void beginStream (edm::StreamID) override
 
virtual void genJetPreclusters (const SparseTree &tree, edm::Event &, const edm::EventSetup &, const fftjet::Functor1< bool, fftjet::Peak > &peakSelector, std::vector< fftjet::Peak > *preclusters)
 
virtual std::unique_ptr< fftjetcms::AbsBgFunctorparse_bgMembershipFunction (const edm::ParameterSet &)
 
virtual std::unique_ptr< fftjet::Functor2< double, RecoFFTJet, RecoFFTJet > > parse_jetDistanceCalc (const edm::ParameterSet &)
 
virtual std::unique_ptr< fftjet::ScaleSpaceKernel > parse_jetMembershipFunction (const edm::ParameterSet &)
 
virtual std::unique_ptr< fftjet::Functor1< double, RecoFFTJet > > parse_memberFactorCalcJet (const edm::ParameterSet &)
 
virtual std::unique_ptr< fftjet::Functor1< double, fftjet::Peak > > parse_memberFactorCalcPeak (const edm::ParameterSet &)
 
virtual std::unique_ptr< fftjet::Functor1< bool, fftjet::Peak > > parse_peakSelector (const edm::ParameterSet &)
 
virtual std::unique_ptr< fftjetcms::AbsPileupCalculatorparse_pileupDensityCalc (const edm::ParameterSet &ps)
 
virtual std::unique_ptr< fftjet::Functor1< double, RecoFFTJet > > parse_recoScaleCalcJet (const edm::ParameterSet &)
 
virtual std::unique_ptr< fftjet::Functor1< double, fftjet::Peak > > parse_recoScaleCalcPeak (const edm::ParameterSet &)
 
virtual std::unique_ptr< fftjet::Functor1< double, RecoFFTJet > > parse_recoScaleRatioCalcJet (const edm::ParameterSet &)
 
virtual std::unique_ptr< fftjet::Functor1< double, fftjet::Peak > > parse_recoScaleRatioCalcPeak (const edm::ParameterSet &)
 
void produce (edm::Event &, const edm::EventSetup &) override
 
virtual void selectPreclusters (const SparseTree &tree, const fftjet::Functor1< bool, fftjet::Peak > &peakSelector, std::vector< fftjet::Peak > *preclusters)
 
void selectTreeNodes (const SparseTree &tree, const fftjet::Functor1< bool, fftjet::Peak > &peakSelect, std::vector< SparseTree::NodeId > *nodes)
 
- Protected Member Functions inherited from fftjetcms::FFTJetInterface
template<class Ptr >
void checkConfig (const Ptr &ptr, const char *message)
 
void discretizeEnergyFlow ()
 
 FFTJetInterface (const edm::ParameterSet &)
 
double getEventScale () const
 
void loadInputCollection (const edm::Event &)
 
bool storeInSinglePrecision () const
 
const reco::Particle::PointvertexUsed () const
 

Private Types

typedef fftjet::AbsRecombinationAlg< fftjetcms::Real, fftjetcms::VectorLike, fftjetcms::BgDataGridAlg
 
typedef fftjet::AbsVectorRecombinationAlg< fftjetcms::VectorLike, fftjetcms::BgDataRecoAlg
 

Private Member Functions

void buildGridAlg ()
 
bool checkConvergence (const std::vector< RecoFFTJet > &previousIterResult, std::vector< RecoFFTJet > &thisIterResult)
 
void determineGriddedConstituents ()
 
void determinePileup ()
 
virtual void determinePileupDensityFromConfig (const edm::Event &iEvent, std::unique_ptr< fftjet::Grid2d< fftjetcms::Real > > &density)
 
virtual void determinePileupDensityFromDB (const edm::Event &iEvent, const edm::EventSetup &iSetup, std::unique_ptr< fftjet::Grid2d< fftjetcms::Real > > &density)
 
void determineVectorConstituents ()
 
unsigned iterateJetReconstruction ()
 
bool loadEnergyFlow (const edm::Event &iEvent, std::unique_ptr< fftjet::Grid2d< fftjetcms::Real > > &flow)
 
template<class Real >
void loadSparseTreeData (const edm::Event &, const edm::EDGetTokenT< reco::PattRecoTree< Real, reco::PattRecoPeak< Real > > > &tok)
 
template<typename Jet >
void makeProduces (const std::string &alias, const std::string &tag)
 
void prepareRecombinationScales ()
 
void removeFakePreclusters ()
 
void saveResults (edm::Event &iEvent, const edm::EventSetup &, unsigned nPreclustersFound)
 
template<typename Jet >
void writeJets (edm::Event &iEvent, const edm::EventSetup &)
 

Static Private Member Functions

static void setJetStatusBit (RecoFFTJet *jet, int mask, bool value)
 

Private Attributes

const bool assignConstituents
 
std::unique_ptr< fftjetcms::AbsBgFunctorbgMembershipFunction
 
const bool calculatePileup
 
std::vector< unsigned > cellCountsVec
 
std::vector< std::vector< reco::CandidatePtr > > constituents
 
const double convergenceDistance
 
std::vector< double > doubleBuf
 
FFTJetLookupTableSequenceLoader esLoader_
 
const double fixedScale
 
const edm::InputTag genJetsLabel
 
edm::ESGetToken< CaloGeometry, CaloGeometryRecordgeometry_token_
 
std::unique_ptr< GridAlggridAlg
 
const double gridScanMaxEta
 
std::unique_ptr< std::vector< double > > iniScales
 
edm::EDGetTokenT< reco::DiscretizedEnergyFlowinput_energyflow_token_
 
edm::EDGetTokenT< std::vector< reco::FFTAnyJet< reco::GenJet > > > input_genjet_token_
 
edm::EDGetTokenT< reco::FFTJetPileupSummaryinput_pusummary_token_
 
edm::EDGetTokenT< reco::PattRecoTree< double, reco::PattRecoPeak< double > > > input_recotree_token_d_
 
edm::EDGetTokenT< reco::PattRecoTree< float, reco::PattRecoPeak< float > > > input_recotree_token_f_
 
const bool isCrisp
 
unsigned iterationsPerformed
 
std::vector< RecoFFTJetiterJets
 
std::vector< fftjet::Peak > iterPreclusters
 
std::unique_ptr< fftjet::Functor2< double, RecoFFTJet, RecoFFTJet > > jetDistanceCalc
 
std::unique_ptr< fftjet::ScaleSpaceKernel > jetMembershipFunction
 
bool loadPileupFromDB
 
const unsigned maxInitialPreclusters
 
const unsigned maxIterations
 
unsigned maxLevel
 
const double maxStableScale
 
std::unique_ptr< fftjet::Functor1< double, RecoFFTJet > > memberFactorCalcJet
 
std::unique_ptr< fftjet::Functor1< double, fftjet::Peak > > memberFactorCalcPeak
 
std::vector< fftjet::AbsKernel2d * > memFcns2dVec
 
unsigned minLevel
 
const double minStableScale
 
const edm::ParameterSet myConfiguration
 
const unsigned nClustersRequested
 
const unsigned nJetsRequiredToConverge
 
std::vector< SparseTree::NodeId > nodes
 
const double noiseLevel
 
std::vector< unsigned > occupancy
 
std::unique_ptr< fftjet::Functor1< bool, fftjet::Peak > > peakSelector
 
std::vector< fftjetcms::VectorLikepileup
 
std::unique_ptr< fftjetcms::AbsPileupCalculatorpileupDensityCalc
 
std::unique_ptr< fftjet::Grid2d< fftjetcms::Real > > pileupEnergyFlow
 
const edm::InputTag pileupLabel
 
std::string pileupTableCategory
 
std::string pileupTableName
 
std::string pileupTableRecord
 
std::vector< fftjet::Peak > preclusters
 
std::unique_ptr< RecoAlgrecoAlg
 
std::vector< RecoFFTJetrecoJets
 
const std::string recombinationAlgorithm
 
const double recombinationDataCutoff
 
std::unique_ptr< fftjet::Functor1< double, RecoFFTJet > > recoScaleCalcJet
 
std::unique_ptr< fftjet::Functor1< double, fftjet::Peak > > recoScaleCalcPeak
 
std::unique_ptr< fftjet::Functor1< double, RecoFFTJet > > recoScaleRatioCalcJet
 
std::unique_ptr< fftjet::Functor1< double, fftjet::Peak > > recoScaleRatioCalcPeak
 
Resolution resolution
 
const bool resumConstituents
 
const bool reuseExistingGrid
 
SparseTree sparseTree
 
const double stabilityAlpha
 
const bool subtractPileup
 
const bool subtractPileupAs4Vec
 
std::vector< double > thresholds
 
edm::ESGetToken< HcalTopology, HcalRecNumberingRecordtopology_token_
 
const edm::InputTag treeLabel
 
fftjetcms::VectorLike unclustered
 
const double unlikelyBgWeight
 
double unused
 
unsigned usedLevel
 
const bool useGriddedAlgorithm
 

Additional Inherited Members

- Protected Attributes inherited from fftjetcms::FFTJetInterface
const AnomalousTower anomalous
 
std::vector< unsigned > candidateIndex
 
const bool doPVCorrection
 
std::unique_ptr< fftjet::Grid2d< fftjetcms::Real > > energyFlow
 
const std::vector< double > etaDependentMagnutideFactors
 
std::vector< fftjetcms::VectorLikeeventData
 
edm::Handle< reco::CandidateViewinputCollection
 
const edm::InputTag inputLabel
 
const JetType jetType
 
const std::string outputLabel
 
const edm::InputTag srcPVs
 

Detailed Description

Description: makes jets using FFTJet clustering tree

Implementation: [Notes on implementation]

Description: makes jets using FFTJet clustering tree

Implementation: If you want to change the jet algorithm functionality (for example, by providing your own jet membership function), derive from this class and override the appropriate parser method (for example, parse_jetMembershipFunction). At the end of your own parser, don't forget to call the parser of the base class in order to get the default behavior when your special configuration is not provided (this is known as the "chain-of-responsibility" design pattern). If you also need to override "beginJob" and/or "produce" methods, the first thing to do in your method is to call the corresponding method of this base.

Definition at line 84 of file FFTJetProducer.h.

Member Typedef Documentation

◆ GridAlg

typedef fftjet::AbsRecombinationAlg<fftjetcms::Real, fftjetcms::VectorLike, fftjetcms::BgData> FFTJetProducer::GridAlg
private

Definition at line 183 of file FFTJetProducer.h.

◆ RecoAlg

typedef fftjet::AbsVectorRecombinationAlg<fftjetcms::VectorLike, fftjetcms::BgData> FFTJetProducer::RecoAlg
private

Definition at line 182 of file FFTJetProducer.h.

◆ RecoFFTJet

typedef fftjet::RecombinedJet<fftjetcms::VectorLike> FFTJetProducer::RecoFFTJet

Definition at line 86 of file FFTJetProducer.h.

◆ SparseTree

typedef fftjet::SparseClusteringTree<fftjet::Peak, long> FFTJetProducer::SparseTree

Definition at line 87 of file FFTJetProducer.h.

Member Enumeration Documentation

◆ Resolution

◆ StatusBits

Enumerator
RESOLUTION 
CONSTITUENTS_RESUMMED 
PILEUP_CALCULATED 
PILEUP_SUBTRACTED_4VEC 
PILEUP_SUBTRACTED_PT 

Definition at line 92 of file FFTJetProducer.h.

Constructor & Destructor Documentation

◆ FFTJetProducer() [1/3]

FFTJetProducer::FFTJetProducer ( const edm::ParameterSet ps)
explicit

Definition at line 116 of file FFTJetProducer.cc.

References DefaultFFTJetRcdMapper< DataType >::acquireToken(), SiStripOfflineCRack_cfg::alias, assignConstituents, fftjetcms::CALOJET, fftjetcms::FFTJetInterface::checkConfig(), deDxTools::esConsumes(), esLoader_, Exception, fftjetcms::fftjet_ScaleSet_parser(), genJetsLabel, geometry_token_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), iniScales, input_energyflow_token_, input_genjet_token_, input_pusummary_token_, input_recotree_token_d_, input_recotree_token_f_, jet_type_switch, fftjetcms::FFTJetInterface::jetType, makeProduces(), fftjetcms::FFTJetInterface::outputLabel, pileupLabel, pileupTableRecord, resumConstituents, jetUpdater_cfi::sort, fftjetcms::FFTJetInterface::storeInSinglePrecision(), AlCaHLTBitMon_QueryRunRegistry::string, topology_token_, and treeLabel.

117  : FFTJetInterface(ps),
118  myConfiguration(ps),
122  init_param(unsigned, maxIterations),
128  init_param(bool, subtractPileup),
131  init_param(double, fixedScale),
132  init_param(double, minStableScale),
133  init_param(double, maxStableScale),
134  init_param(double, stabilityAlpha),
135  init_param(double, noiseLevel),
136  init_param(unsigned, nClustersRequested),
137  init_param(double, gridScanMaxEta),
139  init_param(bool, isCrisp),
140  init_param(double, unlikelyBgWeight),
149 
150  minLevel(0),
151  maxLevel(0),
152  usedLevel(0),
153  unused(0.0),
155  constituents(200) {
156  // Check that the settings make sense
158  throw cms::Exception("FFTJetBadConfig") << "Can't resum constituents if they are not assigned" << std::endl;
159 
160  produces<reco::FFTJetProducerSummary>(outputLabel);
163 
164  if (jetType == CALOJET) {
167  }
168 
169  // Build the set of pattern recognition scales.
170  // This is needed in order to read the clustering tree
171  // from the event record.
173  checkConfig(iniScales, "invalid set of scales");
174  std::sort(iniScales->begin(), iniScales->end(), std::greater<double>());
175 
177  input_recotree_token_f_ = consumes<reco::PattRecoTree<float, reco::PattRecoPeak<float> > >(treeLabel);
178  else
179  input_recotree_token_d_ = consumes<reco::PattRecoTree<double, reco::PattRecoPeak<double> > >(treeLabel);
180  input_genjet_token_ = consumes<std::vector<reco::FFTAnyJet<reco::GenJet> > >(genJetsLabel);
181  input_energyflow_token_ = consumes<reco::DiscretizedEnergyFlow>(treeLabel);
182  input_pusummary_token_ = consumes<reco::FFTJetPileupSummary>(pileupLabel);
183 
184  esLoader_.acquireToken(pileupTableRecord, consumesCollector());
185 
186  // Most of the configuration has to be performed inside
187  // the "beginStream" method. This is because chaining of the
188  // parsers between this base class and the derived classes
189  // can not work from the constructor of the base class.
190 }
std::vector< std::vector< reco::CandidatePtr > > constituents
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
unsigned iterationsPerformed
const bool useGriddedAlgorithm
static Resolution parse_resolution(const std::string &name)
const bool resumConstituents
const double gridScanMaxEta
const std::string recombinationAlgorithm
const double fixedScale
const bool subtractPileupAs4Vec
void checkConfig(const Ptr &ptr, const char *message)
const double unlikelyBgWeight
void makeProduces(const std::string &alias, const std::string &tag)
const bool subtractPileup
const unsigned nJetsRequiredToConverge
Resolution resolution
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > geometry_token_
const bool isCrisp
const double recombinationDataCutoff
void acquireToken(const std::string &record, edm::ConsumesCollector iC)
const double minStableScale
const double maxStableScale
#define init_param(type, varname)
T getUntrackedParameter(std::string const &, T const &) const
const bool reuseExistingGrid
const unsigned nClustersRequested
std::unique_ptr< std::vector< double > > iniScales
edm::EDGetTokenT< reco::PattRecoTree< double, reco::PattRecoPeak< double > > > input_recotree_token_d_
unsigned usedLevel
edm::EDGetTokenT< reco::PattRecoTree< float, reco::PattRecoPeak< float > > > input_recotree_token_f_
const double noiseLevel
std::string pileupTableRecord
std::string pileupTableName
const bool calculatePileup
const bool assignConstituents
const edm::InputTag treeLabel
const edm::InputTag genJetsLabel
const edm::ParameterSet myConfiguration
edm::EDGetTokenT< reco::DiscretizedEnergyFlow > input_energyflow_token_
edm::ESGetToken< HcalTopology, HcalRecNumberingRecord > topology_token_
edm::EDGetTokenT< reco::FFTJetPileupSummary > input_pusummary_token_
const double stabilityAlpha
const unsigned maxInitialPreclusters
std::string pileupTableCategory
const double convergenceDistance
edm::EDGetTokenT< std::vector< reco::FFTAnyJet< reco::GenJet > > > input_genjet_token_
const edm::InputTag pileupLabel
#define jet_type_switch(method, arg1, arg2)
FFTJetLookupTableSequenceLoader esLoader_
std::unique_ptr< std::vector< double > > fftjet_ScaleSet_parser(const edm::ParameterSet &ps)
const std::string outputLabel
const unsigned maxIterations

◆ FFTJetProducer() [2/3]

FFTJetProducer::FFTJetProducer ( )
delete

◆ FFTJetProducer() [3/3]

FFTJetProducer::FFTJetProducer ( const FFTJetProducer )
delete

◆ ~FFTJetProducer()

FFTJetProducer::~FFTJetProducer ( )
override

Definition at line 192 of file FFTJetProducer.cc.

192 {}

Member Function Documentation

◆ assignMembershipFunctions()

void FFTJetProducer::assignMembershipFunctions ( std::vector< fftjet::Peak > *  preclusters)
protectedvirtual

Definition at line 815 of file FFTJetProducer.cc.

Referenced by produce().

815 {}

◆ beginStream()

void FFTJetProducer::beginStream ( edm::StreamID  )
overrideprotected

Definition at line 818 of file FFTJetProducer.cc.

References assignConstituents, bgMembershipFunction, buildGridAlg(), calculatePileup, fftjetcms::FFTJetInterface::checkConfig(), fftjetcms::FFTJetInterface::energyFlow, Exception, fftjetcms::fftjet_Grid2d_parser(), edm::ParameterSet::getParameter(), isCrisp, jetDistanceCalc, jetMembershipFunction, loadPileupFromDB, maxIterations, memberFactorCalcJet, memberFactorCalcPeak, myConfiguration, parse_bgMembershipFunction(), parse_jetDistanceCalc(), parse_jetMembershipFunction(), parse_memberFactorCalcJet(), parse_memberFactorCalcPeak(), parse_peakSelector(), parse_pileupDensityCalc(), parse_recoScaleCalcJet(), parse_recoScaleCalcPeak(), parse_recoScaleRatioCalcJet(), parse_recoScaleRatioCalcPeak(), peakSelector, VtxSmearedParameters_cfi::Phi, pileupDensityCalc, pileupEnergyFlow, recoAlg, recombinationAlgorithm, recoScaleCalcJet, recoScaleCalcPeak, recoScaleRatioCalcJet, recoScaleRatioCalcPeak, reuseExistingGrid, unlikelyBgWeight, and useGriddedAlgorithm.

818  {
820 
821  // Parse the peak selector definition
823  checkConfig(peakSelector, "invalid peak selector");
824 
826  checkConfig(jetMembershipFunction, "invalid jet membership function");
827 
829  checkConfig(bgMembershipFunction, "invalid noise membership function");
830 
831  // Build the energy recombination algorithm
832  if (!useGriddedAlgorithm) {
833  fftjet::DefaultVectorRecombinationAlgFactory<VectorLike, BgData, VBuilder> factory;
834  if (factory[recombinationAlgorithm] == nullptr)
835  throw cms::Exception("FFTJetBadConfig")
836  << "Invalid vector recombination algorithm \"" << recombinationAlgorithm << "\"" << std::endl;
837  recoAlg = std::unique_ptr<RecoAlg>(factory[recombinationAlgorithm]->create(jetMembershipFunction.get(),
838  &VectorLike::Et,
839  &VectorLike::Eta,
841  bgMembershipFunction.get(),
843  isCrisp,
844  false,
846  } else if (!reuseExistingGrid) {
847  energyFlow = fftjet_Grid2d_parser(ps.getParameter<edm::ParameterSet>("GridConfiguration"));
848  checkConfig(energyFlow, "invalid discretization grid");
849  buildGridAlg();
850  }
851 
852  // Create the grid subsequently used for pile-up subtraction
853  if (calculatePileup) {
854  pileupEnergyFlow = fftjet_Grid2d_parser(ps.getParameter<edm::ParameterSet>("PileupGridConfiguration"));
855  checkConfig(pileupEnergyFlow, "invalid pileup density grid");
856 
857  if (!loadPileupFromDB) {
859  checkConfig(pileupDensityCalc, "invalid pile-up density calculator");
860  }
861  }
862 
863  // Parse the calculator of the recombination scale
866  "invalid spec for the "
867  "reconstruction scale calculator from peaks");
868 
869  // Parse the calculator of the recombination scale ratio
872  "invalid spec for the "
873  "reconstruction scale ratio calculator from peaks");
874 
875  // Calculator for the membership function factor
878  "invalid spec for the "
879  "membership function factor calculator from peaks");
880 
881  if (maxIterations > 1) {
882  // We are going to run iteratively. Make required objects.
885  "invalid spec for the "
886  "reconstruction scale calculator from jets");
887 
890  "invalid spec for the "
891  "reconstruction scale ratio calculator from jets");
892 
895  "invalid spec for the "
896  "membership function factor calculator from jets");
897 
900  "invalid spec for the "
901  "jet distance calculator");
902  }
903 }
virtual std::unique_ptr< fftjet::ScaleSpaceKernel > parse_jetMembershipFunction(const edm::ParameterSet &)
std::unique_ptr< fftjet::Functor2< double, RecoFFTJet, RecoFFTJet > > jetDistanceCalc
const bool useGriddedAlgorithm
std::unique_ptr< fftjet::Functor1< double, fftjet::Peak > > memberFactorCalcPeak
std::unique_ptr< fftjet::Functor1< double, RecoFFTJet > > recoScaleCalcJet
const std::string recombinationAlgorithm
virtual std::unique_ptr< fftjetcms::AbsBgFunctor > parse_bgMembershipFunction(const edm::ParameterSet &)
void checkConfig(const Ptr &ptr, const char *message)
const double unlikelyBgWeight
std::unique_ptr< fftjet::Grid2d< Real > > fftjet_Grid2d_parser(const edm::ParameterSet &ps)
const bool isCrisp
const bool reuseExistingGrid
virtual std::unique_ptr< fftjetcms::AbsPileupCalculator > parse_pileupDensityCalc(const edm::ParameterSet &ps)
std::unique_ptr< fftjetcms::AbsBgFunctor > bgMembershipFunction
std::unique_ptr< fftjet::Grid2d< fftjetcms::Real > > energyFlow
virtual std::unique_ptr< fftjet::Functor1< double, RecoFFTJet > > parse_recoScaleCalcJet(const edm::ParameterSet &)
std::unique_ptr< fftjet::Functor1< double, RecoFFTJet > > memberFactorCalcJet
virtual std::unique_ptr< fftjet::Functor1< double, fftjet::Peak > > parse_recoScaleRatioCalcPeak(const edm::ParameterSet &)
std::unique_ptr< fftjet::Functor1< double, RecoFFTJet > > recoScaleRatioCalcJet
std::unique_ptr< fftjet::ScaleSpaceKernel > jetMembershipFunction
const bool calculatePileup
const bool assignConstituents
const edm::ParameterSet myConfiguration
virtual std::unique_ptr< fftjet::Functor1< double, RecoFFTJet > > parse_recoScaleRatioCalcJet(const edm::ParameterSet &)
std::unique_ptr< fftjetcms::AbsPileupCalculator > pileupDensityCalc
std::unique_ptr< fftjet::Functor1< bool, fftjet::Peak > > peakSelector
std::unique_ptr< fftjet::Functor1< double, fftjet::Peak > > recoScaleRatioCalcPeak
virtual std::unique_ptr< fftjet::Functor1< bool, fftjet::Peak > > parse_peakSelector(const edm::ParameterSet &)
std::unique_ptr< fftjet::Grid2d< fftjetcms::Real > > pileupEnergyFlow
std::unique_ptr< fftjet::Functor1< double, fftjet::Peak > > recoScaleCalcPeak
std::unique_ptr< RecoAlg > recoAlg
virtual std::unique_ptr< fftjet::Functor1< double, fftjet::Peak > > parse_memberFactorCalcPeak(const edm::ParameterSet &)
virtual std::unique_ptr< fftjet::Functor1< double, fftjet::Peak > > parse_recoScaleCalcPeak(const edm::ParameterSet &)
const unsigned maxIterations
virtual std::unique_ptr< fftjet::Functor1< double, RecoFFTJet > > parse_memberFactorCalcJet(const edm::ParameterSet &)
virtual std::unique_ptr< fftjet::Functor2< double, RecoFFTJet, RecoFFTJet > > parse_jetDistanceCalc(const edm::ParameterSet &)

◆ buildGridAlg()

void FFTJetProducer::buildGridAlg ( )
private

Definition at line 357 of file FFTJetProducer.cc.

References assignConstituents, bgMembershipFunction, fftjetcms::FFTJetInterface::energyFlow, Exception, gridAlg, gridScanMaxEta, isCrisp, jetMembershipFunction, cms::alpakatools::config::maxBin, cms::alpakatools::config::minBin, recombinationAlgorithm, recombinationDataCutoff, and unlikelyBgWeight.

Referenced by beginStream(), and produce().

357  {
358  int minBin = energyFlow->getEtaBin(-gridScanMaxEta);
359  if (minBin < 0)
360  minBin = 0;
361  int maxBin = energyFlow->getEtaBin(gridScanMaxEta) + 1;
362  if (maxBin < 0)
363  maxBin = 0;
364 
365  fftjet::DefaultRecombinationAlgFactory<Real, VectorLike, BgData, VBuilder> factory;
366  if (factory[recombinationAlgorithm] == nullptr)
367  throw cms::Exception("FFTJetBadConfig")
368  << "Invalid grid recombination algorithm \"" << recombinationAlgorithm << "\"" << std::endl;
369  gridAlg = std::unique_ptr<GridAlg>(factory[recombinationAlgorithm]->create(jetMembershipFunction.get(),
370  bgMembershipFunction.get(),
373  isCrisp,
374  false,
376  minBin,
377  maxBin));
378 }
const double gridScanMaxEta
constexpr unsigned int minBin
const std::string recombinationAlgorithm
const double unlikelyBgWeight
std::unique_ptr< GridAlg > gridAlg
constexpr unsigned int maxBin
const bool isCrisp
const double recombinationDataCutoff
std::unique_ptr< fftjetcms::AbsBgFunctor > bgMembershipFunction
std::unique_ptr< fftjet::Grid2d< fftjetcms::Real > > energyFlow
std::unique_ptr< fftjet::ScaleSpaceKernel > jetMembershipFunction
const bool assignConstituents

◆ checkConvergence()

bool FFTJetProducer::checkConvergence ( const std::vector< RecoFFTJet > &  previousIterResult,
std::vector< RecoFFTJet > &  thisIterResult 
)
private

Definition at line 399 of file FFTJetProducer.cc.

References convergenceDistance, ztail::d, mps_fire::i, jetDistanceCalc, GetRecoTauVFromDQM_MC_cff::next, l1ctJetFileWriter_cfi::nJets, and callgraph::previous.

Referenced by iterateJetReconstruction().

399  {
400  fftjet::Functor2<double, RecoFFTJet, RecoFFTJet>& distanceCalc(*jetDistanceCalc);
401 
402  const unsigned nJets = previous.size();
403  if (nJets != nextSet.size())
404  return false;
405 
406  const RecoFFTJet* prev = &previous[0];
407  RecoFFTJet* next = &nextSet[0];
408 
409  // Calculate convergence distances for all jets
410  bool converged = true;
411  for (unsigned i = 0; i < nJets; ++i) {
412  const double d = distanceCalc(prev[i], next[i]);
413  next[i].setConvergenceDistance(d);
414  if (i < nJetsRequiredToConverge && d > convergenceDistance)
415  converged = false;
416  }
417 
418  return converged;
419 }
std::unique_ptr< fftjet::Functor2< double, RecoFFTJet, RecoFFTJet > > jetDistanceCalc
fftjet::RecombinedJet< VectorLike > RecoFFTJet
d
Definition: ztail.py:151
const double convergenceDistance

◆ determineGriddedConstituents()

void FFTJetProducer::determineGriddedConstituents ( )
private

Definition at line 488 of file FFTJetProducer.cc.

References cms::cuda::assert(), fftjetcms::FFTJetInterface::candidateIndex, constituents, fftjetcms::FFTJetInterface::energyFlow, fftjetcms::FFTJetInterface::eventData, g, gridAlg, mps_fire::i, l1tTowerCalibrationProducer_cfi::iEta, fftjetcms::FFTJetInterface::inputCollection, B2GTnPMonitor_cfi::item, gpuClustering::pixelStatus::mask, HLT_2022v15_cff::nEta, l1ctJetFileWriter_cfi::nJets, HLT_2022v15_cff::nPhi, and recoJets.

Referenced by produce().

488  {
489  const unsigned nJets = recoJets.size();
490  const unsigned* clusterMask = gridAlg->getClusterMask();
491  const int nEta = gridAlg->getLastNEta();
492  const int nPhi = gridAlg->getLastNPhi();
493  const fftjet::Grid2d<Real>& g(*energyFlow);
494 
495  const unsigned nInputs = eventData.size();
496  const VectorLike* inp = nInputs ? &eventData[0] : nullptr;
497  const unsigned* candIdx = nInputs ? &candidateIndex[0] : nullptr;
498  for (unsigned i = 0; i < nInputs; ++i) {
499  const VectorLike& item(inp[i]);
500  const int iPhi = g.getPhiBin(item.Phi());
501  const int iEta = g.getEtaBin(item.Eta());
502  const unsigned mask = iEta >= 0 && iEta < nEta ? clusterMask[iEta * nPhi + iPhi] : 0;
503  assert(mask <= nJets);
504  constituents[mask].push_back(inputCollection->ptrAt(candIdx[i]));
505  }
506 }
std::vector< std::vector< reco::CandidatePtr > > constituents
edm::Handle< reco::CandidateView > inputCollection
std::vector< RecoFFTJet > recoJets
std::unique_ptr< GridAlg > gridAlg
assert(be >=bs)
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
Definition: Activities.doc:4
constexpr uint32_t mask
Definition: gpuClustering.h:26
std::vector< unsigned > candidateIndex
std::unique_ptr< fftjet::Grid2d< fftjetcms::Real > > energyFlow
math::XYZTLorentzVector VectorLike
std::vector< fftjetcms::VectorLike > eventData

◆ determinePileup()

void FFTJetProducer::determinePileup ( )
private

Definition at line 1005 of file FFTJetProducer.cc.

References cms::cuda::assert(), cellCountsVec, HLT_2022v15_cff::dEta, doubleBuf, HLT_2022v15_cff::dPhi, PVValHelper::eta, f, g, mps_fire::i, LEDCalibrationChannels::ieta, LEDCalibrationChannels::iphi, isCrisp, metsig::jet, jetMembershipFunction, reco::btau::jetPhi, M_PI, memberFactorCalcJet, memFcns2dVec, HLT_2022v15_cff::nEta, l1ctJetFileWriter_cfi::nJets, HLT_2022v15_cff::nPhi, pileup, pileupEnergyFlow, recoJets, recoScaleCalcJet, recoScaleRatioCalcJet, mitigatedMETSequence_cff::U, and SiPixelPI::zero.

Referenced by produce().

1005  {
1006  // This function works with crisp clustering only
1007  if (!isCrisp)
1008  assert(!"Pile-up subtraction for fuzzy clustering "
1009  "is not implemented yet");
1010 
1011  // Clear the pileup vector
1012  const unsigned nJets = recoJets.size();
1013  pileup.resize(nJets);
1014  if (nJets == 0)
1015  return;
1016  const VectorLike zero;
1017  for (unsigned i = 0; i < nJets; ++i)
1018  pileup[i] = zero;
1019 
1020  // Pileup energy flow grid
1021  const fftjet::Grid2d<Real>& g(*pileupEnergyFlow);
1022  const unsigned nEta = g.nEta();
1023  const unsigned nPhi = g.nPhi();
1024  const double cellArea = g.etaBinWidth() * g.phiBinWidth();
1025 
1026  // Various calculators
1027  fftjet::Functor1<double, RecoFFTJet>& scaleCalc(*recoScaleCalcJet);
1028  fftjet::Functor1<double, RecoFFTJet>& ratioCalc(*recoScaleRatioCalcJet);
1029  fftjet::Functor1<double, RecoFFTJet>& factorCalc(*memberFactorCalcJet);
1030 
1031  // Make sure we have enough memory
1032  memFcns2dVec.resize(nJets);
1033  fftjet::AbsKernel2d** memFcns2d = &memFcns2dVec[0];
1034 
1035  doubleBuf.resize(nJets * 4U + nJets * nPhi);
1036  double* recoScales = &doubleBuf[0];
1037  double* recoScaleRatios = recoScales + nJets;
1038  double* memFactors = recoScaleRatios + nJets;
1039  double* dEta = memFactors + nJets;
1040  double* dPhiBuf = dEta + nJets;
1041 
1042  cellCountsVec.resize(nJets);
1043  unsigned* cellCounts = &cellCountsVec[0];
1044 
1045  // Go over jets and collect the necessary info
1046  for (unsigned ijet = 0; ijet < nJets; ++ijet) {
1047  const RecoFFTJet& jet(recoJets[ijet]);
1048  const fftjet::Peak& peak(jet.precluster());
1049 
1050  // Make sure we are using 2-d membership functions.
1051  // Pile-up subtraction scheme for 3-d functions should be different.
1052  fftjet::AbsMembershipFunction* m3d = dynamic_cast<fftjet::AbsMembershipFunction*>(peak.membershipFunction());
1053  if (m3d == nullptr)
1054  m3d = dynamic_cast<fftjet::AbsMembershipFunction*>(jetMembershipFunction.get());
1055  if (m3d) {
1056  assert(!"Pile-up subtraction for 3-d membership functions "
1057  "is not implemented yet");
1058  } else {
1059  fftjet::AbsKernel2d* m2d = dynamic_cast<fftjet::AbsKernel2d*>(peak.membershipFunction());
1060  if (m2d == nullptr)
1061  m2d = dynamic_cast<fftjet::AbsKernel2d*>(jetMembershipFunction.get());
1062  assert(m2d);
1063  memFcns2d[ijet] = m2d;
1064  }
1065  recoScales[ijet] = scaleCalc(jet);
1066  recoScaleRatios[ijet] = ratioCalc(jet);
1067  memFactors[ijet] = factorCalc(jet);
1068  cellCounts[ijet] = 0U;
1069 
1070  const double jetPhi = jet.vec().Phi();
1071  for (unsigned iphi = 0; iphi < nPhi; ++iphi) {
1072  double dphi = g.phiBinCenter(iphi) - jetPhi;
1073  while (dphi > M_PI)
1074  dphi -= (2.0 * M_PI);
1075  while (dphi < -M_PI)
1076  dphi += (2.0 * M_PI);
1077  dPhiBuf[iphi * nJets + ijet] = dphi;
1078  }
1079  }
1080 
1081  // Go over all grid points and integrate
1082  // the pile-up energy density
1083  VBuilder vMaker;
1084  for (unsigned ieta = 0; ieta < nEta; ++ieta) {
1085  const double eta(g.etaBinCenter(ieta));
1086  const Real* databuf = g.data() + ieta * nPhi;
1087 
1088  // Figure out dEta for each jet
1089  for (unsigned ijet = 0; ijet < nJets; ++ijet)
1090  dEta[ijet] = eta - recoJets[ijet].vec().Eta();
1091 
1092  for (unsigned iphi = 0; iphi < nPhi; ++iphi) {
1093  double maxW(0.0);
1094  unsigned maxWJet(nJets);
1095  const double* dPhi = dPhiBuf + iphi * nJets;
1096 
1097  for (unsigned ijet = 0; ijet < nJets; ++ijet) {
1098  if (recoScaleRatios[ijet] > 0.0)
1099  memFcns2d[ijet]->setScaleRatio(recoScaleRatios[ijet]);
1100  const double f = memFactors[ijet] * (*memFcns2d[ijet])(dEta[ijet], dPhi[ijet], recoScales[ijet]);
1101  if (f > maxW) {
1102  maxW = f;
1103  maxWJet = ijet;
1104  }
1105  }
1106 
1107  if (maxWJet < nJets) {
1108  pileup[maxWJet] += vMaker(cellArea * databuf[iphi], eta, g.phiBinCenter(iphi));
1109  cellCounts[maxWJet]++;
1110  }
1111  }
1112  }
1113 }
std::vector< fftjetcms::VectorLike > pileup
std::unique_ptr< fftjet::Functor1< double, RecoFFTJet > > recoScaleCalcJet
std::vector< double > doubleBuf
std::vector< fftjet::AbsKernel2d * > memFcns2dVec
std::vector< RecoFFTJet > recoJets
const bool isCrisp
assert(be >=bs)
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
Definition: Activities.doc:4
fftjet::RecombinedJet< VectorLike > RecoFFTJet
std::unique_ptr< fftjet::Functor1< double, RecoFFTJet > > memberFactorCalcJet
math::XYZTLorentzVector VectorLike
double f[11][100]
std::vector< unsigned > cellCountsVec
std::unique_ptr< fftjet::Functor1< double, RecoFFTJet > > recoScaleRatioCalcJet
std::unique_ptr< fftjet::ScaleSpaceKernel > jetMembershipFunction
#define M_PI
double Real
std::unique_ptr< fftjet::Grid2d< fftjetcms::Real > > pileupEnergyFlow

◆ determinePileupDensityFromConfig()

void FFTJetProducer::determinePileupDensityFromConfig ( const edm::Event iEvent,
std::unique_ptr< fftjet::Grid2d< fftjetcms::Real > > &  density 
)
privatevirtual

Definition at line 937 of file FFTJetProducer.cc.

References fastSimProducer_cff::density, PVValHelper::eta, g, LEDCalibrationChannels::ieta, iEvent, input_pusummary_token_, LEDCalibrationChannels::iphi, fftjetcms::AbsPileupCalculator::isPhiDependent(), HLT_2022v15_cff::nEta, HLT_2022v15_cff::nPhi, phi, pileupDensityCalc, alignCSCRings::s, and edmLumisInFiles::summary.

Referenced by produce().

938  {
941 
944  const bool phiDependent = calc.isPhiDependent();
945 
946  fftjet::Grid2d<Real>& g(*density);
947  const unsigned nEta = g.nEta();
948  const unsigned nPhi = g.nPhi();
949 
950  for (unsigned ieta = 0; ieta < nEta; ++ieta) {
951  const double eta(g.etaBinCenter(ieta));
952 
953  if (phiDependent) {
954  for (unsigned iphi = 0; iphi < nPhi; ++iphi) {
955  const double phi(g.phiBinCenter(iphi));
956  g.uncheckedSetBin(ieta, iphi, calc(eta, phi, s));
957  }
958  } else {
959  const double pil = calc(eta, 0.0, s);
960  for (unsigned iphi = 0; iphi < nPhi; ++iphi)
961  g.uncheckedSetBin(ieta, iphi, pil);
962  }
963  }
964 }
Summary info for pile-up determined by Gaussian filtering.
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
Definition: Activities.doc:4
int iEvent
Definition: GenABIO.cc:224
edm::EDGetTokenT< reco::FFTJetPileupSummary > input_pusummary_token_
std::unique_ptr< fftjetcms::AbsPileupCalculator > pileupDensityCalc

◆ determinePileupDensityFromDB()

void FFTJetProducer::determinePileupDensityFromDB ( const edm::Event iEvent,
const edm::EventSetup iSetup,
std::unique_ptr< fftjet::Grid2d< fftjetcms::Real > > &  density 
)
privatevirtual

Definition at line 966 of file FFTJetProducer.cc.

References fastSimProducer_cff::density, esLoader_, PVValHelper::eta, f, g, h, LEDCalibrationChannels::ieta, iEvent, input_pusummary_token_, LEDCalibrationChannels::iphi, DefaultFFTJetRcdMapper< DataType >::load(), HLT_2022v15_cff::nEta, HLT_2022v15_cff::nPhi, pileupTableCategory, pileupTableName, pileupTableRecord, rho, edmLumisInFiles::summary, and mitigatedMETSequence_cff::U.

Referenced by produce().

968  {
970  std::shared_ptr<npstat::StorableMultivariateFunctor> f = (*h)[pileupTableCategory][pileupTableName];
971 
974 
975  const float rho = summary->pileupRho();
976  const bool phiDependent = f->minDim() == 3U;
977 
978  fftjet::Grid2d<Real>& g(*density);
979  const unsigned nEta = g.nEta();
980  const unsigned nPhi = g.nPhi();
981 
982  double functorArg[3] = {0.0, 0.0, 0.0};
983  if (phiDependent)
984  functorArg[2] = rho;
985  else
986  functorArg[1] = rho;
987 
988  for (unsigned ieta = 0; ieta < nEta; ++ieta) {
989  const double eta(g.etaBinCenter(ieta));
990  functorArg[0] = eta;
991 
992  if (phiDependent) {
993  for (unsigned iphi = 0; iphi < nPhi; ++iphi) {
994  functorArg[1] = g.phiBinCenter(iphi);
995  g.uncheckedSetBin(ieta, iphi, (*f)(functorArg, 3U));
996  }
997  } else {
998  const double pil = (*f)(functorArg, 2U);
999  for (unsigned iphi = 0; iphi < nPhi; ++iphi)
1000  g.uncheckedSetBin(ieta, iphi, pil);
1001  }
1002  }
1003 }
edm::ESHandle< DataType > load(const std::string &record, const edm::EventSetup &iSetup) const
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
Definition: Activities.doc:4
int iEvent
Definition: GenABIO.cc:224
double f[11][100]
std::string pileupTableRecord
std::string pileupTableName
edm::EDGetTokenT< reco::FFTJetPileupSummary > input_pusummary_token_
std::string pileupTableCategory
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
FFTJetLookupTableSequenceLoader esLoader_

◆ determineVectorConstituents()

void FFTJetProducer::determineVectorConstituents ( )
private

Definition at line 508 of file FFTJetProducer.cc.

References cms::cuda::assert(), fftjetcms::FFTJetInterface::candidateIndex, constituents, fftjetcms::FFTJetInterface::eventData, mps_fire::i, fftjetcms::FFTJetInterface::inputCollection, gpuClustering::pixelStatus::mask, l1ctJetFileWriter_cfi::nJets, recoAlg, and recoJets.

Referenced by produce().

508  {
509  const unsigned nJets = recoJets.size();
510  const unsigned* clusterMask = recoAlg->getClusterMask();
511  const unsigned maskLength = recoAlg->getLastNData();
512  assert(maskLength == eventData.size());
513 
514  const unsigned* candIdx = maskLength ? &candidateIndex[0] : nullptr;
515  for (unsigned i = 0; i < maskLength; ++i) {
516  // In FFTJet, the mask value of 0 corresponds to unclustered
517  // energy. We will do the same here. Jet numbers are therefore
518  // shifted by 1 wrt constituents vector, and constituents[1]
519  // corresponds to jet number 0.
520  const unsigned mask = clusterMask[i];
521  assert(mask <= nJets);
522  constituents[mask].push_back(inputCollection->ptrAt(candIdx[i]));
523  }
524 }
std::vector< std::vector< reco::CandidatePtr > > constituents
edm::Handle< reco::CandidateView > inputCollection
std::vector< RecoFFTJet > recoJets
assert(be >=bs)
constexpr uint32_t mask
Definition: gpuClustering.h:26
std::vector< unsigned > candidateIndex
std::unique_ptr< RecoAlg > recoAlg
std::vector< fftjetcms::VectorLike > eventData

◆ genJetPreclusters()

void FFTJetProducer::genJetPreclusters ( const SparseTree tree,
edm::Event iEvent,
const edm::EventSetup ,
const fftjet::Functor1< bool, fftjet::Peak > &  peakSelector,
std::vector< fftjet::Peak > *  preclusters 
)
protectedvirtual

Definition at line 214 of file FFTJetProducer.cc.

References mps_fire::i, iEvent, input, input_genjet_token_, SimL1EmulatorRepack_Full_cff::InputCollection, metsig::jet, fftjetcms::jetFromStorable(), AlCaHLTBitMon_ParallelJobs::p, preclusters, resolution, and pfClustersFromCombinedCaloHF_cfi::scale.

Referenced by produce().

218  {
219  typedef reco::FFTAnyJet<reco::GenJet> InputJet;
220  typedef std::vector<InputJet> InputCollection;
221 
223  iEvent.getByToken(input_genjet_token_, input);
224 
225  const unsigned sz = input->size();
226  preclusters->reserve(sz);
227  for (unsigned i = 0; i < sz; ++i) {
228  const RecoFFTJet& jet(jetFromStorable((*input)[i].getFFTSpecific()));
229  fftjet::Peak p(jet.precluster());
230  const double scale(p.scale());
231  p.setEtaPhi(jet.vec().Eta(), jet.vec().Phi());
232  p.setMagnitude(jet.vec().Pt() / scale / scale);
233  p.setStatus(resolution);
234  if (peakSelect(p))
235  preclusters->push_back(p);
236  }
237 }
fftjet::RecombinedJet< VectorLike > jetFromStorable(const reco::FFTJet< Real > &jet)
Definition: jetConverters.h:65
Resolution resolution
std::vector< fftjet::Peak > preclusters
static std::string const input
Definition: EdmProvDump.cc:50
fftjet::RecombinedJet< VectorLike > RecoFFTJet
int iEvent
Definition: GenABIO.cc:224
Implements inheritance relationships for FFTJet jets.
Definition: FFTAnyJet.h:16
edm::EDGetTokenT< std::vector< reco::FFTAnyJet< reco::GenJet > > > input_genjet_token_

◆ iterateJetReconstruction()

unsigned FFTJetProducer::iterateJetReconstruction ( )
private

Definition at line 421 of file FFTJetProducer.cc.

References cms::cuda::assert(), checkConvergence(), fftjetcms::FFTJetInterface::energyFlow, fftjetcms::FFTJetInterface::eventData, Exception, gridAlg, mps_fire::i, iterJets, iterPreclusters, metsig::jet, PDWG_EXODelayedJetMET_cff::jets, maxIterations, memberFactorCalcJet, l1ctJetFileWriter_cfi::nJets, noiseLevel, AlCaHLTBitMon_ParallelJobs::p, preclusters, recoAlg, recoJets, recoScaleCalcJet, recoScaleRatioCalcJet, removeFakePreclusters(), mps_update::status, mitigatedMETSequence_cff::U, unclustered, unused, and useGriddedAlgorithm.

Referenced by produce().

421  {
422  fftjet::Functor1<double, RecoFFTJet>& scaleCalc(*recoScaleCalcJet);
423  fftjet::Functor1<double, RecoFFTJet>& ratioCalc(*recoScaleRatioCalcJet);
424  fftjet::Functor1<double, RecoFFTJet>& factorCalc(*memberFactorCalcJet);
425 
426  unsigned nJets = recoJets.size();
427  unsigned iterNum = 1U;
428  bool converged = false;
429  for (; iterNum < maxIterations && !converged; ++iterNum) {
430  // Recreate the vector of preclusters using the jets
431  const RecoFFTJet* jets = &recoJets[0];
432  iterPreclusters.clear();
433  iterPreclusters.reserve(nJets);
434  for (unsigned i = 0; i < nJets; ++i) {
435  const RecoFFTJet& jet(jets[i]);
436  fftjet::Peak p(jet.precluster());
437  p.setEtaPhi(jet.vec().Eta(), jet.vec().Phi());
438  p.setRecoScale(scaleCalc(jet));
439  p.setRecoScaleRatio(ratioCalc(jet));
440  p.setMembershipFactor(factorCalc(jet));
441  iterPreclusters.push_back(p);
442  }
443 
444  // Run the algorithm
445  int status = 0;
448  else
450  if (status)
451  throw cms::Exception("FFTJetInterface") << "FFTJet algorithm failed" << std::endl;
452 
453  // As it turns out, it is possible, in very rare cases,
454  // to have iterJets.size() != nJets at this point
455 
456  // Figure out if the iterations have converged
457  converged = checkConvergence(recoJets, iterJets);
458 
459  // Prepare for the next cycle
460  iterJets.swap(recoJets);
461  nJets = recoJets.size();
462  }
463 
464  // Check that we have the correct number of preclusters
465  if (preclusters.size() != nJets) {
466  assert(nJets < preclusters.size());
468  assert(preclusters.size() == nJets);
469  }
470 
471  // Plug in the original precluster coordinates into the result
472  RecoFFTJet* jets = &recoJets[0];
473  for (unsigned i = 0; i < nJets; ++i) {
474  const fftjet::Peak& oldp(preclusters[i]);
475  jets[i].setPeakEtaPhi(oldp.eta(), oldp.phi());
476  }
477 
478  // If we have converged on the last cycle, the result
479  // would be indistinguishable from no convergence.
480  // Because of this, raise the counter by one to indicate
481  // the case when the convergence is not achieved.
482  if (!converged)
483  ++iterNum;
484 
485  return iterNum;
486 }
const bool useGriddedAlgorithm
std::unique_ptr< fftjet::Functor1< double, RecoFFTJet > > recoScaleCalcJet
std::vector< RecoFFTJet > recoJets
std::unique_ptr< GridAlg > gridAlg
assert(be >=bs)
std::vector< fftjet::Peak > preclusters
fftjet::RecombinedJet< VectorLike > RecoFFTJet
std::unique_ptr< fftjet::Grid2d< fftjetcms::Real > > energyFlow
std::unique_ptr< fftjet::Functor1< double, RecoFFTJet > > memberFactorCalcJet
const double noiseLevel
std::vector< RecoFFTJet > iterJets
std::unique_ptr< fftjet::Functor1< double, RecoFFTJet > > recoScaleRatioCalcJet
bool checkConvergence(const std::vector< RecoFFTJet > &previousIterResult, std::vector< RecoFFTJet > &thisIterResult)
std::unique_ptr< RecoAlg > recoAlg
std::vector< fftjetcms::VectorLike > eventData
fftjetcms::VectorLike unclustered
std::vector< fftjet::Peak > iterPreclusters
void removeFakePreclusters()
const unsigned maxIterations

◆ loadEnergyFlow()

bool FFTJetProducer::loadEnergyFlow ( const edm::Event iEvent,
std::unique_ptr< fftjet::Grid2d< fftjetcms::Real > > &  flow 
)
private

Definition at line 380 of file FFTJetProducer.cc.

References fftjetcommon_cfi::flow, iEvent, input, and input_energyflow_token_.

Referenced by produce().

380  {
382  iEvent.getByToken(input_energyflow_token_, input);
383 
384  // Make sure that the grid is compatible with the stored one
385  bool rebuildGrid = flow.get() == nullptr;
386  if (!rebuildGrid)
387  rebuildGrid =
388  !(flow->nEta() == input->nEtaBins() && flow->nPhi() == input->nPhiBins() && flow->etaMin() == input->etaMin() &&
389  flow->etaMax() == input->etaMax() && flow->phiBin0Edge() == input->phiBin0Edge());
390  if (rebuildGrid) {
391  // We should not get here very often...
392  flow = std::make_unique<fftjet::Grid2d<Real> >(
393  input->nEtaBins(), input->etaMin(), input->etaMax(), input->nPhiBins(), input->phiBin0Edge(), input->title());
394  }
395  flow->blockSet(input->data(), input->nEtaBins(), input->nPhiBins());
396  return rebuildGrid;
397 }
static std::string const input
Definition: EdmProvDump.cc:50
int iEvent
Definition: GenABIO.cc:224
edm::EDGetTokenT< reco::DiscretizedEnergyFlow > input_energyflow_token_

◆ loadSparseTreeData() [1/2]

template<class Real >
void FFTJetProducer::loadSparseTreeData ( const edm::Event ,
const edm::EDGetTokenT< reco::PattRecoTree< Real, reco::PattRecoPeak< Real > > > &  tok 
)
private

◆ loadSparseTreeData() [2/2]

template<class Real >
void FFTJetProducer::loadSparseTreeData ( const edm::Event iEvent,
const edm::EDGetTokenT< reco::PattRecoTree< Real, reco::PattRecoPeak< Real > > > &  tok 
)

Definition at line 198 of file FFTJetProducer.cc.

References fftjetcms::FFTJetInterface::getEventScale(), iEvent, iniScales, input, fftjetcms::sparsePeakTreeFromStorable(), and sparseTree.

199  {
201 
202  // Get the input
204  iEvent.getByToken(tok, input);
205 
206  if (!input->isSparse())
207  throw cms::Exception("FFTJetBadConfig") << "The stored clustering tree is not sparse" << std::endl;
208 
210  sparseTree.sortNodes();
211  fftjet::updateSplitMergeTimes(sparseTree, sparseTree.minScale(), sparseTree.maxScale());
212 }
Class for storing FFTJet sparse clustering trees.
Definition: PattRecoTree.h:20
static std::string const input
Definition: EdmProvDump.cc:50
std::unique_ptr< std::vector< double > > iniScales
int iEvent
Definition: GenABIO.cc:224
void sparsePeakTreeFromStorable(const reco::PattRecoTree< Real, reco::PattRecoPeak< Real > > &in, const std::vector< double > *scaleSetIfNotAdaptive, double completeEventScale, fftjet::SparseClusteringTree< fftjet::Peak, long > *out)
SparseTree sparseTree

◆ makeProduces()

template<typename T >
void FFTJetProducer::makeProduces ( const std::string &  alias,
const std::string &  tag 
)
private

Definition at line 109 of file FFTJetProducer.cc.

References SiStripOfflineCRack_cfg::alias, and makeGlobalPositionRcd_cfg::tag.

Referenced by FFTJetProducer().

109  {
110  produces<std::vector<reco::FFTAnyJet<T> > >(tag).setBranchAlias(alias);
111 }

◆ operator=()

FFTJetProducer& FFTJetProducer::operator= ( const FFTJetProducer )
delete

◆ parse_bgMembershipFunction()

std::unique_ptr< AbsBgFunctor > FFTJetProducer::parse_bgMembershipFunction ( const edm::ParameterSet ps)
protectedvirtual

Definition at line 768 of file FFTJetProducer.cc.

References fftjetcms::fftjet_BgFunctor_parser(), and edm::ParameterSet::getParameter().

Referenced by beginStream().

768  {
769  return fftjet_BgFunctor_parser(ps.getParameter<edm::ParameterSet>("bgMembershipFunction"));
770 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
std::unique_ptr< AbsBgFunctor > fftjet_BgFunctor_parser(const edm::ParameterSet &ps)

◆ parse_jetDistanceCalc()

std::unique_ptr< fftjet::Functor2< double, FFTJetProducer::RecoFFTJet, FFTJetProducer::RecoFFTJet > > FFTJetProducer::parse_jetDistanceCalc ( const edm::ParameterSet ps)
protectedvirtual

Definition at line 811 of file FFTJetProducer.cc.

References fftjetcms::fftjet_JetDistance_parser(), and edm::ParameterSet::getParameter().

Referenced by beginStream().

811  {
812  return fftjet_JetDistance_parser(ps.getParameter<edm::ParameterSet>("jetDistanceCalc"));
813 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
std::unique_ptr< fftjet::Functor2< double, fftjet::RecombinedJet< VectorLike >, fftjet::RecombinedJet< VectorLike > > > fftjet_JetDistance_parser(const edm::ParameterSet &ps)

◆ parse_jetMembershipFunction()

std::unique_ptr< fftjet::ScaleSpaceKernel > FFTJetProducer::parse_jetMembershipFunction ( const edm::ParameterSet ps)
protectedvirtual

Definition at line 763 of file FFTJetProducer.cc.

References fftjetcms::fftjet_MembershipFunction_parser(), and edm::ParameterSet::getParameter().

Referenced by beginStream().

763  {
764  return fftjet_MembershipFunction_parser(ps.getParameter<edm::ParameterSet>("jetMembershipFunction"));
765 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
std::unique_ptr< fftjet::ScaleSpaceKernel > fftjet_MembershipFunction_parser(const edm::ParameterSet &ps)

◆ parse_memberFactorCalcJet()

std::unique_ptr< fftjet::Functor1< double, FFTJetProducer::RecoFFTJet > > FFTJetProducer::parse_memberFactorCalcJet ( const edm::ParameterSet ps)
protectedvirtual

Definition at line 805 of file FFTJetProducer.cc.

References fftjetcms::fftjet_JetFunctor_parser(), and edm::ParameterSet::getParameter().

Referenced by beginStream().

806  {
807  return fftjet_JetFunctor_parser(ps.getParameter<edm::ParameterSet>("memberFactorCalcJet"));
808 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
std::unique_ptr< fftjet::Functor1< double, fftjet::RecombinedJet< VectorLike > > > fftjet_JetFunctor_parser(const edm::ParameterSet &ps)

◆ parse_memberFactorCalcPeak()

std::unique_ptr< fftjet::Functor1< double, fftjet::Peak > > FFTJetProducer::parse_memberFactorCalcPeak ( const edm::ParameterSet ps)
protectedvirtual

Definition at line 790 of file FFTJetProducer.cc.

References fftjetcms::fftjet_PeakFunctor_parser(), and edm::ParameterSet::getParameter().

Referenced by beginStream().

791  {
792  return fftjet_PeakFunctor_parser(ps.getParameter<edm::ParameterSet>("memberFactorCalcPeak"));
793 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
std::unique_ptr< fftjet::Functor1< double, fftjet::Peak > > fftjet_PeakFunctor_parser(const edm::ParameterSet &ps)

◆ parse_peakSelector()

std::unique_ptr< fftjet::Functor1< bool, fftjet::Peak > > FFTJetProducer::parse_peakSelector ( const edm::ParameterSet ps)
protectedvirtual

Definition at line 758 of file FFTJetProducer.cc.

References fftjetcms::fftjet_PeakSelector_parser(), and edm::ParameterSet::getParameter().

Referenced by beginStream().

758  {
759  return fftjet_PeakSelector_parser(ps.getParameter<edm::ParameterSet>("PeakSelectorConfiguration"));
760 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
std::unique_ptr< fftjet::Functor1< bool, fftjet::Peak > > fftjet_PeakSelector_parser(const edm::ParameterSet &ps)

◆ parse_pileupDensityCalc()

std::unique_ptr< fftjetcms::AbsPileupCalculator > FFTJetProducer::parse_pileupDensityCalc ( const edm::ParameterSet ps)
protectedvirtual

Definition at line 779 of file FFTJetProducer.cc.

References fftjetcms::fftjet_PileupCalculator_parser(), and edm::ParameterSet::getParameter().

Referenced by beginStream().

779  {
780  return fftjet_PileupCalculator_parser(ps.getParameter<edm::ParameterSet>("pileupDensityCalc"));
781 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
std::unique_ptr< AbsPileupCalculator > fftjet_PileupCalculator_parser(const edm::ParameterSet &ps)

◆ parse_recoScaleCalcJet()

std::unique_ptr< fftjet::Functor1< double, FFTJetProducer::RecoFFTJet > > FFTJetProducer::parse_recoScaleCalcJet ( const edm::ParameterSet ps)
protectedvirtual

Definition at line 795 of file FFTJetProducer.cc.

References fftjetcms::fftjet_JetFunctor_parser(), and edm::ParameterSet::getParameter().

Referenced by beginStream().

796  {
797  return fftjet_JetFunctor_parser(ps.getParameter<edm::ParameterSet>("recoScaleCalcJet"));
798 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
std::unique_ptr< fftjet::Functor1< double, fftjet::RecombinedJet< VectorLike > > > fftjet_JetFunctor_parser(const edm::ParameterSet &ps)

◆ parse_recoScaleCalcPeak()

std::unique_ptr< fftjet::Functor1< double, fftjet::Peak > > FFTJetProducer::parse_recoScaleCalcPeak ( const edm::ParameterSet ps)
protectedvirtual

Definition at line 773 of file FFTJetProducer.cc.

References fftjetcms::fftjet_PeakFunctor_parser(), and edm::ParameterSet::getParameter().

Referenced by beginStream().

774  {
775  return fftjet_PeakFunctor_parser(ps.getParameter<edm::ParameterSet>("recoScaleCalcPeak"));
776 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
std::unique_ptr< fftjet::Functor1< double, fftjet::Peak > > fftjet_PeakFunctor_parser(const edm::ParameterSet &ps)

◆ parse_recoScaleRatioCalcJet()

std::unique_ptr< fftjet::Functor1< double, FFTJetProducer::RecoFFTJet > > FFTJetProducer::parse_recoScaleRatioCalcJet ( const edm::ParameterSet ps)
protectedvirtual

Definition at line 800 of file FFTJetProducer.cc.

References fftjetcms::fftjet_JetFunctor_parser(), and edm::ParameterSet::getParameter().

Referenced by beginStream().

801  {
802  return fftjet_JetFunctor_parser(ps.getParameter<edm::ParameterSet>("recoScaleRatioCalcJet"));
803 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
std::unique_ptr< fftjet::Functor1< double, fftjet::RecombinedJet< VectorLike > > > fftjet_JetFunctor_parser(const edm::ParameterSet &ps)

◆ parse_recoScaleRatioCalcPeak()

std::unique_ptr< fftjet::Functor1< double, fftjet::Peak > > FFTJetProducer::parse_recoScaleRatioCalcPeak ( const edm::ParameterSet ps)
protectedvirtual

Definition at line 784 of file FFTJetProducer.cc.

References fftjetcms::fftjet_PeakFunctor_parser(), and edm::ParameterSet::getParameter().

Referenced by beginStream().

785  {
786  return fftjet_PeakFunctor_parser(ps.getParameter<edm::ParameterSet>("recoScaleRatioCalcPeak"));
787 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
std::unique_ptr< fftjet::Functor1< double, fftjet::Peak > > fftjet_PeakFunctor_parser(const edm::ParameterSet &ps)

◆ parse_resolution()

FFTJetProducer::Resolution FFTJetProducer::parse_resolution ( const std::string &  name)
static

Definition at line 93 of file FFTJetProducer.cc.

References Exception, and Skims_PA_cff::name.

93  {
94  if (!name.compare("fixed"))
95  return FIXED;
96  else if (!name.compare("maximallyStable"))
97  return MAXIMALLY_STABLE;
98  else if (!name.compare("globallyAdaptive"))
99  return GLOBALLY_ADAPTIVE;
100  else if (!name.compare("locallyAdaptive"))
101  return LOCALLY_ADAPTIVE;
102  else if (!name.compare("fromGenJets"))
103  return FROM_GENJETS;
104  else
105  throw cms::Exception("FFTJetBadConfig") << "Invalid resolution specification \"" << name << "\"" << std::endl;
106 }

◆ prepareRecombinationScales()

void FFTJetProducer::prepareRecombinationScales ( )
private

Definition at line 341 of file FFTJetProducer.cc.

References mps_fire::i, memberFactorCalcPeak, preclusters, recoScaleCalcPeak, and recoScaleRatioCalcPeak.

Referenced by produce().

341  {
342  const unsigned nClus = preclusters.size();
343  if (nClus) {
344  fftjet::Peak* clus = &preclusters[0];
345  fftjet::Functor1<double, fftjet::Peak>& scaleCalc(*recoScaleCalcPeak);
346  fftjet::Functor1<double, fftjet::Peak>& ratioCalc(*recoScaleRatioCalcPeak);
347  fftjet::Functor1<double, fftjet::Peak>& factorCalc(*memberFactorCalcPeak);
348 
349  for (unsigned i = 0; i < nClus; ++i) {
350  clus[i].setRecoScale(scaleCalc(clus[i]));
351  clus[i].setRecoScaleRatio(ratioCalc(clus[i]));
352  clus[i].setMembershipFactor(factorCalc(clus[i]));
353  }
354  }
355 }
std::unique_ptr< fftjet::Functor1< double, fftjet::Peak > > memberFactorCalcPeak
std::vector< fftjet::Peak > preclusters
std::unique_ptr< fftjet::Functor1< double, fftjet::Peak > > recoScaleRatioCalcPeak
std::unique_ptr< fftjet::Functor1< double, fftjet::Peak > > recoScaleCalcPeak

◆ produce()

void FFTJetProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprotected

Definition at line 656 of file FFTJetProducer.cc.

References cms::cuda::assert(), assignConstituents, assignMembershipFunctions(), buildGridAlg(), calculatePileup, l1ct::clear(), constituents, determineGriddedConstituents(), determinePileup(), determinePileupDensityFromConfig(), determinePileupDensityFromDB(), determineVectorConstituents(), fftjetcms::FFTJetInterface::discretizeEnergyFlow(), fftjetcms::FFTJetInterface::energyFlow, fftjetcms::FFTJetInterface::eventData, Exception, FROM_GENJETS, genJetPreclusters(), gridAlg, mps_fire::i, iEvent, input_recotree_token_d_, input_recotree_token_f_, iterateJetReconstruction(), iterationsPerformed, loadEnergyFlow(), fftjetcms::FFTJetInterface::loadInputCollection(), loadPileupFromDB, maxInitialPreclusters, maxIterations, l1ctJetFileWriter_cfi::nJets, noiseLevel, occupancy, peakSelector, pileup, pileupEnergyFlow, preclusters, prepareRecombinationScales(), recoAlg, recoJets, removeFakePreclusters(), resolution, reuseExistingGrid, saveResults(), selectPreclusters(), jetUpdater_cfi::sort, sparseTree, mps_update::status, fftjetcms::FFTJetInterface::storeInSinglePrecision(), mitigatedMETSequence_cff::U, unclustered, unused, and useGriddedAlgorithm.

656  {
657  // Load the clustering tree made by FFTJetPatRecoProducer
659  loadSparseTreeData<float>(iEvent, input_recotree_token_f_);
660  else
661  loadSparseTreeData<double>(iEvent, input_recotree_token_d_);
662 
663  // Do we need to load the candidate collection?
666 
667  // Do we need to have discretized energy flow?
668  if (useGriddedAlgorithm) {
669  if (reuseExistingGrid) {
671  buildGridAlg();
672  } else
674  }
675 
676  // Calculate cluster occupancy as a function of level number
677  sparseTree.occupancyInScaleSpace(*peakSelector, &occupancy);
678 
679  // Select the preclusters using the requested resolution scheme
680  preclusters.clear();
681  if (resolution == FROM_GENJETS)
683  else
685  if (preclusters.size() > maxInitialPreclusters) {
686  std::sort(preclusters.begin(), preclusters.end(), std::greater<fftjet::Peak>());
688  }
689 
690  // Prepare to run the jet recombination procedure
692 
693  // Assign membership functions to preclusters. If this function
694  // is not overriden in a derived class, default algorithm membership
695  // function will be used for every cluster.
697 
698  // Count the preclusters going in
699  unsigned nPreclustersFound = 0U;
700  const unsigned npre = preclusters.size();
701  for (unsigned i = 0; i < npre; ++i)
702  if (preclusters[i].membershipFactor() > 0.0)
703  ++nPreclustersFound;
704 
705  // Run the recombination algorithm once
706  int status = 0;
709  else
711  if (status)
712  throw cms::Exception("FFTJetInterface") << "FFTJet algorithm failed (first iteration)" << std::endl;
713 
714  // If requested, iterate the jet recombination procedure
715  if (maxIterations > 1U && !recoJets.empty()) {
716  // It is possible to have a smaller number of jets than we had
717  // preclusters. Fake preclusters are possible, but for a good
718  // choice of pattern recognition kernel their presence should
719  // be infrequent. However, any fake preclusters will throw the
720  // iterative reconstruction off balance. Deal with the problem now.
721  const unsigned nJets = recoJets.size();
722  if (preclusters.size() != nJets) {
723  assert(nJets < preclusters.size());
725  }
727  } else
729 
730  // Determine jet constituents. FFTJet returns a map
731  // of constituents which is inverse to what we need here.
732  const unsigned nJets = recoJets.size();
733  if (constituents.size() <= nJets)
734  constituents.resize(nJets + 1U);
735  if (assignConstituents) {
736  for (unsigned i = 0; i <= nJets; ++i)
737  constituents[i].clear();
740  else
742  }
743 
744  // Figure out the pile-up
745  if (calculatePileup) {
746  if (loadPileupFromDB)
748  else
750  determinePileup();
751  assert(pileup.size() == recoJets.size());
752  }
753 
754  // Write out the results
755  saveResults(iEvent, iSetup, nPreclustersFound);
756 }
std::vector< std::vector< reco::CandidatePtr > > constituents
unsigned iterationsPerformed
const bool useGriddedAlgorithm
std::vector< fftjetcms::VectorLike > pileup
void saveResults(edm::Event &iEvent, const edm::EventSetup &, unsigned nPreclustersFound)
virtual void assignMembershipFunctions(std::vector< fftjet::Peak > *preclusters)
void loadInputCollection(const edm::Event &)
Resolution resolution
std::vector< RecoFFTJet > recoJets
std::unique_ptr< GridAlg > gridAlg
std::vector< unsigned > occupancy
assert(be >=bs)
std::vector< fftjet::Peak > preclusters
void determineVectorConstituents()
const bool reuseExistingGrid
int iEvent
Definition: GenABIO.cc:224
edm::EDGetTokenT< reco::PattRecoTree< double, reco::PattRecoPeak< double > > > input_recotree_token_d_
std::unique_ptr< fftjet::Grid2d< fftjetcms::Real > > energyFlow
edm::EDGetTokenT< reco::PattRecoTree< float, reco::PattRecoPeak< float > > > input_recotree_token_f_
const double noiseLevel
virtual void determinePileupDensityFromDB(const edm::Event &iEvent, const edm::EventSetup &iSetup, std::unique_ptr< fftjet::Grid2d< fftjetcms::Real > > &density)
unsigned iterateJetReconstruction()
const bool calculatePileup
const bool assignConstituents
virtual void selectPreclusters(const SparseTree &tree, const fftjet::Functor1< bool, fftjet::Peak > &peakSelector, std::vector< fftjet::Peak > *preclusters)
const unsigned maxInitialPreclusters
SparseTree sparseTree
void determineGriddedConstituents()
std::unique_ptr< fftjet::Functor1< bool, fftjet::Peak > > peakSelector
std::unique_ptr< fftjet::Grid2d< fftjetcms::Real > > pileupEnergyFlow
virtual void genJetPreclusters(const SparseTree &tree, edm::Event &, const edm::EventSetup &, const fftjet::Functor1< bool, fftjet::Peak > &peakSelector, std::vector< fftjet::Peak > *preclusters)
void clear(EGIsoObj &c)
Definition: egamma.h:82
bool loadEnergyFlow(const edm::Event &iEvent, std::unique_ptr< fftjet::Grid2d< fftjetcms::Real > > &flow)
std::unique_ptr< RecoAlg > recoAlg
std::vector< fftjetcms::VectorLike > eventData
fftjetcms::VectorLike unclustered
virtual void determinePileupDensityFromConfig(const edm::Event &iEvent, std::unique_ptr< fftjet::Grid2d< fftjetcms::Real > > &density)
void removeFakePreclusters()
const unsigned maxIterations
void prepareRecombinationScales()

◆ removeFakePreclusters()

void FFTJetProducer::removeFakePreclusters ( )
private

Definition at line 905 of file FFTJetProducer.cc.

References cms::cuda::assert(), mps_fire::i, iterPreclusters, fftjetcms::matchOneToOne(), preclusters, and recoJets.

Referenced by iterateJetReconstruction(), and produce().

905  {
906  // There are two possible reasons for fake preclusters:
907  // 1. Membership factor was set to 0
908  // 2. Genuine problem with pattern recognition
909  //
910  // Anyway, we need to match jets to preclusters and keep
911  // only those preclusters that have been matched
912  //
913  std::vector<int> matchTable;
914  const unsigned nmatched = matchOneToOne(recoJets, preclusters, JetToPeakDistance(), &matchTable);
915 
916  // Ensure that all jets have been matched.
917  // If not, we must have a bug somewhere.
918  assert(nmatched == recoJets.size());
919 
920  // Collect all matched preclusters
921  iterPreclusters.clear();
922  iterPreclusters.reserve(nmatched);
923  for (unsigned i = 0; i < nmatched; ++i)
924  iterPreclusters.push_back(preclusters[matchTable[i]]);
926 }
unsigned matchOneToOne(const std::vector< T1 > &v1, const std::vector< T2 > &v2, const DistanceCalculator &calc, std::vector< int > *matchFrom1To2, const double maxMatchingDistance=1.0e300)
Definition: matchOneToOne.h:38
std::vector< RecoFFTJet > recoJets
assert(be >=bs)
std::vector< fftjet::Peak > preclusters
std::vector< fftjet::Peak > iterPreclusters

◆ saveResults()

void FFTJetProducer::saveResults ( edm::Event iEvent,
const edm::EventSetup iSetup,
unsigned  nPreclustersFound 
)
private

Definition at line 620 of file FFTJetProducer.cc.

References constituents, makeMEIFBenchmarkPlots::ev, mps_fire::i, iterationsPerformed, jet_type_switch, maxIterations, maxLevel, fftjetcommon_cfi::maxScale, minLevel, fftjetcommon_cfi::minScale, occupancy, fftjetcms::FFTJetInterface::outputLabel, resumConstituents, sparseTree, thresholds, mitigatedMETSequence_cff::U, unclustered, unused, usedLevel, and writeJets().

Referenced by produce().

620  {
621  // Write recombined jets
622  jet_type_switch(writeJets, ev, iSetup);
623 
624  // Check if we should resum unclustered energy constituents
625  VectorLike unclusE(unclustered);
626  if (resumConstituents) {
627  VectorLike sum(0.0, 0.0, 0.0, 0.0);
628  const unsigned nCon = constituents[0].size();
629  const reco::CandidatePtr* cn = nCon ? &constituents[0][0] : nullptr;
630  for (unsigned i = 0; i < nCon; ++i)
631  sum += cn[i]->p4();
632  unclusE = sum;
633  }
634 
635  // Write the jet reconstruction summary
636  const double minScale = minLevel ? sparseTree.getScale(minLevel) : 0.0;
637  const double maxScale = maxLevel ? sparseTree.getScale(maxLevel) : 0.0;
638  const double scaleUsed = usedLevel ? sparseTree.getScale(usedLevel) : 0.0;
639 
640  ev.put(
641  std::make_unique<reco::FFTJetProducerSummary>(thresholds,
642  occupancy,
643  unclusE,
644  constituents[0],
645  unused,
646  minScale,
647  maxScale,
648  scaleUsed,
649  nPreclustersFound,
652  outputLabel);
653 }
std::vector< std::vector< reco::CandidatePtr > > constituents
unsigned iterationsPerformed
const bool resumConstituents
std::vector< unsigned > occupancy
math::XYZTLorentzVector VectorLike
unsigned usedLevel
std::vector< double > thresholds
SparseTree sparseTree
void writeJets(edm::Event &iEvent, const edm::EventSetup &)
#define jet_type_switch(method, arg1, arg2)
const std::string outputLabel
fftjetcms::VectorLike unclustered
const unsigned maxIterations

◆ selectPreclusters()

void FFTJetProducer::selectPreclusters ( const SparseTree tree,
const fftjet::Functor1< bool, fftjet::Peak > &  peakSelector,
std::vector< fftjet::Peak > *  preclusters 
)
protectedvirtual

Definition at line 239 of file FFTJetProducer.cc.

References bsc_activity_cfg::clusters, mps_fire::i, nodes, preclusters, resolution, selectTreeNodes(), and sparseTree.

Referenced by produce().

241  {
242  nodes.clear();
243  selectTreeNodes(tree, peakSelect, &nodes);
244 
245  // Fill out the vector of preclusters using the tree node ids
246  const unsigned nNodes = nodes.size();
247  const SparseTree::NodeId* pnodes = nNodes ? &nodes[0] : nullptr;
248  preclusters->reserve(nNodes);
249  for (unsigned i = 0; i < nNodes; ++i)
250  preclusters->push_back(sparseTree.uncheckedNode(pnodes[i]).getCluster());
251 
252  // Remember the node id in the precluster and set
253  // the status word to indicate the resolution scheme used
254  fftjet::Peak* clusters = nNodes ? &(*preclusters)[0] : nullptr;
255  for (unsigned i = 0; i < nNodes; ++i) {
256  clusters[i].setCode(pnodes[i]);
257  clusters[i].setStatus(resolution);
258  }
259 }
void selectTreeNodes(const SparseTree &tree, const fftjet::Functor1< bool, fftjet::Peak > &peakSelect, std::vector< SparseTree::NodeId > *nodes)
Resolution resolution
std::vector< fftjet::Peak > preclusters
SparseTree sparseTree
std::vector< SparseTree::NodeId > nodes
Definition: tree.py:1

◆ selectTreeNodes()

void FFTJetProducer::selectTreeNodes ( const SparseTree tree,
const fftjet::Functor1< bool, fftjet::Peak > &  peakSelect,
std::vector< SparseTree::NodeId > *  nodes 
)
protected

Definition at line 261 of file FFTJetProducer.cc.

References cms::cuda::assert(), ztail::d, dumpMFGeometry_cfg::delta, FIXED, fixedScale, GLOBALLY_ADAPTIVE, personalPlayback::level, LOCALLY_ADAPTIVE, MAXIMALLY_STABLE, maxLevel, maxStableScale, minLevel, minStableScale, dqmiodumpmetadata::n, nClustersRequested, occupancy, resolution, stabilityAlpha, TopDecayID::stable, thresholds, and usedLevel.

Referenced by selectPreclusters().

263  {
264  minLevel = maxLevel = usedLevel = 0;
265 
266  // Get the tree nodes which pass the cuts
267  // (according to the selected resolution strategy)
268  switch (resolution) {
269  case FIXED: {
270  usedLevel = tree.getLevel(fixedScale);
271  tree.getPassingNodes(usedLevel, peakSelect, mynodes);
272  } break;
273 
274  case MAXIMALLY_STABLE: {
275  const unsigned minStartingLevel = maxStableScale > 0.0 ? tree.getLevel(maxStableScale) : 0;
276  const unsigned maxStartingLevel = minStableScale > 0.0 ? tree.getLevel(minStableScale) : UINT_MAX;
277 
278  if (tree.stableClusterCount(
279  peakSelect, &minLevel, &maxLevel, stabilityAlpha, minStartingLevel, maxStartingLevel)) {
280  usedLevel = (minLevel + maxLevel) / 2;
281  tree.getPassingNodes(usedLevel, peakSelect, mynodes);
282  }
283  } break;
284 
285  case GLOBALLY_ADAPTIVE: {
286  const bool stable = tree.clusterCountLevels(nClustersRequested, peakSelect, &minLevel, &maxLevel);
287  if (minLevel || maxLevel) {
288  usedLevel = (minLevel + maxLevel) / 2;
289  if (!stable) {
290  const int maxlev = tree.maxStoredLevel();
291  bool levelFound = false;
292  for (int delta = 0; delta <= maxlev && !levelFound; ++delta)
293  for (int ifac = 1; ifac > -2 && !levelFound; ifac -= 2) {
294  const int level = usedLevel + ifac * delta;
295  if (level > 0 && level <= maxlev)
297  usedLevel = level;
298  levelFound = true;
299  }
300  }
301  assert(levelFound);
302  }
303  } else {
304  // Can't find that exact number of preclusters.
305  // Try to get the next best thing.
306  usedLevel = 1;
307  const unsigned occ1 = occupancy[1];
308  if (nClustersRequested >= occ1) {
309  const unsigned maxlev = tree.maxStoredLevel();
310  if (nClustersRequested > occupancy[maxlev])
311  usedLevel = maxlev;
312  else {
313  // It would be nice to use "lower_bound" here,
314  // but the occupancy is not necessarily monotonous.
315  unsigned bestDelta = nClustersRequested > occ1 ? nClustersRequested - occ1 : occ1 - nClustersRequested;
316  for (unsigned level = 2; level <= maxlev; ++level) {
317  const unsigned n = occupancy[level];
318  const unsigned d = nClustersRequested > n ? nClustersRequested - n : n - nClustersRequested;
319  if (d < bestDelta) {
320  bestDelta = d;
321  usedLevel = level;
322  }
323  }
324  }
325  }
326  }
327  tree.getPassingNodes(usedLevel, peakSelect, mynodes);
328  } break;
329 
330  case LOCALLY_ADAPTIVE: {
331  usedLevel = tree.getLevel(fixedScale);
332  tree.getMagS2OptimalNodes(peakSelect, nClustersRequested, usedLevel, mynodes, &thresholds);
333  } break;
334 
335  default:
336  assert(!"ERROR in FFTJetProducer::selectTreeNodes : "
337  "should never get here! This is a bug. Please report.");
338  }
339 }
static const int stable
Definition: TopGenEvent.h:10
const double fixedScale
Resolution resolution
std::vector< unsigned > occupancy
assert(be >=bs)
const double minStableScale
const double maxStableScale
const unsigned nClustersRequested
unsigned usedLevel
std::vector< double > thresholds
d
Definition: ztail.py:151
const double stabilityAlpha
Definition: tree.py:1

◆ setJetStatusBit()

void FFTJetProducer::setJetStatusBit ( RecoFFTJet jet,
int  mask,
bool  value 
)
staticprivate

Definition at line 928 of file FFTJetProducer.cc.

References metsig::jet, gpuClustering::pixelStatus::mask, and mps_update::status.

Referenced by writeJets().

928  {
929  int status = jet->status();
930  if (value)
931  status |= mask;
932  else
933  status &= ~mask;
934  jet->setStatus(status);
935 }
constexpr uint32_t mask
Definition: gpuClustering.h:26
Definition: value.py:1

◆ writeJets()

template<typename T >
void FFTJetProducer::writeJets ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
private

Definition at line 529 of file FFTJetProducer.cc.

References fftjetcms::adjustForPileup(), calculatePileup, cellCountsVec, constituents, CONSTITUENTS_RESUMMED, fftjetcms::FFTJetInterface::energyFlow, geometry_token_, edm::EventSetup::getData(), mps_fire::i, iEvent, metsig::jet, PDWG_EXODelayedJetMET_cff::jets, eostools::move(), l1ctJetFileWriter_cfi::nJets, HLTTauReferences_cfi::OutputCollection, fftjetcms::FFTJetInterface::outputLabel, pileup, PILEUP_CALCULATED, PILEUP_SUBTRACTED_4VEC, PILEUP_SUBTRACTED_PT, pileupEnergyFlow, DiDispStaMuonMonitor_cfi::pt, recoJets, recombinationDataCutoff, resumConstituents, reco::FFTJet< Real >::setFourVec(), setJetStatusBit(), reco::FFTJet< Real >::setNCells(), reco::FFTJet< Real >::setPileup(), jetUpdater_cfi::sort, subtractPileup, subtractPileupAs4Vec, topology_token_, useGriddedAlgorithm, fftjetcms::FFTJetInterface::vertexUsed(), and reco::writeSpecific().

Referenced by saveResults().

529  {
530  using namespace reco;
531 
532  typedef FFTAnyJet<T> OutputJet;
533  typedef std::vector<OutputJet> OutputCollection;
534 
535  // Area of a single eta-phi cell for jet area calculations.
536  // Set it to 0 in case the module configuration does not allow
537  // us to calculate jet areas reliably.
538  double cellArea = useGriddedAlgorithm && recombinationDataCutoff < 0.0
539  ? energyFlow->etaBinWidth() * energyFlow->phiBinWidth()
540  : 0.0;
541 
542  if (calculatePileup)
543  cellArea = pileupEnergyFlow->etaBinWidth() * pileupEnergyFlow->phiBinWidth();
544 
545  // allocate output jet collection
546  auto jets = std::make_unique<OutputCollection>();
547  const unsigned nJets = recoJets.size();
548  jets->reserve(nJets);
549 
550  bool sorted = true;
551  double previousPt = DBL_MAX;
552  for (unsigned ijet = 0; ijet < nJets; ++ijet) {
553  RecoFFTJet& myjet(recoJets[ijet]);
554 
555  // Check if we should resum jet constituents
556  VectorLike jet4vec(myjet.vec());
557  if (resumConstituents) {
558  VectorLike sum(0.0, 0.0, 0.0, 0.0);
559  const unsigned nCon = constituents[ijet + 1].size();
560  const reco::CandidatePtr* cn = nCon ? &constituents[ijet + 1][0] : nullptr;
561  for (unsigned i = 0; i < nCon; ++i)
562  sum += cn[i]->p4();
563  jet4vec = sum;
564  setJetStatusBit(&myjet, CONSTITUENTS_RESUMMED, true);
565  }
566 
567  // Subtract the pile-up
569  jet4vec = adjustForPileup(jet4vec, pileup[ijet], subtractPileupAs4Vec);
572  else
573  setJetStatusBit(&myjet, PILEUP_SUBTRACTED_PT, true);
574  }
575 
576  // Write the specifics to the jet (simultaneously sets 4-vector,
577  // vertex, constituents). These are overridden functions that will
578  // call the appropriate specific code.
579  T jet;
580  if constexpr (std::is_same_v<T, reco::CaloJet>) {
581  const CaloGeometry& geometry = iSetup.getData(geometry_token_);
582  const HcalTopology& topology = iSetup.getData(topology_token_);
583  writeSpecific(jet, jet4vec, vertexUsed(), constituents[ijet + 1], geometry, topology);
584  } else {
585  writeSpecific(jet, jet4vec, vertexUsed(), constituents[ijet + 1]);
586  }
587 
588  // calcuate the jet area
589  double ncells = myjet.ncells();
590  if (calculatePileup) {
591  ncells = cellCountsVec[ijet];
592  setJetStatusBit(&myjet, PILEUP_CALCULATED, true);
593  }
594  jet.setJetArea(cellArea * ncells);
595 
596  // add jet to the list
597  FFTJet<float> fj(jetToStorable<float>(myjet));
598  fj.setFourVec(jet4vec);
599  if (calculatePileup) {
600  fj.setPileup(pileup[ijet]);
601  fj.setNCells(ncells);
602  }
603  jets->push_back(OutputJet(jet, fj));
604 
605  // Check whether the sequence remains sorted by pt
606  const double pt = jet.pt();
607  if (pt > previousPt)
608  sorted = false;
609  previousPt = pt;
610  }
611 
612  // Sort the collection
613  if (!sorted)
614  std::sort(jets->begin(), jets->end(), LocalSortByPt());
615 
616  // put the collection into the event
618 }
std::vector< std::vector< reco::CandidatePtr > > constituents
const bool useGriddedAlgorithm
std::vector< fftjetcms::VectorLike > pileup
const bool resumConstituents
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
const bool subtractPileupAs4Vec
const reco::Particle::Point & vertexUsed() const
void writeSpecific(reco::CaloJet &jet, reco::Particle::LorentzVector const &p4, reco::Particle::Point const &point, std::vector< reco::CandidatePtr > const &constituents, CaloGeometry const &geometry, HcalTopology const &topology)
Definition: JetSpecific.cc:32
const bool subtractPileup
std::vector< RecoFFTJet > recoJets
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > geometry_token_
const double recombinationDataCutoff
fftjet::RecombinedJet< VectorLike > RecoFFTJet
int iEvent
Definition: GenABIO.cc:224
std::unique_ptr< fftjet::Grid2d< fftjetcms::Real > > energyFlow
math::XYZTLorentzVector VectorLike
Implements inheritance relationships for FFTJet jets.
Definition: FFTAnyJet.h:16
static void setJetStatusBit(RecoFFTJet *jet, int mask, bool value)
std::vector< unsigned > cellCountsVec
const bool calculatePileup
edm::ESGetToken< HcalTopology, HcalRecNumberingRecord > topology_token_
fixed size matrix
std::unique_ptr< fftjet::Grid2d< fftjetcms::Real > > pileupEnergyFlow
long double T
const std::string outputLabel
math::XYZTLorentzVector adjustForPileup(const math::XYZTLorentzVector &jet, const math::XYZTLorentzVector &pileup, bool subtractPileupAs4Vec)
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

◆ assignConstituents

const bool FFTJetProducer::assignConstituents
private

Definition at line 260 of file FFTJetProducer.h.

Referenced by beginStream(), buildGridAlg(), FFTJetProducer(), and produce().

◆ bgMembershipFunction

std::unique_ptr<fftjetcms::AbsBgFunctor> FFTJetProducer::bgMembershipFunction
private

Definition at line 336 of file FFTJetProducer.h.

Referenced by beginStream(), and buildGridAlg().

◆ calculatePileup

const bool FFTJetProducer::calculatePileup
private

Definition at line 269 of file FFTJetProducer.h.

Referenced by beginStream(), produce(), and writeJets().

◆ cellCountsVec

std::vector<unsigned> FFTJetProducer::cellCountsVec
private

Definition at line 401 of file FFTJetProducer.h.

Referenced by determinePileup(), and writeJets().

◆ constituents

std::vector<std::vector<reco::CandidatePtr> > FFTJetProducer::constituents
private

◆ convergenceDistance

const double FFTJetProducer::convergenceDistance
private

Definition at line 257 of file FFTJetProducer.h.

Referenced by checkConvergence().

◆ doubleBuf

std::vector<double> FFTJetProducer::doubleBuf
private

Definition at line 400 of file FFTJetProducer.h.

Referenced by determinePileup().

◆ esLoader_

FFTJetLookupTableSequenceLoader FFTJetProducer::esLoader_
private

Definition at line 413 of file FFTJetProducer.h.

Referenced by determinePileupDensityFromDB(), and FFTJetProducer().

◆ fixedScale

const double FFTJetProducer::fixedScale
private

Definition at line 278 of file FFTJetProducer.h.

Referenced by selectTreeNodes().

◆ genJetsLabel

const edm::InputTag FFTJetProducer::genJetsLabel
private

Definition at line 304 of file FFTJetProducer.h.

Referenced by FFTJetProducer().

◆ geometry_token_

edm::ESGetToken<CaloGeometry, CaloGeometryRecord> FFTJetProducer::geometry_token_
private

Definition at line 410 of file FFTJetProducer.h.

Referenced by FFTJetProducer(), and writeJets().

◆ gridAlg

std::unique_ptr<GridAlg> FFTJetProducer::gridAlg
private

◆ gridScanMaxEta

const double FFTJetProducer::gridScanMaxEta
private

Definition at line 295 of file FFTJetProducer.h.

Referenced by buildGridAlg().

◆ iniScales

std::unique_ptr<std::vector<double> > FFTJetProducer::iniScales
private

Definition at line 324 of file FFTJetProducer.h.

Referenced by FFTJetProducer(), and loadSparseTreeData().

◆ input_energyflow_token_

edm::EDGetTokenT<reco::DiscretizedEnergyFlow> FFTJetProducer::input_energyflow_token_
private

Definition at line 407 of file FFTJetProducer.h.

Referenced by FFTJetProducer(), and loadEnergyFlow().

◆ input_genjet_token_

edm::EDGetTokenT<std::vector<reco::FFTAnyJet<reco::GenJet> > > FFTJetProducer::input_genjet_token_
private

Definition at line 406 of file FFTJetProducer.h.

Referenced by FFTJetProducer(), and genJetPreclusters().

◆ input_pusummary_token_

edm::EDGetTokenT<reco::FFTJetPileupSummary> FFTJetProducer::input_pusummary_token_
private

◆ input_recotree_token_d_

edm::EDGetTokenT<reco::PattRecoTree<double, reco::PattRecoPeak<double> > > FFTJetProducer::input_recotree_token_d_
private

Definition at line 404 of file FFTJetProducer.h.

Referenced by FFTJetProducer(), and produce().

◆ input_recotree_token_f_

edm::EDGetTokenT<reco::PattRecoTree<float, reco::PattRecoPeak<float> > > FFTJetProducer::input_recotree_token_f_
private

Definition at line 405 of file FFTJetProducer.h.

Referenced by FFTJetProducer(), and produce().

◆ isCrisp

const bool FFTJetProducer::isCrisp
private

Definition at line 299 of file FFTJetProducer.h.

Referenced by beginStream(), buildGridAlg(), and determinePileup().

◆ iterationsPerformed

unsigned FFTJetProducer::iterationsPerformed
private

Definition at line 381 of file FFTJetProducer.h.

Referenced by produce(), and saveResults().

◆ iterJets

std::vector<RecoFFTJet> FFTJetProducer::iterJets
private

Definition at line 380 of file FFTJetProducer.h.

Referenced by iterateJetReconstruction().

◆ iterPreclusters

std::vector<fftjet::Peak> FFTJetProducer::iterPreclusters
private

Definition at line 379 of file FFTJetProducer.h.

Referenced by iterateJetReconstruction(), and removeFakePreclusters().

◆ jetDistanceCalc

std::unique_ptr<fftjet::Functor2<double, RecoFFTJet, RecoFFTJet> > FFTJetProducer::jetDistanceCalc
private

Definition at line 354 of file FFTJetProducer.h.

Referenced by beginStream(), and checkConvergence().

◆ jetMembershipFunction

std::unique_ptr<fftjet::ScaleSpaceKernel> FFTJetProducer::jetMembershipFunction
private

Definition at line 335 of file FFTJetProducer.h.

Referenced by beginStream(), buildGridAlg(), and determinePileup().

◆ loadPileupFromDB

bool FFTJetProducer::loadPileupFromDB
private

Definition at line 321 of file FFTJetProducer.h.

Referenced by beginStream(), and produce().

◆ maxInitialPreclusters

const unsigned FFTJetProducer::maxInitialPreclusters
private

Definition at line 309 of file FFTJetProducer.h.

Referenced by produce().

◆ maxIterations

const unsigned FFTJetProducer::maxIterations
private

Definition at line 253 of file FFTJetProducer.h.

Referenced by beginStream(), iterateJetReconstruction(), produce(), and saveResults().

◆ maxLevel

unsigned FFTJetProducer::maxLevel
private

Definition at line 372 of file FFTJetProducer.h.

Referenced by saveResults(), and selectTreeNodes().

◆ maxStableScale

const double FFTJetProducer::maxStableScale
private

Definition at line 282 of file FFTJetProducer.h.

Referenced by selectTreeNodes().

◆ memberFactorCalcJet

std::unique_ptr<fftjet::Functor1<double, RecoFFTJet> > FFTJetProducer::memberFactorCalcJet
private

Definition at line 350 of file FFTJetProducer.h.

Referenced by beginStream(), determinePileup(), and iterateJetReconstruction().

◆ memberFactorCalcPeak

std::unique_ptr<fftjet::Functor1<double, fftjet::Peak> > FFTJetProducer::memberFactorCalcPeak
private

Definition at line 345 of file FFTJetProducer.h.

Referenced by beginStream(), and prepareRecombinationScales().

◆ memFcns2dVec

std::vector<fftjet::AbsKernel2d*> FFTJetProducer::memFcns2dVec
private

Definition at line 399 of file FFTJetProducer.h.

Referenced by determinePileup().

◆ minLevel

unsigned FFTJetProducer::minLevel
private

Definition at line 372 of file FFTJetProducer.h.

Referenced by saveResults(), and selectTreeNodes().

◆ minStableScale

const double FFTJetProducer::minStableScale
private

Definition at line 281 of file FFTJetProducer.h.

Referenced by selectTreeNodes().

◆ myConfiguration

const edm::ParameterSet FFTJetProducer::myConfiguration
private

Definition at line 239 of file FFTJetProducer.h.

Referenced by beginStream().

◆ nClustersRequested

const unsigned FFTJetProducer::nClustersRequested
private

Definition at line 292 of file FFTJetProducer.h.

Referenced by selectTreeNodes().

◆ nJetsRequiredToConverge

const unsigned FFTJetProducer::nJetsRequiredToConverge
private

Definition at line 256 of file FFTJetProducer.h.

◆ nodes

std::vector<SparseTree::NodeId> FFTJetProducer::nodes
private

Definition at line 357 of file FFTJetProducer.h.

Referenced by selectPreclusters().

◆ noiseLevel

const double FFTJetProducer::noiseLevel
private

Definition at line 289 of file FFTJetProducer.h.

Referenced by iterateJetReconstruction(), and produce().

◆ occupancy

std::vector<unsigned> FFTJetProducer::occupancy
private

Definition at line 366 of file FFTJetProducer.h.

Referenced by produce(), saveResults(), and selectTreeNodes().

◆ peakSelector

std::unique_ptr<fftjet::Functor1<bool, fftjet::Peak> > FFTJetProducer::peakSelector
private

Definition at line 330 of file FFTJetProducer.h.

Referenced by beginStream(), and produce().

◆ pileup

std::vector<fftjetcms::VectorLike> FFTJetProducer::pileup
private

Definition at line 388 of file FFTJetProducer.h.

Referenced by determinePileup(), produce(), and writeJets().

◆ pileupDensityCalc

std::unique_ptr<fftjetcms::AbsPileupCalculator> FFTJetProducer::pileupDensityCalc
private

Definition at line 396 of file FFTJetProducer.h.

Referenced by beginStream(), and determinePileupDensityFromConfig().

◆ pileupEnergyFlow

std::unique_ptr<fftjet::Grid2d<fftjetcms::Real> > FFTJetProducer::pileupEnergyFlow
private

Definition at line 393 of file FFTJetProducer.h.

Referenced by beginStream(), determinePileup(), produce(), and writeJets().

◆ pileupLabel

const edm::InputTag FFTJetProducer::pileupLabel
private

Definition at line 275 of file FFTJetProducer.h.

Referenced by FFTJetProducer().

◆ pileupTableCategory

std::string FFTJetProducer::pileupTableCategory
private

Definition at line 320 of file FFTJetProducer.h.

Referenced by determinePileupDensityFromDB().

◆ pileupTableName

std::string FFTJetProducer::pileupTableName
private

Definition at line 319 of file FFTJetProducer.h.

Referenced by determinePileupDensityFromDB().

◆ pileupTableRecord

std::string FFTJetProducer::pileupTableRecord
private

Definition at line 318 of file FFTJetProducer.h.

Referenced by determinePileupDensityFromDB(), and FFTJetProducer().

◆ preclusters

std::vector<fftjet::Peak> FFTJetProducer::preclusters
private

◆ recoAlg

std::unique_ptr<RecoAlg> FFTJetProducer::recoAlg
private

◆ recoJets

std::vector<RecoFFTJet> FFTJetProducer::recoJets
private

◆ recombinationAlgorithm

const std::string FFTJetProducer::recombinationAlgorithm
private

Definition at line 298 of file FFTJetProducer.h.

Referenced by beginStream(), and buildGridAlg().

◆ recombinationDataCutoff

const double FFTJetProducer::recombinationDataCutoff
private

Definition at line 301 of file FFTJetProducer.h.

Referenced by buildGridAlg(), and writeJets().

◆ recoScaleCalcJet

std::unique_ptr<fftjet::Functor1<double, RecoFFTJet> > FFTJetProducer::recoScaleCalcJet
private

Definition at line 348 of file FFTJetProducer.h.

Referenced by beginStream(), determinePileup(), and iterateJetReconstruction().

◆ recoScaleCalcPeak

std::unique_ptr<fftjet::Functor1<double, fftjet::Peak> > FFTJetProducer::recoScaleCalcPeak
private

Definition at line 339 of file FFTJetProducer.h.

Referenced by beginStream(), and prepareRecombinationScales().

◆ recoScaleRatioCalcJet

std::unique_ptr<fftjet::Functor1<double, RecoFFTJet> > FFTJetProducer::recoScaleRatioCalcJet
private

Definition at line 349 of file FFTJetProducer.h.

Referenced by beginStream(), determinePileup(), and iterateJetReconstruction().

◆ recoScaleRatioCalcPeak

std::unique_ptr<fftjet::Functor1<double, fftjet::Peak> > FFTJetProducer::recoScaleRatioCalcPeak
private

Definition at line 342 of file FFTJetProducer.h.

Referenced by beginStream(), and prepareRecombinationScales().

◆ resolution

Resolution FFTJetProducer::resolution
private

Definition at line 314 of file FFTJetProducer.h.

Referenced by genJetPreclusters(), produce(), selectPreclusters(), and selectTreeNodes().

◆ resumConstituents

const bool FFTJetProducer::resumConstituents
private

Definition at line 265 of file FFTJetProducer.h.

Referenced by FFTJetProducer(), saveResults(), and writeJets().

◆ reuseExistingGrid

const bool FFTJetProducer::reuseExistingGrid
private

Definition at line 250 of file FFTJetProducer.h.

Referenced by beginStream(), and produce().

◆ sparseTree

SparseTree FFTJetProducer::sparseTree
private

Definition at line 327 of file FFTJetProducer.h.

Referenced by loadSparseTreeData(), produce(), saveResults(), and selectPreclusters().

◆ stabilityAlpha

const double FFTJetProducer::stabilityAlpha
private

Definition at line 285 of file FFTJetProducer.h.

Referenced by selectTreeNodes().

◆ subtractPileup

const bool FFTJetProducer::subtractPileup
private

Definition at line 270 of file FFTJetProducer.h.

Referenced by writeJets().

◆ subtractPileupAs4Vec

const bool FFTJetProducer::subtractPileupAs4Vec
private

Definition at line 271 of file FFTJetProducer.h.

Referenced by writeJets().

◆ thresholds

std::vector<double> FFTJetProducer::thresholds
private

Definition at line 369 of file FFTJetProducer.h.

Referenced by saveResults(), and selectTreeNodes().

◆ topology_token_

edm::ESGetToken<HcalTopology, HcalRecNumberingRecord> FFTJetProducer::topology_token_
private

Definition at line 411 of file FFTJetProducer.h.

Referenced by FFTJetProducer(), and writeJets().

◆ treeLabel

const edm::InputTag FFTJetProducer::treeLabel
private

Definition at line 242 of file FFTJetProducer.h.

Referenced by FFTJetProducer().

◆ unclustered

fftjetcms::VectorLike FFTJetProducer::unclustered
private

Definition at line 375 of file FFTJetProducer.h.

Referenced by iterateJetReconstruction(), produce(), and saveResults().

◆ unlikelyBgWeight

const double FFTJetProducer::unlikelyBgWeight
private

Definition at line 300 of file FFTJetProducer.h.

Referenced by beginStream(), and buildGridAlg().

◆ unused

double FFTJetProducer::unused
private

Definition at line 376 of file FFTJetProducer.h.

Referenced by iterateJetReconstruction(), produce(), and saveResults().

◆ usedLevel

unsigned FFTJetProducer::usedLevel
private

Definition at line 372 of file FFTJetProducer.h.

Referenced by saveResults(), and selectTreeNodes().

◆ useGriddedAlgorithm

const bool FFTJetProducer::useGriddedAlgorithm
private

Definition at line 246 of file FFTJetProducer.h.

Referenced by beginStream(), iterateJetReconstruction(), produce(), and writeJets().