CMS 3D CMS Logo

HcalDigiAnalyzer.cc
Go to the documentation of this file.
4 #include <iostream>
5 
7  : hitReadoutName_("HcalHits"),
8  simParameterMap_(),
9  hbheFilter_(),
10  hoFilter_(),
11  hfFilter_(),
12  hbheHitAnalyzer_("HBHEDigi", 1., &simParameterMap_, &hbheFilter_),
13  hoHitAnalyzer_("HODigi", 1., &simParameterMap_, &hoFilter_),
14  hfHitAnalyzer_("HFDigi", 1., &simParameterMap_, &hfFilter_),
15  zdcHitAnalyzer_("ZDCDigi", 1., &simParameterMap_, &zdcFilter_),
16  hbheDigiStatistics_("HBHEDigi", 4, 10., 6., 0.1, 0.5, hbheHitAnalyzer_),
17  hoDigiStatistics_("HODigi", 4, 10., 6., 0.1, 0.5, hoHitAnalyzer_),
18  hfDigiStatistics_("HFDigi", 3, 10., 6., 0.1, 0.5, hfHitAnalyzer_),
19  zdcDigiStatistics_("ZDCDigi", 3, 10., 6., 0.1, 0.5, zdcHitAnalyzer_),
20  hbheDigiCollectionTag_(conf.getParameter<edm::InputTag>("hbheDigiCollectionTag")),
21  hoDigiCollectionTag_(conf.getParameter<edm::InputTag>("hoDigiCollectionTag")),
22  hfDigiCollectionTag_(conf.getParameter<edm::InputTag>("hfDigiCollectionTag")) {}
23 
25  template <class Collection>
28  e.getByLabel(tag, digis);
29  for (unsigned i = 0; i < digis->size(); ++i) {
30  std::cout << (*digis)[i] << std::endl;
31  statistics.analyze((*digis)[i]);
32  }
33  }
34 } // namespace HcalDigiAnalyzerImpl
35 
37  // Step A: Get Inputs
39  e.getByLabel("mix", "HcalHits", cf);
40  // e.getByLabel("mix", "ZDCHits", zdccf);
41 
42  // test access to SimHits for HcalHits and ZDC hits
43  std::unique_ptr<MixCollection<PCaloHit>> hits(new MixCollection<PCaloHit>(cf.product()));
44  // std::unique_ptr<MixCollection<PCaloHit> > zdcHits(new
45  // MixCollection<PCaloHit>(zdccf.product()));
47  hoHitAnalyzer_.fillHits(*hits);
48  hfHitAnalyzer_.fillHits(*hits);
49  // zdcHitAnalyzer_.fillHits(*zdcHits);
50  HcalDigiAnalyzerImpl::analyze<HBHEDigiCollection>(e, hbheDigiStatistics_, hbheDigiCollectionTag_);
51  HcalDigiAnalyzerImpl::analyze<HODigiCollection>(e, hoDigiStatistics_, hoDigiCollectionTag_);
52  HcalDigiAnalyzerImpl::analyze<HFDigiCollection>(e, hfDigiStatistics_, hfDigiCollectionTag_);
53  // HcalDigiAnalyzerImpl::analyze<ZDCDigiCollection>(e, zdcDigiStatistics_);
54 }
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:480
void analyze(const Digi &digi)
HcalDigiStatistics hbheDigiStatistics_
T const * product() const
Definition: Handle.h:74
HLT enums.
void analyze(edm::Event const &e, edm::EventSetup const &c) override