CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Types | Private Attributes
PFMultiDepthClusterProducer Class Reference
Inheritance diagram for PFMultiDepthClusterProducer:
edm::stream::EDProducer<>

Public Member Functions

void beginRun (const edm::Run &, const edm::EventSetup &) override
 
 PFMultiDepthClusterProducer (const edm::ParameterSet &)
 
void produce (edm::Event &, const edm::EventSetup &) override
 
 ~PFMultiDepthClusterProducer () override=default
 
- 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 void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Types

typedef InitialClusteringStepBase ICSB
 
typedef PFClusterBuilderBase PFCBB
 
typedef PFCPositionCalculatorBase PosCalc
 

Private Attributes

edm::EDGetTokenT< reco::PFClusterCollection_clustersLabel
 
std::unique_ptr< PFClusterEnergyCorrectorBase_energyCorrector
 
std::unique_ptr< PFClusterBuilderBase_pfClusterBuilder
 
bool cutsFromDB
 
edm::ESGetToken< HcalPFCuts, HcalPFCutsRcdhcalCutsToken_
 
HcalPFCuts const * paramPF = nullptr
 

Additional Inherited Members

- 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
 

Detailed Description

Definition at line 17 of file PFMultiDepthClusterProducer.cc.

Member Typedef Documentation

◆ ICSB

Definition at line 18 of file PFMultiDepthClusterProducer.cc.

◆ PFCBB

Definition at line 19 of file PFMultiDepthClusterProducer.cc.

◆ PosCalc

Definition at line 20 of file PFMultiDepthClusterProducer.cc.

Constructor & Destructor Documentation

◆ PFMultiDepthClusterProducer()

PFMultiDepthClusterProducer::PFMultiDepthClusterProducer ( const edm::ParameterSet conf)

Definition at line 91 of file PFMultiDepthClusterProducer.cc.

References _clustersLabel, _energyCorrector, _pfClusterBuilder, gpuPixelDoublets::cc, cutsFromDB, edm::ParameterSet::empty(), get, edm::ParameterSet::getParameter(), edm::ParameterSet::getParameterSet(), hcalCutsToken_, and AlCaHLTBitMon_QueryRunRegistry::string.

91  {
92  _clustersLabel = consumes<reco::PFClusterCollection>(conf.getParameter<edm::InputTag>("clustersSource"));
93  cutsFromDB = conf.getParameter<bool>("usePFThresholdsFromDB");
94  const edm::ParameterSet& pfcConf = conf.getParameterSet("pfClusterBuilder");
95 
96  edm::ConsumesCollector&& cc = consumesCollector();
97 
98  if (cutsFromDB) {
99  hcalCutsToken_ = esConsumes<HcalPFCuts, HcalPFCutsRcd, edm::Transition::BeginRun>(edm::ESInputTag("", "withTopo"));
100  }
101 
102  if (!pfcConf.empty()) {
103  const std::string& pfcName = pfcConf.getParameter<std::string>("algoName");
104  if (!pfcName.empty())
105  _pfClusterBuilder = PFClusterBuilderFactory::get()->create(pfcName, pfcConf, cc);
106  }
107  // see if new need to apply corrections, setup if there.
108  const edm::ParameterSet& cConf = conf.getParameterSet("energyCorrector");
109  if (!cConf.empty()) {
110  const std::string& cName = cConf.getParameter<std::string>("algoName");
111  if (!cName.empty())
112  _energyCorrector = PFClusterEnergyCorrectorFactory::get()->create(cName, cConf);
113  }
114 
115  produces<reco::PFClusterCollection>();
116 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
uint32_t cc[maxCellsPerHit]
Definition: gpuFishbone.h:49
ParameterSet const & getParameterSet(std::string const &) const
std::unique_ptr< PFClusterBuilderBase > _pfClusterBuilder
bool empty() const
Definition: ParameterSet.h:202
std::unique_ptr< PFClusterEnergyCorrectorBase > _energyCorrector
edm::ESGetToken< HcalPFCuts, HcalPFCutsRcd > hcalCutsToken_
edm::EDGetTokenT< reco::PFClusterCollection > _clustersLabel
#define get

◆ ~PFMultiDepthClusterProducer()

PFMultiDepthClusterProducer::~PFMultiDepthClusterProducer ( )
overridedefault

Member Function Documentation

◆ beginRun()

void PFMultiDepthClusterProducer::beginRun ( const edm::Run run,
const edm::EventSetup es 
)
override

Definition at line 118 of file PFMultiDepthClusterProducer.cc.

References _pfClusterBuilder, cutsFromDB, edm::EventSetup::getData(), hcalCutsToken_, and paramPF.

118  {
119  if (cutsFromDB) {
121  }
122  _pfClusterBuilder->update(es);
123 }
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
std::unique_ptr< PFClusterBuilderBase > _pfClusterBuilder
edm::ESGetToken< HcalPFCuts, HcalPFCutsRcd > hcalCutsToken_

◆ fillDescriptions()

void PFMultiDepthClusterProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 44 of file PFMultiDepthClusterProducer.cc.

References edm::ParameterSetDescription::add(), edm::ParameterSetDescription::addVPSet(), edm::ConfigurationDescriptions::addWithDefaultLabel(), submitPVResolutionJobs::desc, MillePedeFileConverter_cfg::e, and AlCaHLTBitMon_QueryRunRegistry::string.

44  {
46  desc.add<edm::InputTag>("clustersSource", {});
47  desc.add<edm::ParameterSetDescription>("energyCorrector", {});
48  {
50  pset0.add<std::string>("algoName", "PFMultiDepthClusterizer");
51  {
53  pset1.add<std::string>("algoName", "Basic2DGenericPFlowPositionCalc");
54  {
56  psd.add<std::vector<int>>("depths", {});
57  psd.add<std::string>("detector", "");
58  psd.add<std::vector<double>>("logWeightDenominator", {});
59  pset1.addVPSet("logWeightDenominatorByDetector", psd, {});
60  }
61  pset1.add<double>("minAllowedNormalization", 1e-09);
62  pset1.add<double>("minFractionInCalc", 1e-09);
63  pset1.add<int>("posCalcNCrystals", -1);
64  pset1.add<edm::ParameterSetDescription>("timeResolutionCalcBarrel", {});
65  pset1.add<edm::ParameterSetDescription>("timeResolutionCalcEndcap", {});
66  pset0.add<edm::ParameterSetDescription>("allCellsPositionCalc", pset1);
67  }
68  pset0.add<edm::ParameterSetDescription>("positionCalc", {});
69  pset0.add<double>("minFractionToKeep", 1e-07);
70  pset0.add<double>("nSigmaEta", 2.0);
71  pset0.add<double>("nSigmaPhi", 2.0);
72  desc.add<edm::ParameterSetDescription>("pfClusterBuilder", pset0);
73  }
74  desc.add<edm::ParameterSetDescription>("positionReCalc", {});
75  desc.add<bool>("usePFThresholdsFromDB", false);
76  descriptions.addWithDefaultLabel(desc);
77 }
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
ParameterDescriptionBase * addVPSet(U const &iLabel, ParameterSetDescription const &validator, std::vector< ParameterSet > const &defaults)
ParameterDescriptionBase * add(U const &iLabel, T const &value)

◆ produce()

void PFMultiDepthClusterProducer::produce ( edm::Event e,
const edm::EventSetup es 
)
override

Definition at line 125 of file PFMultiDepthClusterProducer.cc.

References _clustersLabel, _energyCorrector, _pfClusterBuilder, MillePedeFileConverter_cfg::e, HLT_FULL_cff::inputClusters, LOGVERB, eostools::move(), and paramPF.

125  {
126  _pfClusterBuilder->reset();
127 
129  e.getByToken(_clustersLabel, inputClusters);
130 
131  std::vector<bool> seedable;
132 
133  auto pfClusters = std::make_unique<reco::PFClusterCollection>();
134  _pfClusterBuilder->buildClusters(*inputClusters, seedable, *pfClusters, paramPF);
135  LOGVERB("PFMultiDepthClusterProducer::produce()") << *_pfClusterBuilder;
136 
137  if (_energyCorrector) {
138  _energyCorrector->correctEnergies(*pfClusters);
139  }
140  e.put(std::move(pfClusters));
141 }
std::unique_ptr< PFClusterBuilderBase > _pfClusterBuilder
std::unique_ptr< PFClusterEnergyCorrectorBase > _energyCorrector
edm::EDGetTokenT< reco::PFClusterCollection > _clustersLabel
#define LOGVERB(x)
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

◆ _clustersLabel

edm::EDGetTokenT<reco::PFClusterCollection> PFMultiDepthClusterProducer::_clustersLabel
private

Definition at line 32 of file PFMultiDepthClusterProducer.cc.

Referenced by PFMultiDepthClusterProducer(), and produce().

◆ _energyCorrector

std::unique_ptr<PFClusterEnergyCorrectorBase> PFMultiDepthClusterProducer::_energyCorrector
private

Definition at line 37 of file PFMultiDepthClusterProducer.cc.

Referenced by PFMultiDepthClusterProducer(), and produce().

◆ _pfClusterBuilder

std::unique_ptr<PFClusterBuilderBase> PFMultiDepthClusterProducer::_pfClusterBuilder
private

Definition at line 36 of file PFMultiDepthClusterProducer.cc.

Referenced by beginRun(), PFMultiDepthClusterProducer(), and produce().

◆ cutsFromDB

bool PFMultiDepthClusterProducer::cutsFromDB
private

Definition at line 38 of file PFMultiDepthClusterProducer.cc.

Referenced by beginRun(), and PFMultiDepthClusterProducer().

◆ hcalCutsToken_

edm::ESGetToken<HcalPFCuts, HcalPFCutsRcd> PFMultiDepthClusterProducer::hcalCutsToken_
private

Definition at line 33 of file PFMultiDepthClusterProducer.cc.

Referenced by beginRun(), and PFMultiDepthClusterProducer().

◆ paramPF

HcalPFCuts const* PFMultiDepthClusterProducer::paramPF = nullptr
private

Definition at line 39 of file PFMultiDepthClusterProducer.cc.

Referenced by beginRun(), and produce().