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 { 0 }
 
MonitorElementDetFractionReportMap_hasBadChan { 0 }
 
MonitorElementDetFractionReportMap_hasDcsErr { 0 }
 
MonitorElementDetFractionReportMap_hasExclFed { 0 }
 
MonitorElementDetFractionReportMap_hasTooManyClu { 0 }
 
MonitorElementDetFractionReportMap_hasTooManyDigis { 0 }
 
edm::ParameterSet const pSet_
 
MonitorElementSToNReportMap { 0 }
 
std::map< std::string, std::string > SubDetFolderMap
 
std::map< std::string, SubDetMEsSubDetMEsMap
 
MonitorElementSummaryReportGlobal { 0 }
 
MonitorElementSummaryReportMap { 0 }
 
const TkDetMaptkDetMap_
 
MonitorElementTrackSummaryReportGlobal { 0 }
 
MonitorElementTrackSummaryReportMap { 0 }
 

Detailed Description

Definition at line 19 of file SiStripQualityChecker.h.

Member Typedef Documentation

Definition at line 22 of file SiStripQualityChecker.h.

Definition at line 21 of file SiStripQualityChecker.h.

Constructor & Destructor Documentation

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

Definition at line 22 of file SiStripQualityChecker.cc.

References SubDetFolderMap.

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

Definition at line 34 of file SiStripQualityChecker.cc.

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

Member Function Documentation

void SiStripQualityChecker::bookStatus ( DQMStore dqm_store)

Definition at line 41 of file SiStripQualityChecker.cc.

References dqm::dqmstoreimpl::DQMStore::book2D(), bookedStripStatus_, dqm::dqmstoreimpl::DQMStore::bookFloat(), dqm::dqmstoreimpl::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::dqmstoreimpl::DQMStore::setCurrentFolder(), SiStripQualityChecker::SubDetMEs::SToNFlag, SToNReportMap, AlCaHLTBitMon_QueryRunRegistry::string, SubDetFolderMap, SubDetMEsMap, SiStripQualityChecker::SubDetMEs::SummaryFlag, SummaryReportGlobal, and SummaryReportMap.

Referenced by fillStatus(), and fillStatusAtLumi().

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

Definition at line 216 of file SiStripQualityChecker.cc.

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

Referenced by fillStatus().

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

Definition at line 545 of file SiStripQualityChecker.cc.

References dqm::dqmstoreimpl::DQMStore::cd(), dqm::impl::MonitorElement::Fill(), HLT_2018_cff::fraction, reco_skim_cfg_mod::fullpath, dqm::dqmstoreimpl::DQMStore::get(), dqm::legacy::MonitorElement::getTH1F(), SiStripUtility::goToDir(), dqm::impl::MonitorElement::kind(), label, hlt_dqm_clientPB-live_cfg::me, dqm::dqmstoreimpl::DQMStore::pwd(), AlCaHLTBitMon_QueryRunRegistry::string, SubDetMEsMap, SummaryReportGlobal, and MonitorElementData::TH1F.

Referenced by fillStatusAtLumi().

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

Definition at line 145 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().

145  {
146  resetStatus();
147  if (bookedStripStatus_) {
148  for (auto& pr : SubDetMEsMap) {
149  auto& local_mes = pr.second;
150  local_mes.SummaryFlag->Fill(-1.0);
151  local_mes.DetFraction->Fill(-1.0);
152  local_mes.SToNFlag->Fill(-1.0);
153  }
154 
155  for (int xbin = 1; xbin < SummaryReportMap->getNbinsX() + 1; xbin++) {
156  for (int ybin = 1; ybin < SummaryReportMap->getNbinsY() + 1; ybin++) {
157  SummaryReportMap->Fill(xbin, ybin, -1.0);
158  DetFractionReportMap->Fill(xbin, ybin, -1.0);
159  DetFractionReportMap_hasBadChan->Fill(xbin, ybin, -1.0);
160  DetFractionReportMap_hasTooManyDigis->Fill(xbin, ybin, -1.0);
161  DetFractionReportMap_hasTooManyClu->Fill(xbin, ybin, -1.0);
162  DetFractionReportMap_hasExclFed->Fill(xbin, ybin, -1.0);
163  DetFractionReportMap_hasDcsErr->Fill(xbin, ybin, -1.0);
164  SToNReportMap->Fill(xbin, ybin, -1.0);
165  }
166  }
167  SummaryReportGlobal->Fill(-1.0);
168  }
169 }
virtual int getNbinsY() const
get # of bins in Y-axis
MonitorElement * DetFractionReportMap_hasTooManyDigis
void Fill(long long x)
std::map< std::string, SubDetMEs > SubDetMEsMap
virtual int getNbinsX() const
get # of bins in X-axis
MonitorElement * DetFractionReportMap
MonitorElement * DetFractionReportMap_hasTooManyClu
MonitorElement * DetFractionReportMap_hasBadChan
MonitorElement * SummaryReportMap
MonitorElement * SummaryReportGlobal
MonitorElement * SToNReportMap
MonitorElement * DetFractionReportMap_hasExclFed
MonitorElement * DetFractionReportMap_hasDcsErr
void SiStripQualityChecker::fillFaultyModuleStatus ( DQMStore dqm_store,
const edm::EventSetup eSetup 
)

Definition at line 487 of file SiStripQualityChecker.cc.

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

Referenced by fillStatus().

487  {
488  if (badModuleList.empty())
489  return;
490 
491  //Retrieve tracker topology from geometry
492  edm::ESHandle<TrackerTopology> tTopoHandle;
493  eSetup.get<TrackerTopologyRcd>().get(tTopoHandle);
494  const TrackerTopology* const tTopo = tTopoHandle.product();
495 
496  dqm_store.cd();
497  std::string mdir = "MechanicalView";
498  if (!SiStripUtility::goToDir(dqm_store, mdir))
499  return;
500  std::string mechanical_dir = dqm_store.pwd();
501 
502  SiStripFolderOrganizer folder_organizer;
503  for (auto const [detId, value] : badModuleList) {
504  std::string subdet_folder;
505  folder_organizer.getSubDetFolder(detId, tTopo, subdet_folder);
506  if (!dqm_store.dirExists(subdet_folder)) {
507  subdet_folder = mechanical_dir + subdet_folder.substr(subdet_folder.find("MechanicalView") + 14);
508  if (!dqm_store.dirExists(subdet_folder))
509  continue;
510  }
511  std::string bad_module_folder = subdet_folder + "/" + "BadModuleList";
512  dqm_store.setCurrentFolder(bad_module_folder);
513 
514  std::ostringstream detid_str;
515  detid_str << detId;
516  std::string full_path = bad_module_folder + "/" + detid_str.str();
517  MonitorElement* me = dqm_store.get(full_path);
518  if (me)
519  me->Reset();
520  else
521  me = dqm_store.bookInt(detid_str.str());
522  me->Fill(value);
523  }
524  dqm_store.cd();
525 }
void getSubDetFolder(const uint32_t &detid, const TrackerTopology *tTopo, std::string &folder_name)
void Fill(long long x)
virtual void Reset()
reset ME (ie. contents, errors, etc)
Definition: value.py:1
std::map< uint32_t, uint16_t > badModuleList
static bool goToDir(DQMStore &dqm_store, std::string const &name)
T get() const
Definition: EventSetup.h:73
T const * product() const
Definition: ESHandle.h:86
void SiStripQualityChecker::fillStatus ( DQMStore dqm_store,
const edm::ESHandle< SiStripDetCabling > &  cabling,
const edm::EventSetup eSetup 
)

Definition at line 196 of file SiStripQualityChecker.cc.

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

198  {
199  if (!bookedStripStatus_)
200  bookStatus(dqm_store);
201 
202  edm::ESHandle<TkDetMap> tkMapHandle;
203  eSetup.get<TrackerTopologyRcd>().get(tkMapHandle);
204  tkDetMap_ = tkMapHandle.product();
205 
206  fillDummyStatus();
207  fillDetectorStatus(dqm_store, cabling);
208 
209  int faulty_moduleflag = pSet_.getUntrackedParameter<bool>("PrintFaultyModuleList", false);
210  if (faulty_moduleflag)
211  fillFaultyModuleStatus(dqm_store, eSetup);
212 }
T getUntrackedParameter(std::string const &, T const &) const
void fillFaultyModuleStatus(DQMStore &dqm_store, const edm::EventSetup &eSetup)
void bookStatus(DQMStore &dqm_store)
T get() const
Definition: EventSetup.h:73
void fillDetectorStatus(DQMStore &dqm_store, const edm::ESHandle< SiStripDetCabling > &cabling)
edm::ParameterSet const pSet_
T const * product() const
Definition: ESHandle.h:86
void SiStripQualityChecker::fillStatusAtLumi ( DQMStore dqm_store)

Definition at line 536 of file SiStripQualityChecker.cc.

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

536  {
537  if (!bookedStripStatus_)
538  bookStatus(dqm_store);
539  fillDummyStatus();
540  fillDetectorStatusAtLumi(dqm_store);
541 }
void fillDetectorStatusAtLumi(DQMStore &dqm_store)
void bookStatus(DQMStore &dqm_store)
void SiStripQualityChecker::fillStatusHistogram ( MonitorElement const *  me,
int  xbin,
int  ybin,
float  val 
)
private

Definition at line 475 of file SiStripQualityChecker.cc.

References dqm::legacy::MonitorElement::getTH2F(), dqm::impl::MonitorElement::kind(), and MonitorElementData::TH2F.

Referenced by fillSubDetStatus().

478  {
479  if (me && me->kind() == MonitorElement::Kind::TH2F) {
480  auto th2d = me->getTH2F();
481  th2d->SetBinContent(xbin, ybin, val);
482  }
483 }
void SiStripQualityChecker::fillSubDetStatus ( DQMStore dqm_store,
const edm::ESHandle< SiStripDetCabling > &  cabling,
SubDetMEs mes,
unsigned int  xbin,
float &  gflag 
)
private

Definition at line 247 of file SiStripQualityChecker.cc.

References dqm::dqmstoreimpl::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::dqmstoreimpl::DQMStore::getContents(), SiStripUtility::getMEStatus(), getModuleStatus(), dqm::dqmstoreimpl::DQMStore::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().

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

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

Referenced by fillSubDetStatus().

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

Definition at line 527 of file SiStripQualityChecker.cc.

References badModuleList.

Referenced by fillDetectorStatus().

527  {
528  for (auto& badMod : badModuleList) {
529  badMod.second = 0;
530  }
531 }
std::map< uint32_t, uint16_t > badModuleList
void SiStripQualityChecker::printStatusReport ( )

Definition at line 359 of file SiStripQualityChecker.cc.

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

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

Definition at line 173 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().

173  {
174  if (bookedStripStatus_) {
175  for (auto& pr : SubDetMEsMap) {
176  auto& local_mes = pr.second;
177  local_mes.DetFraction->Reset();
178  local_mes.SummaryFlag->Reset();
179  local_mes.SToNFlag->Reset();
180  }
188  SToNReportMap->Reset();
189 
191  }
192 }
MonitorElement * DetFractionReportMap_hasTooManyDigis
std::map< std::string, SubDetMEs > SubDetMEsMap
virtual void Reset()
reset ME (ie. contents, errors, etc)
MonitorElement * DetFractionReportMap
MonitorElement * DetFractionReportMap_hasTooManyClu
MonitorElement * DetFractionReportMap_hasBadChan
MonitorElement * SummaryReportMap
MonitorElement * SummaryReportGlobal
MonitorElement * SToNReportMap
MonitorElement * DetFractionReportMap_hasExclFed
MonitorElement * DetFractionReportMap_hasDcsErr

Member Data Documentation

std::map<uint32_t, uint16_t> SiStripQualityChecker::badModuleList
private
bool SiStripQualityChecker::bookedStripStatus_ {false}
private
MonitorElement* SiStripQualityChecker::DetFractionReportMap { 0 }
private

Definition at line 66 of file SiStripQualityChecker.h.

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

MonitorElement* SiStripQualityChecker::DetFractionReportMap_hasBadChan { 0 }
private

Definition at line 67 of file SiStripQualityChecker.h.

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

MonitorElement* SiStripQualityChecker::DetFractionReportMap_hasDcsErr { 0 }
private

Definition at line 71 of file SiStripQualityChecker.h.

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

MonitorElement* SiStripQualityChecker::DetFractionReportMap_hasExclFed { 0 }
private

Definition at line 70 of file SiStripQualityChecker.h.

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

MonitorElement* SiStripQualityChecker::DetFractionReportMap_hasTooManyClu { 0 }
private

Definition at line 69 of file SiStripQualityChecker.h.

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

MonitorElement* SiStripQualityChecker::DetFractionReportMap_hasTooManyDigis { 0 }
private

Definition at line 68 of file SiStripQualityChecker.h.

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

edm::ParameterSet const SiStripQualityChecker::pSet_
private

Definition at line 80 of file SiStripQualityChecker.h.

Referenced by fillStatus(), and fillSubDetStatus().

MonitorElement* SiStripQualityChecker::SToNReportMap { 0 }
private

Definition at line 72 of file SiStripQualityChecker.h.

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

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

Definition at line 64 of file SiStripQualityChecker.h.

Referenced by bookStatus(), fillDetectorStatus(), and SiStripQualityChecker().

std::map<std::string, SubDetMEs> SiStripQualityChecker::SubDetMEsMap
private
MonitorElement* SiStripQualityChecker::SummaryReportGlobal { 0 }
private
MonitorElement* SiStripQualityChecker::SummaryReportMap { 0 }
private

Definition at line 73 of file SiStripQualityChecker.h.

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

const TkDetMap* SiStripQualityChecker::tkDetMap_
private

Definition at line 84 of file SiStripQualityChecker.h.

Referenced by fillStatus(), and getModuleStatus().

MonitorElement* SiStripQualityChecker::TrackSummaryReportGlobal { 0 }
private

Definition at line 76 of file SiStripQualityChecker.h.

MonitorElement* SiStripQualityChecker::TrackSummaryReportMap { 0 }
private

Definition at line 75 of file SiStripQualityChecker.h.