CMS 3D CMS Logo

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

#include <SiStripQualityChecker.h>

Classes

struct  SubDetMEs
 

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

Constructor & Destructor Documentation

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

Definition at line 23 of file SiStripQualityChecker.cc.

References SubDetFolderMap.

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

Definition at line 37 of file SiStripQualityChecker.cc.

38 {
39  edm::LogInfo("SiStripQualityChecker") << " Deleting SiStripQualityChecker "
40  << "\n";
41 }

Member Function Documentation

void SiStripQualityChecker::bookStatus ( DQMStore dqm_store)

Definition at line 46 of file SiStripQualityChecker.cc.

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

Referenced by fillStatus(), and fillStatusAtLumi().

47 {
48  if (bookedStripStatus_) return;
49 
50  dqm_store.cd();
51  std::string strip_dir = "";
52  SiStripUtility::getTopFolderPath(dqm_store, "SiStrip", strip_dir);
53  if (strip_dir.empty()) strip_dir = "SiStrip";
54 
55  // Non Standard Plots and should be put outside EventInfo folder
56 
57  dqm_store.setCurrentFolder(strip_dir + "/MechanicalView");
58 
59  std::string hname, htitle;
60  hname = "detFractionReportMap";
61  htitle = "SiStrip Report for Good Detector Fraction";
63  dqm_store.book2D(hname, htitle, 6, 0.5, 6.5, 9, 0.5, 9.5);
64  DetFractionReportMap->setAxisTitle("Sub Detector Type", 1);
65  DetFractionReportMap->setAxisTitle("Layer/Disc Number", 2);
66 
67  hname = "detFractionReportMap_hasBadChan";
68  htitle = "SiStrip Report for Good Detector Fraction due to bad channels";
70  dqm_store.book2D(hname, htitle, 6, 0.5, 6.5, 9, 0.5, 9.5);
71  DetFractionReportMap_hasBadChan->setAxisTitle("Sub Detector Type", 1);
72  DetFractionReportMap_hasBadChan->setAxisTitle("Layer/Disc Number", 2);
73  hname = "detFractionReportMap_hasTooManyDigis";
74  htitle = "SiStrip Report for Good Detector Fraction due to too many digis";
76  dqm_store.book2D(hname, htitle, 6, 0.5, 6.5, 9, 0.5, 9.5);
77  DetFractionReportMap_hasTooManyDigis->setAxisTitle("Sub Detector Type", 1);
78  DetFractionReportMap_hasTooManyDigis->setAxisTitle("Layer/Disc Number", 2);
79  hname = "detFractionReportMap_hasTooManyClu";
80  htitle = "SiStrip Report for Good Detector Fraction due to too many clusters";
82  dqm_store.book2D(hname, htitle, 6, 0.5, 6.5, 9, 0.5, 9.5);
83  DetFractionReportMap_hasTooManyClu->setAxisTitle("Sub Detector Type", 1);
84  DetFractionReportMap_hasTooManyClu->setAxisTitle("Layer/Disc Number", 2);
85  hname = "detFractionReportMap_hasExclFed";
86  htitle = "SiStrip Report for Good Detector Fraction due to excluded FEDs";
88  dqm_store.book2D(hname, htitle, 6, 0.5, 6.5, 9, 0.5, 9.5);
89  DetFractionReportMap_hasExclFed->setAxisTitle("Sub Detector Type", 1);
90  DetFractionReportMap_hasExclFed->setAxisTitle("Layer/Disc Number", 2);
91  hname = "detFractionReportMap_hasDcsErr";
92  htitle = "SiStrip Report for Good Detector Fraction due to DCS errors";
94  dqm_store.book2D(hname, htitle, 6, 0.5, 6.5, 9, 0.5, 9.5);
95  DetFractionReportMap_hasDcsErr->setAxisTitle("Sub Detector Type", 1);
96  DetFractionReportMap_hasDcsErr->setAxisTitle("Layer/Disc Number", 2);
97 
98  hname = "sToNReportMap";
99  htitle = "SiStrip Report for Signal-to-Noise";
100  SToNReportMap = dqm_store.book2D(hname, htitle, 6, 0.5, 6.5, 9, 0.5, 9.5);
101  SToNReportMap->setAxisTitle("Sub Detector Type", 1);
102  SToNReportMap->setAxisTitle("Layer/Disc Number", 2);
103 
104  // this is the main reportSummary 2D plot and should be in EventInfo
105  dqm_store.setCurrentFolder(strip_dir + "/EventInfo");
106 
107  hname = "reportSummaryMap";
108  htitle = "SiStrip Report Summary Map";
109  SummaryReportMap = dqm_store.book2D(hname, htitle, 6, 0.5, 6.5, 9, 0.5, 9.5);
110  SummaryReportMap->setAxisTitle("Sub Detector Type", 1);
111  SummaryReportMap->setAxisTitle("Layer/Disc Number", 2);
112 
113  SummaryReportGlobal = dqm_store.bookFloat("reportSummary");
114  int ibin = 0;
115 
116  dqm_store.setCurrentFolder(strip_dir + "/EventInfo/reportSummaryContents");
117  for (auto const& [det, label] : SubDetFolderMap) {
118  ibin++;
127 
128  SubDetMEs local_mes;
129 
130  if (det == "TECF")
131  local_mes.detectorTag = "TEC+";
132  else if (det == "TECB")
133  local_mes.detectorTag = "TEC-";
134  else if (det == "TIDF")
135  local_mes.detectorTag = "TID+";
136  else if (det == "TIDB")
137  local_mes.detectorTag = "TID-";
138  else
139  local_mes.detectorTag = det;
140 
141  std::string me_name;
142  me_name = "SiStrip_" + det;
143  local_mes.SummaryFlag = dqm_store.bookFloat(me_name);
144 
145  me_name = "SiStrip_DetFraction_" + det;
146  local_mes.DetFraction = dqm_store.bookFloat(me_name);
147 
148  me_name = "SiStrip_SToNFlag_" + det;
149  local_mes.SToNFlag = dqm_store.bookFloat(me_name);
150  SubDetMEsMap.insert(std::pair<std::string, SubDetMEs>(det, local_mes));
151  }
152  bookedStripStatus_ = true;
153 }
MonitorElement * book2D(char_string const &name, char_string const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
Definition: DQMStore.cc:1173
std::map< std::string, std::string > SubDetFolderMap
MonitorElement * DetFractionReportMap_hasTooManyDigis
void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
MonitorElement * bookFloat(char_string const &name)
Book float.
Definition: DQMStore.cc:1048
std::map< std::string, SubDetMEs > SubDetMEsMap
char const * label
MonitorElement * DetFractionReportMap
MonitorElement * DetFractionReportMap_hasTooManyClu
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:571
void cd()
go to top directory (ie. root)
Definition: DQMStore.cc:546
MonitorElement * DetFractionReportMap_hasBadChan
MonitorElement * SummaryReportMap
MonitorElement * SummaryReportGlobal
MonitorElement * SToNReportMap
MonitorElement * DetFractionReportMap_hasExclFed
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
MonitorElement * DetFractionReportMap_hasDcsErr
static void getTopFolderPath(DQMStore &dqm_store, std::string const &top_dir, std::string &path)
void SiStripQualityChecker::fillDetectorStatus ( DQMStore dqm_store,
const edm::ESHandle< SiStripDetCabling > &  cabling 
)
private

Definition at line 230 of file SiStripQualityChecker.cc.

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

Referenced by fillStatus().

233 {
234  unsigned int xbin = 0;
235  float global_flag = 0;
236  dqm_store.cd();
237  std::string mdir = "MechanicalView";
238  if (!SiStripUtility::goToDir(dqm_store, mdir)) return;
239  std::string mechanicalview_dir = dqm_store.pwd();
240 
242  for (auto& [det, local_mes] : SubDetMEsMap) {
243  auto cPos = SubDetFolderMap.find(det);
244  if (cPos == SubDetFolderMap.end()) continue;
245  std::string dname = mechanicalview_dir + "/" + cPos->second;
246  if (!dqm_store.dirExists(dname)) continue;
247  dqm_store.cd(dname);
248  ++xbin;
249  float flag;
250  fillSubDetStatus(dqm_store, cabling, local_mes, xbin,flag);
251  global_flag += flag;
252  }
253  global_flag = global_flag/xbin*1.0;
254  if (SummaryReportGlobal) SummaryReportGlobal->Fill(global_flag);
255  dqm_store.cd();
256 }
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)
bool dirExists(std::string const &path) const
true if directory exists
Definition: DQMStore.cc:635
std::string const & pwd() const
Definition: DQMStore.cc:539
void cd()
go to top directory (ie. root)
Definition: DQMStore.cc:546
MonitorElement * SummaryReportGlobal
static bool goToDir(DQMStore &dqm_store, std::string const &name)
void SiStripQualityChecker::fillDetectorStatusAtLumi ( DQMStore dqm_store)
private

Definition at line 549 of file SiStripQualityChecker.cc.

References DQMStore::cd(), MonitorElement::DQM_KIND_TH1F, MonitorElement::Fill(), HcalObjRepresent::Fill(), dedxEstimators_cff::fraction, DQMStore::get(), MonitorElement::getTH1F(), SiStripUtility::goToDir(), MonitorElement::kind(), label, DQMStore::pwd(), AlCaHLTBitMon_QueryRunRegistry::string, SubDetMEsMap, and SummaryReportGlobal.

Referenced by fillStatusAtLumi().

550 {
551  dqm_store.cd();
552  std::string rdir = "ReadoutView";
553  if (!SiStripUtility::goToDir(dqm_store, rdir)) return;
554  std::string fullpath =
555  dqm_store.pwd() + "/PerLumiSection/" + "lumiErrorFraction";
556  MonitorElement* me = dqm_store.get(fullpath);
557  if (me && me->kind() == MonitorElement::DQM_KIND_TH1F) {
558  TH1F* th1 = me->getTH1F();
559  float global_fraction = 0.0;
560  float dets = 0.0;
561  for (int ibin = 1; ibin <= th1->GetNbinsX(); ibin++) {
562  std::string label = th1->GetXaxis()->GetBinLabel(ibin);
563  std::map<std::string, SubDetMEs>::iterator iPos = SubDetMEsMap.find(label);
564  if (iPos != SubDetMEsMap.end()) {
565  float fraction = 1.0 - th1->GetBinContent(ibin);
566  global_fraction += fraction;
567  dets++;
568  iPos->second.DetFraction -> Fill(fraction);
569  iPos->second.SToNFlag -> Fill(-1.0);
570  iPos->second.SummaryFlag -> Fill(fraction);
571  }
572  }
573  global_fraction = global_fraction/dets;
574  if (SummaryReportGlobal) SummaryReportGlobal->Fill(global_fraction);
575  }
576  dqm_store.cd();
577 }
TH1F * getTH1F() const
void Fill(long long x)
std::map< std::string, SubDetMEs > SubDetMEsMap
char const * label
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
MonitorElement * get(std::string const &path) const
get ME from full pathname (e.g. "my/long/dir/my_histo")
Definition: DQMStore.cc:1613
std::string const & pwd() const
Definition: DQMStore.cc:539
void cd()
go to top directory (ie. root)
Definition: DQMStore.cc:546
MonitorElement * SummaryReportGlobal
static bool goToDir(DQMStore &dqm_store, std::string const &name)
Kind kind() const
Get the type of the monitor element.
void SiStripQualityChecker::fillDummyStatus ( )

Definition at line 156 of file SiStripQualityChecker.cc.

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

Referenced by fillStatus(), and fillStatusAtLumi().

157 {
158  resetStatus();
159  if (bookedStripStatus_) {
160  for (auto& pr : SubDetMEsMap) {
161  auto& local_mes = pr.second;
162  local_mes.SummaryFlag -> Fill(-1.0);
163  local_mes.DetFraction -> Fill(-1.0);
164  local_mes.SToNFlag -> Fill(-1.0);
165  }
166 
167  for (int xbin = 1; xbin < SummaryReportMap->getNbinsX()+1; xbin++) {
168  for (int ybin = 1; ybin < SummaryReportMap->getNbinsY()+1; ybin++) {
169  SummaryReportMap->Fill(xbin, ybin, -1.0);
170  DetFractionReportMap->Fill(xbin, ybin, -1.0);
171  DetFractionReportMap_hasBadChan->Fill(xbin, ybin, -1.0);
172  DetFractionReportMap_hasTooManyDigis->Fill(xbin, ybin, -1.0);
173  DetFractionReportMap_hasTooManyClu->Fill(xbin, ybin, -1.0);
174  DetFractionReportMap_hasExclFed->Fill(xbin, ybin, -1.0);
175  DetFractionReportMap_hasDcsErr->Fill(xbin, ybin, -1.0);
176  SToNReportMap->Fill(xbin, ybin, -1.0);
177  }
178  }
179  SummaryReportGlobal->Fill(-1.0);
180  }
181 }
MonitorElement * DetFractionReportMap_hasTooManyDigis
void Fill(long long x)
std::map< std::string, SubDetMEs > SubDetMEsMap
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
MonitorElement * DetFractionReportMap
MonitorElement * DetFractionReportMap_hasTooManyClu
MonitorElement * DetFractionReportMap_hasBadChan
MonitorElement * SummaryReportMap
int getNbinsY() const
get # of bins in Y-axis
MonitorElement * SummaryReportGlobal
MonitorElement * SToNReportMap
MonitorElement * DetFractionReportMap_hasExclFed
int getNbinsX() const
get # of bins in X-axis
MonitorElement * DetFractionReportMap_hasDcsErr
void SiStripQualityChecker::fillFaultyModuleStatus ( DQMStore dqm_store,
const edm::EventSetup eSetup 
)

Definition at line 489 of file SiStripQualityChecker.cc.

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

Referenced by fillStatus().

491 {
492  if (badModuleList.empty()) return;
493 
494  //Retrieve tracker topology from geometry
495  edm::ESHandle<TrackerTopology> tTopoHandle;
496  eSetup.get<TrackerTopologyRcd>().get(tTopoHandle);
497  const TrackerTopology* const tTopo = tTopoHandle.product();
498 
499  dqm_store.cd();
500  std::string mdir = "MechanicalView";
501  if (!SiStripUtility::goToDir(dqm_store, mdir)) return;
502  std::string mechanical_dir = dqm_store.pwd();
503 
504  SiStripFolderOrganizer folder_organizer;
505  for (auto const [detId, value] : badModuleList) {
506  std::string subdet_folder ;
507  folder_organizer.getSubDetFolder(detId,tTopo,subdet_folder);
508  if (!dqm_store.dirExists(subdet_folder)) {
509  subdet_folder = mechanical_dir + subdet_folder.substr(subdet_folder.find("MechanicalView")+14);
510  if (!dqm_store.dirExists(subdet_folder)) continue;
511  }
512  std::string bad_module_folder = subdet_folder + "/" + "BadModuleList";
513  dqm_store.setCurrentFolder(bad_module_folder);
514 
515  std::ostringstream detid_str;
516  detid_str << detId;
517  std::string full_path = bad_module_folder + "/" + detid_str.str();
518  MonitorElement* me = dqm_store.get(full_path);
519  if (me) 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)
MonitorElement * bookInt(char_string const &name)
Book int.
Definition: DQMStore.cc:1027
void Fill(long long x)
bool dirExists(std::string const &path) const
true if directory exists
Definition: DQMStore.cc:635
MonitorElement * get(std::string const &path) const
get ME from full pathname (e.g. "my/long/dir/my_histo")
Definition: DQMStore.cc:1613
Definition: value.py:1
void Reset()
reset ME (ie. contents, errors, etc)
std::string const & pwd() const
Definition: DQMStore.cc:539
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:571
void cd()
go to top directory (ie. root)
Definition: DQMStore.cc:546
static bool goToDir(DQMStore &dqm_store, std::string const &name)
T get() const
Definition: EventSetup.h:71
std::map< uint32_t, uint16_t > badModuleList
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 209 of file SiStripQualityChecker.cc.

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

213 {
214  if (!bookedStripStatus_) bookStatus(dqm_store);
215 
216  edm::ESHandle<TkDetMap> tkMapHandle;
217  eSetup.get<TrackerTopologyRcd>().get(tkMapHandle);
218  tkDetMap_ = tkMapHandle.product();
219 
220  fillDummyStatus();
221  fillDetectorStatus(dqm_store, cabling);
222 
223  int faulty_moduleflag = pSet_.getUntrackedParameter<bool>("PrintFaultyModuleList", false);
224  if (faulty_moduleflag) fillFaultyModuleStatus(dqm_store, eSetup);
225 }
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:71
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 539 of file SiStripQualityChecker.cc.

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

540 {
541  if (!bookedStripStatus_) bookStatus(dqm_store);
542  fillDummyStatus();
543  fillDetectorStatusAtLumi(dqm_store);
544 }
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 MonitorElement::DQM_KIND_TH2F, MonitorElement::getTH2F(), and MonitorElement::kind().

Referenced by fillSubDetStatus().

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

Definition at line 261 of file SiStripQualityChecker.cc.

References 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, MonitorElement::Fill(), fillStatusHistogram(), DQMStore::getContents(), SiStripUtility::getMEStatus(), getModuleStatus(), DQMStore::getSubdirs(), edm::ParameterSet::getUntrackedParameter(), min(), dataset::name, pSet_, dqm::qstatus::STATUS_OK, SiStripQualityChecker::SubDetMEs::SToNFlag, SToNReportMap, AlCaHLTBitMon_QueryRunRegistry::string, SiStripQualityChecker::SubDetMEs::SummaryFlag, and SummaryReportMap.

Referenced by fillDetectorStatus().

267 {
268 
269  int status_flag = pSet_.getUntrackedParameter<int>("GlobalStatusFilling", 1);
270  if (status_flag < 1) return;
271 
272  auto const subDirVec = dqm_store.getSubdirs();
273 
274  unsigned int ybin = 0;
275  int tot_ndet = 0;
276  int tot_errdet = 0;
277  float tot_ston_stat = 0;
278 
279  for (auto const& dname : subDirVec) {
280  if (dname.find("BadModuleList") != std::string::npos) continue;
281  if (dname.find("ring") !=std::string::npos) continue;
282  std::vector<MonitorElement*> meVec;
283 
284  ybin++;
285  dqm_store.cd(dname);
286  meVec = dqm_store.getContents(dname);
287  uint16_t ndet = 100;
288  int errdet = 0;
289  int errdet_hasBadChan = 0;
290  int errdet_hasTooManyDigis = 0;
291  int errdet_hasTooManyClu = 0;
292  int errdet_hasExclFed = 0;
293  int errdet_hasDcsErr = 0;
294 
295  int ston_stat = 1;
296  int lnum = atoi(dname.substr(dname.find_last_of("_")+1).c_str());
297  ndet = cabling->connectedNumber(mes.detectorTag, lnum);
298 
299  getModuleStatus(dqm_store, meVec, errdet, errdet_hasBadChan, errdet_hasTooManyDigis, errdet_hasTooManyClu, errdet_hasExclFed, errdet_hasDcsErr);
300 
301  for (auto const* me : meVec) {
302  if (!me) continue;
303  std::vector<QReport *> reports = me->getQReports();
304 
305  if (reports.empty()) continue;
306  std::string name = me->getName();
307 
308  if( name.find("Summary_ClusterStoNCorr__OnTrack") != std::string::npos){
309  int istat = SiStripUtility::getMEStatus(me);
310  if (reports[0]->getQTresult() == -1) {
311  ston_stat = -1;
312  } else {
313  if (istat == dqm::qstatus::ERROR) ston_stat = 0;
314  else if (istat == dqm::qstatus::STATUS_OK) ston_stat = 1;
315  }
316  }
317  }
318  if (ndet > 0) {
319  float eff_fac = 1 - (errdet*1.0/ndet);
320  float eff_fac_hasBadChan = 1 - (errdet_hasBadChan *1.0/ndet);
321  float eff_fac_hasTooManyDigis = 1 - (errdet_hasTooManyDigis*1.0/ndet);
322  float eff_fac_hasTooManyClu = 1 - (errdet_hasTooManyClu *1.0/ndet);
323  float eff_fac_hasExclFed = 1 - (errdet_hasExclFed *1.0/ndet);
324  float eff_fac_hasDcsErr = 1 - (errdet_hasDcsErr *1.0/ndet);
325  fillStatusHistogram(SToNReportMap, xbin, ybin, ston_stat);
326  fillStatusHistogram(DetFractionReportMap, xbin, ybin, eff_fac);
327  fillStatusHistogram(DetFractionReportMap_hasBadChan , xbin, ybin, eff_fac_hasBadChan );
328  fillStatusHistogram(DetFractionReportMap_hasTooManyDigis, xbin, ybin, eff_fac_hasTooManyDigis);
329  fillStatusHistogram(DetFractionReportMap_hasTooManyClu , xbin, ybin, eff_fac_hasTooManyClu );
330  fillStatusHistogram(DetFractionReportMap_hasExclFed , xbin, ybin, eff_fac_hasExclFed );
331  fillStatusHistogram(DetFractionReportMap_hasDcsErr , xbin, ybin, eff_fac_hasDcsErr );
332  if (ston_stat < 0) fillStatusHistogram(SummaryReportMap, xbin, ybin, eff_fac);
333  else fillStatusHistogram(SummaryReportMap, xbin, ybin, ston_stat*eff_fac);
334 
335  tot_ndet += ndet;
336  tot_errdet += errdet;
337  tot_ston_stat += ston_stat;
338  }
339  dqm_store.cd(dname);
340  }
341  if (tot_ndet > 0) {
342  float tot_eff_fac = 1 - (tot_errdet*1.0/tot_ndet);
343  if (mes.DetFraction) mes.DetFraction->Fill(tot_eff_fac);
344  float tot_ston_fac = tot_ston_stat/ybin;
345  if (mes.SToNFlag) 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) mes.SummaryFlag->Fill(gflag);
352  }
353 }
T getUntrackedParameter(std::string const &, T const &) const
std::vector< MonitorElement * > getContents(std::string const &path) const
Definition: DQMStore.cc:1640
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
std::vector< std::string > getSubdirs() const
Definition: DQMStore.cc:1564
MonitorElement * DetFractionReportMap
MonitorElement * DetFractionReportMap_hasTooManyClu
void cd()
go to top directory (ie. root)
Definition: DQMStore.cc:546
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, lumiPlot::currentdir, MonitorElement::DQM_KIND_TPROFILE, MonitorElement::DQM_KIND_TPROFILE2D, RemoveAddSevLevel::flag, DQMStore::get(), TkDetMap::getDetFromBin(), SiStripUtility::getMEValue(), MonitorElement::getName(), MonitorElement::getQReports(), MonitorElement::kind(), dataset::name, DQMStore::pwd(), SiStripUtility::setBadModuleFlag(), AlCaHLTBitMon_QueryRunRegistry::string, tkDetMap_, and globals_cff::x1.

Referenced by fillSubDetStatus().

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

Definition at line 528 of file SiStripQualityChecker.cc.

References badModuleList.

Referenced by fillDetectorStatus().

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

Definition at line 357 of file SiStripQualityChecker.cc.

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

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

Definition at line 185 of file SiStripQualityChecker.cc.

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

Referenced by fillDummyStatus().

185  {
186  if (bookedStripStatus_) {
187  for (auto& pr : SubDetMEsMap) {
188  auto& local_mes = pr.second;
189  local_mes.DetFraction -> Reset();
190  local_mes.SummaryFlag -> Reset();
191  local_mes.SToNFlag -> Reset();
192  }
200  SToNReportMap->Reset();
201 
203  }
204 }
MonitorElement * DetFractionReportMap_hasTooManyDigis
std::map< std::string, SubDetMEs > SubDetMEsMap
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
void Reset(std::vector< TH2F > &depth)
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 70 of file SiStripQualityChecker.h.

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

MonitorElement* SiStripQualityChecker::DetFractionReportMap_hasBadChan { 0 }
private

Definition at line 71 of file SiStripQualityChecker.h.

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

MonitorElement* SiStripQualityChecker::DetFractionReportMap_hasDcsErr { 0 }
private

Definition at line 75 of file SiStripQualityChecker.h.

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

MonitorElement* SiStripQualityChecker::DetFractionReportMap_hasExclFed { 0 }
private

Definition at line 74 of file SiStripQualityChecker.h.

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

MonitorElement* SiStripQualityChecker::DetFractionReportMap_hasTooManyClu { 0 }
private

Definition at line 73 of file SiStripQualityChecker.h.

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

MonitorElement* SiStripQualityChecker::DetFractionReportMap_hasTooManyDigis { 0 }
private

Definition at line 72 of file SiStripQualityChecker.h.

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

edm::ParameterSet const SiStripQualityChecker::pSet_
private

Definition at line 84 of file SiStripQualityChecker.h.

Referenced by fillStatus(), and fillSubDetStatus().

MonitorElement* SiStripQualityChecker::SToNReportMap { 0 }
private

Definition at line 76 of file SiStripQualityChecker.h.

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

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

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

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

const TkDetMap* SiStripQualityChecker::tkDetMap_
private

Definition at line 88 of file SiStripQualityChecker.h.

Referenced by fillStatus(), and getModuleStatus().

MonitorElement* SiStripQualityChecker::TrackSummaryReportGlobal { 0 }
private

Definition at line 80 of file SiStripQualityChecker.h.

MonitorElement* SiStripQualityChecker::TrackSummaryReportMap { 0 }
private

Definition at line 79 of file SiStripQualityChecker.h.