CMS 3D CMS Logo

SiStripQualityChecker.cc
Go to the documentation of this file.
6 
8 
10 
14 
17 
20 
21 
22 #include <iomanip>
23 //
24 // -- Constructor
25 //
27  edm::LogInfo("SiStripQualityChecker") <<
28  " Creating SiStripQualityChecker " << "\n" ;
29 
30  bookedStripStatus_ = false;
31 
32  SubDetFolderMap.insert(std::pair<std::string, std::string>("TIB", "TIB"));
33  SubDetFolderMap.insert(std::pair<std::string, std::string>("TOB", "TOB"));
34  SubDetFolderMap.insert(std::pair<std::string, std::string>("TECF", "TEC/PLUS"));
35  SubDetFolderMap.insert(std::pair<std::string, std::string>("TECB", "TEC/MINUS"));
36  SubDetFolderMap.insert(std::pair<std::string, std::string>("TIDF", "TID/PLUS"));
37  SubDetFolderMap.insert(std::pair<std::string, std::string>("TIDB", "TID/MINUS"));
38  badModuleList.clear();
39 
40  if(!edm::Service<TkDetMap>().isAvailable()){
41  edm::LogError("TkHistoMap") <<
42  "\n------------------------------------------"
43  "\nUnAvailable Service TkHistoMap: please insert in the configuration file an instance like"
44  "\n\tprocess.TkDetMap = cms.Service(\"TkDetMap\")"
45  "\n------------------------------------------";
46  }
48 
49 }
50 //
51 // -- Destructor
52 //
54  edm::LogInfo("SiStripQualityChecker") <<
55  " Deleting SiStripQualityChecker " << "\n" ;
56 }
57 //
58 // -- create reportSummary MEs
59 //
61 
62  if (!bookedStripStatus_) {
63  dqm_store->cd();
64  std::string strip_dir = "";
65  SiStripUtility::getTopFolderPath(dqm_store, "SiStrip", strip_dir);
66  if (strip_dir.size() == 0) strip_dir = "SiStrip";
67 
68  // Non Standard Plots and should be put outside EventInfo folder
69 
70  dqm_store->setCurrentFolder(strip_dir+"/MechanicalView");
71 
72  std::string hname, htitle;
73  hname = "detFractionReportMap";
74  htitle = "SiStrip Report for Good Detector Fraction";
75  DetFractionReportMap = dqm_store->book2D(hname, htitle, 6,0.5,6.5,9,0.5,9.5);
76  DetFractionReportMap->setAxisTitle("Sub Detector Type", 1);
77  DetFractionReportMap->setAxisTitle("Layer/Disc Number", 2);
78 
79  hname = "detFractionReportMap_hasBadChan";
80  htitle = "SiStrip Report for Good Detector Fraction due to bad channels";
81  DetFractionReportMap_hasBadChan = dqm_store->book2D(hname, htitle, 6,0.5,6.5,9,0.5,9.5);
82  DetFractionReportMap_hasBadChan->setAxisTitle("Sub Detector Type", 1);
83  DetFractionReportMap_hasBadChan->setAxisTitle("Layer/Disc Number", 2);
84  hname = "detFractionReportMap_hasTooManyDigis";
85  htitle = "SiStrip Report for Good Detector Fraction due to too many digis";
86  DetFractionReportMap_hasTooManyDigis = dqm_store->book2D(hname, htitle, 6,0.5,6.5,9,0.5,9.5);
87  DetFractionReportMap_hasTooManyDigis->setAxisTitle("Sub Detector Type", 1);
88  DetFractionReportMap_hasTooManyDigis->setAxisTitle("Layer/Disc Number", 2);
89  hname = "detFractionReportMap_hasTooManyClu";
90  htitle = "SiStrip Report for Good Detector Fraction due to too many clusters";
91  DetFractionReportMap_hasTooManyClu = dqm_store->book2D(hname, htitle, 6,0.5,6.5,9,0.5,9.5);
92  DetFractionReportMap_hasTooManyClu->setAxisTitle("Sub Detector Type", 1);
93  DetFractionReportMap_hasTooManyClu->setAxisTitle("Layer/Disc Number", 2);
94  hname = "detFractionReportMap_hasExclFed";
95  htitle = "SiStrip Report for Good Detector Fraction due to excluded FEDs";
96  DetFractionReportMap_hasExclFed = dqm_store->book2D(hname, htitle, 6,0.5,6.5,9,0.5,9.5);
97  DetFractionReportMap_hasExclFed->setAxisTitle("Sub Detector Type", 1);
98  DetFractionReportMap_hasExclFed->setAxisTitle("Layer/Disc Number", 2);
99  hname = "detFractionReportMap_hasDcsErr";
100  htitle = "SiStrip Report for Good Detector Fraction due to DCS errors";
101  DetFractionReportMap_hasDcsErr = dqm_store->book2D(hname, htitle, 6,0.5,6.5,9,0.5,9.5);
102  DetFractionReportMap_hasDcsErr->setAxisTitle("Sub Detector Type", 1);
103  DetFractionReportMap_hasDcsErr->setAxisTitle("Layer/Disc Number", 2);
104 
105  hname = "sToNReportMap";
106  htitle = "SiStrip Report for Signal-to-Noise";
107  SToNReportMap = dqm_store->book2D(hname, htitle, 6,0.5,6.5,9,0.5,9.5);
108  SToNReportMap->setAxisTitle("Sub Detector Type", 1);
109  SToNReportMap->setAxisTitle("Layer/Disc Number", 2);
110 
111  // this is the main reportSummary 2D plot and should be in EventInfo
112  dqm_store->setCurrentFolder(strip_dir+"/EventInfo");
113 
114  hname = "reportSummaryMap";
115  htitle = "SiStrip Report Summary Map";
116  SummaryReportMap = dqm_store->book2D(hname, htitle, 6,0.5,6.5,9,0.5,9.5);
117  SummaryReportMap->setAxisTitle("Sub Detector Type", 1);
118  SummaryReportMap->setAxisTitle("Layer/Disc Number", 2);
119 
120  SummaryReportGlobal = dqm_store->bookFloat("reportSummary");
121  int ibin = 0;
122 
123  dqm_store->setCurrentFolder(strip_dir+"/EventInfo/reportSummaryContents");
124  for (std::map<std::string, std::string>::const_iterator it = SubDetFolderMap.begin();
125  it != SubDetFolderMap.end(); it++) {
126  ibin++;
127  std::string det = it->first;
128  DetFractionReportMap->setBinLabel(ibin,it->second);
129  DetFractionReportMap_hasBadChan ->setBinLabel(ibin,it->second);
132  DetFractionReportMap_hasExclFed ->setBinLabel(ibin,it->second);
133  DetFractionReportMap_hasDcsErr ->setBinLabel(ibin,it->second);
134  SToNReportMap->setBinLabel(ibin,it->second);
135  SummaryReportMap->setBinLabel(ibin,it->second);
136 
137  SubDetMEs local_mes;
138 
139  if (det == "TECF") local_mes.detectorTag = "TEC+";
140  else if (det == "TECB") local_mes.detectorTag = "TEC-";
141  else if (det == "TIDF") local_mes.detectorTag = "TID+";
142  else if (det == "TIDB") local_mes.detectorTag = "TID-";
143  else local_mes.detectorTag = det;
144 
145  std::string me_name;
146  me_name = "SiStrip_" + det;
147  local_mes.SummaryFlag = dqm_store->bookFloat(me_name);
148 
149  me_name = "SiStrip_DetFraction_" + det;
150  local_mes.DetFraction = dqm_store->bookFloat(me_name);
151 
152  me_name = "SiStrip_SToNFlag_" + det;
153  local_mes.SToNFlag = dqm_store->bookFloat(me_name);
154  SubDetMEsMap.insert(std::pair<std::string, SubDetMEs>(det, local_mes));
155  }
156  bookedStripStatus_ = true;
157  }
158 }
159 //
160 // -- Fill Dummy Status
161 //
163 
164  resetStatus();
165  if (bookedStripStatus_) {
166  for (std::map<std::string, SubDetMEs>::const_iterator it = SubDetMEsMap.begin();
167  it != SubDetMEsMap.end(); it++) {
168  SubDetMEs local_mes = it->second;
169  local_mes.SummaryFlag -> Fill(-1.0);
170  local_mes.DetFraction -> Fill(-1.0);
171  local_mes.SToNFlag -> Fill(-1.0);
172  }
173 
174  for (int xbin = 1; xbin < SummaryReportMap->getNbinsX()+1; xbin++) {
175  for (int ybin = 1; ybin < SummaryReportMap->getNbinsY()+1; ybin++) {
176  SummaryReportMap -> Fill(xbin, ybin, -1.0);
177  DetFractionReportMap -> Fill(xbin, ybin, -1.0);
178  DetFractionReportMap_hasBadChan -> Fill(xbin, ybin, -1.0);
179  DetFractionReportMap_hasTooManyDigis -> Fill(xbin, ybin, -1.0);
180  DetFractionReportMap_hasTooManyClu -> Fill(xbin, ybin, -1.0);
181  DetFractionReportMap_hasExclFed -> Fill(xbin, ybin, -1.0);
182  DetFractionReportMap_hasDcsErr -> Fill(xbin, ybin, -1.0);
183  SToNReportMap -> Fill(xbin, ybin, -1.0);
184  }
185  }
186  SummaryReportGlobal->Fill(-1.0);
187  }
188 }
189 //
190 // -- Reset Status
191 //
193  if (bookedStripStatus_) {
194  for (std::map<std::string, SubDetMEs>::const_iterator it = SubDetMEsMap.begin();
195  it != SubDetMEsMap.end(); it++) {
196  SubDetMEs local_mes = it->second;
197  local_mes.DetFraction -> Reset();
198  local_mes.SummaryFlag -> Reset();
199  local_mes.SToNFlag -> Reset();
200  }
208  SToNReportMap->Reset();
209 
211  }
212 }
213 //
214 // -- Fill Status
215 //
217  if (!bookedStripStatus_) bookStatus(dqm_store);
218 
219  fillDummyStatus();
220  fillDetectorStatus(dqm_store, cabling);
221 
222  int faulty_moduleflag = pSet_.getUntrackedParameter<bool>("PrintFaultyModuleList", false);
223  if (faulty_moduleflag) fillFaultyModuleStatus(dqm_store, eSetup);
224 }
225 //
226 // Fill Detector Status
227 //
229  unsigned int xbin = 0;
230  float global_flag = 0;
231  dqm_store->cd();
232  std::string mdir = "MechanicalView";
233  if (!SiStripUtility::goToDir(dqm_store, mdir)) return;
234  std::string mechanicalview_dir = dqm_store->pwd();
235 
237  for (std::map<std::string, SubDetMEs>::const_iterator it = SubDetMEsMap.begin();
238  it != SubDetMEsMap.end(); it++) {
239  std::string det = it->first;
240  std::map<std::string, std::string>::const_iterator cPos = SubDetFolderMap.find(det);
241  if (cPos == SubDetFolderMap.end()) continue;
242  std::string dname = mechanicalview_dir + "/" + cPos->second;
243  if (!dqm_store->dirExists(dname)) continue;
244  dqm_store->cd(dname);
245  SubDetMEs local_mes = it->second;
246  xbin++;
247  float flag;
248  fillSubDetStatus(dqm_store, cabling, local_mes, xbin,flag);
249  global_flag += flag;
250  }
251  global_flag = global_flag/xbin*1.0;
252  if (SummaryReportGlobal) SummaryReportGlobal->Fill(global_flag);
253  dqm_store->cd();
254 }
255 //
256 // -- Fill Sub detector Reports
257 //
259  const edm::ESHandle< SiStripDetCabling >& cabling,
260  SubDetMEs& mes, unsigned int xbin, float& gflag) {
261 
262  int status_flag = pSet_.getUntrackedParameter<int>("GlobalStatusFilling", 1);
263  if (status_flag < 1) return;
264 
265  std::vector<std::string> subDirVec = dqm_store->getSubdirs();
266 
267  unsigned int ybin = 0;
268  int tot_ndet = 0;
269  int tot_errdet = 0;
270  float tot_ston_stat = 0;
271 
272  for (std::vector<std::string>::const_iterator ic = subDirVec.begin();
273  ic != subDirVec.end(); ic++) {
274  std::string dname = (*ic);
275  if (dname.find("BadModuleList") != std::string::npos) continue;
276  if (dname.find("ring") !=std::string::npos) continue;
277  std::vector<MonitorElement*> meVec;
278 
279  ybin++;
280  dqm_store->cd((*ic));
281  meVec = dqm_store->getContents((*ic));
282  uint16_t ndet = 100;
283  int errdet = 0;
284  int errdet_hasBadChan = 0;
285  int errdet_hasTooManyDigis = 0;
286  int errdet_hasTooManyClu = 0;
287  int errdet_hasExclFed = 0;
288  int errdet_hasDcsErr = 0;
289 
290  int ston_stat = 1;
291  int lnum = atoi(dname.substr(dname.find_last_of("_")+1).c_str());
292  ndet = cabling->connectedNumber(mes.detectorTag, lnum);
293 
294  getModuleStatus(dqm_store, meVec, errdet, errdet_hasBadChan, errdet_hasTooManyDigis, errdet_hasTooManyClu, errdet_hasExclFed, errdet_hasDcsErr);
295 
296  for (std::vector<MonitorElement*>::const_iterator it = meVec.begin();
297  it != meVec.end(); it++) {
298  MonitorElement * me = (*it);
299  if (!me) continue;
300  std::vector<QReport *> reports = me->getQReports();
301 
302  if (reports.size() == 0) continue;
303  std::string name = me->getName();
304 
305  if( name.find("Summary_ClusterStoNCorr__OnTrack") != std::string::npos){
306  int istat = SiStripUtility::getMEStatus((*it));
307  if (reports[0]->getQTresult() == -1) {
308  ston_stat =-1;
309  } else {
310  if (istat == dqm::qstatus::ERROR) ston_stat = 0;
311  else if (istat == dqm::qstatus::STATUS_OK) ston_stat = 1;
312  }
313  }
314  }
315  if (ndet > 0) {
316  float eff_fac = 1 - (errdet*1.0/ndet);
317  float eff_fac_hasBadChan = 1 - (errdet_hasBadChan *1.0/ndet);
318  float eff_fac_hasTooManyDigis = 1 - (errdet_hasTooManyDigis*1.0/ndet);
319  float eff_fac_hasTooManyClu = 1 - (errdet_hasTooManyClu *1.0/ndet);
320  float eff_fac_hasExclFed = 1 - (errdet_hasExclFed *1.0/ndet);
321  float eff_fac_hasDcsErr = 1 - (errdet_hasDcsErr *1.0/ndet);
322  fillStatusHistogram(SToNReportMap, xbin, ybin, ston_stat);
323  fillStatusHistogram(DetFractionReportMap, xbin, ybin, eff_fac);
324  fillStatusHistogram(DetFractionReportMap_hasBadChan , xbin, ybin, eff_fac_hasBadChan );
325  fillStatusHistogram(DetFractionReportMap_hasTooManyDigis, xbin, ybin, eff_fac_hasTooManyDigis);
326  fillStatusHistogram(DetFractionReportMap_hasTooManyClu , xbin, ybin, eff_fac_hasTooManyClu );
327  fillStatusHistogram(DetFractionReportMap_hasExclFed , xbin, ybin, eff_fac_hasExclFed );
328  fillStatusHistogram(DetFractionReportMap_hasDcsErr , xbin, ybin, eff_fac_hasDcsErr );
329  if (ston_stat < 0) fillStatusHistogram(SummaryReportMap, xbin, ybin, eff_fac);
330  else fillStatusHistogram(SummaryReportMap, xbin, ybin, ston_stat*eff_fac);
331 
332  tot_ndet += ndet;
333  tot_errdet += errdet;
334  tot_ston_stat += ston_stat;
335  }
336  dqm_store->cd((*ic));
337  }
338  if (tot_ndet > 0) {
339  float tot_eff_fac = 1 - (tot_errdet*1.0/tot_ndet);
340  if (mes.DetFraction) mes.DetFraction->Fill(tot_eff_fac);
341  float tot_ston_fac = tot_ston_stat/ybin;
342  if (mes.SToNFlag) mes.SToNFlag->Fill(tot_ston_fac);
343  if (tot_ston_fac < 0){
344  gflag = tot_eff_fac;
345  }else{
346  gflag = std::min(tot_eff_fac,tot_ston_fac);
347  }
348  if (mes.SummaryFlag) mes.SummaryFlag->Fill(gflag);
349  }
350 }
351 //
352 // -- Print Status Report
353 //
355  std::ostringstream det_summary_str;
356  for (std::map<std::string, SubDetMEs>::const_iterator it = SubDetMEsMap.begin();
357  it != SubDetMEsMap.end(); it++) {
358  std::string det = it->first;
359  det_summary_str << std::setprecision(4);
360  det_summary_str << std::setiosflags(std::ios::fixed);
361 
362  det_summary_str << " Printing Status for " << det << " : " << std::endl;
363  SubDetMEs local_mes = it->second;
364 
365  std::string sval;
366  float fval1, fval2, fval3;
367  fval1 = fval2 = fval3 = -1.0;
368 
369 
370  SiStripUtility::getMEValue(local_mes.DetFraction, sval);
371  if (sval.size() > 0) fval1 = atof(sval.c_str());
372  SiStripUtility::getMEValue(local_mes.SToNFlag, sval);
373  if (sval.size() > 0) fval2 = atof(sval.c_str());
374  SiStripUtility::getMEValue(local_mes.SummaryFlag, sval);
375  if (sval.size() > 0) fval3 = atof(sval.c_str());
376 
377  det_summary_str << std::setw(7) << " % of good detectors " << fval1
378  << " SToN Flag " << fval2
379  << " Summary Flag " << fval3 << std::endl;
380  }
381 }
382 //
383 // -- Get Module Status from Layer Level Histograms
384 //
385 void SiStripQualityChecker::getModuleStatus(DQMStore* dqm_store, std::vector<MonitorElement*>& layer_mes,int& errdet, int& errdet_hasBadChan, int& errdet_hasTooManyDigis, int& errdet_hasTooManyClu, int& errdet_hasExclFed, int& errdet_hasDcsErr) {
386 
387  std::string lname;
388  std::map<uint32_t,uint16_t> bad_modules;
389  for (std::vector<MonitorElement*>::const_iterator it = layer_mes.begin();
390  it != layer_mes.end(); it++) {
391  MonitorElement * me = (*it);
392  if (!me) continue;
393  std::vector<QReport *> qreports = me->getQReports();
394  if (qreports.size() == 0) continue;
395  std::string name = me->getName();
396  std::vector<DQMChannel> bad_channels_me;
398  bad_channels_me = qreports[0]->getBadChannels();
399  lname = "";
400  } else if (me->kind() == MonitorElement::DQM_KIND_TPROFILE2D && name.find("TkHMap") != std::string::npos) {
401  bad_channels_me = qreports[0]->getBadChannels();
402  lname = name.substr(name.find("TkHMap_")+7);
403  lname = lname.substr(lname.find("_T")+1);
404 
405  }
406  for (std::vector<DQMChannel>::iterator it = bad_channels_me.begin(); it != bad_channels_me.end(); it++){
407  int xval = (*it).getBinX();
408  int yval = (*it).getBinY();
409  uint32_t detId = tkDetMap_->getDetFromBin(lname, xval, yval);
410  std::map<uint32_t,uint16_t>::iterator iPos = bad_modules.find(detId);
411  uint16_t flag;
412  if (iPos != bad_modules.end()){
413  flag = iPos->second;
415  iPos->second = flag;
416  } else {
417  //
418  //if not in the local bad module list, check the BadModuleList dir
419  //
420  std::ostringstream detid_str;
421  detid_str << detId;
422  //now in the layer/wheel dir
423  std::string currentdir = dqm_store->pwd();
424  std::string thisMEpath = currentdir.substr( 0 , currentdir.rfind( "/" ) ) + "/BadModuleList/" + detid_str.str() ;
425 
426  MonitorElement *meBadModule = dqm_store->get ( thisMEpath );
427  if ( meBadModule )
428  {
429  std::string val_str;
430  SiStripUtility::getMEValue ( meBadModule , val_str );
431  flag = atoi ( val_str.c_str() );
432  }
433  else
434  flag = 0;
435 
437  bad_modules.insert(std::pair<uint32_t,uint16_t>(detId,flag));
438  }
439  }
440  }
441  for(std::map<uint32_t,uint16_t>::const_iterator it = bad_modules.begin();
442  it != bad_modules.end(); it++) {
443  uint32_t detId = it->first;
444  uint16_t flag = it->second;
445  if (((flag >> 0) & 0x1) > 0) errdet_hasBadChan++;
446  if (((flag >> 1) & 0x1) > 0) errdet_hasTooManyDigis++;
447  if (((flag >> 2) & 0x1) > 0) errdet_hasTooManyClu++;
448  if (((flag >> 3) & 0x1) > 0) errdet_hasExclFed++;
449  if (((flag >> 4) & 0x1) > 0) errdet_hasDcsErr++;
450  std::map<uint32_t,uint16_t>::iterator iPos = badModuleList.find(detId);
451  if (iPos != badModuleList.end()){
452  iPos->second = flag;
453  } else {
454  badModuleList.insert(std::pair<uint32_t,uint16_t>(detId,flag));
455  }
456  }
457  errdet = bad_modules.size();
458 }
459 //
460 // -- Fill Report Summary Map
461 //
462  void SiStripQualityChecker::fillStatusHistogram(MonitorElement* me, int xbin, int ybin, float val){
463  if (me && me->kind() == MonitorElement::DQM_KIND_TH2F) {
464  TH2F* th2d = me->getTH2F();
465  th2d->SetBinContent(xbin, ybin, val);
466  }
467  }
468 //
469 // -- Create Monitor Elements for Modules
470 //
472  if (badModuleList.size() == 0) return;
473 
474  //Retrieve tracker topology from geometry
475  edm::ESHandle<TrackerTopology> tTopoHandle;
476  eSetup.get<TrackerTopologyRcd>().get(tTopoHandle);
477  const TrackerTopology* const tTopo = tTopoHandle.product();
478 
479  dqm_store->cd();
480  std::string mdir = "MechanicalView";
481  if (!SiStripUtility::goToDir(dqm_store, mdir)) return;
482  std::string mechanical_dir = dqm_store->pwd();
483 
484  SiStripFolderOrganizer folder_organizer;
485  for (std::map<uint32_t,uint16_t>::const_iterator it = badModuleList.begin() ; it != badModuleList.end(); it++) {
486  uint32_t detId = it->first;
487  std::string subdet_folder ;
488  folder_organizer.getSubDetFolder(detId,tTopo,subdet_folder);
489  if (!dqm_store->dirExists(subdet_folder)) {
490  subdet_folder = mechanical_dir + subdet_folder.substr(subdet_folder.find("MechanicalView")+14);
491  if (!dqm_store->dirExists(subdet_folder)) continue;
492  }
493  std::string bad_module_folder = subdet_folder + "/" + "BadModuleList";
494  dqm_store->setCurrentFolder(bad_module_folder);
495 
496  std::ostringstream detid_str;
497  detid_str << detId;
498  std::string full_path = bad_module_folder + "/" + detid_str.str();
499  MonitorElement* me = dqm_store->get(full_path);
500  if (me) me->Reset();
501  else me = dqm_store->bookInt(detid_str.str());
502  me->Fill(it->second);
503  }
504  dqm_store->cd();
505 }
506 //
507 // -- Initialise Bad Module List
508 //
510  for (std::map<uint32_t,uint16_t>::iterator it=badModuleList.begin(); it!=badModuleList.end(); it++) {
511  it->second = 0;
512  }
513 }
514 //
515 // -- Fill Status information and the lumi block
516 //
518  if (!bookedStripStatus_) bookStatus(dqm_store);
519  fillDummyStatus();
520  fillDetectorStatusAtLumi(dqm_store);
521 }
522 //
523 // Fill Detector Status MEs at the Lumi block
524 //
526 
527 
528 
529  dqm_store->cd();
530  std::string rdir = "ReadoutView";
531  if (!SiStripUtility::goToDir(dqm_store, rdir)) return;
532  std::string fullpath = dqm_store->pwd()
533  // + "/FedSummary/PerLumiSection/"
534  + "/PerLumiSection/"
535  + "lumiErrorFraction";
536  MonitorElement* me = dqm_store->get(fullpath);
537  if (me && me->kind() == MonitorElement::DQM_KIND_TH1F) {
538  TH1F* th1 = me->getTH1F();
539  float global_fraction = 0.0;
540  float dets = 0.0;
541  for (int ibin = 1; ibin <= th1->GetNbinsX(); ibin++) {
542  std::string label = th1->GetXaxis()->GetBinLabel(ibin);
543  std::map<std::string, SubDetMEs>::iterator iPos = SubDetMEsMap.find(label);
544  if (iPos != SubDetMEsMap.end()) {
545  float fraction = 1.0 - th1->GetBinContent(ibin);
546  global_fraction += fraction;
547  dets++;
548  iPos->second.DetFraction -> Fill(fraction);
549  iPos->second.SToNFlag -> Fill(-1.0);
550  iPos->second.SummaryFlag -> Fill(fraction);
551  }
552  }
553  global_fraction = global_fraction/dets;
554  if (SummaryReportGlobal) SummaryReportGlobal->Fill(global_fraction);
555  }
556  dqm_store->cd();
557 }
void fillStatus(DQMStore *dqm_store, const edm::ESHandle< SiStripDetCabling > &cabling, const edm::EventSetup &eSetup)
static void setBadModuleFlag(std::string &hname, uint16_t &flg)
T getUntrackedParameter(std::string const &, T const &) const
const std::string & getName(void) const
get name of ME
void getSubDetFolder(const uint32_t &detid, const TrackerTopology *tTopo, std::string &folder_name)
void bookStatus(DQMStore *dqm_store)
void fillDetectorStatusAtLumi(DQMStore *dqm_store)
std::vector< std::string > getSubdirs(void) const
Definition: DQMStore.cc:1740
void fillDetectorStatus(DQMStore *dqm_store, const edm::ESHandle< SiStripDetCabling > &cabling)
static void getMEValue(MonitorElement *me, std::string &val)
std::map< std::string, std::string > SubDetFolderMap
void cd(void)
go to top directory (ie. root)
Definition: DQMStore.cc:718
MonitorElement * DetFractionReportMap_hasTooManyDigis
void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
uint32_t connectedNumber(const std::string &subDet, const uint16_t layer) const
MonitorElement * bookFloat(const char *name)
Book float.
Definition: DQMStore.cc:972
SiStripQualityChecker(edm::ParameterSet const &ps)
int getNbinsY(void) const
get # of bins in Y-axis
void Fill(long long x)
std::map< std::string, SubDetMEs > SubDetMEsMap
uint32_t getDetFromBin(int layer, int ix, int iy) const
Definition: TkDetMap.h:128
currentdir
parse figure configuration if found
Definition: lumiPlot.py:48
void fillFaultyModuleStatus(DQMStore *dqm_store, const edm::EventSetup &eSetup)
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
T min(T a, T b)
Definition: MathUtil.h:58
Kind kind(void) const
Get the type of the monitor element.
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. "my/long/dir/my_histo")
Definition: DQMStore.cc:1789
std::vector< MonitorElement * > getContents(const std::string &path) const
Definition: DQMStore.cc:1818
MonitorElement * DetFractionReportMap
MonitorElement * DetFractionReportMap_hasTooManyClu
void getModuleStatus(DQMStore *dqm_store, std::vector< MonitorElement * > &layer_mes, int &errdet, int &errdet_hasBadChan, int &errdet_hasTooManyDigis, int &errdet_hasTooManyClu, int &errdet_hasExclFed, int &errdet_hasDcsErr)
bool dirExists(const std::string &path) const
true if directory exists
Definition: DQMStore.cc:806
std::vector< QReport * > getQReports(void) const
get map of QReports
static int getMEStatus(MonitorElement *me)
MonitorElement * DetFractionReportMap_hasBadChan
const T & get() const
Definition: EventSetup.h:55
TH1F * getTH1F(void) const
void fillStatusAtLumi(DQMStore *dqm_store)
MonitorElement * SummaryReportMap
MonitorElement * SummaryReportGlobal
MonitorElement * SToNReportMap
MonitorElement * DetFractionReportMap_hasExclFed
int getNbinsX(void) const
get # of bins in X-axis
static const int STATUS_OK
std::map< uint32_t, uint16_t > badModuleList
void Reset(std::vector< TH2F > &depth)
TH2F * getTH2F(void) const
MonitorElement * bookInt(const char *name)
Book int.
Definition: DQMStore.cc:942
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
Definition: DQMStore.cc:1163
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void Reset(void)
reset ME (ie. contents, errors, etc)
void fillSubDetStatus(DQMStore *dqm_store, const edm::ESHandle< SiStripDetCabling > &cabling, SubDetMEs &mes, unsigned int xbin, float &gflag)
static bool goToDir(DQMStore *dqm_store, std::string name)
T const * product() const
Definition: ESHandle.h:86
MonitorElement * DetFractionReportMap_hasDcsErr
static void getTopFolderPath(DQMStore *dqm_store, std::string top_dir, std::string &path)
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:741
static const int ERROR
void fillStatusHistogram(MonitorElement *, int xbin, int ybin, float val)
const std::string & pwd(void) const
Definition: DQMStore.cc:713