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 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
~PFMultiDepthClusterProducer() override=default
ParameterSet const & getParameterSet(std::string const &) const
std::unique_ptr< PFClusterBuilderBase > _pfClusterBuilder
void beginLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &) override
bool empty() const
Definition: ParameterSet.h:201
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
std::unique_ptr< PFClusterEnergyCorrectorBase > _energyCorrector
void produce(edm::Event &, const edm::EventSetup &) override
PFMultiDepthClusterProducer(const edm::ParameterSet &)
edm::EDGetTokenT< reco::PFClusterCollection > _clustersLabel
#define LOGVERB(x)
#define get
def move(src, dest)
Definition: eostools.py:511