CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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  // Processing DigiCollections and putting the results into the HGCalTriggerCellBxCollectio
71  if (ee_digis_h.isValid()) {
72  const HGCalDigiCollection& ee_digis = *ee_digis_h;
73  vfeProcess_->run(ee_digis, *vfe_trigcell_output, es);
74  }
75 
76  if (fh_digis_h.isValid()) {
77  const HGCalDigiCollection& fh_digis = *fh_digis_h;
78  vfeProcess_->run(fh_digis, *vfe_trigcell_output, es);
79  }
80 
81  if (bh_digis_h.isValid()) {
82  const HGCalDigiCollection& bh_digis = *bh_digis_h;
83  vfeProcess_->run(bh_digis, *vfe_trigcell_output, es);
84  }
85 
86  // Put in the event
87  e.put(std::move(vfe_trigcell_output), vfeProcess_->name());
88  // At the moment the HGCalTriggerSumsBxCollection is empty
89  e.put(std::move(vfe_trigsums_output), vfeProcess_->name());
90 }
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
HGCalVFEProducer::inputee_
edm::EDGetToken inputee_
Definition: HGCalVFEProducer.cc:29
edm::Run
Definition: Run.h:45
CaloGeometryRecord
Definition: CaloGeometryRecord.h:30
edm
HLT enums.
Definition: AlignableModifier.h:19
EDProducer.h
edm::SortedCollection
Definition: SortedCollection.h:49
HGCalTriggerSums.h
HGCalVFEProducer::triggerGeometry_
edm::ESHandle< HGCalTriggerGeometryBase > triggerGeometry_
Definition: HGCalVFEProducer.cc:30
edm::Handle
Definition: AssociativeIterator.h:50
HGCalVFEProducer::inputfh_
edm::EDGetToken inputfh_
Definition: HGCalVFEProducer.cc:29
MakerMacros.h
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
HGCalTriggerGeometryBase.h
edm::ESHandle< HGCalTriggerGeometryBase >
HGCalVFEProducer::~HGCalVFEProducer
~HGCalVFEProducer() override
Definition: HGCalVFEProducer.cc:22
CaloGeometryRecord.h
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
HLT_2018_cff.InputTag
InputTag
Definition: HLT_2018_cff.py:79016
edm::ParameterSet
Definition: ParameterSet.h:36
Event.h
HGCDigiCollections.h
edm::stream::EDProducer
Definition: EDProducer.h:38
HGCalVFEProducer::beginRun
void beginRun(const edm::Run &, const edm::EventSetup &) override
Definition: HGCalVFEProducer.cc:51
edm::EventSetup
Definition: EventSetup.h:57
edm::EDGetToken
Definition: EDGetToken.h:35
get
#define get
HGCalVFEProducer::inputbh_
edm::EDGetToken inputbh_
Definition: HGCalVFEProducer.cc:29
HGCalVFEProducer::vfeProcess_
std::unique_ptr< HGCalVFEProcessorBase > vfeProcess_
Definition: HGCalVFEProducer.cc:32
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
eostools.move
def move(src, dest)
Definition: eostools.py:511
Frameworkfwd.h
HGCalProcessorBase.h
HGCalVFEProducer
Definition: HGCalVFEProducer.cc:19
HGCalVFEProducer::produce
void produce(edm::Event &, const edm::EventSetup &) override
Definition: HGCalVFEProducer.cc:56
HGCalTriggerCell.h
ParameterSet.h
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
edm::Event
Definition: Event.h:73
edm::ParameterSet::getParameterSet
ParameterSet const & getParameterSet(std::string const &) const
Definition: ParameterSet.cc:2121
HGCalVFEProducer::HGCalVFEProducer
HGCalVFEProducer(const edm::ParameterSet &)
Definition: HGCalVFEProducer.cc:37
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37