CMS 3D CMS Logo

HFNoseVFEProducer.cc
Go to the documentation of this file.
4 
7 
10 
13 
15 
16 #include <memory>
17 
19 public:
21  ~HFNoseVFEProducer() override {}
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
31 
32  std::unique_ptr<HGCalVFEProcessorBase> vfeProcess_;
33 };
34 
36 
38  : inputnose_(consumes<HGCalDigiCollection>(conf.getParameter<edm::InputTag>("noseDigis"))),
39  triggerGeomToken_(esConsumes<HGCalTriggerGeometryBase, CaloGeometryRecord, edm::Transition::BeginRun>()) {
40  // setup VFE parameters
41  const edm::ParameterSet& vfeParamConfig = conf.getParameterSet("ProcessorParameters");
42  const std::string& vfeProcessorName = vfeParamConfig.getParameter<std::string>("ProcessorName");
43  vfeProcess_ = std::unique_ptr<HGCalVFEProcessorBase>{
44  HGCalVFEProcessorBaseFactory::get()->create(vfeProcessorName, vfeParamConfig)};
45 
46  produces<l1t::HGCalTriggerCellBxCollection>(vfeProcess_->name());
47 }
48 
49 void HFNoseVFEProducer::beginRun(const edm::Run& /*run*/, const edm::EventSetup& es) {
51  vfeProcess_->setGeometry(triggerGeometry_.product());
52 }
53 
55  // Output collection
56  auto vfe_trigcell_output = std::make_unique<l1t::HGCalTriggerCellBxCollection>();
57 
59  e.getByToken(inputnose_, nose_digis_h);
60 
61  if (nose_digis_h.isValid()) {
62  const HGCalDigiCollection& nose_digis = *nose_digis_h;
63  vfeProcess_->run(nose_digis, *vfe_trigcell_output);
64  }
65 
66  // Put in the event
67  e.put(std::move(vfe_trigcell_output), vfeProcess_->name());
68 }
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
void produce(edm::Event &, const edm::EventSetup &) override
ParameterSet const & getParameterSet(std::string const &) const
T const * product() const
Definition: ESHandle.h:86
Transition
Definition: Transition.h:12
HFNoseVFEProducer(const edm::ParameterSet &)
#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
edm::ESHandle< HGCalTriggerGeometryBase > triggerGeometry_
std::unique_ptr< HGCalVFEProcessorBase > vfeProcess_
HLT enums.
~HFNoseVFEProducer() override
edm::ESGetToken< HGCalTriggerGeometryBase, CaloGeometryRecord > triggerGeomToken_
#define get
edm::EDGetToken inputnose_
def move(src, dest)
Definition: eostools.py:511
Definition: Run.h:45