CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 }
bool empty() const
Definition: ParameterSet.h:201
~PFMultiDepthClusterProducer() override=default
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
std::unique_ptr< PFClusterBuilderBase > _pfClusterBuilder
void beginLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &) override
def move
Definition: eostools.py:511
std::unique_ptr< PFClusterEnergyCorrectorBase > _energyCorrector
void produce(edm::Event &, const edm::EventSetup &) override
list lumi
Definition: dqmdumpme.py:53
PFMultiDepthClusterProducer(const edm::ParameterSet &)
ParameterSet const & getParameterSet(std::string const &) const
edm::EDGetTokenT< reco::PFClusterCollection > _clustersLabel
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
#define LOGVERB(x)
#define get