CMS 3D CMS Logo

HGCalRawToDigiFake.cc
Go to the documentation of this file.
1 //STL includes
2 #include <memory>
3 
4 //framework includes
12 
13 //other includes
15 
17 public:
18  explicit HGCalRawToDigiFake(const edm::ParameterSet&);
19  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
20 
21 private:
22  void produce(edm::StreamID, edm::Event&, const edm::EventSetup&) const override;
26 };
27 
29  : tok_ee_(consumes<HGCalDigiCollection>(iConfig.getParameter<edm::InputTag>("eeDigis"))),
30  tok_fh_(consumes<HGCalDigiCollection>(iConfig.getParameter<edm::InputTag>("fhDigis"))),
31  tok_bh_(consumes<HGCalDigiCollection>(iConfig.getParameter<edm::InputTag>("bhDigis"))) {
32  produces<HGCalDigiCollection>("EE");
33  produces<HGCalDigiCollection>("HEfront");
34  produces<HGCalDigiCollection>("HEback");
35 }
36 
41 
42  iEvent.getByToken(tok_ee_, h_ee);
43  iEvent.getByToken(tok_fh_, h_fh);
44  iEvent.getByToken(tok_bh_, h_bh);
45 
46  auto out_ee = std::make_unique<HGCalDigiCollection>();
47  if (h_ee.isValid()) {
48  out_ee = std::make_unique<HGCalDigiCollection>(*(h_ee.product()));
49  }
50  iEvent.put(std::move(out_ee), "EE");
51 
52  auto out_fh = std::make_unique<HGCalDigiCollection>();
53  if (h_fh.isValid()) {
54  out_fh = std::make_unique<HGCalDigiCollection>(*(h_fh.product()));
55  }
56  iEvent.put(std::move(out_fh), "HEfront");
57 
58  auto out_bh = std::make_unique<HGCalDigiCollection>();
59  if (h_bh.isValid()) {
60  out_bh = std::make_unique<HGCalDigiCollection>(*(h_bh.product()));
61  }
62  iEvent.put(std::move(out_bh), "HEback");
63 }
64 
67  desc.add<edm::InputTag>("eeDigis", edm::InputTag("simHGCalUnsuppressedDigis:EE"));
68  desc.add<edm::InputTag>("fhDigis", edm::InputTag("simHGCalUnsuppressedDigis:HEfront"));
69  desc.add<edm::InputTag>("bhDigis", edm::InputTag("simHGCalUnsuppressedDigis:HEback"));
70 
71  descriptions.add("HGCalRawToDigiFake", desc);
72 }
73 
74 //define this as a plug-in
edm::EDGetTokenT< HGCalDigiCollection > tok_fh_
T const * product() const
Definition: Handle.h:70
edm::EDGetTokenT< HGCalDigiCollection > tok_bh_
int iEvent
Definition: GenABIO.cc:224
HGCalRawToDigiFake(const edm::ParameterSet &)
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
edm::EDGetTokenT< HGCalDigiCollection > tok_ee_
void add(std::string const &label, ParameterSetDescription const &psetDescription)
bool isValid() const
Definition: HandleBase.h:70
HLT enums.
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
def move(src, dest)
Definition: eostools.py:511