CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HcalDigiAnalyzer.cc
Go to the documentation of this file.
4 #include<iostream>
5 
6 
8 : hitReadoutName_("HcalHits"),
9  simParameterMap_(),
10  hbheFilter_(),
11  hoFilter_(),
12  hfFilter_(true),
13  hbheHitAnalyzer_("HBHEDigi", 1., &simParameterMap_, &hbheFilter_),
14  hoHitAnalyzer_("HODigi", 1., &simParameterMap_, &hoFilter_),
15  hfHitAnalyzer_("HFDigi", 1., &simParameterMap_, &hfFilter_),
16  zdcHitAnalyzer_("ZDCDigi", 1., &simParameterMap_, &zdcFilter_),
17  hbheDigiStatistics_("HBHEDigi", 4, 10., 6., 0.1, 0.5, hbheHitAnalyzer_),
18  hoDigiStatistics_("HODigi", 4, 10., 6., 0.1, 0.5, hoHitAnalyzer_),
19  hfDigiStatistics_("HFDigi", 3, 10., 6., 0.1, 0.5, hfHitAnalyzer_),
20  zdcDigiStatistics_("ZDCDigi", 3, 10., 6., 0.1, 0.5, zdcHitAnalyzer_)
21 {
22 }
23 
24 
25 namespace HcalDigiAnalyzerImpl {
26  template<class Collection>
29  e.getByType(digis);
30  for(unsigned i = 0; i < digis->size(); ++i) {
31  std::cout << (*digis)[i] << std::endl;
32  statistics.analyze((*digis)[i]);
33  }
34  }
35 }
36 
37 
39  // Step A: Get Inputs
41  e.getByLabel("mix", "HcalHits",cf);
42  //e.getByLabel("mix", "ZDCHits", zdccf);
43 
44  // test access to SimHits for HcalHits and ZDC hits
45  std::auto_ptr<MixCollection<PCaloHit> > hits(new MixCollection<PCaloHit>(cf.product()));
46  //std::auto_ptr<MixCollection<PCaloHit> > zdcHits(new MixCollection<PCaloHit>(zdccf.product()));
48  hoHitAnalyzer_.fillHits(*hits);
49  hfHitAnalyzer_.fillHits(*hits);
50  //zdcHitAnalyzer_.fillHits(*zdcHits);
51  HcalDigiAnalyzerImpl::analyze<HBHEDigiCollection>(e, hbheDigiStatistics_);
52  HcalDigiAnalyzerImpl::analyze<HODigiCollection>(e, hoDigiStatistics_);
53  HcalDigiAnalyzerImpl::analyze<HFDigiCollection>(e, hfDigiStatistics_);
54  //HcalDigiAnalyzerImpl::analyze<ZDCDigiCollection>(e, zdcDigiStatistics_);
55 }
56 
57 
int i
Definition: DBlmapReader.cc:9
CaloHitAnalyzer hoHitAnalyzer_
HcalDigiAnalyzer(edm::ParameterSet const &conf)
HcalDigiStatistics hfDigiStatistics_
bool getByType(Handle< PROD > &result) const
Definition: Event.h:398
HcalDigiStatistics hoDigiStatistics_
CaloHitAnalyzer hfHitAnalyzer_
CaloHitAnalyzer hbheHitAnalyzer_
void fillHits(MixCollection< PCaloHit > &hits)
should be called each event
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
tuple conf
Definition: dbtoconf.py:185
void analyze(const Digi &digi)
HcalDigiStatistics hbheDigiStatistics_
virtual void analyze(edm::Event const &e, edm::EventSetup const &c)
void analyze(edm::Event const &e, HcalDigiStatistics &statistics)
T const * product() const
Definition: Handle.h:74
tuple cout
Definition: gather_cfg.py:121