CMS 3D CMS Logo

HFNoseVFEProducer.cc
Go to the documentation of this file.
4 
7 
11 
14 
16 
17 #include <memory>
18 
20 public:
22  ~HFNoseVFEProducer() 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  : inputnose_(consumes<HGCalDigiCollection>(conf.getParameter<edm::InputTag>("noseDigis"))) {
39  // setup VFE parameters
40  const edm::ParameterSet& vfeParamConfig = conf.getParameterSet("ProcessorParameters");
41  const std::string& vfeProcessorName = vfeParamConfig.getParameter<std::string>("ProcessorName");
42  vfeProcess_ = std::unique_ptr<HGCalVFEProcessorBase>{
43  HGCalVFEProcessorBaseFactory::get()->create(vfeProcessorName, vfeParamConfig)};
44 
45  produces<l1t::HGCalTriggerCellBxCollection>(vfeProcess_->name());
46  produces<l1t::HGCalTriggerSumsBxCollection>(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 collections
56  auto vfe_trigcell_output = std::make_unique<l1t::HGCalTriggerCellBxCollection>();
57  auto vfe_trigsums_output = std::make_unique<l1t::HGCalTriggerSumsBxCollection>();
58 
60  e.getByToken(inputnose_, nose_digis_h);
61 
62  if (nose_digis_h.isValid()) {
63  const HGCalDigiCollection& nose_digis = *nose_digis_h;
64  vfeProcess_->run(nose_digis, *vfe_trigcell_output, es);
65  }
66 
67  // Put in the event
68  e.put(std::move(vfe_trigcell_output), vfeProcess_->name());
69  // At the moment the HGCalTriggerSumsBxCollection is empty
70  e.put(std::move(vfe_trigsums_output), vfeProcess_->name());
71 }
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
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
edm::Handle
Definition: AssociativeIterator.h:50
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 >
HFNoseVFEProducer::HFNoseVFEProducer
HFNoseVFEProducer(const edm::ParameterSet &)
Definition: HFNoseVFEProducer.cc:37
CaloGeometryRecord.h
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
HFNoseVFEProducer
Definition: HFNoseVFEProducer.cc:19
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
edm::EventSetup
Definition: EventSetup.h:57
edm::EDGetToken
Definition: EDGetToken.h:35
get
#define get
HFNoseVFEProducer::beginRun
void beginRun(const edm::Run &, const edm::EventSetup &) override
Definition: HFNoseVFEProducer.cc:49
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
eostools.move
def move(src, dest)
Definition: eostools.py:511
Frameworkfwd.h
HGCalProcessorBase.h
HFNoseVFEProducer::inputnose_
edm::EDGetToken inputnose_
Definition: HFNoseVFEProducer.cc:29
HGCalTriggerCell.h
HFNoseVFEProducer::triggerGeometry_
edm::ESHandle< HGCalTriggerGeometryBase > triggerGeometry_
Definition: HFNoseVFEProducer.cc:30
HFNoseVFEProducer::~HFNoseVFEProducer
~HFNoseVFEProducer() override
Definition: HFNoseVFEProducer.cc:22
ParameterSet.h
HFNoseVFEProducer::vfeProcess_
std::unique_ptr< HGCalVFEProcessorBase > vfeProcess_
Definition: HFNoseVFEProducer.cc:32
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
edm::Event
Definition: Event.h:73
HFNoseVFEProducer::produce
void produce(edm::Event &, const edm::EventSetup &) override
Definition: HFNoseVFEProducer.cc:54
edm::ParameterSet::getParameterSet
ParameterSet const & getParameterSet(std::string const &) const
Definition: ParameterSet.cc:2121
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37