CMS 3D CMS Logo

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_(),
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  hbheDigiCollectionTag_(conf.getParameter<edm::InputTag>("hbheDigiCollectionTag")),
22  hoDigiCollectionTag_(conf.getParameter<edm::InputTag>("hoDigiCollectionTag")),
23  hfDigiCollectionTag_(conf.getParameter<edm::InputTag>("hfDigiCollectionTag"))
24 {
25 }
26 
27 
29  template<class Collection>
32  e.getByLabel(tag, digis);
33  for(unsigned i = 0; i < digis->size(); ++i) {
34  std::cout << (*digis)[i] << std::endl;
35  statistics.analyze((*digis)[i]);
36  }
37  }
38 }
39 
40 
42  // Step A: Get Inputs
44  e.getByLabel("mix", "HcalHits",cf);
45  //e.getByLabel("mix", "ZDCHits", zdccf);
46 
47  // test access to SimHits for HcalHits and ZDC hits
48  std::unique_ptr<MixCollection<PCaloHit> > hits(new MixCollection<PCaloHit>(cf.product()));
49  //std::unique_ptr<MixCollection<PCaloHit> > zdcHits(new MixCollection<PCaloHit>(zdccf.product()));
51  hoHitAnalyzer_.fillHits(*hits);
52  hfHitAnalyzer_.fillHits(*hits);
53  //zdcHitAnalyzer_.fillHits(*zdcHits);
54  HcalDigiAnalyzerImpl::analyze<HBHEDigiCollection>(e, hbheDigiStatistics_, hbheDigiCollectionTag_);
55  HcalDigiAnalyzerImpl::analyze<HODigiCollection>(e, hoDigiStatistics_, hoDigiCollectionTag_);
56  HcalDigiAnalyzerImpl::analyze<HFDigiCollection>(e, hfDigiStatistics_, hfDigiCollectionTag_);
57  //HcalDigiAnalyzerImpl::analyze<ZDCDigiCollection>(e, zdcDigiStatistics_);
58 }
edm::InputTag hfDigiCollectionTag_
CaloHitAnalyzer hoHitAnalyzer_
HcalDigiAnalyzer(edm::ParameterSet const &conf)
HcalDigiStatistics hfDigiStatistics_
HcalDigiStatistics hoDigiStatistics_
edm::InputTag hbheDigiCollectionTag_
CaloHitAnalyzer hfHitAnalyzer_
CaloHitAnalyzer hbheHitAnalyzer_
edm::InputTag hoDigiCollectionTag_
void fillHits(MixCollection< PCaloHit > &hits)
should be called each event
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:475
void analyze(const Digi &digi)
HcalDigiStatistics hbheDigiStatistics_
T const * product() const
Definition: Handle.h:81
HLT enums.
void analyze(edm::Event const &e, edm::EventSetup const &c) override