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) {
51  towersProcess_->eventSetup(es);
53  towersProcess_->setGeometry(triggerGeometry_.product());
54 }
55 
57  // Output collections
58  auto towers_output = std::make_unique<l1t::HGCalTowerBxCollection>();
59 
60  // Input collections
61  std::pair<edm::Handle<l1t::HGCalTowerMapBxCollection>, edm::Handle<l1t::HGCalClusterBxCollection> > inputsColl;
62  auto& towersMapBxColl = inputsColl.first;
63  auto& clustersBxColl = inputsColl.second;
64 
65  e.getByToken(input_towers_map_, towersMapBxColl);
66  e.getByToken(input_trigger_cells_, clustersBxColl);
67 
68  towersProcess_->run(inputsColl, *towers_output, es);
69 
70  e.put(std::move(towers_output), towersProcess_->name());
71 }
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
HGCalTriggerGeometryBase
Definition: HGCalTriggerGeometryBase.h:19
HGCalTowerProducer::~HGCalTowerProducer
~HGCalTowerProducer() override
Definition: HGCalTowerProducer.cc:21
edm::Run
Definition: Run.h:45
CaloGeometryRecord
Definition: CaloGeometryRecord.h:30
edm
HLT enums.
Definition: AlignableModifier.h:19
HGCalTowerProducer::towersProcess_
std::unique_ptr< HGCalTowerProcessorBase > towersProcess_
Definition: HGCalTowerProducer.cc:32
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89287
EDProducer.h
HGCalTriggerSums.h
edm::Handle
Definition: AssociativeIterator.h:50
ESGetToken.h
MakerMacros.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
HGCalTowerProducer::beginRun
void beginRun(const edm::Run &, const edm::EventSetup &) override
Definition: HGCalTowerProducer.cc:50
HGCalTriggerGeometryBase.h
edm::ESHandle< HGCalTriggerGeometryBase >
l1t::HGCalClusterBxCollection
BXVector< HGCalCluster > HGCalClusterBxCollection
Definition: HGCalCluster.h:27
HGCalTowerProducer::triggerGeometry_
edm::ESHandle< HGCalTriggerGeometryBase > triggerGeometry_
Definition: HGCalTowerProducer.cc:30
HGCalTowerProducer::input_trigger_cells_
edm::EDGetToken input_trigger_cells_
Definition: HGCalTowerProducer.cc:29
CaloGeometryRecord.h
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ParameterSet
Definition: ParameterSet.h:47
edm::Transition
Transition
Definition: Transition.h:12
Event.h
l1t
delete x;
Definition: CaloConfig.h:22
HGCalTower.h
HGCalTowerProducer::triggerGeomToken_
edm::ESGetToken< HGCalTriggerGeometryBase, CaloGeometryRecord > triggerGeomToken_
Definition: HGCalTowerProducer.cc:31
edm::EventSetup::getHandle
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:148
edm::stream::EDProducer
Definition: EDProducer.h:38
edm::EventSetup
Definition: EventSetup.h:57
edm::EDGetToken
Definition: EDGetToken.h:35
get
#define get
HGCalTowerProducer::produce
void produce(edm::Event &, const edm::EventSetup &) override
Definition: HGCalTowerProducer.cc:56
edm::ESGetToken< HGCalTriggerGeometryBase, CaloGeometryRecord >
eostools.move
def move(src, dest)
Definition: eostools.py:511
HGCalTowerProducer::HGCalTowerProducer
HGCalTowerProducer(const edm::ParameterSet &)
Definition: HGCalTowerProducer.cc:37
l1t::HGCalTowerMapBxCollection
BXVector< HGCalTowerMap > HGCalTowerMapBxCollection
Definition: HGCalTowerMap.h:12
Frameworkfwd.h
HGCalProcessorBase.h
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
HGCalTowerProducer
Definition: HGCalTowerProducer.cc:18
HGCalTowerProducer::input_towers_map_
edm::EDGetToken input_towers_map_
Definition: HGCalTowerProducer.cc:28
HGCalTriggerCell.h
edm::Event
Definition: Event.h:73
edm::ParameterSet::getParameterSet
ParameterSet const & getParameterSet(std::string const &) const
Definition: ParameterSet.cc:2128
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37