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  private:
21  void produce(edm::StreamID, edm::Event&, const edm::EventSetup&) const override;
25 };
26 
28  tok_ee_(consumes<HGCalDigiCollection>(iConfig.getParameter<edm::InputTag>("eeDigis"))),
29  tok_fh_(consumes<HGCalDigiCollection>(iConfig.getParameter<edm::InputTag>("fhDigis"))),
30  tok_bh_(consumes<HGCalDigiCollection>(iConfig.getParameter<edm::InputTag>("bhDigis")))
31 {
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
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:125
edm::EDGetTokenT< HGCalDigiCollection > tok_fh_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
edm::EDGetTokenT< HGCalDigiCollection > tok_bh_
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
int iEvent
Definition: GenABIO.cc:224
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
HGCalRawToDigiFake(const edm::ParameterSet &)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
bool isValid() const
Definition: HandleBase.h:74
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
T const * product() const
Definition: Handle.h:74
edm::EDGetTokenT< HGCalDigiCollection > tok_ee_
void add(std::string const &label, ParameterSetDescription const &psetDescription)
HLT enums.
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
def move(src, dest)
Definition: eostools.py:511