CMS 3D CMS Logo

List of all members | Classes | Public Types | Public Member Functions | Private Member Functions | Private Attributes
SiStripQualityChecker Class Reference

#include <SiStripQualityChecker.h>

Classes

struct  SubDetMEs
 

Public Types

typedef dqm::harvesting::DQMStore DQMStore
 
typedef dqm::harvesting::MonitorElement MonitorElement
 

Public Member Functions

void bookStatus (DQMStore &dqm_store)
 
void fillDummyStatus ()
 
void fillFaultyModuleStatus (DQMStore &dqm_store, const edm::EventSetup &eSetup)
 
void fillStatus (DQMStore &dqm_store, const edm::ESHandle< SiStripDetCabling > &cabling, const edm::EventSetup &eSetup)
 
void fillStatusAtLumi (DQMStore &dqm_store)
 
void printStatusReport ()
 
void resetStatus ()
 
 SiStripQualityChecker (edm::ParameterSet const &ps)
 
 ~SiStripQualityChecker ()
 

Private Member Functions

void fillDetectorStatus (DQMStore &dqm_store, const edm::ESHandle< SiStripDetCabling > &cabling)
 
void fillDetectorStatusAtLumi (DQMStore &dqm_store)
 
void fillStatusHistogram (MonitorElement const *, int xbin, int ybin, float val)
 
void fillSubDetStatus (DQMStore &dqm_store, const edm::ESHandle< SiStripDetCabling > &cabling, SubDetMEs &mes, unsigned int xbin, float &gflag)
 
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)
 
void initialiseBadModuleList ()
 

Private Attributes

std::map< uint32_t, uint16_t > badModuleList
 
bool bookedStripStatus_ {false}
 
MonitorElementDetFractionReportMap {nullptr}
 
MonitorElementDetFractionReportMap_hasBadChan {nullptr}
 
MonitorElementDetFractionReportMap_hasDcsErr {nullptr}
 
MonitorElementDetFractionReportMap_hasExclFed {nullptr}
 
MonitorElementDetFractionReportMap_hasTooManyClu {nullptr}
 
MonitorElementDetFractionReportMap_hasTooManyDigis {nullptr}
 
const edm::ParameterSet pSet_
 
MonitorElementSToNReportMap {nullptr}
 
std::map< std::string, std::string > SubDetFolderMap
 
std::map< std::string, SubDetMEsSubDetMEsMap
 
MonitorElementSummaryReportGlobal {nullptr}
 
MonitorElementSummaryReportMap {nullptr}
 
const TkDetMaptkDetMap_
 
MonitorElementTrackSummaryReportGlobal {nullptr}
 
MonitorElementTrackSummaryReportMap {nullptr}
 

Detailed Description

Definition at line 19 of file SiStripQualityChecker.h.

Member Typedef Documentation

◆ DQMStore

Definition at line 22 of file SiStripQualityChecker.h.

◆ MonitorElement

Definition at line 21 of file SiStripQualityChecker.h.

Constructor & Destructor Documentation

◆ SiStripQualityChecker()

SiStripQualityChecker::SiStripQualityChecker ( edm::ParameterSet const &  ps)

Definition at line 21 of file SiStripQualityChecker.cc.

21  : pSet_{ps} {
22  edm::LogInfo("SiStripQualityChecker") << " Creating SiStripQualityChecker "
23  << "\n";
24 
25  SubDetFolderMap.emplace("TIB", "TIB");
26  SubDetFolderMap.emplace("TOB", "TOB");
27  SubDetFolderMap.emplace("TECF", "TEC/PLUS");
28  SubDetFolderMap.emplace("TECB", "TEC/MINUS");
29  SubDetFolderMap.emplace("TIDF", "TID/PLUS");
30  SubDetFolderMap.emplace("TIDB", "TID/MINUS");
31 }

◆ ~SiStripQualityChecker()

SiStripQualityChecker::~SiStripQualityChecker ( )

Definition at line 33 of file SiStripQualityChecker.cc.

33  {
34  edm::LogInfo("SiStripQualityChecker") << " Deleting SiStripQualityChecker "
35  << "\n";
36 }

Member Function Documentation

◆ bookStatus()

void SiStripQualityChecker::bookStatus ( DQMStore dqm_store)

Definition at line 40 of file SiStripQualityChecker.cc.

40  {
42  return;
43 
44  dqm_store.cd();
45  std::string strip_dir = "";
46  SiStripUtility::getTopFolderPath(dqm_store, "SiStrip", strip_dir);
47  if (strip_dir.empty())
48  strip_dir = "SiStrip";
49 
50  // Non Standard Plots and should be put outside EventInfo folder
51 
52  dqm_store.setCurrentFolder(strip_dir + "/MechanicalView");
53 
54  std::string hname, htitle;
55  hname = "detFractionReportMap";
56  htitle = "SiStrip Report for Good Detector Fraction";
57  DetFractionReportMap = dqm_store.book2D(hname, htitle, 6, 0.5, 6.5, 9, 0.5, 9.5);
58  DetFractionReportMap->setAxisTitle("Sub Detector Type", 1);
59  DetFractionReportMap->setAxisTitle("Layer/Disc Number", 2);
60 
61  hname = "detFractionReportMap_hasBadChan";
62  htitle = "SiStrip Report for Good Detector Fraction due to bad channels";
63  DetFractionReportMap_hasBadChan = dqm_store.book2D(hname, htitle, 6, 0.5, 6.5, 9, 0.5, 9.5);
64  DetFractionReportMap_hasBadChan->setAxisTitle("Sub Detector Type", 1);
65  DetFractionReportMap_hasBadChan->setAxisTitle("Layer/Disc Number", 2);
66  hname = "detFractionReportMap_hasTooManyDigis";
67  htitle = "SiStrip Report for Good Detector Fraction due to too many digis";
68  DetFractionReportMap_hasTooManyDigis = dqm_store.book2D(hname, htitle, 6, 0.5, 6.5, 9, 0.5, 9.5);
69  DetFractionReportMap_hasTooManyDigis->setAxisTitle("Sub Detector Type", 1);
70  DetFractionReportMap_hasTooManyDigis->setAxisTitle("Layer/Disc Number", 2);
71  hname = "detFractionReportMap_hasTooManyClu";
72  htitle = "SiStrip Report for Good Detector Fraction due to too many clusters";
73  DetFractionReportMap_hasTooManyClu = dqm_store.book2D(hname, htitle, 6, 0.5, 6.5, 9, 0.5, 9.5);
74  DetFractionReportMap_hasTooManyClu->setAxisTitle("Sub Detector Type", 1);
75  DetFractionReportMap_hasTooManyClu->setAxisTitle("Layer/Disc Number", 2);
76  hname = "detFractionReportMap_hasExclFed";
77  htitle = "SiStrip Report for Good Detector Fraction due to excluded FEDs";
78  DetFractionReportMap_hasExclFed = dqm_store.book2D(hname, htitle, 6, 0.5, 6.5, 9, 0.5, 9.5);
79  DetFractionReportMap_hasExclFed->setAxisTitle("Sub Detector Type", 1);
80  DetFractionReportMap_hasExclFed->setAxisTitle("Layer/Disc Number", 2);
81  hname = "detFractionReportMap_hasDcsErr";
82  htitle = "SiStrip Report for Good Detector Fraction due to DCS errors";
83  DetFractionReportMap_hasDcsErr = dqm_store.book2D(hname, htitle, 6, 0.5, 6.5, 9, 0.5, 9.5);
84  DetFractionReportMap_hasDcsErr->setAxisTitle("Sub Detector Type", 1);
85  DetFractionReportMap_hasDcsErr->setAxisTitle("Layer/Disc Number", 2);
86 
87  hname = "sToNReportMap";
88  htitle = "SiStrip Report for Signal-to-Noise";
89  SToNReportMap = dqm_store.book2D(hname, htitle, 6, 0.5, 6.5, 9, 0.5, 9.5);
90  SToNReportMap->setAxisTitle("Sub Detector Type", 1);
91  SToNReportMap->setAxisTitle("Layer/Disc Number", 2);
92 
93  // this is the main reportSummary 2D plot and should be in EventInfo
94  dqm_store.setCurrentFolder(strip_dir + "/EventInfo");
95 
96  hname = "reportSummaryMap";
97  htitle = "SiStrip Report Summary Map";
98  SummaryReportMap = dqm_store.book2D(hname, htitle, 6, 0.5, 6.5, 9, 0.5, 9.5);
99  SummaryReportMap->setAxisTitle("Sub Detector Type", 1);
100  SummaryReportMap->setAxisTitle("Layer/Disc Number", 2);
101 
102  SummaryReportGlobal = dqm_store.bookFloat("reportSummary");
103  int ibin = 0;
104 
105  dqm_store.setCurrentFolder(strip_dir + "/EventInfo/reportSummaryContents");
106  for (auto const& [det, label] : SubDetFolderMap) {
107  ibin++;
116 
117  SubDetMEs local_mes;
118 
119  if (det == "TECF")
120  local_mes.detectorTag = "TEC+";
121  else if (det == "TECB")
122  local_mes.detectorTag = "TEC-";
123  else if (det == "TIDF")
124  local_mes.detectorTag = "TID+";
125  else if (det == "TIDB")
126  local_mes.detectorTag = "TID-";
127  else
128  local_mes.detectorTag = det;
129 
130  std::string me_name;
131  me_name = "SiStrip_" + det;
132  local_mes.SummaryFlag = dqm_store.bookFloat(me_name);
133 
134  me_name = "SiStrip_DetFraction_" + det;
135  local_mes.DetFraction = dqm_store.bookFloat(me_name);
136 
137  me_name = "SiStrip_SToNFlag_" + det;
138  local_mes.SToNFlag = dqm_store.bookFloat(me_name);
139  SubDetMEsMap.insert(std::pair<std::string, SubDetMEs>(det, local_mes));
140  }
141  bookedStripStatus_ = true;
142 }

References dqm::implementation::IBooker::book2D(), bookedStripStatus_, dqm::implementation::IBooker::bookFloat(), dqm::implementation::DQMStore::cd(), SiStripQualityChecker::SubDetMEs::detectorTag, SiStripQualityChecker::SubDetMEs::DetFraction, DetFractionReportMap, DetFractionReportMap_hasBadChan, DetFractionReportMap_hasDcsErr, DetFractionReportMap_hasExclFed, DetFractionReportMap_hasTooManyClu, DetFractionReportMap_hasTooManyDigis, SiStripUtility::getTopFolderPath(), label, dqm::impl::MonitorElement::setAxisTitle(), dqm::impl::MonitorElement::setBinLabel(), dqm::implementation::DQMStore::setCurrentFolder(), SiStripQualityChecker::SubDetMEs::SToNFlag, SToNReportMap, AlCaHLTBitMon_QueryRunRegistry::string, SubDetFolderMap, SubDetMEsMap, SiStripQualityChecker::SubDetMEs::SummaryFlag, SummaryReportGlobal, and SummaryReportMap.

Referenced by fillStatus(), and fillStatusAtLumi().

◆ fillDetectorStatus()

void SiStripQualityChecker::fillDetectorStatus ( DQMStore dqm_store,
const edm::ESHandle< SiStripDetCabling > &  cabling 
)
private

Definition at line 215 of file SiStripQualityChecker.cc.

215  {
216  unsigned int xbin = 0;
217  float global_flag = 0;
218  dqm_store.cd();
219  std::string mdir = "MechanicalView";
220  if (!SiStripUtility::goToDir(dqm_store, mdir))
221  return;
222  std::string mechanicalview_dir = dqm_store.pwd();
223 
225  for (auto& [det, local_mes] : SubDetMEsMap) {
226  auto cPos = SubDetFolderMap.find(det);
227  if (cPos == SubDetFolderMap.end())
228  continue;
229  std::string dname = mechanicalview_dir + "/" + cPos->second;
230  if (!dqm_store.dirExists(dname))
231  continue;
232  dqm_store.cd(dname);
233  ++xbin;
234  float flag;
235  fillSubDetStatus(dqm_store, cabling, local_mes, xbin, flag);
236  global_flag += flag;
237  }
238  global_flag = global_flag / xbin * 1.0;
240  SummaryReportGlobal->Fill(global_flag);
241  dqm_store.cd();
242 }

References dqm::implementation::DQMStore::cd(), dqm::implementation::IGetter::dirExists(), RefreshWebPage::dname, dqm::impl::MonitorElement::Fill(), fillSubDetStatus(), RemoveAddSevLevel::flag, SiStripUtility::goToDir(), initialiseBadModuleList(), dqm::implementation::DQMStore::pwd(), AlCaHLTBitMon_QueryRunRegistry::string, SubDetFolderMap, SubDetMEsMap, and SummaryReportGlobal.

Referenced by fillStatus().

◆ fillDetectorStatusAtLumi()

void SiStripQualityChecker::fillDetectorStatusAtLumi ( DQMStore dqm_store)
private

Definition at line 544 of file SiStripQualityChecker.cc.

544  {
545  dqm_store.cd();
546  std::string rdir = "ReadoutView";
547  if (!SiStripUtility::goToDir(dqm_store, rdir))
548  return;
549  std::string fullpath = dqm_store.pwd() + "/PerLumiSection/" + "lumiErrorFraction";
550  MonitorElement* me = dqm_store.get(fullpath);
551  if (me && me->kind() == MonitorElement::Kind::TH1F) {
552  TH1F* th1 = me->getTH1F();
553  float global_fraction = 0.0;
554  float dets = 0.0;
555  for (int ibin = 1; ibin <= th1->GetNbinsX(); ibin++) {
556  std::string label = th1->GetXaxis()->GetBinLabel(ibin);
557  std::map<std::string, SubDetMEs>::iterator iPos = SubDetMEsMap.find(label);
558  if (iPos != SubDetMEsMap.end()) {
559  float fraction = 1.0 - th1->GetBinContent(ibin);
560  global_fraction += fraction;
561  dets++;
562  iPos->second.DetFraction->Fill(fraction);
563  iPos->second.SToNFlag->Fill(-1.0);
564  iPos->second.SummaryFlag->Fill(fraction);
565  }
566  }
567  global_fraction = global_fraction / dets;
569  SummaryReportGlobal->Fill(global_fraction);
570  }
571  dqm_store.cd();
572 }

References dqm::implementation::DQMStore::cd(), dqm::impl::MonitorElement::Fill(), HLT_FULL_cff::fraction, reco_skim_cfg_mod::fullpath, dqm::implementation::IGetter::get(), SiStripUtility::goToDir(), label, hlt_dqm_clientPB-live_cfg::me, dqm::implementation::DQMStore::pwd(), AlCaHLTBitMon_QueryRunRegistry::string, SubDetMEsMap, SummaryReportGlobal, and MonitorElementData::TH1F.

Referenced by fillStatusAtLumi().

◆ fillDummyStatus()

void SiStripQualityChecker::fillDummyStatus ( )

Definition at line 144 of file SiStripQualityChecker.cc.

144  {
145  resetStatus();
146  if (bookedStripStatus_) {
147  for (auto& pr : SubDetMEsMap) {
148  auto& local_mes = pr.second;
149  local_mes.SummaryFlag->Fill(-1.0);
150  local_mes.DetFraction->Fill(-1.0);
151  local_mes.SToNFlag->Fill(-1.0);
152  }
153 
154  for (int xbin = 1; xbin < SummaryReportMap->getNbinsX() + 1; xbin++) {
155  for (int ybin = 1; ybin < SummaryReportMap->getNbinsY() + 1; ybin++) {
156  SummaryReportMap->Fill(xbin, ybin, -1.0);
157  DetFractionReportMap->Fill(xbin, ybin, -1.0);
158  DetFractionReportMap_hasBadChan->Fill(xbin, ybin, -1.0);
159  DetFractionReportMap_hasTooManyDigis->Fill(xbin, ybin, -1.0);
160  DetFractionReportMap_hasTooManyClu->Fill(xbin, ybin, -1.0);
161  DetFractionReportMap_hasExclFed->Fill(xbin, ybin, -1.0);
162  DetFractionReportMap_hasDcsErr->Fill(xbin, ybin, -1.0);
163  SToNReportMap->Fill(xbin, ybin, -1.0);
164  }
165  }
166  SummaryReportGlobal->Fill(-1.0);
167  }
168 }

References bookedStripStatus_, DetFractionReportMap, DetFractionReportMap_hasBadChan, DetFractionReportMap_hasDcsErr, DetFractionReportMap_hasExclFed, DetFractionReportMap_hasTooManyClu, DetFractionReportMap_hasTooManyDigis, dqm::impl::MonitorElement::Fill(), dqm::impl::MonitorElement::getNbinsX(), dqm::impl::MonitorElement::getNbinsY(), resetStatus(), SToNReportMap, SubDetMEsMap, SummaryReportGlobal, and SummaryReportMap.

Referenced by fillStatus(), and fillStatusAtLumi().

◆ fillFaultyModuleStatus()

void SiStripQualityChecker::fillFaultyModuleStatus ( DQMStore dqm_store,
const edm::EventSetup eSetup 
)

Definition at line 486 of file SiStripQualityChecker.cc.

486  {
487  if (badModuleList.empty())
488  return;
489 
490  //Retrieve tracker topology from geometry
491  edm::ESHandle<TrackerTopology> tTopoHandle;
492  eSetup.get<TrackerTopologyRcd>().get(tTopoHandle);
493  const TrackerTopology* const tTopo = tTopoHandle.product();
494 
495  dqm_store.cd();
496  std::string mdir = "MechanicalView";
497  if (!SiStripUtility::goToDir(dqm_store, mdir))
498  return;
499  std::string mechanical_dir = dqm_store.pwd();
500 
501  SiStripFolderOrganizer folder_organizer;
502  for (auto const [detId, value] : badModuleList) {
503  std::string subdet_folder;
504  folder_organizer.getSubDetFolder(detId, tTopo, subdet_folder);
505  if (!dqm_store.dirExists(subdet_folder)) {
506  subdet_folder = mechanical_dir + subdet_folder.substr(subdet_folder.find("MechanicalView") + 14);
507  if (!dqm_store.dirExists(subdet_folder))
508  continue;
509  }
510  std::string bad_module_folder = subdet_folder + "/" + "BadModuleList";
511  dqm_store.setCurrentFolder(bad_module_folder);
512 
513  std::ostringstream detid_str;
514  detid_str << detId;
515  std::string full_path = bad_module_folder + "/" + detid_str.str();
516  MonitorElement* me = dqm_store.get(full_path);
517  if (me)
518  me->Reset();
519  else
520  me = dqm_store.bookInt(detid_str.str());
521  me->Fill(value);
522  }
523  dqm_store.cd();
524 }

References badModuleList, dqm::implementation::IBooker::bookInt(), dqm::implementation::DQMStore::cd(), dqm::implementation::IGetter::dirExists(), edm::EventSetup::get(), get, dqm::implementation::IGetter::get(), SiStripFolderOrganizer::getSubDetFolder(), SiStripUtility::goToDir(), hlt_dqm_clientPB-live_cfg::me, edm::ESHandle< T >::product(), dqm::implementation::DQMStore::pwd(), dqm::implementation::DQMStore::setCurrentFolder(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by fillStatus().

◆ fillStatus()

void SiStripQualityChecker::fillStatus ( DQMStore dqm_store,
const edm::ESHandle< SiStripDetCabling > &  cabling,
const edm::EventSetup eSetup 
)

Definition at line 195 of file SiStripQualityChecker.cc.

197  {
198  if (!bookedStripStatus_)
199  bookStatus(dqm_store);
200 
201  edm::ESHandle<TkDetMap> tkMapHandle;
202  eSetup.get<TrackerTopologyRcd>().get(tkMapHandle);
203  tkDetMap_ = tkMapHandle.product();
204 
205  fillDummyStatus();
206  fillDetectorStatus(dqm_store, cabling);
207 
208  int faulty_moduleflag = pSet_.getUntrackedParameter<bool>("PrintFaultyModuleList", false);
209  if (faulty_moduleflag)
210  fillFaultyModuleStatus(dqm_store, eSetup);
211 }

References bookedStripStatus_, bookStatus(), fillDetectorStatus(), fillDummyStatus(), fillFaultyModuleStatus(), edm::EventSetup::get(), get, edm::ParameterSet::getUntrackedParameter(), edm::ESHandle< T >::product(), pSet_, and tkDetMap_.

◆ fillStatusAtLumi()

void SiStripQualityChecker::fillStatusAtLumi ( DQMStore dqm_store)

Definition at line 535 of file SiStripQualityChecker.cc.

535  {
536  if (!bookedStripStatus_)
537  bookStatus(dqm_store);
538  fillDummyStatus();
539  fillDetectorStatusAtLumi(dqm_store);
540 }

References bookedStripStatus_, bookStatus(), fillDetectorStatusAtLumi(), and fillDummyStatus().

◆ fillStatusHistogram()

void SiStripQualityChecker::fillStatusHistogram ( MonitorElement const *  me,
int  xbin,
int  ybin,
float  val 
)
private

Definition at line 474 of file SiStripQualityChecker.cc.

477  {
478  if (me && me->kind() == MonitorElement::Kind::TH2F) {
479  auto th2d = me->getTH2F();
480  th2d->SetBinContent(xbin, ybin, val);
481  }
482 }

References hlt_dqm_clientPB-live_cfg::me, MonitorElementData::TH2F, and heppy_batch::val.

Referenced by fillSubDetStatus().

◆ fillSubDetStatus()

void SiStripQualityChecker::fillSubDetStatus ( DQMStore dqm_store,
const edm::ESHandle< SiStripDetCabling > &  cabling,
SubDetMEs mes,
unsigned int  xbin,
float &  gflag 
)
private

Definition at line 246 of file SiStripQualityChecker.cc.

250  {
251  int status_flag = pSet_.getUntrackedParameter<int>("GlobalStatusFilling", 1);
252  if (status_flag < 1)
253  return;
254 
255  auto const subDirVec = dqm_store.getSubdirs();
256 
257  unsigned int ybin = 0;
258  int tot_ndet = 0;
259  int tot_errdet = 0;
260  float tot_ston_stat = 0;
261 
262  for (auto const& dname : subDirVec) {
263  if (dname.find("BadModuleList") != std::string::npos)
264  continue;
265  if (dname.find("ring") != std::string::npos)
266  continue;
267  std::vector<MonitorElement*> meVec;
268 
269  ybin++;
270  dqm_store.cd(dname);
271  meVec = dqm_store.getContents(dname);
272  uint16_t ndet = 100;
273  int errdet = 0;
274  int errdet_hasBadChan = 0;
275  int errdet_hasTooManyDigis = 0;
276  int errdet_hasTooManyClu = 0;
277  int errdet_hasExclFed = 0;
278  int errdet_hasDcsErr = 0;
279 
280  int ston_stat = 1;
281  int lnum = atoi(dname.substr(dname.find_last_of('_') + 1).c_str());
282  ndet = cabling->connectedNumber(mes.detectorTag, lnum);
283 
284  getModuleStatus(dqm_store,
285  meVec,
286  errdet,
287  errdet_hasBadChan,
288  errdet_hasTooManyDigis,
289  errdet_hasTooManyClu,
290  errdet_hasExclFed,
291  errdet_hasDcsErr);
292 
293  for (auto const* me : meVec) {
294  if (!me)
295  continue;
296  std::vector<QReport*> reports = me->getQReports();
297 
298  if (reports.empty())
299  continue;
300  std::string name = me->getName();
301 
302  if (name.find("Summary_ClusterStoNCorr__OnTrack") != std::string::npos) {
303  int istat = SiStripUtility::getMEStatus(me);
304  if (reports[0]->getQTresult() == -1) {
305  ston_stat = -1;
306  } else {
307  if (istat == dqm::qstatus::ERROR)
308  ston_stat = 0;
309  else if (istat == dqm::qstatus::STATUS_OK)
310  ston_stat = 1;
311  }
312  }
313  }
314  if (ndet > 0) {
315  float eff_fac = 1 - (errdet * 1.0 / ndet);
316  float eff_fac_hasBadChan = 1 - (errdet_hasBadChan * 1.0 / ndet);
317  float eff_fac_hasTooManyDigis = 1 - (errdet_hasTooManyDigis * 1.0 / ndet);
318  float eff_fac_hasTooManyClu = 1 - (errdet_hasTooManyClu * 1.0 / ndet);
319  float eff_fac_hasExclFed = 1 - (errdet_hasExclFed * 1.0 / ndet);
320  float eff_fac_hasDcsErr = 1 - (errdet_hasDcsErr * 1.0 / ndet);
321  fillStatusHistogram(SToNReportMap, xbin, ybin, ston_stat);
322  fillStatusHistogram(DetFractionReportMap, xbin, ybin, eff_fac);
323  fillStatusHistogram(DetFractionReportMap_hasBadChan, xbin, ybin, eff_fac_hasBadChan);
324  fillStatusHistogram(DetFractionReportMap_hasTooManyDigis, xbin, ybin, eff_fac_hasTooManyDigis);
325  fillStatusHistogram(DetFractionReportMap_hasTooManyClu, xbin, ybin, eff_fac_hasTooManyClu);
326  fillStatusHistogram(DetFractionReportMap_hasExclFed, xbin, ybin, eff_fac_hasExclFed);
327  fillStatusHistogram(DetFractionReportMap_hasDcsErr, xbin, ybin, eff_fac_hasDcsErr);
328  if (ston_stat < 0)
329  fillStatusHistogram(SummaryReportMap, xbin, ybin, eff_fac);
330  else
331  fillStatusHistogram(SummaryReportMap, xbin, ybin, ston_stat * eff_fac);
332 
333  tot_ndet += ndet;
334  tot_errdet += errdet;
335  tot_ston_stat += ston_stat;
336  }
337  dqm_store.cd(dname);
338  }
339  if (tot_ndet > 0) {
340  float tot_eff_fac = 1 - (tot_errdet * 1.0 / tot_ndet);
341  if (mes.DetFraction)
342  mes.DetFraction->Fill(tot_eff_fac);
343  float tot_ston_fac = tot_ston_stat / ybin;
344  if (mes.SToNFlag)
345  mes.SToNFlag->Fill(tot_ston_fac);
346  if (tot_ston_fac < 0) {
347  gflag = tot_eff_fac;
348  } else {
349  gflag = std::min(tot_eff_fac, tot_ston_fac);
350  }
351  if (mes.SummaryFlag)
352  mes.SummaryFlag->Fill(gflag);
353  }
354 }

References dqm::implementation::DQMStore::cd(), SiStripDetCabling::connectedNumber(), SiStripQualityChecker::SubDetMEs::detectorTag, SiStripQualityChecker::SubDetMEs::DetFraction, DetFractionReportMap, DetFractionReportMap_hasBadChan, DetFractionReportMap_hasDcsErr, DetFractionReportMap_hasExclFed, DetFractionReportMap_hasTooManyClu, DetFractionReportMap_hasTooManyDigis, RefreshWebPage::dname, dqm::qstatus::ERROR, dqm::impl::MonitorElement::Fill(), fillStatusHistogram(), dqm::implementation::IGetter::getContents(), SiStripUtility::getMEStatus(), getModuleStatus(), dqm::implementation::IGetter::getSubdirs(), edm::ParameterSet::getUntrackedParameter(), hlt_dqm_clientPB-live_cfg::me, min(), Skims_PA_cff::name, pSet_, dqm::qstatus::STATUS_OK, SiStripQualityChecker::SubDetMEs::SToNFlag, SToNReportMap, AlCaHLTBitMon_QueryRunRegistry::string, SiStripQualityChecker::SubDetMEs::SummaryFlag, and SummaryReportMap.

Referenced by fillDetectorStatus().

◆ getModuleStatus()

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 
)
private

Definition at line 389 of file SiStripQualityChecker.cc.

396  {
397  std::string lname;
398  std::map<uint32_t, uint16_t> bad_modules;
399  for (std::vector<MonitorElement*>::const_iterator it = layer_mes.begin(); it != layer_mes.end(); it++) {
400  MonitorElement* me = (*it);
401  if (!me)
402  continue;
403  std::vector<QReport*> qreports = me->getQReports();
404  if (qreports.empty())
405  continue;
406  std::string name = me->getName();
407  std::vector<DQMChannel> bad_channels_me;
408  if (me->kind() == MonitorElement::Kind::TPROFILE) {
409  bad_channels_me = qreports[0]->getBadChannels();
410  lname = "";
411  } else if (me->kind() == MonitorElement::Kind::TPROFILE2D && name.find("TkHMap") != std::string::npos) {
412  bad_channels_me = qreports[0]->getBadChannels();
413  lname = name.substr(name.find("TkHMap_") + 7);
414  lname = lname.substr(lname.find("_T") + 1);
415  }
416  for (std::vector<DQMChannel>::iterator it = bad_channels_me.begin(); it != bad_channels_me.end(); it++) {
417  int xval = (*it).getBinX();
418  int yval = (*it).getBinY();
419  uint32_t detId = tkDetMap_->getDetFromBin(lname, xval, yval);
420  std::map<uint32_t, uint16_t>::iterator iPos = bad_modules.find(detId);
421  uint16_t flag;
422  if (iPos != bad_modules.end()) {
423  flag = iPos->second;
425  iPos->second = flag;
426  } else {
427  //
428  // if not in the local bad module list, check the BadModuleList dir
429  //
430  std::ostringstream detid_str;
431  detid_str << detId;
432  // now in the layer/wheel dir
433  const std::string& currentdir = dqm_store.pwd();
434  std::string thisMEpath = currentdir.substr(0, currentdir.rfind('/')) + "/BadModuleList/" + detid_str.str();
435 
436  MonitorElement* meBadModule = dqm_store.get(thisMEpath);
437  if (meBadModule) {
438  std::string val_str;
439  SiStripUtility::getMEValue(meBadModule, val_str);
440  flag = atoi(val_str.c_str());
441  } else
442  flag = 0;
443 
445  bad_modules.insert(std::pair<uint32_t, uint16_t>(detId, flag));
446  }
447  }
448  }
449  for (std::map<uint32_t, uint16_t>::const_iterator it = bad_modules.begin(); it != bad_modules.end(); it++) {
450  uint32_t detId = it->first;
451  uint16_t flag = it->second;
452  if (((flag >> 0) & 0x1) > 0)
453  errdet_hasBadChan++;
454  if (((flag >> 1) & 0x1) > 0)
455  errdet_hasTooManyDigis++;
456  if (((flag >> 2) & 0x1) > 0)
457  errdet_hasTooManyClu++;
458  if (((flag >> 3) & 0x1) > 0)
459  errdet_hasExclFed++;
460  if (((flag >> 4) & 0x1) > 0)
461  errdet_hasDcsErr++;
462  std::map<uint32_t, uint16_t>::iterator iPos = badModuleList.find(detId);
463  if (iPos != badModuleList.end()) {
464  iPos->second = flag;
465  } else {
466  badModuleList.insert(std::pair<uint32_t, uint16_t>(detId, flag));
467  }
468  }
469  errdet = bad_modules.size();
470 }

References badModuleList, RemoveAddSevLevel::flag, dqm::implementation::IGetter::get(), TkDetMap::getDetFromBin(), SiStripUtility::getMEValue(), hlt_dqm_clientPB-live_cfg::me, Skims_PA_cff::name, dqm::implementation::DQMStore::pwd(), SiStripUtility::setBadModuleFlag(), AlCaHLTBitMon_QueryRunRegistry::string, tkDetMap_, MonitorElementData::TPROFILE, MonitorElementData::TPROFILE2D, and testProducerWithPsetDescEmpty_cfi::x1.

Referenced by fillSubDetStatus().

◆ initialiseBadModuleList()

void SiStripQualityChecker::initialiseBadModuleList ( )
private

Definition at line 526 of file SiStripQualityChecker.cc.

526  {
527  for (auto& badMod : badModuleList) {
528  badMod.second = 0;
529  }
530 }

References badModuleList.

Referenced by fillDetectorStatus().

◆ printStatusReport()

void SiStripQualityChecker::printStatusReport ( )

Definition at line 358 of file SiStripQualityChecker.cc.

358  {
359  std::ostringstream det_summary_str;
360  for (std::map<std::string, SubDetMEs>::const_iterator it = SubDetMEsMap.begin(); it != SubDetMEsMap.end(); it++) {
361  std::string det = it->first;
362  det_summary_str << std::setprecision(4);
363  det_summary_str << std::setiosflags(std::ios::fixed);
364 
365  det_summary_str << " Printing Status for " << det << " : " << std::endl;
366  SubDetMEs local_mes = it->second;
367 
368  std::string sval;
369  float fval1, fval2, fval3;
370  fval1 = fval2 = fval3 = -1.0;
371 
372  SiStripUtility::getMEValue(local_mes.DetFraction, sval);
373  if (!sval.empty())
374  fval1 = atof(sval.c_str());
375  SiStripUtility::getMEValue(local_mes.SToNFlag, sval);
376  if (!sval.empty())
377  fval2 = atof(sval.c_str());
378  SiStripUtility::getMEValue(local_mes.SummaryFlag, sval);
379  if (!sval.empty())
380  fval3 = atof(sval.c_str());
381 
382  det_summary_str << std::setw(7) << " % of good detectors " << fval1 << " SToN Flag " << fval2
383  << " Summary Flag " << fval3 << std::endl;
384  }
385 }

References SiStripQualityChecker::SubDetMEs::DetFraction, alignBH_cfg::fixed, SiStripUtility::getMEValue(), SiStripQualityChecker::SubDetMEs::SToNFlag, AlCaHLTBitMon_QueryRunRegistry::string, SubDetMEsMap, and SiStripQualityChecker::SubDetMEs::SummaryFlag.

◆ resetStatus()

void SiStripQualityChecker::resetStatus ( )

Member Data Documentation

◆ badModuleList

std::map<uint32_t, uint16_t> SiStripQualityChecker::badModuleList
private

◆ bookedStripStatus_

bool SiStripQualityChecker::bookedStripStatus_ {false}
private

◆ DetFractionReportMap

MonitorElement* SiStripQualityChecker::DetFractionReportMap {nullptr}
private

Definition at line 66 of file SiStripQualityChecker.h.

Referenced by bookStatus(), fillDummyStatus(), fillSubDetStatus(), and resetStatus().

◆ DetFractionReportMap_hasBadChan

MonitorElement* SiStripQualityChecker::DetFractionReportMap_hasBadChan {nullptr}
private

Definition at line 67 of file SiStripQualityChecker.h.

Referenced by bookStatus(), fillDummyStatus(), fillSubDetStatus(), and resetStatus().

◆ DetFractionReportMap_hasDcsErr

MonitorElement* SiStripQualityChecker::DetFractionReportMap_hasDcsErr {nullptr}
private

Definition at line 71 of file SiStripQualityChecker.h.

Referenced by bookStatus(), fillDummyStatus(), fillSubDetStatus(), and resetStatus().

◆ DetFractionReportMap_hasExclFed

MonitorElement* SiStripQualityChecker::DetFractionReportMap_hasExclFed {nullptr}
private

Definition at line 70 of file SiStripQualityChecker.h.

Referenced by bookStatus(), fillDummyStatus(), fillSubDetStatus(), and resetStatus().

◆ DetFractionReportMap_hasTooManyClu

MonitorElement* SiStripQualityChecker::DetFractionReportMap_hasTooManyClu {nullptr}
private

Definition at line 69 of file SiStripQualityChecker.h.

Referenced by bookStatus(), fillDummyStatus(), fillSubDetStatus(), and resetStatus().

◆ DetFractionReportMap_hasTooManyDigis

MonitorElement* SiStripQualityChecker::DetFractionReportMap_hasTooManyDigis {nullptr}
private

Definition at line 68 of file SiStripQualityChecker.h.

Referenced by bookStatus(), fillDummyStatus(), fillSubDetStatus(), and resetStatus().

◆ pSet_

const edm::ParameterSet SiStripQualityChecker::pSet_
private

Definition at line 80 of file SiStripQualityChecker.h.

Referenced by fillStatus(), and fillSubDetStatus().

◆ SToNReportMap

MonitorElement* SiStripQualityChecker::SToNReportMap {nullptr}
private

Definition at line 72 of file SiStripQualityChecker.h.

Referenced by bookStatus(), fillDummyStatus(), fillSubDetStatus(), and resetStatus().

◆ SubDetFolderMap

std::map<std::string, std::string> SiStripQualityChecker::SubDetFolderMap
private

Definition at line 64 of file SiStripQualityChecker.h.

Referenced by bookStatus(), and fillDetectorStatus().

◆ SubDetMEsMap

std::map<std::string, SubDetMEs> SiStripQualityChecker::SubDetMEsMap
private

◆ SummaryReportGlobal

MonitorElement* SiStripQualityChecker::SummaryReportGlobal {nullptr}
private

◆ SummaryReportMap

MonitorElement* SiStripQualityChecker::SummaryReportMap {nullptr}
private

Definition at line 73 of file SiStripQualityChecker.h.

Referenced by bookStatus(), fillDummyStatus(), fillSubDetStatus(), and resetStatus().

◆ tkDetMap_

const TkDetMap* SiStripQualityChecker::tkDetMap_
private

Definition at line 84 of file SiStripQualityChecker.h.

Referenced by fillStatus(), and getModuleStatus().

◆ TrackSummaryReportGlobal

MonitorElement* SiStripQualityChecker::TrackSummaryReportGlobal {nullptr}
private

Definition at line 76 of file SiStripQualityChecker.h.

◆ TrackSummaryReportMap

MonitorElement* SiStripQualityChecker::TrackSummaryReportMap {nullptr}
private

Definition at line 75 of file SiStripQualityChecker.h.

edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
alignBH_cfg.fixed
fixed
Definition: alignBH_cfg.py:54
dqm::implementation::IGetter::getContents
virtual std::vector< dqm::harvesting::MonitorElement * > getContents(std::string const &path) const
Definition: DQMStore.cc:593
dqm::implementation::IBooker::bookFloat
MonitorElement * bookFloat(TString const &name, FUNC onbooking=NOOP())
Definition: DQMStore.h:80
reco_skim_cfg_mod.fullpath
fullpath
Definition: reco_skim_cfg_mod.py:202
min
T min(T a, T b)
Definition: MathUtil.h:58
MonitorElementData::Kind::TH1F
TrackerTopology
Definition: TrackerTopology.h:16
SiStripQualityChecker::SubDetMEsMap
std::map< std::string, SubDetMEs > SubDetMEsMap
Definition: SiStripQualityChecker.h:63
dqm::implementation::IGetter::getSubdirs
virtual DQM_DEPRECATED std::vector< std::string > getSubdirs() const
Definition: DQMStore.cc:678
dqm::legacy::MonitorElement
Definition: MonitorElement.h:461
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
SiStripQualityChecker::initialiseBadModuleList
void initialiseBadModuleList()
Definition: SiStripQualityChecker.cc:526
MonitorElementData::Kind::TH2F
SiStripQualityChecker::DetFractionReportMap_hasExclFed
MonitorElement * DetFractionReportMap_hasExclFed
Definition: SiStripQualityChecker.h:70
testProducerWithPsetDescEmpty_cfi.x1
x1
Definition: testProducerWithPsetDescEmpty_cfi.py:33
edm::EventSetup::get
T get() const
Definition: EventSetup.h:80
HLT_FULL_cff.fraction
fraction
Definition: HLT_FULL_cff.py:52795
dqm::impl::MonitorElement::Fill
void Fill(long long x)
Definition: MonitorElement.h:290
TkDetMap::getDetFromBin
DetId getDetFromBin(int layer, int ix, int iy) const
Definition: TkDetMap.h:191
dqm::impl::MonitorElement::Reset
virtual void Reset()
Remove all data from the ME, keept the empty histogram with all its settings.
Definition: MonitorElement.cc:354
edm::ESHandle< TrackerTopology >
dqm::implementation::DQMStore::setCurrentFolder
void setCurrentFolder(std::string const &fullpath) override
Definition: DQMStore.h:569
SiStripQualityChecker::fillStatusHistogram
void fillStatusHistogram(MonitorElement const *, int xbin, int ybin, float val)
Definition: SiStripQualityChecker.cc:474
SiStripQualityChecker::fillDetectorStatusAtLumi
void fillDetectorStatusAtLumi(DQMStore &dqm_store)
Definition: SiStripQualityChecker.cc:544
SiStripQualityChecker::DetFractionReportMap
MonitorElement * DetFractionReportMap
Definition: SiStripQualityChecker.h:66
SiStripUtility::getMEValue
static void getMEValue(MonitorElement const *me, std::string &val)
Definition: SiStripUtility.cc:239
SiStripQualityChecker::fillSubDetStatus
void fillSubDetStatus(DQMStore &dqm_store, const edm::ESHandle< SiStripDetCabling > &cabling, SubDetMEs &mes, unsigned int xbin, float &gflag)
Definition: SiStripQualityChecker.cc:246
SiStripQualityChecker::SubDetFolderMap
std::map< std::string, std::string > SubDetFolderMap
Definition: SiStripQualityChecker.h:64
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
SiStripQualityChecker::fillDummyStatus
void fillDummyStatus()
Definition: SiStripQualityChecker.cc:144
dqm::implementation::DQMStore::pwd
std::string pwd() override
Definition: DQMStore.h:567
dqm::impl::MonitorElement::getNbinsY
virtual int getNbinsY() const
get # of bins in Y-axis
Definition: MonitorElement.cc:580
sipixeldigitoraw
Definition: SiPixelDigiToRaw.cc:39
SiStripFolderOrganizer::getSubDetFolder
void getSubDetFolder(const uint32_t &detid, const TrackerTopology *tTopo, std::string &folder_name)
Definition: SiStripFolderOrganizer.cc:406
SiStripUtility::goToDir
static bool goToDir(DQMStore &dqm_store, std::string const &name)
Definition: SiStripUtility.cc:252
dqm::implementation::IBooker::bookInt
MonitorElement * bookInt(TString const &name, FUNC onbooking=NOOP())
Definition: DQMStore.h:73
SiStripQualityChecker::fillFaultyModuleStatus
void fillFaultyModuleStatus(DQMStore &dqm_store, const edm::EventSetup &eSetup)
Definition: SiStripQualityChecker.cc:486
SiStripQualityChecker::tkDetMap_
const TkDetMap * tkDetMap_
Definition: SiStripQualityChecker.h:84
value
Definition: value.py:1
dqm::impl::MonitorElement::setBinLabel
virtual 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)
Definition: MonitorElement.cc:771
SiStripQualityChecker::resetStatus
void resetStatus()
Definition: SiStripQualityChecker.cc:172
SiStripQualityChecker::fillDetectorStatus
void fillDetectorStatus(DQMStore &dqm_store, const edm::ESHandle< SiStripDetCabling > &cabling)
Definition: SiStripQualityChecker.cc:215
get
#define get
SiStripQualityChecker::DetFractionReportMap_hasDcsErr
MonitorElement * DetFractionReportMap_hasDcsErr
Definition: SiStripQualityChecker.h:71
heppy_batch.val
val
Definition: heppy_batch.py:351
SiStripQualityChecker::bookedStripStatus_
bool bookedStripStatus_
Definition: SiStripQualityChecker.h:82
MonitorElementData::Kind::TPROFILE2D
SiStripQualityChecker::DetFractionReportMap_hasBadChan
MonitorElement * DetFractionReportMap_hasBadChan
Definition: SiStripQualityChecker.h:67
SiStripQualityChecker::badModuleList
std::map< uint32_t, uint16_t > badModuleList
Definition: SiStripQualityChecker.h:78
dqm::implementation::IBooker::book2D
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:177
dqm::impl::MonitorElement::getNbinsX
virtual int getNbinsX() const
get # of bins in X-axis
Definition: MonitorElement.cc:574
SiStripFolderOrganizer
Definition: SiStripFolderOrganizer.h:27
SiStripQualityChecker::SummaryReportGlobal
MonitorElement * SummaryReportGlobal
Definition: SiStripQualityChecker.h:74
dqm::implementation::IGetter::get
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:651
SiStripQualityChecker::getModuleStatus
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)
Definition: SiStripQualityChecker.cc:389
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
SiStripQualityChecker::bookStatus
void bookStatus(DQMStore &dqm_store)
Definition: SiStripQualityChecker.cc:40
dqm::qstatus::STATUS_OK
static const int STATUS_OK
Definition: MonitorElement.h:52
RefreshWebPage.dname
dname
Definition: RefreshWebPage.py:56
SiStripQualityChecker::DetFractionReportMap_hasTooManyDigis
MonitorElement * DetFractionReportMap_hasTooManyDigis
Definition: SiStripQualityChecker.h:68
TrackerTopologyRcd
Definition: TrackerTopologyRcd.h:10
hlt_dqm_clientPB-live_cfg.me
me
Definition: hlt_dqm_clientPB-live_cfg.py:61
dqm::qstatus::ERROR
static const int ERROR
Definition: MonitorElement.h:54
SiStripUtility::setBadModuleFlag
static void setBadModuleFlag(std::string &hname, uint16_t &flg)
Definition: SiStripUtility.cc:328
MonitorElementData::Kind::TPROFILE
dqm::impl::MonitorElement::setAxisTitle
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
Definition: MonitorElement.cc:800
SiStripUtility::getMEStatus
static int getMEStatus(MonitorElement const *me)
Definition: SiStripUtility.cc:169
label
const char * label
Definition: PFTauDecayModeTools.cc:11
SiStripQualityChecker::SummaryReportMap
MonitorElement * SummaryReportMap
Definition: SiStripQualityChecker.h:73
dqm::implementation::IGetter::dirExists
virtual bool dirExists(std::string const &path) const
Definition: DQMStore.cc:708
SiStripQualityChecker::DetFractionReportMap_hasTooManyClu
MonitorElement * DetFractionReportMap_hasTooManyClu
Definition: SiStripQualityChecker.h:69
SiStripQualityChecker::pSet_
const edm::ParameterSet pSet_
Definition: SiStripQualityChecker.h:80
SiStripUtility::getTopFolderPath
static void getTopFolderPath(DQMStore &dqm_store, std::string const &top_dir, std::string &path)
Definition: SiStripUtility.cc:362
dqm::implementation::DQMStore::cd
void cd() override
Definition: DQMStore.h:564
SiStripQualityChecker::SToNReportMap
MonitorElement * SToNReportMap
Definition: SiStripQualityChecker.h:72
RemoveAddSevLevel.flag
flag
Definition: RemoveAddSevLevel.py:116
SiStripDetCabling::connectedNumber
uint32_t connectedNumber(const std::string &subDet, const uint16_t layer) const
Definition: SiStripDetCabling.h:79