CMS 3D CMS Logo

HGCalTowerMapProducer.cc
Go to the documentation of this file.
3 
6 
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
30 
31  std::unique_ptr<HGCalTowerMapProcessorBase> towersMapProcess_;
32 };
33 
35 
37  : input_cell_(consumes<l1t::HGCalTriggerCellBxCollection>(conf.getParameter<edm::InputTag>("InputTriggerCells"))) {
38  //setup TowerMap parameters
39  const edm::ParameterSet& towerMapParamConfig = conf.getParameterSet("ProcessorParameters");
40  const std::string& towerMapProcessorName = towerMapParamConfig.getParameter<std::string>("ProcessorName");
41  towersMapProcess_ = std::unique_ptr<HGCalTowerMapProcessorBase>{
42  HGCalTowerMapFactory::get()->create(towerMapProcessorName, towerMapParamConfig)};
43 
44  produces<l1t::HGCalTowerMapBxCollection>(towersMapProcess_->name());
45 }
46 
47 void HGCalTowerMapProducer::beginRun(const edm::Run& /*run*/, const edm::EventSetup& es) {
50 }
51 
53  // Output collections
54  auto towersMap_output = std::make_unique<l1t::HGCalTowerMapBxCollection>();
55 
56  // Input collections
58 
59  e.getByToken(input_cell_, trigCellBxColl);
60 
61  towersMapProcess_->run(trigCellBxColl, *towersMap_output, es);
62 
63  e.put(std::move(towersMap_output), towersMapProcess_->name());
64 }
T getParameter(std::string const &) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:131
HGCalTowerMapProducer(const edm::ParameterSet &)
BXVector< HGCalTriggerCell > HGCalTriggerCellBxCollection
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
void beginRun(const edm::Run &, const edm::EventSetup &) override
delete x;
Definition: CaloConfig.h:22
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
edm::ESHandle< HGCalTriggerGeometryBase > triggerGeometry_
std::unique_ptr< HGCalTowerMapProcessorBase > towersMapProcess_
ParameterSet const & getParameterSet(std::string const &) const
HLT enums.
T get() const
Definition: EventSetup.h:73
void produce(edm::Event &, const edm::EventSetup &) override
T const * product() const
Definition: ESHandle.h:86
def move(src, dest)
Definition: eostools.py:511
Definition: Run.h:45