CMS 3D CMS Logo

HGCalTowerProducer.cc
Go to the documentation of this file.
3 
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
32  std::unique_ptr<HGCalTowerProcessorBase> towersProcess_;
33 };
34 
36 
38  : input_towers_map_(consumes<l1t::HGCalTowerMapBxCollection>(conf.getParameter<edm::InputTag>("InputTowerMaps"))),
39  input_trigger_cells_(
40  consumes<l1t::HGCalClusterBxCollection>(conf.getParameter<edm::InputTag>("InputTriggerCells"))),
41  triggerGeomToken_(esConsumes<HGCalTriggerGeometryBase, CaloGeometryRecord, edm::Transition::BeginRun>()) {
42  //setup TowerMap parameters
43  const edm::ParameterSet& towerParamConfig = conf.getParameterSet("ProcessorParameters");
44  const std::string& towerProcessorName = towerParamConfig.getParameter<std::string>("ProcessorName");
45  towersProcess_ = HGCalTowerFactory::get()->create(towerProcessorName, towerParamConfig);
46 
47  produces<l1t::HGCalTowerBxCollection>(towersProcess_->name());
48 }
49 
50 void HGCalTowerProducer::beginRun(const edm::Run& /*run*/, const edm::EventSetup& es) {
52  towersProcess_->setGeometry(triggerGeometry_.product());
53 }
54 
56  // Output collections
57  auto towers_output = std::make_unique<l1t::HGCalTowerBxCollection>();
58 
59  // Input collections
60  std::pair<edm::Handle<l1t::HGCalTowerMapBxCollection>, edm::Handle<l1t::HGCalClusterBxCollection> > inputsColl;
61  auto& towersMapBxColl = inputsColl.first;
62  auto& clustersBxColl = inputsColl.second;
63 
64  e.getByToken(input_towers_map_, towersMapBxColl);
65  e.getByToken(input_trigger_cells_, clustersBxColl);
66 
67  towersProcess_->run(inputsColl, *towers_output);
68 
69  e.put(std::move(towers_output), towersProcess_->name());
70 }
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
ParameterSet const & getParameterSet(std::string const &) const
edm::ESHandle< HGCalTriggerGeometryBase > triggerGeometry_
delete x;
Definition: CaloConfig.h:22
edm::EDGetToken input_trigger_cells_
BXVector< HGCalTowerMap > HGCalTowerMapBxCollection
Definition: HGCalTowerMap.h:12
T const * product() const
Definition: ESHandle.h:86
edm::ESGetToken< HGCalTriggerGeometryBase, CaloGeometryRecord > triggerGeomToken_
Transition
Definition: Transition.h:12
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:130
void beginRun(const edm::Run &, const edm::EventSetup &) override
edm::EDGetToken input_towers_map_
BXVector< HGCalCluster > HGCalClusterBxCollection
Definition: HGCalCluster.h:27
HLT enums.
~HGCalTowerProducer() override
#define get
void produce(edm::Event &, const edm::EventSetup &) override
HGCalTowerProducer(const edm::ParameterSet &)
std::unique_ptr< HGCalTowerProcessorBase > towersProcess_
def move(src, dest)
Definition: eostools.py:511
Definition: Run.h:45