CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CSCCLCTDigiValidation.cc
Go to the documentation of this file.
5 
9 
10 
11 
13 : CSCBaseValidation(dbe, inputTag),
14  theTimeBinPlots(),
15  theNDigisPerLayerPlots(),
16  theNDigisPerEventPlot( dbe_->book1D("CSCCLCTDigisPerEvent", "CSC CLCT Digis per event", 100, 0, 100) )
17 {
18  for(int i = 0; i < 10; ++i)
19  {
20  char title1[200], title2[200];
21  sprintf(title1, "CSCCLCTDigiTimeType%d", i+1);
22  sprintf(title2, "CSCCLCTDigisPerLayerType%d", i+1);
23  theTimeBinPlots[i] = dbe_->book1D(title1, title1, 20, 0, 20);
24  theNDigisPerLayerPlots[i] = dbe_->book1D(title2, title2, 100, 0, 20);
25  }
26 }
27 
28 
29 
31 {
32 
33 // for(int i = 0; i < 10; ++i)
34 // {
35 // edm::LogInfo("CSCDigiValidation") << "Mean of " << theTimeBinPlots[i]->getName()
36 // << " is " << theTimeBinPlots[i]->getMean()
37 // << " +/- " << theTimeBinPlots[i]->getRMS();
38 // }
39 
40 }
41 
42 
44 {
46 
47  e.getByLabel(theInputTag, clcts);
48  if (!clcts.isValid()) {
49  edm::LogError("CSCDigiDump") << "Cannot get clcts by label " << theInputTag.encode();
50  }
51 
52  unsigned nDigisPerEvent = 0;
53 
54  for (CSCCLCTDigiCollection::DigiRangeIterator j=clcts->begin(); j!=clcts->end(); j++) {
55  std::vector<CSCCLCTDigi>::const_iterator beginDigi = (*j).second.first;
56  std::vector<CSCCLCTDigi>::const_iterator endDigi = (*j).second.second;
57  CSCDetId detId((*j).first.rawId());
58  int chamberType = detId.iChamberType();
59 
60  int nDigis = endDigi-beginDigi;
61  nDigisPerEvent += nDigis;
62  theNDigisPerLayerPlots[chamberType-1]->Fill(nDigis);
63 
64  for( std::vector<CSCCLCTDigi>::const_iterator digiItr = beginDigi;
65  digiItr != endDigi; ++digiItr)
66  {
67  theTimeBinPlots[chamberType-1]->Fill(digiItr->getBX());
68  }
69 
70  }
71 }
int i
Definition: DBlmapReader.cc:9
edm::InputTag theInputTag
MonitorElement * theNDigisPerLayerPlots[10]
void analyze(const edm::Event &, const edm::EventSetup &)
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:722
MonitorElement * theTimeBinPlots[10]
CSCCLCTDigiValidation(DQMStore *dbe, const edm::InputTag &inputTag)
std::string encode() const
Definition: InputTag.cc:164
void Fill(long long x)
int j
Definition: DBlmapReader.cc:9
bool isValid() const
Definition: HandleBase.h:76
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:361
DQMStore * dbe_
unsigned short iChamberType()
Definition: CSCDetId.h:109