CMS 3D CMS Logo

HGCalVFEProducer.cc
Go to the documentation of this file.
4 
10 
13 
15 
16 #include <memory>
17 
19 public:
21  ~HGCalVFEProducer() 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  std::unique_ptr<HGCalVFEProcessorBase> vfeProcess_;
32 };
33 
35 
37  : inputee_(consumes<HGCalDigiCollection>(conf.getParameter<edm::InputTag>("eeDigis"))),
38  inputfh_(consumes<HGCalDigiCollection>(conf.getParameter<edm::InputTag>("fhDigis"))),
39  inputbh_(consumes<HGCalDigiCollection>(conf.getParameter<edm::InputTag>("bhDigis"))),
40  triggerGeomToken_(esConsumes<HGCalTriggerGeometryBase, CaloGeometryRecord, edm::Transition::BeginRun>()) {
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 }
49 
50 void HGCalVFEProducer::beginRun(const edm::Run& /*run*/, const edm::EventSetup& es) {
52  vfeProcess_->setGeometry(triggerGeometry_.product());
53 }
54 
56  // Output collection
57  auto vfe_trigcell_output = std::make_unique<l1t::HGCalTriggerCellBxCollection>();
58 
59  // Input collections
63 
64  e.getByToken(inputee_, ee_digis_h);
65  e.getByToken(inputfh_, fh_digis_h);
66  e.getByToken(inputbh_, bh_digis_h);
67 
68  // Processing DigiCollections and putting the results into the HGCalTriggerCellBxCollectio
69  if (ee_digis_h.isValid()) {
70  const HGCalDigiCollection& ee_digis = *ee_digis_h;
71  vfeProcess_->run(ee_digis, *vfe_trigcell_output, es);
72  }
73 
74  if (fh_digis_h.isValid()) {
75  const HGCalDigiCollection& fh_digis = *fh_digis_h;
76  vfeProcess_->run(fh_digis, *vfe_trigcell_output, es);
77  }
78 
79  if (bh_digis_h.isValid()) {
80  const HGCalDigiCollection& bh_digis = *bh_digis_h;
81  vfeProcess_->run(bh_digis, *vfe_trigcell_output, es);
82  }
83 
84  // Put in the event
85  e.put(std::move(vfe_trigcell_output), vfeProcess_->name());
86 }
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
HGCalTriggerGeometryBase
Definition: HGCalTriggerGeometryBase.h:19
HGCalVFEProducer::inputee_
edm::EDGetToken inputee_
Definition: HGCalVFEProducer.cc:28
edm::Run
Definition: Run.h:45
CaloGeometryRecord
Definition: CaloGeometryRecord.h:30
edm
HLT enums.
Definition: AlignableModifier.h:19
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89301
EDProducer.h
edm::SortedCollection
Definition: SortedCollection.h:49
HGCalVFEProducer::triggerGeometry_
edm::ESHandle< HGCalTriggerGeometryBase > triggerGeometry_
Definition: HGCalVFEProducer.cc:29
edm::Handle
Definition: AssociativeIterator.h:50
HGCalVFEProducer::inputfh_
edm::EDGetToken inputfh_
Definition: HGCalVFEProducer.cc:28
ESGetToken.h
MakerMacros.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
HGCalTriggerGeometryBase.h
edm::ESHandle< HGCalTriggerGeometryBase >
HGCalVFEProducer::~HGCalVFEProducer
~HGCalVFEProducer() override
Definition: HGCalVFEProducer.cc:21
CaloGeometryRecord.h
edm::ParameterSet
Definition: ParameterSet.h:47
edm::Transition
Transition
Definition: Transition.h:12
Event.h
HGCDigiCollections.h
edm::EventSetup::getHandle
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:155
edm::stream::EDProducer
Definition: EDProducer.h:36
HGCalVFEProducer::beginRun
void beginRun(const edm::Run &, const edm::EventSetup &) override
Definition: HGCalVFEProducer.cc:50
edm::EventSetup
Definition: EventSetup.h:58
edm::EDGetToken
Definition: EDGetToken.h:35
get
#define get
HGCalVFEProducer::inputbh_
edm::EDGetToken inputbh_
Definition: HGCalVFEProducer.cc:28
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ESGetToken< HGCalTriggerGeometryBase, CaloGeometryRecord >
HGCalVFEProducer::vfeProcess_
std::unique_ptr< HGCalVFEProcessorBase > vfeProcess_
Definition: HGCalVFEProducer.cc:31
eostools.move
def move(src, dest)
Definition: eostools.py:511
Frameworkfwd.h
HGCalProcessorBase.h
HGCalVFEProducer
Definition: HGCalVFEProducer.cc:18
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
HGCalVFEProducer::produce
void produce(edm::Event &, const edm::EventSetup &) override
Definition: HGCalVFEProducer.cc:55
HGCalTriggerCell.h
HGCalVFEProducer::triggerGeomToken_
edm::ESGetToken< HGCalTriggerGeometryBase, CaloGeometryRecord > triggerGeomToken_
Definition: HGCalVFEProducer.cc:30
ParameterSet.h
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
DeDxTools::esConsumes
ESGetTokenH3DDVariant esConsumes(std::string const &Reccord, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
edm::Event
Definition: Event.h:73
edm::ParameterSet::getParameterSet
ParameterSet const & getParameterSet(std::string const &) const
Definition: ParameterSet.cc:2128
HGCalVFEProducer::HGCalVFEProducer
HGCalVFEProducer(const edm::ParameterSet &)
Definition: HGCalVFEProducer.cc:36
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37