CMS 3D CMS Logo

HGCalConcentratorProducer.cc
Go to the documentation of this file.
3 
6 
10 
13 
15 
16 #include <memory>
17 
19 public:
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<HGCalConcentratorProcessorBase> concentratorProcess_;
32 };
33 
35 
37  : input_cell_(consumes<l1t::HGCalTriggerCellBxCollection>(conf.getParameter<edm::InputTag>("InputTriggerCells"))),
38  input_sums_(consumes<l1t::HGCalTriggerSumsBxCollection>(conf.getParameter<edm::InputTag>("InputTriggerSums"))) {
39  //setup Concentrator parameters
40  const edm::ParameterSet& concParamConfig = conf.getParameterSet("ProcessorParameters");
41  const std::string& concProcessorName = concParamConfig.getParameter<std::string>("ProcessorName");
42  concentratorProcess_ = std::unique_ptr<HGCalConcentratorProcessorBase>{
43  HGCalConcentratorFactory::get()->create(concProcessorName, concParamConfig)};
44 
45  produces<l1t::HGCalTriggerCellBxCollection>(concentratorProcess_->name());
46  produces<l1t::HGCalTriggerSumsBxCollection>(concentratorProcess_->name());
47 }
48 
51 
53 }
54 
56  // Output collections
57  auto cc_trigcell_output = std::make_unique<l1t::HGCalTriggerCellBxCollection>();
58  auto cc_trigsums_output = std::make_unique<l1t::HGCalTriggerSumsBxCollection>();
59 
60  // Input collections
62 
63  e.getByToken(input_cell_, trigCellBxColl);
64  concentratorProcess_->run(trigCellBxColl, *cc_trigcell_output, es);
65  // Put in the event
66  // At the moment the HGCalTriggerSumsBxCollection is empty
67  e.put(std::move(cc_trigcell_output), concentratorProcess_->name());
68  e.put(std::move(cc_trigsums_output), concentratorProcess_->name());
69 }
T getParameter(std::string const &) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:125
BXVector< HGCalTriggerCell > HGCalTriggerCellBxCollection
void produce(edm::Event &, const edm::EventSetup &) override
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
std::unique_ptr< HGCalConcentratorProcessorBase > concentratorProcess_
delete x;
Definition: CaloConfig.h:22
edm::ESHandle< HGCalTriggerGeometryBase > triggerGeometry_
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
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:71
HGCalConcentratorProducer(const edm::ParameterSet &)
T const * product() const
Definition: ESHandle.h:86
def move(src, dest)
Definition: eostools.py:511
T get(const Candidate &c)
Definition: component.h:55
Definition: Run.h:45