CMS 3D CMS Logo

HGCalTowerProducer.cc
Go to the documentation of this file.
3 
6 
10 
13 
15 
16 #include <memory>
17 
19 public:
21  ~HGCalTowerProducer() 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<HGCalTowerProcessorBase> towersProcess_;
32 };
33 
35 
37  : input_towers_map_(consumes<l1t::HGCalTowerMapBxCollection>(conf.getParameter<edm::InputTag>("InputTowerMaps"))) {
38  //setup TowerMap parameters
39  const edm::ParameterSet& towerParamConfig = conf.getParameterSet("ProcessorParameters");
40  const std::string& towerProcessorName = towerParamConfig.getParameter<std::string>("ProcessorName");
41  towersProcess_ = HGCalTowerFactory::get()->create(towerProcessorName, towerParamConfig);
42 
43  produces<l1t::HGCalTowerBxCollection>(towersProcess_->name());
44 }
45 
46 void HGCalTowerProducer::beginRun(const edm::Run& /*run*/, const edm::EventSetup& es) {
48  towersProcess_->setGeometry(triggerGeometry_.product());
49 }
50 
52  // Output collections
53  auto towers_output = std::make_unique<l1t::HGCalTowerBxCollection>();
54 
55  // Input collections
57 
58  e.getByToken(input_towers_map_, towersMapBxColl);
59 
60  towersProcess_->run(towersMapBxColl, *towers_output, es);
61 
62  e.put(std::move(towers_output), towersProcess_->name());
63 }
T getParameter(std::string const &) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:131
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
edm::ESHandle< HGCalTriggerGeometryBase > triggerGeometry_
delete x;
Definition: CaloConfig.h:22
BXVector< HGCalTowerMap > HGCalTowerMapBxCollection
Definition: HGCalTowerMap.h:12
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
void beginRun(const edm::Run &, const edm::EventSetup &) override
edm::EDGetToken input_towers_map_
ParameterSet const & getParameterSet(std::string const &) const
HLT enums.
T get() const
Definition: EventSetup.h:73
~HGCalTowerProducer() override
void produce(edm::Event &, const edm::EventSetup &) override
HGCalTowerProducer(const edm::ParameterSet &)
T const * product() const
Definition: ESHandle.h:86
std::unique_ptr< HGCalTowerProcessorBase > towersProcess_
def move(src, dest)
Definition: eostools.py:511
Definition: Run.h:45