CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CSCALCTDigiValidation.cc
Go to the documentation of this file.
4 
8 
11  CSCBaseValidation(inputTag),
12  theTimeBinPlots(),
13  theNDigisPerLayerPlots()
14 {
16 }
17 
19 {
20 }
21 
23 {
24  theNDigisPerEventPlot = iBooker.book1D("CSCALCTDigisPerEvent", "CSC ALCT Digis per event", 100, 0, 100);
25  for(int i = 0; i < 10; ++i)
26  {
27  char title1[200], title2[200];
28  sprintf(title1, "CSCALCTDigiTimeType%d", i+1);
29  sprintf(title2, "CSCALCTDigisPerLayerType%d", i+1);
30  theTimeBinPlots[i] = iBooker.book1D(title1, title1, 20, 0, 20);
31  theNDigisPerLayerPlots[i] = iBooker.book1D(title2, title2, 100, 0, 20);
32  }
33 }
34 
36 {
38 
39  e.getByToken(alcts_Token_, alcts);
40  if (!alcts.isValid()) {
41  edm::LogError("CSCDigiDump") << "Cannot get alcts by label " << theInputTag.encode();
42  }
43  unsigned nDigisPerEvent = 0;
44 
45  for (CSCALCTDigiCollection::DigiRangeIterator j=alcts->begin(); j!=alcts->end(); j++) {
46  std::vector<CSCALCTDigi>::const_iterator beginDigi = (*j).second.first;
47  std::vector<CSCALCTDigi>::const_iterator endDigi = (*j).second.second;
48  CSCDetId detId((*j).first.rawId());
49  int chamberType = detId.iChamberType();
50  int nDigis = endDigi-beginDigi;
51  nDigisPerEvent += nDigis;
52  theNDigisPerLayerPlots[chamberType-1]->Fill(nDigis);
53 
54  for( std::vector<CSCALCTDigi>::const_iterator digiItr = beginDigi;
55  digiItr != endDigi; ++digiItr)
56  {
57  theTimeBinPlots[chamberType-1]->Fill(digiItr->getBX());
58  }
59  }
60 }
int i
Definition: DBlmapReader.cc:9
edm::InputTag theInputTag
MonitorElement * theTimeBinPlots[10]
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:464
void bookHistograms(DQMStore::IBooker &)
CSCALCTDigiValidation(const edm::InputTag &inputTag, edm::ConsumesCollector &&iC)
std::string encode() const
Definition: InputTag.cc:164
void Fill(long long x)
edm::EDGetTokenT< CSCALCTDigiCollection > alcts_Token_
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
int j
Definition: DBlmapReader.cc:9
bool isValid() const
Definition: HandleBase.h:75
unsigned short iChamberType()
Definition: CSCDetId.h:120
MonitorElement * theNDigisPerLayerPlots[10]
MonitorElement * theNDigisPerEventPlot
void analyze(const edm::Event &, const edm::EventSetup &)