CMS 3D CMS Logo

HGCalBackendLayer2Producer.cc
Go to the documentation of this file.
3 
7 
12 
15 
17 
18 #include <memory>
19 #include <utility>
20 
22 public:
25 
26  void beginRun(const edm::Run&, const edm::EventSetup&) override;
27  void produce(edm::Event&, const edm::EventSetup&) override;
28 
29 private:
30  // inputs
34 
35  std::unique_ptr<HGCalBackendLayer2ProcessorBase> backendProcess_;
36 };
37 
39 
41  : input_clusters_(consumes<l1t::HGCalClusterBxCollection>(conf.getParameter<edm::InputTag>("InputCluster"))),
42  triggerGeomToken_(esConsumes<HGCalTriggerGeometryBase, CaloGeometryRecord, edm::Transition::BeginRun>()) {
43  //setup Backend parameters
44  const edm::ParameterSet& beParamConfig = conf.getParameterSet("ProcessorParameters");
45  const std::string& beProcessorName = beParamConfig.getParameter<std::string>("ProcessorName");
46  backendProcess_ = std::unique_ptr<HGCalBackendLayer2ProcessorBase>{
47  HGCalBackendLayer2Factory::get()->create(beProcessorName, beParamConfig)};
48 
49  produces<l1t::HGCalMulticlusterBxCollection>(backendProcess_->name());
50  produces<l1t::HGCalClusterBxCollection>(backendProcess_->name() + "Unclustered");
51 }
52 
56 }
57 
59  // Output collections
60  std::pair<l1t::HGCalMulticlusterBxCollection, l1t::HGCalClusterBxCollection> be_output;
61 
62  // Input collections
64 
65  e.getByToken(input_clusters_, trigCluster2DBxColl);
66 
67  backendProcess_->run(trigCluster2DBxColl, be_output);
68 
69  e.put(std::make_unique<l1t::HGCalMulticlusterBxCollection>(std::move(be_output.first)), backendProcess_->name());
70  e.put(std::make_unique<l1t::HGCalClusterBxCollection>(std::move(be_output.second)),
71  backendProcess_->name() + "Unclustered");
72 }
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
void beginRun(const edm::Run &, const edm::EventSetup &) override
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
HGCalBackendLayer2Producer(const edm::ParameterSet &)
void produce(edm::Event &, const edm::EventSetup &) override
ParameterSet const & getParameterSet(std::string const &) const
delete x;
Definition: CaloConfig.h:22
edm::ESGetToken< HGCalTriggerGeometryBase, CaloGeometryRecord > triggerGeomToken_
T const * product() const
Definition: ESHandle.h:86
Transition
Definition: Transition.h:12
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
std::unique_ptr< HGCalBackendLayer2ProcessorBase > backendProcess_
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:151
edm::ESHandle< HGCalTriggerGeometryBase > triggerGeometry_
BXVector< HGCalCluster > HGCalClusterBxCollection
Definition: HGCalCluster.h:27
HLT enums.
#define get
def move(src, dest)
Definition: eostools.py:511
Definition: Run.h:45