CMS 3D CMS Logo

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