CMS 3D CMS Logo

HGCalConcentratorProducer.cc
Go to the documentation of this file.
3 
6 
10 
13 
15 
16 #include <memory>
17 
18 
20  public:
23 
24  void beginRun(const edm::Run&,
25  const edm::EventSetup&) override;
26  void produce(edm::Event&, const edm::EventSetup&) override;
27 
28  private:
29  // inputs
32 
33  std::unique_ptr<HGCalConcentratorProcessorBase> concentratorProcess_;
34 };
35 
37 
40  input_cell_(consumes<l1t::HGCalTriggerCellBxCollection>(conf.getParameter<edm::InputTag>("InputTriggerCells"))),
41  input_sums_(consumes<l1t::HGCalTriggerSumsBxCollection>(conf.getParameter<edm::InputTag>("InputTriggerSums")))
42 {
43  //setup Concentrator parameters
44  const edm::ParameterSet& concParamConfig = conf.getParameterSet("ProcessorParameters");
45  const std::string& concProcessorName = concParamConfig.getParameter<std::string>("ProcessorName");
46  HGCalConcentratorProcessorBase* concProc = HGCalConcentratorFactory::get()->create(concProcessorName, concParamConfig);
47  concentratorProcess_.reset(concProc);
48 
49  produces<l1t::HGCalTriggerCellBxCollection>(concentratorProcess_->name());
50  produces<l1t::HGCalTriggerSumsBxCollection>(concentratorProcess_->name());
51 
52 }
53 
55  const edm::EventSetup& es) {
57 
59 
60 }
61 
63 
64  // Output collections
65  auto cc_trigcell_output = std::make_unique<l1t::HGCalTriggerCellBxCollection>();
66  auto cc_trigsums_output = std::make_unique<l1t::HGCalTriggerSumsBxCollection>();
67 
68  // Input collections
70 
71  e.getByToken(input_cell_,trigCellBxColl);
72  concentratorProcess_->run(trigCellBxColl, *cc_trigcell_output, es);
73  // Put in the event
74  // At the moment the HGCalTriggerSumsBxCollection is empty
75  e.put(std::move(cc_trigcell_output), concentratorProcess_->name());
76  e.put(std::move(cc_trigsums_output), concentratorProcess_->name());
77 
78 }
T getParameter(std::string const &) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:137
BXVector< HGCalTriggerCell > HGCalTriggerCellBxCollection
void produce(edm::Event &, const edm::EventSetup &) override
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:579
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
std::unique_ptr< HGCalConcentratorProcessorBase > concentratorProcess_
delete x;
Definition: CaloConfig.h:22
edm::ESHandle< HGCalTriggerGeometryBase > triggerGeometry_
BXVector< HGCalTriggerSums > HGCalTriggerSumsBxCollection
ParameterSet const & getParameterSet(std::string const &) const
void beginRun(const edm::Run &, const edm::EventSetup &) override
HLT enums.
T get() const
Definition: EventSetup.h:68
HGCalConcentratorProducer(const edm::ParameterSet &)
T const * product() const
Definition: ESHandle.h:84
def move(src, dest)
Definition: eostools.py:511
T get(const Candidate &c)
Definition: component.h:55
Definition: Run.h:44