CMS 3D CMS Logo

HGCalBackendLayer2Producer.cc
Go to the documentation of this file.
3 
6 
11 
14 
16 
17 #include <memory>
18 
19 
21  public:
24 
25  void beginRun(const edm::Run&,
26  const edm::EventSetup&) override;
27  void produce(edm::Event&, const edm::EventSetup&) override;
28 
29  private:
30  // inputs
33 
34  std::unique_ptr<HGCalBackendLayer2ProcessorBase> backendProcess_;
35 };
36 
38 
41  input_clusters_(consumes<l1t::HGCalClusterBxCollection>(conf.getParameter<edm::InputTag>("InputCluster")))
42 {
43  //setup Backend parameters
44  const edm::ParameterSet& beParamConfig = conf.getParameterSet("ProcessorParameters");
45  const std::string& beProcessorName = beParamConfig.getParameter<std::string>("ProcessorName");
46  HGCalBackendLayer2ProcessorBase* beProc = HGCalBackendLayer2Factory::get()->create(beProcessorName, beParamConfig);
47  backendProcess_.reset(beProc);
48 
49  produces<l1t::HGCalMulticlusterBxCollection>(backendProcess_->name());
50 }
51 
53  const edm::EventSetup& es)
54 {
57 }
58 
60 {
61  // Output collections
62  auto be_multicluster_output = std::make_unique<l1t::HGCalMulticlusterBxCollection>();
63 
64  // Input collections
66 
67  e.getByToken(input_clusters_, trigCluster2DBxColl);
68 
69  backendProcess_->run(trigCluster2DBxColl, *be_multicluster_output, es);
70 
71  e.put(std::move(be_multicluster_output), backendProcess_->name());
72 }
T getParameter(std::string const &) const
void beginRun(const edm::Run &, const edm::EventSetup &) override
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:137
HGCalBackendLayer2Producer(const edm::ParameterSet &)
void produce(edm::Event &, const edm::EventSetup &) override
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:579
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
delete x;
Definition: CaloConfig.h:22
std::unique_ptr< HGCalBackendLayer2ProcessorBase > backendProcess_
ParameterSet const & getParameterSet(std::string const &) const
edm::ESHandle< HGCalTriggerGeometryBase > triggerGeometry_
BXVector< HGCalCluster > HGCalClusterBxCollection
Definition: HGCalCluster.h:36
HLT enums.
T get() const
Definition: EventSetup.h:68
T const * product() const
Definition: ESHandle.h:84
def move(src, dest)
Definition: eostools.py:511
T get(const Candidate &c)
Definition: component.h:55
Definition: Run.h:44