CMS 3D CMS Logo

CSCCLCTDigiValidation.cc
Go to the documentation of this file.
4 
8 
10  : CSCBaseValidation(inputTag), theTimeBinPlots(), theNDigisPerLayerPlots() {
12 }
13 
15 
17  theNDigisPerEventPlot = iBooker.book1D("CSCCLCTDigisPerEvent", "CSC CLCT Digis per event", 100, 0, 100);
18  for (int i = 0; i < 10; ++i) {
19  char title1[200], title2[200];
20  sprintf(title1, "CSCCLCTDigiTimeType%d", i + 1);
21  sprintf(title2, "CSCCLCTDigisPerLayerType%d", i + 1);
22  theTimeBinPlots[i] = iBooker.book1D(title1, title1, 20, 0, 20);
23  theNDigisPerLayerPlots[i] = iBooker.book1D(title2, title2, 100, 0, 20);
24  }
25 }
26 
29 
30  e.getByToken(clcts_Token_, clcts);
31  if (!clcts.isValid()) {
32  edm::LogError("CSCDigiDump") << "Cannot get clcts by label " << theInputTag.encode();
33  }
34 
35  unsigned nDigisPerEvent = 0;
36 
37  for (CSCCLCTDigiCollection::DigiRangeIterator j = clcts->begin(); j != clcts->end(); j++) {
38  std::vector<CSCCLCTDigi>::const_iterator beginDigi = (*j).second.first;
39  std::vector<CSCCLCTDigi>::const_iterator endDigi = (*j).second.second;
40  CSCDetId detId((*j).first.rawId());
41  int chamberType = detId.iChamberType();
42 
43  int nDigis = endDigi - beginDigi;
44  nDigisPerEvent += nDigis;
45  theNDigisPerLayerPlots[chamberType - 1]->Fill(nDigis);
46 
47  for (std::vector<CSCCLCTDigi>::const_iterator digiItr = beginDigi; digiItr != endDigi; ++digiItr) {
48  theTimeBinPlots[chamberType - 1]->Fill(digiItr->getBX());
49  }
50  }
51 }
edm::InputTag theInputTag
MonitorElement * theNDigisPerLayerPlots[10]
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
MonitorElement * theTimeBinPlots[10]
std::string encode() const
Definition: InputTag.cc:159
void Fill(long long x)
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:106
unsigned short iChamberType() const
Definition: CSCDetId.h:107
void analyze(const edm::Event &, const edm::EventSetup &) override
bool isValid() const
Definition: HandleBase.h:74
void bookHistograms(DQMStore::IBooker &)
MonitorElement * theNDigisPerEventPlot
CSCCLCTDigiValidation(const edm::InputTag &inputTag, edm::ConsumesCollector &&iC)
edm::EDGetTokenT< CSCCLCTDigiCollection > clcts_Token_