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");
42  std::unique_ptr<HGCalTowerProcessorBase>{HGCalTowerFactory::get()->create(towerProcessorName, towerParamConfig)};
43 
44  produces<l1t::HGCalTowerBxCollection>(towersProcess_->name());
45 }
46 
47 void HGCalTowerProducer::beginRun(const edm::Run& /*run*/, const edm::EventSetup& es) {
49  towersProcess_->setGeometry(triggerGeometry_.product());
50 }
51 
53  // Output collections
54  auto towers_output = std::make_unique<l1t::HGCalTowerBxCollection>();
55 
56  // Input collections
58 
59  e.getByToken(input_towers_map_, towersMapBxColl);
60 
61  towersProcess_->run(towersMapBxColl, *towers_output, es);
62 
63  e.put(std::move(towers_output), towersProcess_->name());
64 }
T getParameter(std::string const &) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:125
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
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:71
~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
T get(const Candidate &c)
Definition: component.h:55
Definition: Run.h:45