CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 }
void beginRun(const edm::Run &, const edm::EventSetup &) override
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
HGCalBackendLayer2Producer(const edm::ParameterSet &)
void produce(edm::Event &, const edm::EventSetup &) override
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
edm::ESGetToken< HGCalTriggerGeometryBase, CaloGeometryRecord > triggerGeomToken_
def move
Definition: eostools.py:511
Transition
Definition: Transition.h:12
std::unique_ptr< HGCalBackendLayer2ProcessorBase > backendProcess_
ParameterSet const & getParameterSet(std::string const &) const
edm::ESHandle< HGCalTriggerGeometryBase > triggerGeometry_
T const * product() const
Definition: ESHandle.h:86
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
BXVector< HGCalCluster > HGCalClusterBxCollection
Definition: HGCalCluster.h:27
#define get
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:151
ESGetTokenH3DDVariant esConsumes(std::string const &Reccord, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
Definition: Run.h:45