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
HGCalRawToDigiFake::tok_bh_
edm::EDGetTokenT< HGCalDigiCollection > tok_bh_
Definition: HGCalRawToDigiFake.cc:25
HGCalRawToDigiFake::HGCalRawToDigiFake
HGCalRawToDigiFake(const edm::ParameterSet &)
Definition: HGCalRawToDigiFake.cc:28
edm::StreamID
Definition: StreamID.h:30
edm::Handle::product
T const * product() const
Definition: Handle.h:70
ESHandle.h
edm::EDGetTokenT
Definition: EDGetToken.h:33
edm
HLT enums.
Definition: AlignableModifier.h:19
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89287
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
HGCalRawToDigiFake::tok_ee_
edm::EDGetTokenT< HGCalDigiCollection > tok_ee_
Definition: HGCalRawToDigiFake.cc:23
edm::SortedCollection
Definition: SortedCollection.h:49
HGCalRawToDigiFake::produce
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
Definition: HGCalRawToDigiFake.cc:37
edm::Handle
Definition: AssociativeIterator.h:50
MakerMacros.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
HGCalRawToDigiFake::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: HGCalRawToDigiFake.cc:65
HGCalRawToDigiFake
Definition: HGCalRawToDigiFake.cc:16
edm::global::EDProducer
Definition: EDProducer.h:32
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
edm::ParameterSet
Definition: ParameterSet.h:47
Event.h
iEvent
int iEvent
Definition: GenABIO.cc:224
HGCDigiCollections.h
edm::EventSetup
Definition: EventSetup.h:57
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
eostools.move
def move(src, dest)
Definition: eostools.py:511
Frameworkfwd.h
EventSetup.h
ParameterSet.h
EDProducer.h
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
edm::Event
Definition: Event.h:73
HGCalRawToDigiFake::tok_fh_
edm::EDGetTokenT< HGCalDigiCollection > tok_fh_
Definition: HGCalRawToDigiFake.cc:24
edm::InputTag
Definition: InputTag.h:15