HGCal Test Beam  03a93d6239a951948e06fb3ef8dae4cbdebfad30
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
HGCalDigiDump.cc
Go to the documentation of this file.
1 #include "FWCore/Framework/interface/EDAnalyzer.h"
2 #include "FWCore/Framework/interface/Event.h"
3 #include "DataFormats/Common/interface/Handle.h"
4 #include "HGCal/DataFormats/interface/HGCalTBDataFrameContainers.h"
5 
6 #include <iostream>
7 
8 using namespace std;
9 
10 /** \class HGCalDigiDump
11 
12 \author J. Mans - Minnesota
13 */
14 class HGCalDigiDump : public edm::EDAnalyzer
15 {
16 public:
17  explicit HGCalDigiDump(edm::ParameterSet const& conf);
18  virtual void analyze(edm::Event const& e, edm::EventSetup const& c);
19 };
20 
21 
22 HGCalDigiDump::HGCalDigiDump(edm::ParameterSet const& conf)
23 {
24  consumesMany<SKIROC2DigiCollection>();
25 }
26 void HGCalDigiDump::analyze(edm::Event const& e, edm::EventSetup const& c)
27 {
28 
29  std::vector<edm::Handle<SKIROC2DigiCollection> > ski;
30 
31  try {
32  e.getManyByType(ski);
33  std::vector<edm::Handle<SKIROC2DigiCollection> >::iterator i;
34  for (i = ski.begin(); i != ski.end(); i++) {
35  const SKIROC2DigiCollection& c = *(*i);
36 
37  cout << "SKIROC2 Digis: " << i->provenance()->branchName() << endl;
38 
39  for (SKIROC2DigiCollection::const_iterator j = c.begin(); j != c.end(); j++)
40  cout << " " << *j << std::endl;
41  }
42  } catch (...) {
43  cout << "No SKIROC2 Digis." << endl;
44  }
45 }
46 
47 #include "FWCore/PluginManager/interface/ModuleDef.h"
48 #include "FWCore/Framework/interface/MakerMacros.h"
49 
50 
51 DEFINE_FWK_MODULE(HGCalDigiDump);
DEFINE_FWK_MODULE(Pedestals)