CMS 3D CMS Logo

HGCalTowerMapProducer.cc
Go to the documentation of this file.
3 
10 
13 
15 
16 #include <memory>
17 
19 public:
21  ~HGCalTowerMapProducer() override {}
22 
23  void beginRun(const edm::Run&, const edm::EventSetup&) override;
24  void produce(edm::Event&, const edm::EventSetup&) override;
25 
26 private:
27  // inputs
31  std::unique_ptr<HGCalTowerMapProcessorBase> towersMapProcess_;
32 };
33 
35 
37  : input_sums_(consumes<l1t::HGCalTriggerSumsBxCollection>(conf.getParameter<edm::InputTag>("InputTriggerSums"))),
38  triggerGeomToken_(esConsumes<HGCalTriggerGeometryBase, CaloGeometryRecord, edm::Transition::BeginRun>()) {
39  //setup TowerMap parameters
40  const edm::ParameterSet& towerMapParamConfig = conf.getParameterSet("ProcessorParameters");
41  const std::string& towerMapProcessorName = towerMapParamConfig.getParameter<std::string>("ProcessorName");
42  towersMapProcess_ = std::unique_ptr<HGCalTowerMapProcessorBase>{
43  HGCalTowerMapFactory::get()->create(towerMapProcessorName, towerMapParamConfig)};
44 
45  produces<l1t::HGCalTowerMapBxCollection>(towersMapProcess_->name());
46 }
47 
48 void HGCalTowerMapProducer::beginRun(const edm::Run& /*run*/, const edm::EventSetup& es) {
51 }
52 
54  // Output collections
55  auto towersMap_output = std::make_unique<l1t::HGCalTowerMapBxCollection>();
56 
57  // Input collections
59 
60  e.getByToken(input_sums_, trigSumBxColl);
61 
62  towersMapProcess_->run(trigSumBxColl, *towersMap_output);
63 
64  e.put(std::move(towersMap_output), towersMapProcess_->name());
65 }
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
HGCalTowerMapProducer(const edm::ParameterSet &)
void beginRun(const edm::Run &, const edm::EventSetup &) override
ParameterSet const & getParameterSet(std::string const &) const
delete x;
Definition: CaloConfig.h:22
T const * product() const
Definition: ESHandle.h:86
BXVector< HGCalTriggerSums > HGCalTriggerSumsBxCollection
Transition
Definition: Transition.h:12
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
edm::ESGetToken< HGCalTriggerGeometryBase, CaloGeometryRecord > triggerGeomToken_
edm::ESHandle< HGCalTriggerGeometryBase > triggerGeometry_
std::unique_ptr< HGCalTowerMapProcessorBase > towersMapProcess_
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:151
HLT enums.
void produce(edm::Event &, const edm::EventSetup &) override
#define get
def move(src, dest)
Definition: eostools.py:511
Definition: Run.h:45