CMS 3D CMS Logo

HGCalConcentratorProducer.cc
Go to the documentation of this file.
3 
11 
14 
16 
17 #include <memory>
18 #include <utility>
19 
21 public:
24 
25  void beginRun(const edm::Run&, const edm::EventSetup&) override;
26  void produce(edm::Event&, const edm::EventSetup&) override;
27 
28 private:
29  // inputs
33 
34  std::unique_ptr<HGCalConcentratorProcessorBase> concentratorProcess_;
35 };
36 
38 
40  : input_cell_(consumes<l1t::HGCalTriggerCellBxCollection>(conf.getParameter<edm::InputTag>("InputTriggerCells"))),
41  input_sums_(consumes<l1t::HGCalTriggerSumsBxCollection>(conf.getParameter<edm::InputTag>("InputTriggerSums"))),
42  triggerGeomToken_(esConsumes<HGCalTriggerGeometryBase, CaloGeometryRecord, edm::Transition::BeginRun>()) {
43  //setup Concentrator parameters
44  const edm::ParameterSet& concParamConfig = conf.getParameterSet("ProcessorParameters");
45  const std::string& concProcessorName = concParamConfig.getParameter<std::string>("ProcessorName");
46  concentratorProcess_ = std::unique_ptr<HGCalConcentratorProcessorBase>{
47  HGCalConcentratorFactory::get()->create(concProcessorName, concParamConfig)};
48 
49  produces<l1t::HGCalTriggerCellBxCollection>(concentratorProcess_->name());
50  produces<l1t::HGCalTriggerSumsBxCollection>(concentratorProcess_->name());
51  produces<l1t::HGCalConcentratorDataBxCollection>(concentratorProcess_->name());
52 }
53 
57 }
58 
60  // Output collections
61  std::tuple<l1t::HGCalTriggerCellBxCollection, l1t::HGCalTriggerSumsBxCollection, l1t::HGCalConcentratorDataBxCollection>
62  cc_output;
63 
64  // Input collections
66 
67  e.getByToken(input_cell_, trigCellBxColl);
68  concentratorProcess_->run(trigCellBxColl, cc_output);
69  // Put in the event
70  e.put(std::make_unique<l1t::HGCalTriggerCellBxCollection>(std::move(std::get<0>(cc_output))),
71  concentratorProcess_->name());
72  e.put(std::make_unique<l1t::HGCalTriggerSumsBxCollection>(std::move(std::get<1>(cc_output))),
73  concentratorProcess_->name());
74  e.put(std::make_unique<l1t::HGCalConcentratorDataBxCollection>(std::move(std::get<2>(cc_output))),
75  concentratorProcess_->name());
76 }
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
BXVector< HGCalTriggerCell > HGCalTriggerCellBxCollection
void produce(edm::Event &, const edm::EventSetup &) override
std::unique_ptr< HGCalConcentratorProcessorBase > concentratorProcess_
ParameterSet const & getParameterSet(std::string const &) const
delete x;
Definition: CaloConfig.h:22
edm::ESHandle< HGCalTriggerGeometryBase > triggerGeometry_
T const * product() const
Definition: ESHandle.h:86
BXVector< HGCalTriggerSums > HGCalTriggerSumsBxCollection
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
HLT enums.
#define get
HGCalConcentratorProducer(const edm::ParameterSet &)
edm::ESGetToken< HGCalTriggerGeometryBase, CaloGeometryRecord > triggerGeomToken_
def move(src, dest)
Definition: eostools.py:511
Definition: Run.h:45