CMS 3D CMS Logo

AlCaEcalHcalReadoutsProducer.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 
3 // system include files
4 #include <memory>
5 #include <string>
6 // user include files
14 
18 
25 
26 //
27 // class decleration
28 //
29 
31 public:
33  ~AlCaEcalHcalReadoutsProducer() override = default;
34 
35  void produce(edm::StreamID, edm::Event&, const edm::EventSetup&) const override;
36  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
37 
38 private:
39  // ----------member data ---------------------------
40 
44 
48 };
49 
51  tok_ho_ = consumes<HORecHitCollection>(iConfig.getParameter<edm::InputTag>("hoInput"));
52  tok_hf_ = consumes<HFRecHitCollection>(iConfig.getParameter<edm::InputTag>("hfInput"));
53  tok_hbhe_ = consumes<HBHERecHitCollection>(iConfig.getParameter<edm::InputTag>("hbheInput"));
54 
55  //register your products
56  put_hbhe_ = produces<HBHERecHitCollection>("HBHERecHitCollection");
57  put_ho_ = produces<HORecHitCollection>("HORecHitCollection");
58  put_hf_ = produces<HFRecHitCollection>("HFRecHitCollection");
59 }
60 
61 // ------------ method called to produce the data ------------
64  if (!hbhe.isValid()) {
65  edm::LogVerbatim("AlCaEcalHcal") << "AlCaEcalHcalReadoutProducer: Error! can't get hbhe product!";
66  return;
67  }
68 
70  if (!ho.isValid()) {
71  edm::LogVerbatim("AlCaEcalHcal") << "AlCaEcalHcalReadoutProducer: Error! can't get ho product!";
72  }
73 
75  if (!hf.isValid()) {
76  edm::LogVerbatim("AlCaEcalHcal") << "AlCaEcalHcalReadoutProducer: Error! can't get hf product!";
77  }
78 
79  //Put selected information in the event
80  iEvent.emplace(put_hbhe_, *hbhe);
81  iEvent.emplace(put_ho_, *ho);
82  iEvent.emplace(put_hf_, *hf);
83 }
84 
87  desc.add<edm::InputTag>("hbheInput", edm::InputTag("hbhereco"));
88  desc.add<edm::InputTag>("hfInput", edm::InputTag("hfreco"));
89  desc.add<edm::InputTag>("hoInput", edm::InputTag("horeco"));
90  descriptions.add("alcaEcalHcalReadoutsProducer", desc);
91 }
92 
95 
Log< level::Info, true > LogVerbatim
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
~AlCaEcalHcalReadoutsProducer() override=default
edm::EDPutTokenT< HBHERecHitCollection > put_hbhe_
edm::EDGetTokenT< HBHERecHitCollection > tok_hbhe_
edm::EDPutTokenT< HORecHitCollection > put_ho_
int iEvent
Definition: GenABIO.cc:224
AlCaEcalHcalReadoutsProducer(const edm::ParameterSet &)
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
edm::EDGetTokenT< HFRecHitCollection > tok_hf_
void add(std::string const &label, ParameterSetDescription const &psetDescription)
edm::EDGetTokenT< HORecHitCollection > tok_ho_
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
edm::EDPutTokenT< HFRecHitCollection > put_hf_