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 TrackerTopology *tTopo)
 
void fillStatus (DQMStore &dqm_store, const SiStripDetCabling *cabling, const TkDetMap *tkDetMap, const TrackerTopology *tTopo)
 
void fillStatusAtLumi (DQMStore &dqm_store)
 
void printStatusReport ()
 
void resetStatus ()
 
 SiStripQualityChecker (edm::ParameterSet const &ps)
 
 ~SiStripQualityChecker ()
 

Private Member Functions

void fillDetectorStatus (DQMStore &dqm_store, const SiStripDetCabling *cabling)
 
void fillDetectorStatusAtLumi (DQMStore &dqm_store)
 
void fillStatusHistogram (MonitorElement const *, int xbin, int ybin, float val)
 
void fillSubDetStatus (DQMStore &dqm_store, const 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}
 
edm::ParameterSet const 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 18 of file SiStripQualityChecker.h.

Member Typedef Documentation

◆ DQMStore

Definition at line 21 of file SiStripQualityChecker.h.

◆ MonitorElement

Definition at line 20 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 }
std::map< std::string, std::string > SubDetFolderMap
Log< level::Info, false > LogInfo
edm::ParameterSet const pSet_

◆ ~SiStripQualityChecker()

SiStripQualityChecker::~SiStripQualityChecker ( )

Definition at line 33 of file SiStripQualityChecker.cc.

33  {
34  edm::LogInfo("SiStripQualityChecker") << " Deleting SiStripQualityChecker "
35  << "\n";
36 }
Log< level::Info, false > LogInfo

Member Function Documentation

◆ bookStatus()

void SiStripQualityChecker::bookStatus ( DQMStore dqm_store)

Definition at line 40 of file SiStripQualityChecker.cc.

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().

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 }
MonitorElement * bookFloat(TString const &name, FUNC onbooking=NOOP())
Definition: DQMStore.h:80
std::map< std::string, std::string > SubDetFolderMap
void setCurrentFolder(std::string const &fullpath) override
Definition: DQMStore.h:647
MonitorElement * DetFractionReportMap_hasTooManyDigis
std::map< std::string, SubDetMEs > SubDetMEsMap
char const * label
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)
MonitorElement * DetFractionReportMap
MonitorElement * DetFractionReportMap_hasTooManyClu
MonitorElement * DetFractionReportMap_hasBadChan
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:212
MonitorElement * SummaryReportMap
MonitorElement * SummaryReportGlobal
MonitorElement * SToNReportMap
MonitorElement * DetFractionReportMap_hasExclFed
MonitorElement * DetFractionReportMap_hasDcsErr
static void getTopFolderPath(DQMStore &dqm_store, std::string const &top_dir, std::string &path)
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)

◆ fillDetectorStatus()

void SiStripQualityChecker::fillDetectorStatus ( DQMStore dqm_store,
const SiStripDetCabling cabling 
)
private

Definition at line 214 of file SiStripQualityChecker.cc.

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().

214  {
215  unsigned int xbin = 0;
216  float global_flag = 0;
217  dqm_store.cd();
218  std::string mdir = "MechanicalView";
219  if (!SiStripUtility::goToDir(dqm_store, mdir))
220  return;
221  std::string mechanicalview_dir = dqm_store.pwd();
222 
224  for (auto& [det, local_mes] : SubDetMEsMap) {
225  auto cPos = SubDetFolderMap.find(det);
226  if (cPos == SubDetFolderMap.end())
227  continue;
228  std::string dname = mechanicalview_dir + "/" + cPos->second;
229  if (!dqm_store.dirExists(dname))
230  continue;
231  dqm_store.cd(dname);
232  ++xbin;
233  float flag = 0;
234  fillSubDetStatus(dqm_store, cabling, local_mes, xbin, flag);
235  global_flag += flag;
236  }
237  global_flag = global_flag / xbin * 1.0;
239  SummaryReportGlobal->Fill(global_flag);
240  dqm_store.cd();
241 }
std::map< std::string, std::string > SubDetFolderMap
virtual bool dirExists(std::string const &path) const
Definition: DQMStore.cc:769
std::string pwd() override
Definition: DQMStore.h:645
void fillSubDetStatus(DQMStore &dqm_store, const SiStripDetCabling *cabling, SubDetMEs &mes, unsigned int xbin, float &gflag)
void Fill(long long x)
std::map< std::string, SubDetMEs > SubDetMEsMap
MonitorElement * SummaryReportGlobal
static bool goToDir(DQMStore &dqm_store, std::string const &name)

◆ fillDetectorStatusAtLumi()

void SiStripQualityChecker::fillDetectorStatusAtLumi ( DQMStore dqm_store)
private

Definition at line 535 of file SiStripQualityChecker.cc.

References dqm::implementation::DQMStore::cd(), dqm::impl::MonitorElement::Fill(), HLT_2024v12_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().

535  {
536  dqm_store.cd();
537  std::string rdir = "ReadoutView";
538  if (!SiStripUtility::goToDir(dqm_store, rdir))
539  return;
540  std::string fullpath = dqm_store.pwd() + "/PerLumiSection/" + "lumiErrorFraction";
541  MonitorElement* me = dqm_store.get(fullpath);
542  if (me && me->kind() == MonitorElement::Kind::TH1F) {
543  TH1F* th1 = me->getTH1F();
544  float global_fraction = 0.0;
545  float dets = 0.0;
546  for (int ibin = 1; ibin <= th1->GetNbinsX(); ibin++) {
547  std::string label = th1->GetXaxis()->GetBinLabel(ibin);
548  std::map<std::string, SubDetMEs>::iterator iPos = SubDetMEsMap.find(label);
549  if (iPos != SubDetMEsMap.end()) {
550  float fraction = 1.0 - th1->GetBinContent(ibin);
551  global_fraction += fraction;
552  dets++;
553  iPos->second.DetFraction->Fill(fraction);
554  iPos->second.SToNFlag->Fill(-1.0);
555  iPos->second.SummaryFlag->Fill(fraction);
556  }
557  }
558  global_fraction = global_fraction / dets;
560  SummaryReportGlobal->Fill(global_fraction);
561  }
562  dqm_store.cd();
563 }
std::string pwd() override
Definition: DQMStore.h:645
void Fill(long long x)
std::map< std::string, SubDetMEs > SubDetMEsMap
char const * label
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:712
MonitorElement * SummaryReportGlobal
static bool goToDir(DQMStore &dqm_store, std::string const &name)

◆ fillDummyStatus()

void SiStripQualityChecker::fillDummyStatus ( )

Definition at line 144 of file SiStripQualityChecker.cc.

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().

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 }
MonitorElement * DetFractionReportMap_hasTooManyDigis
void Fill(long long x)
std::map< std::string, SubDetMEs > SubDetMEsMap
MonitorElement * DetFractionReportMap
virtual int getNbinsY() const
get # of bins in Y-axis
MonitorElement * DetFractionReportMap_hasTooManyClu
MonitorElement * DetFractionReportMap_hasBadChan
MonitorElement * SummaryReportMap
MonitorElement * SummaryReportGlobal
MonitorElement * SToNReportMap
MonitorElement * DetFractionReportMap_hasExclFed
virtual int getNbinsX() const
get # of bins in X-axis
MonitorElement * DetFractionReportMap_hasDcsErr

◆ fillFaultyModuleStatus()

void SiStripQualityChecker::fillFaultyModuleStatus ( DQMStore dqm_store,
const TrackerTopology tTopo 
)

Definition at line 482 of file SiStripQualityChecker.cc.

References badModuleList, dqm::implementation::IBooker::bookInt(), dqm::implementation::DQMStore::cd(), hcalRecHitTable_cff::detId, dqm::implementation::IGetter::dirExists(), dqm::implementation::IGetter::get(), SiStripFolderOrganizer::getSubDetFolder(), SiStripUtility::goToDir(), hlt_dqm_clientPB-live_cfg::me, dqm::implementation::DQMStore::pwd(), dqm::implementation::DQMStore::setCurrentFolder(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by fillStatus().

482  {
483  if (badModuleList.empty())
484  return;
485 
486  dqm_store.cd();
487  std::string mdir = "MechanicalView";
488  if (!SiStripUtility::goToDir(dqm_store, mdir))
489  return;
490  std::string mechanical_dir = dqm_store.pwd();
491 
492  SiStripFolderOrganizer folder_organizer;
493  for (auto const [detId, value] : badModuleList) {
494  std::string subdet_folder;
495  folder_organizer.getSubDetFolder(detId, tTopo, subdet_folder);
496  if (!dqm_store.dirExists(subdet_folder)) {
497  subdet_folder = mechanical_dir + subdet_folder.substr(subdet_folder.find("MechanicalView") + 14);
498  if (!dqm_store.dirExists(subdet_folder))
499  continue;
500  }
501  std::string bad_module_folder = subdet_folder + "/" + "BadModuleList";
502  dqm_store.setCurrentFolder(bad_module_folder);
503 
504  std::ostringstream detid_str;
505  detid_str << detId;
506  std::string full_path = bad_module_folder + "/" + detid_str.str();
507  MonitorElement* me = dqm_store.get(full_path);
508  if (me)
509  me->Reset();
510  else
511  me = dqm_store.bookInt(detid_str.str());
512  me->Fill(value);
513  }
514  dqm_store.cd();
515 }
void getSubDetFolder(const uint32_t &detid, const TrackerTopology *tTopo, std::string &folder_name)
void setCurrentFolder(std::string const &fullpath) override
Definition: DQMStore.h:647
virtual bool dirExists(std::string const &path) const
Definition: DQMStore.cc:769
std::string pwd() override
Definition: DQMStore.h:645
Definition: value.py:1
MonitorElement * bookInt(TString const &name, FUNC onbooking=NOOP())
Definition: DQMStore.h:73
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:712
std::map< uint32_t, uint16_t > badModuleList
static bool goToDir(DQMStore &dqm_store, std::string const &name)

◆ fillStatus()

void SiStripQualityChecker::fillStatus ( DQMStore dqm_store,
const SiStripDetCabling cabling,
const TkDetMap tkDetMap,
const TrackerTopology tTopo 
)

Definition at line 195 of file SiStripQualityChecker.cc.

References bookedStripStatus_, bookStatus(), fillDetectorStatus(), fillDummyStatus(), fillFaultyModuleStatus(), edm::ParameterSet::getUntrackedParameter(), pSet_, and tkDetMap_.

198  {
199  if (!bookedStripStatus_)
200  bookStatus(dqm_store);
201 
202  tkDetMap_ = tkDetMap;
203 
204  fillDummyStatus();
205  fillDetectorStatus(dqm_store, cabling);
206 
207  int faulty_moduleflag = pSet_.getUntrackedParameter<bool>("PrintFaultyModuleList", false);
208  if (faulty_moduleflag)
209  fillFaultyModuleStatus(dqm_store, tTopo);
210 }
void fillFaultyModuleStatus(DQMStore &dqm_store, const TrackerTopology *tTopo)
T getUntrackedParameter(std::string const &, T const &) const
void bookStatus(DQMStore &dqm_store)
void fillDetectorStatus(DQMStore &dqm_store, const SiStripDetCabling *cabling)
edm::ParameterSet const pSet_

◆ fillStatusAtLumi()

void SiStripQualityChecker::fillStatusAtLumi ( DQMStore dqm_store)

Definition at line 526 of file SiStripQualityChecker.cc.

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

526  {
527  if (!bookedStripStatus_)
528  bookStatus(dqm_store);
529  fillDummyStatus();
530  fillDetectorStatusAtLumi(dqm_store);
531 }
void fillDetectorStatusAtLumi(DQMStore &dqm_store)
void bookStatus(DQMStore &dqm_store)

◆ fillStatusHistogram()

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

Definition at line 470 of file SiStripQualityChecker.cc.

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

Referenced by fillSubDetStatus().

473  {
474  if (me && me->kind() == MonitorElement::Kind::TH2F) {
475  auto th2d = me->getTH2F();
476  th2d->SetBinContent(xbin, ybin, val);
477  }
478 }

◆ fillSubDetStatus()

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

Definition at line 245 of file SiStripQualityChecker.cc.

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, SiStripPI::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().

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

◆ 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 385 of file SiStripQualityChecker.cc.

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

Referenced by fillSubDetStatus().

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

◆ initialiseBadModuleList()

void SiStripQualityChecker::initialiseBadModuleList ( )
private

Definition at line 517 of file SiStripQualityChecker.cc.

References badModuleList.

Referenced by fillDetectorStatus().

517  {
518  for (auto& badMod : badModuleList) {
519  badMod.second = 0;
520  }
521 }
std::map< uint32_t, uint16_t > badModuleList

◆ printStatusReport()

void SiStripQualityChecker::printStatusReport ( )

Definition at line 354 of file SiStripQualityChecker.cc.

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

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

◆ resetStatus()

void SiStripQualityChecker::resetStatus ( )

Definition at line 172 of file SiStripQualityChecker.cc.

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

Referenced by fillDummyStatus().

172  {
173  if (bookedStripStatus_) {
174  for (auto& pr : SubDetMEsMap) {
175  auto& local_mes = pr.second;
176  local_mes.DetFraction->Reset();
177  local_mes.SummaryFlag->Reset();
178  local_mes.SToNFlag->Reset();
179  }
187  SToNReportMap->Reset();
188 
190  }
191 }
MonitorElement * DetFractionReportMap_hasTooManyDigis
std::map< std::string, SubDetMEs > SubDetMEsMap
virtual void Reset()
Remove all data from the ME, keept the empty histogram with all its settings.
MonitorElement * DetFractionReportMap
MonitorElement * DetFractionReportMap_hasTooManyClu
MonitorElement * DetFractionReportMap_hasBadChan
MonitorElement * SummaryReportMap
MonitorElement * SummaryReportGlobal
MonitorElement * SToNReportMap
MonitorElement * DetFractionReportMap_hasExclFed
MonitorElement * DetFractionReportMap_hasDcsErr

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 65 of file SiStripQualityChecker.h.

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

◆ DetFractionReportMap_hasBadChan

MonitorElement* SiStripQualityChecker::DetFractionReportMap_hasBadChan {nullptr}
private

Definition at line 66 of file SiStripQualityChecker.h.

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

◆ DetFractionReportMap_hasDcsErr

MonitorElement* SiStripQualityChecker::DetFractionReportMap_hasDcsErr {nullptr}
private

Definition at line 70 of file SiStripQualityChecker.h.

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

◆ DetFractionReportMap_hasExclFed

MonitorElement* SiStripQualityChecker::DetFractionReportMap_hasExclFed {nullptr}
private

Definition at line 69 of file SiStripQualityChecker.h.

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

◆ DetFractionReportMap_hasTooManyClu

MonitorElement* SiStripQualityChecker::DetFractionReportMap_hasTooManyClu {nullptr}
private

Definition at line 68 of file SiStripQualityChecker.h.

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

◆ DetFractionReportMap_hasTooManyDigis

MonitorElement* SiStripQualityChecker::DetFractionReportMap_hasTooManyDigis {nullptr}
private

Definition at line 67 of file SiStripQualityChecker.h.

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

◆ pSet_

edm::ParameterSet const SiStripQualityChecker::pSet_
private

Definition at line 79 of file SiStripQualityChecker.h.

Referenced by fillStatus(), and fillSubDetStatus().

◆ SToNReportMap

MonitorElement* SiStripQualityChecker::SToNReportMap {nullptr}
private

Definition at line 71 of file SiStripQualityChecker.h.

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

◆ SubDetFolderMap

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

Definition at line 63 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 72 of file SiStripQualityChecker.h.

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

◆ tkDetMap_

const TkDetMap* SiStripQualityChecker::tkDetMap_
private

Definition at line 83 of file SiStripQualityChecker.h.

Referenced by fillStatus(), and getModuleStatus().

◆ TrackSummaryReportGlobal

MonitorElement* SiStripQualityChecker::TrackSummaryReportGlobal {nullptr}
private

Definition at line 75 of file SiStripQualityChecker.h.

◆ TrackSummaryReportMap

MonitorElement* SiStripQualityChecker::TrackSummaryReportMap {nullptr}
private

Definition at line 74 of file SiStripQualityChecker.h.