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 
9 
10 
12  const edm::InputTag & inputTag,
14  : CSCBaseValidation(dbe, inputTag),
15  theTimeBinPlots(),
16  theNDigisPerLayerPlots(),
17  theNDigisPerEventPlot( dbe_->book1D("CSCALCTDigisPerEvent", "CSC ALCT Digis per event", 100, 0, 100) )
18 {
19  alcts_Token_ = iC.consumes<CSCALCTDigiCollection> (inputTag);
20 
21  for(int i = 0; i < 10; ++i)
22  {
23  char title1[200], title2[200];
24  sprintf(title1, "CSCALCTDigiTimeType%d", i+1);
25  sprintf(title2, "CSCALCTDigisPerLayerType%d", i+1);
26  theTimeBinPlots[i] = dbe_->book1D(title1, title1, 20, 0, 20);
27  theNDigisPerLayerPlots[i] = dbe_->book1D(title2, title2, 100, 0, 20);
28  }
29 }
30 
31 
32 
34 {
35  // for(int i = 0; i < 10; ++i)
36  // {
37  // edm::LogInfo("CSCDigiValidation") << "Mean of " << theTimeBinPlots[i]->getName()
38  // << " is " << theTimeBinPlots[i]->getMean()
39  // << " +/- " << theTimeBinPlots[i]->getRMS();
40  // }
41 }
42 
43 
45 {
47 
48  e.getByToken(alcts_Token_, alcts);
49  if (!alcts.isValid()) {
50  edm::LogError("CSCDigiDump") << "Cannot get alcts by label " << theInputTag.encode();
51  }
52  unsigned nDigisPerEvent = 0;
53 
54  for (CSCALCTDigiCollection::DigiRangeIterator j=alcts->begin(); j!=alcts->end(); j++) {
55  std::vector<CSCALCTDigi>::const_iterator beginDigi = (*j).second.first;
56  std::vector<CSCALCTDigi>::const_iterator endDigi = (*j).second.second;
57  CSCDetId detId((*j).first.rawId());
58  int chamberType = detId.iChamberType();
59  int nDigis = endDigi-beginDigi;
60  nDigisPerEvent += nDigis;
61  theNDigisPerLayerPlots[chamberType-1]->Fill(nDigis);
62 
63  for( std::vector<CSCALCTDigi>::const_iterator digiItr = beginDigi;
64  digiItr != endDigi; ++digiItr)
65  {
66  theTimeBinPlots[chamberType-1]->Fill(digiItr->getBX());
67  }
68  }
69 }
int i
Definition: DBlmapReader.cc:9
edm::InputTag theInputTag
MonitorElement * theTimeBinPlots[10]
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:954
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
std::string encode() const
Definition: InputTag.cc:164
void Fill(long long x)
edm::EDGetTokenT< CSCALCTDigiCollection > alcts_Token_
int j
Definition: DBlmapReader.cc:9
bool isValid() const
Definition: HandleBase.h:76
DQMStore * dbe_
unsigned short iChamberType()
Definition: CSCDetId.h:120
MonitorElement * theNDigisPerLayerPlots[10]
CSCALCTDigiValidation(DQMStore *dbe, const edm::InputTag &inputTag, edm::ConsumesCollector &&iC)
void analyze(const edm::Event &, const edm::EventSetup &)