CMS 3D CMS Logo

HGCalVFEProducer.cc
Go to the documentation of this file.
4 
7 
11 
14 
16 
17 #include <memory>
18 
20 public:
22  ~HGCalVFEProducer() override {}
23 
24  void beginRun(const edm::Run&, const edm::EventSetup&) override;
25  void produce(edm::Event&, const edm::EventSetup&) override;
26 
27 private:
28  // inputs
31 
32  std::unique_ptr<HGCalVFEProcessorBase> vfeProcess_;
33 };
34 
36 
38  : inputee_(consumes<HGCalDigiCollection>(conf.getParameter<edm::InputTag>("eeDigis"))),
39  inputfh_(consumes<HGCalDigiCollection>(conf.getParameter<edm::InputTag>("fhDigis"))),
40  inputbh_(consumes<HGCalDigiCollection>(conf.getParameter<edm::InputTag>("bhDigis"))) {
41  //setup VFE parameters
42  const edm::ParameterSet& vfeParamConfig = conf.getParameterSet("ProcessorParameters");
43  const std::string& vfeProcessorName = vfeParamConfig.getParameter<std::string>("ProcessorName");
44  vfeProcess_ = std::unique_ptr<HGCalVFEProcessorBase>{
45  HGCalVFEProcessorBaseFactory::get()->create(vfeProcessorName, vfeParamConfig)};
46 
47  produces<l1t::HGCalTriggerCellBxCollection>(vfeProcess_->name());
48  produces<l1t::HGCalTriggerSumsBxCollection>(vfeProcess_->name());
49 }
50 
51 void HGCalVFEProducer::beginRun(const edm::Run& /*run*/, const edm::EventSetup& es) {
53  vfeProcess_->setGeometry(triggerGeometry_.product());
54 }
55 
57  // Output collections
58  auto vfe_trigcell_output = std::make_unique<l1t::HGCalTriggerCellBxCollection>();
59  auto vfe_trigsums_output = std::make_unique<l1t::HGCalTriggerSumsBxCollection>();
60 
61  // Input collections
65 
66  e.getByToken(inputee_, ee_digis_h);
67  e.getByToken(inputfh_, fh_digis_h);
68  e.getByToken(inputbh_, bh_digis_h);
69 
70  const HGCalDigiCollection& ee_digis = *ee_digis_h;
71  const HGCalDigiCollection& fh_digis = *fh_digis_h;
72  const HGCalDigiCollection& bh_digis = *bh_digis_h;
73 
74  // Processing DigiCollections and putting the results into the HGCalTriggerCellBxCollection
75  vfeProcess_->run(ee_digis, *vfe_trigcell_output, es);
76  vfeProcess_->run(fh_digis, *vfe_trigcell_output, es);
77  vfeProcess_->run(bh_digis, *vfe_trigcell_output, es);
78 
79  // Put in the event
80  e.put(std::move(vfe_trigcell_output), vfeProcess_->name());
81  // At the moment the HGCalTriggerSumsBxCollection is empty
82  e.put(std::move(vfe_trigsums_output), vfeProcess_->name());
83 }
T getParameter(std::string const &) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:125
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
std::unique_ptr< HGCalVFEProcessorBase > vfeProcess_
void produce(edm::Event &, const edm::EventSetup &) override
edm::EDGetToken inputbh_
void beginRun(const edm::Run &, const edm::EventSetup &) override
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
HGCalVFEProducer(const edm::ParameterSet &)
edm::EDGetToken inputee_
edm::EDGetToken inputfh_
ParameterSet const & getParameterSet(std::string const &) const
~HGCalVFEProducer() override
HLT enums.
T get() const
Definition: EventSetup.h:71
edm::ESHandle< HGCalTriggerGeometryBase > triggerGeometry_
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