CMS 3D CMS Logo

PFMultiDepthClusterProducer.cc
Go to the documentation of this file.
12 
13 #include <memory>
14 
19 
20 public:
22  ~PFMultiDepthClusterProducer() override = default;
23 
24  void beginLuminosityBlock(const edm::LuminosityBlock&, const edm::EventSetup&) override;
25  void produce(edm::Event&, const edm::EventSetup&) override;
26 
27 private:
28  // inputs
30  // options
31  // the actual algorithm
32  std::unique_ptr<PFClusterBuilderBase> _pfClusterBuilder;
33  std::unique_ptr<PFClusterEnergyCorrectorBase> _energyCorrector;
34 };
35 
37 
38 #ifdef PFLOW_DEBUG
39 #define LOGVERB(x) edm::LogVerbatim(x)
40 #define LOGWARN(x) edm::LogWarning(x)
41 #define LOGERR(x) edm::LogError(x)
42 #define LOGDRESSED(x) edm::LogInfo(x)
43 #else
44 #define LOGVERB(x) LogTrace(x)
45 #define LOGWARN(x) edm::LogWarning(x)
46 #define LOGERR(x) edm::LogError(x)
47 #define LOGDRESSED(x) LogDebug(x)
48 #endif
49 
51  _clustersLabel = consumes<reco::PFClusterCollection>(conf.getParameter<edm::InputTag>("clustersSource"));
52  const edm::ParameterSet& pfcConf = conf.getParameterSet("pfClusterBuilder");
53 
54  edm::ConsumesCollector&& cc = consumesCollector();
55  if (!pfcConf.empty()) {
56  const std::string& pfcName = pfcConf.getParameter<std::string>("algoName");
57  _pfClusterBuilder = PFClusterBuilderFactory::get()->create(pfcName, pfcConf, cc);
58  }
59  // see if new need to apply corrections, setup if there.
60  const edm::ParameterSet& cConf = conf.getParameterSet("energyCorrector");
61  if (!cConf.empty()) {
62  const std::string& cName = cConf.getParameter<std::string>("algoName");
64  }
65 
66  produces<reco::PFClusterCollection>();
67 }
68 
70  _pfClusterBuilder->update(es);
71 }
72 
74  _pfClusterBuilder->reset();
75 
77  e.getByToken(_clustersLabel, inputClusters);
78 
79  std::vector<bool> seedable;
80 
81  auto pfClusters = std::make_unique<reco::PFClusterCollection>();
82  _pfClusterBuilder->buildClusters(*inputClusters, seedable, *pfClusters);
83  LOGVERB("PFMultiDepthClusterProducer::produce()") << *_pfClusterBuilder;
84 
85  if (_energyCorrector) {
86  _energyCorrector->correctEnergies(*pfClusters);
87  }
88  e.put(std::move(pfClusters));
89 }
InitialClusteringStepBase.h
PFMultiDepthClusterProducer::PFCBB
PFClusterBuilderBase PFCBB
Definition: PFMultiDepthClusterProducer.cc:17
SeedFinderBase.h
PFMultiDepthClusterProducer::beginLuminosityBlock
void beginLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &) override
Definition: PFMultiDepthClusterProducer.cc:69
edm::LuminosityBlock
Definition: LuminosityBlock.h:50
PFMultiDepthClusterProducer
Definition: PFMultiDepthClusterProducer.cc:15
edm::EDGetTokenT< reco::PFClusterCollection >
PFMultiDepthClusterProducer::PFMultiDepthClusterProducer
PFMultiDepthClusterProducer(const edm::ParameterSet &)
Definition: PFMultiDepthClusterProducer.cc:50
LOGVERB
#define LOGVERB(x)
Definition: PFMultiDepthClusterProducer.cc:44
PFMultiDepthClusterProducer::PosCalc
PFCPositionCalculatorBase PosCalc
Definition: PFMultiDepthClusterProducer.cc:18
EDProducer.h
PFMultiDepthClusterProducer::_energyCorrector
std::unique_ptr< PFClusterEnergyCorrectorBase > _energyCorrector
Definition: PFMultiDepthClusterProducer.cc:33
edm::Handle
Definition: AssociativeIterator.h:50
PFMultiDepthClusterProducer::_pfClusterBuilder
std::unique_ptr< PFClusterBuilderBase > _pfClusterBuilder
Definition: PFMultiDepthClusterProducer.cc:32
MakerMacros.h
PFClusterEnergyCorrectorBase.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
PFClusterBuilderBase.h
PFCPositionCalculatorBase.h
PFCPositionCalculatorBase
Definition: PFCPositionCalculatorBase.h:15
RecHitTopologicalCleanerBase.h
edm::ParameterSet
Definition: ParameterSet.h:47
InitialClusteringStepBase
Definition: InitialClusteringStepBase.h:24
Event.h
PFMultiDepthClusterProducer::_clustersLabel
edm::EDGetTokenT< reco::PFClusterCollection > _clustersLabel
Definition: PFMultiDepthClusterProducer.cc:29
edm::stream::EDProducer
Definition: EDProducer.h:36
edm::EventSetup
Definition: EventSetup.h:58
get
#define get
cc
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
eostools.move
def move(src, dest)
Definition: eostools.py:511
PFMultiDepthClusterProducer::~PFMultiDepthClusterProducer
~PFMultiDepthClusterProducer() override=default
Frameworkfwd.h
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
PFMultiDepthClusterProducer::produce
void produce(edm::Event &, const edm::EventSetup &) override
Definition: PFMultiDepthClusterProducer.cc:73
PFClusterBuilderBase
Definition: PFClusterBuilderBase.h:19
ConsumesCollector.h
edm::Event
Definition: Event.h:73
lumi
Definition: LumiSectionData.h:20
edm::InputTag
Definition: InputTag.h:15
edm::ConsumesCollector
Definition: ConsumesCollector.h:45
edm::ParameterSet::empty
bool empty() const
Definition: ParameterSet.h:201
edm::ParameterSet::getParameterSet
ParameterSet const & getParameterSet(std::string const &) const
Definition: ParameterSet.cc:2128
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
PFMultiDepthClusterProducer::ICSB
InitialClusteringStepBase ICSB
Definition: PFMultiDepthClusterProducer.cc:16