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)
 
virtual ~SiStripQualityChecker ()
 

Private Member Functions

void fillDetectorStatus (DQMStore *dqm_store, const edm::ESHandle< SiStripDetCabling > &cabling)
 
void fillDetectorStatusAtLumi (DQMStore *dqm_store)
 
void fillStatusHistogram (MonitorElement *, 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_
 
float cutoffChi2overDoF_
 
float cutoffRecHits_
 
float cutoffTrackRate_
 
MonitorElementDetFractionReportMap
 
MonitorElementDetFractionReportMap_hasBadChan
 
MonitorElementDetFractionReportMap_hasDcsErr
 
MonitorElementDetFractionReportMap_hasExclFed
 
MonitorElementDetFractionReportMap_hasTooManyClu
 
MonitorElementDetFractionReportMap_hasTooManyDigis
 
int globalStatusFilling_
 
edm::ParameterSet pSet_
 
MonitorElementSToNReportMap
 
std::map< std::string, std::string > SubDetFolderMap
 
std::map< std::string, SubDetMEsSubDetMEsMap
 
MonitorElementSummaryReportGlobal
 
MonitorElementSummaryReportMap
 
const TkDetMaptkDetMap_
 
MonitorElementTrackSummaryReportGlobal
 
MonitorElementTrackSummaryReportMap
 
bool useGoodTracks_
 

Detailed Description

Definition at line 21 of file SiStripQualityChecker.h.

Constructor & Destructor Documentation

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

Definition at line 26 of file SiStripQualityChecker.cc.

References badModuleList, bookedStripStatus_, and SubDetFolderMap.

26  :pSet_(ps) {
27  edm::LogInfo("SiStripQualityChecker") <<
28  " Creating SiStripQualityChecker " << "\n" ;
29 
30  bookedStripStatus_ = false;
31 
32  SubDetFolderMap.insert(std::pair<std::string, std::string>("TIB", "TIB"));
33  SubDetFolderMap.insert(std::pair<std::string, std::string>("TOB", "TOB"));
34  SubDetFolderMap.insert(std::pair<std::string, std::string>("TECF", "TEC/PLUS"));
35  SubDetFolderMap.insert(std::pair<std::string, std::string>("TECB", "TEC/MINUS"));
36  SubDetFolderMap.insert(std::pair<std::string, std::string>("TIDF", "TID/PLUS"));
37  SubDetFolderMap.insert(std::pair<std::string, std::string>("TIDB", "TID/MINUS"));
38  badModuleList.clear();
39 }
std::map< std::string, std::string > SubDetFolderMap
std::map< uint32_t, uint16_t > badModuleList
SiStripQualityChecker::~SiStripQualityChecker ( )
virtual

Definition at line 43 of file SiStripQualityChecker.cc.

43  {
44  edm::LogInfo("SiStripQualityChecker") <<
45  " Deleting SiStripQualityChecker " << "\n" ;
46 }

Member Function Documentation

void SiStripQualityChecker::bookStatus ( DQMStore dqm_store)

Definition at line 50 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(), MonitorElement::setAxisTitle(), MonitorElement::setBinLabel(), DQMStore::setCurrentFolder(), SiStripQualityChecker::SubDetMEs::SToNFlag, SToNReportMap, AlCaHLTBitMon_QueryRunRegistry::string, SubDetFolderMap, SubDetMEsMap, SiStripQualityChecker::SubDetMEs::SummaryFlag, SummaryReportGlobal, and SummaryReportMap.

Referenced by SiStripActionExecutor::createStatus(), fillStatus(), and fillStatusAtLumi().

50  {
51 
52  if (!bookedStripStatus_) {
53  dqm_store->cd();
54  std::string strip_dir = "";
55  SiStripUtility::getTopFolderPath(dqm_store, "SiStrip", strip_dir);
56  if (strip_dir.empty()) strip_dir = "SiStrip";
57 
58  // Non Standard Plots and should be put outside EventInfo folder
59 
60  dqm_store->setCurrentFolder(strip_dir+"/MechanicalView");
61 
62  std::string hname, htitle;
63  hname = "detFractionReportMap";
64  htitle = "SiStrip Report for Good Detector Fraction";
65  DetFractionReportMap = dqm_store->book2D(hname, htitle, 6,0.5,6.5,9,0.5,9.5);
66  DetFractionReportMap->setAxisTitle("Sub Detector Type", 1);
67  DetFractionReportMap->setAxisTitle("Layer/Disc Number", 2);
68 
69  hname = "detFractionReportMap_hasBadChan";
70  htitle = "SiStrip Report for Good Detector Fraction due to bad channels";
71  DetFractionReportMap_hasBadChan = dqm_store->book2D(hname, htitle, 6,0.5,6.5,9,0.5,9.5);
72  DetFractionReportMap_hasBadChan->setAxisTitle("Sub Detector Type", 1);
73  DetFractionReportMap_hasBadChan->setAxisTitle("Layer/Disc Number", 2);
74  hname = "detFractionReportMap_hasTooManyDigis";
75  htitle = "SiStrip Report for Good Detector Fraction due to too many digis";
76  DetFractionReportMap_hasTooManyDigis = 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";
81  DetFractionReportMap_hasTooManyClu = dqm_store->book2D(hname, htitle, 6,0.5,6.5,9,0.5,9.5);
82  DetFractionReportMap_hasTooManyClu->setAxisTitle("Sub Detector Type", 1);
83  DetFractionReportMap_hasTooManyClu->setAxisTitle("Layer/Disc Number", 2);
84  hname = "detFractionReportMap_hasExclFed";
85  htitle = "SiStrip Report for Good Detector Fraction due to excluded FEDs";
86  DetFractionReportMap_hasExclFed = dqm_store->book2D(hname, htitle, 6,0.5,6.5,9,0.5,9.5);
87  DetFractionReportMap_hasExclFed->setAxisTitle("Sub Detector Type", 1);
88  DetFractionReportMap_hasExclFed->setAxisTitle("Layer/Disc Number", 2);
89  hname = "detFractionReportMap_hasDcsErr";
90  htitle = "SiStrip Report for Good Detector Fraction due to DCS errors";
91  DetFractionReportMap_hasDcsErr = dqm_store->book2D(hname, htitle, 6,0.5,6.5,9,0.5,9.5);
92  DetFractionReportMap_hasDcsErr->setAxisTitle("Sub Detector Type", 1);
93  DetFractionReportMap_hasDcsErr->setAxisTitle("Layer/Disc Number", 2);
94 
95  hname = "sToNReportMap";
96  htitle = "SiStrip Report for Signal-to-Noise";
97  SToNReportMap = dqm_store->book2D(hname, htitle, 6,0.5,6.5,9,0.5,9.5);
98  SToNReportMap->setAxisTitle("Sub Detector Type", 1);
99  SToNReportMap->setAxisTitle("Layer/Disc Number", 2);
100 
101  // this is the main reportSummary 2D plot and should be in EventInfo
102  dqm_store->setCurrentFolder(strip_dir+"/EventInfo");
103 
104  hname = "reportSummaryMap";
105  htitle = "SiStrip Report Summary Map";
106  SummaryReportMap = dqm_store->book2D(hname, htitle, 6,0.5,6.5,9,0.5,9.5);
107  SummaryReportMap->setAxisTitle("Sub Detector Type", 1);
108  SummaryReportMap->setAxisTitle("Layer/Disc Number", 2);
109 
110  SummaryReportGlobal = dqm_store->bookFloat("reportSummary");
111  int ibin = 0;
112 
113  dqm_store->setCurrentFolder(strip_dir+"/EventInfo/reportSummaryContents");
114  for (std::map<std::string, std::string>::const_iterator it = SubDetFolderMap.begin();
115  it != SubDetFolderMap.end(); it++) {
116  ibin++;
117  std::string det = it->first;
118  DetFractionReportMap->setBinLabel(ibin,it->second);
119  DetFractionReportMap_hasBadChan ->setBinLabel(ibin,it->second);
122  DetFractionReportMap_hasExclFed ->setBinLabel(ibin,it->second);
123  DetFractionReportMap_hasDcsErr ->setBinLabel(ibin,it->second);
124  SToNReportMap->setBinLabel(ibin,it->second);
125  SummaryReportMap->setBinLabel(ibin,it->second);
126 
127  SubDetMEs local_mes;
128 
129  if (det == "TECF") local_mes.detectorTag = "TEC+";
130  else if (det == "TECB") local_mes.detectorTag = "TEC-";
131  else if (det == "TIDF") local_mes.detectorTag = "TID+";
132  else if (det == "TIDB") local_mes.detectorTag = "TID-";
133  else local_mes.detectorTag = det;
134 
135  std::string me_name;
136  me_name = "SiStrip_" + det;
137  local_mes.SummaryFlag = dqm_store->bookFloat(me_name);
138 
139  me_name = "SiStrip_DetFraction_" + det;
140  local_mes.DetFraction = dqm_store->bookFloat(me_name);
141 
142  me_name = "SiStrip_SToNFlag_" + det;
143  local_mes.SToNFlag = dqm_store->bookFloat(me_name);
144  SubDetMEsMap.insert(std::pair<std::string, SubDetMEs>(det, local_mes));
145  }
146  bookedStripStatus_ = true;
147  }
148 }
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(const char *name)
Book float.
Definition: DQMStore.cc:819
std::map< std::string, SubDetMEs > SubDetMEsMap
MonitorElement * DetFractionReportMap
MonitorElement * DetFractionReportMap_hasTooManyClu
void cd()
go to top directory (ie. root)
Definition: DQMStore.cc:565
MonitorElement * DetFractionReportMap_hasBadChan
MonitorElement * SummaryReportMap
MonitorElement * SummaryReportGlobal
MonitorElement * SToNReportMap
MonitorElement * DetFractionReportMap_hasExclFed
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
Definition: DQMStore.cc:1010
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 top_dir, std::string &path)
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:588
void SiStripQualityChecker::fillDetectorStatus ( DQMStore dqm_store,
const edm::ESHandle< SiStripDetCabling > &  cabling 
)
private

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

222  {
223  unsigned int xbin = 0;
224  float global_flag = 0;
225  dqm_store->cd();
226  std::string mdir = "MechanicalView";
227  if (!SiStripUtility::goToDir(dqm_store, mdir)) return;
228  std::string mechanicalview_dir = dqm_store->pwd();
229 
231  for (std::map<std::string, SubDetMEs>::const_iterator it = SubDetMEsMap.begin();
232  it != SubDetMEsMap.end(); it++) {
233  std::string det = it->first;
234  std::map<std::string, std::string>::const_iterator cPos = SubDetFolderMap.find(det);
235  if (cPos == SubDetFolderMap.end()) continue;
236  std::string dname = mechanicalview_dir + "/" + cPos->second;
237  if (!dqm_store->dirExists(dname)) continue;
238  dqm_store->cd(dname);
239  SubDetMEs local_mes = it->second;
240  xbin++;
241  float flag;
242  fillSubDetStatus(dqm_store, cabling, local_mes, xbin,flag);
243  global_flag += flag;
244  }
245  global_flag = global_flag/xbin*1.0;
246  if (SummaryReportGlobal) SummaryReportGlobal->Fill(global_flag);
247  dqm_store->cd();
248 }
const std::string & pwd() const
Definition: DQMStore.cc:560
std::map< std::string, std::string > SubDetFolderMap
void Fill(long long x)
std::map< std::string, SubDetMEs > SubDetMEsMap
bool dirExists(const std::string &path) const
true if directory exists
Definition: DQMStore.cc:653
void cd()
go to top directory (ie. root)
Definition: DQMStore.cc:565
MonitorElement * SummaryReportGlobal
void fillSubDetStatus(DQMStore *dqm_store, const edm::ESHandle< SiStripDetCabling > &cabling, SubDetMEs &mes, unsigned int xbin, float &gflag)
static bool goToDir(DQMStore *dqm_store, std::string name)
void SiStripQualityChecker::fillDetectorStatusAtLumi ( DQMStore dqm_store)
private

Definition at line 519 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(), diffTwoXMLs::label, DQMStore::pwd(), AlCaHLTBitMon_QueryRunRegistry::string, SubDetMEsMap, and SummaryReportGlobal.

Referenced by fillStatusAtLumi().

519  {
520 
521 
522 
523  dqm_store->cd();
524  std::string rdir = "ReadoutView";
525  if (!SiStripUtility::goToDir(dqm_store, rdir)) return;
526  std::string fullpath = dqm_store->pwd()
527  // + "/FedSummary/PerLumiSection/"
528  + "/PerLumiSection/"
529  + "lumiErrorFraction";
530  MonitorElement* me = dqm_store->get(fullpath);
531  if (me && me->kind() == MonitorElement::DQM_KIND_TH1F) {
532  TH1F* th1 = me->getTH1F();
533  float global_fraction = 0.0;
534  float dets = 0.0;
535  for (int ibin = 1; ibin <= th1->GetNbinsX(); ibin++) {
536  std::string label = th1->GetXaxis()->GetBinLabel(ibin);
537  std::map<std::string, SubDetMEs>::iterator iPos = SubDetMEsMap.find(label);
538  if (iPos != SubDetMEsMap.end()) {
539  float fraction = 1.0 - th1->GetBinContent(ibin);
540  global_fraction += fraction;
541  dets++;
542  iPos->second.DetFraction -> Fill(fraction);
543  iPos->second.SToNFlag -> Fill(-1.0);
544  iPos->second.SummaryFlag -> Fill(fraction);
545  }
546  }
547  global_fraction = global_fraction/dets;
548  if (SummaryReportGlobal) SummaryReportGlobal->Fill(global_fraction);
549  }
550  dqm_store->cd();
551 }
const std::string & pwd() const
Definition: DQMStore.cc:560
TH1F * getTH1F() const
void Fill(long long x)
std::map< std::string, SubDetMEs > SubDetMEsMap
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. "my/long/dir/my_histo")
Definition: DQMStore.cc:1655
void cd()
go to top directory (ie. root)
Definition: DQMStore.cc:565
MonitorElement * SummaryReportGlobal
static bool goToDir(DQMStore *dqm_store, std::string name)
Kind kind() const
Get the type of the monitor element.
void SiStripQualityChecker::fillDummyStatus ( )

Definition at line 152 of file SiStripQualityChecker.cc.

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

Referenced by SiStripActionExecutor::fillDummyStatus(), fillStatus(), and fillStatusAtLumi().

152  {
153 
154  resetStatus();
155  if (bookedStripStatus_) {
156  for (std::map<std::string, SubDetMEs>::const_iterator it = SubDetMEsMap.begin();
157  it != SubDetMEsMap.end(); it++) {
158  SubDetMEs local_mes = it->second;
159  local_mes.SummaryFlag -> Fill(-1.0);
160  local_mes.DetFraction -> Fill(-1.0);
161  local_mes.SToNFlag -> Fill(-1.0);
162  }
163 
164  for (int xbin = 1; xbin < SummaryReportMap->getNbinsX()+1; xbin++) {
165  for (int ybin = 1; ybin < SummaryReportMap->getNbinsY()+1; ybin++) {
166  SummaryReportMap -> Fill(xbin, ybin, -1.0);
167  DetFractionReportMap -> Fill(xbin, ybin, -1.0);
168  DetFractionReportMap_hasBadChan -> Fill(xbin, ybin, -1.0);
169  DetFractionReportMap_hasTooManyDigis -> Fill(xbin, ybin, -1.0);
170  DetFractionReportMap_hasTooManyClu -> Fill(xbin, ybin, -1.0);
171  DetFractionReportMap_hasExclFed -> Fill(xbin, ybin, -1.0);
172  DetFractionReportMap_hasDcsErr -> Fill(xbin, ybin, -1.0);
173  SToNReportMap -> Fill(xbin, ybin, -1.0);
174  }
175  }
176  SummaryReportGlobal->Fill(-1.0);
177  }
178 }
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 465 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().

465  {
466  if (badModuleList.empty()) return;
467 
468  //Retrieve tracker topology from geometry
469  edm::ESHandle<TrackerTopology> tTopoHandle;
470  eSetup.get<TrackerTopologyRcd>().get(tTopoHandle);
471  const TrackerTopology* const tTopo = tTopoHandle.product();
472 
473  dqm_store->cd();
474  std::string mdir = "MechanicalView";
475  if (!SiStripUtility::goToDir(dqm_store, mdir)) return;
476  std::string mechanical_dir = dqm_store->pwd();
477 
478  SiStripFolderOrganizer folder_organizer;
479  for (std::map<uint32_t,uint16_t>::const_iterator it = badModuleList.begin() ; it != badModuleList.end(); it++) {
480  uint32_t detId = it->first;
481  std::string subdet_folder ;
482  folder_organizer.getSubDetFolder(detId,tTopo,subdet_folder);
483  if (!dqm_store->dirExists(subdet_folder)) {
484  subdet_folder = mechanical_dir + subdet_folder.substr(subdet_folder.find("MechanicalView")+14);
485  if (!dqm_store->dirExists(subdet_folder)) continue;
486  }
487  std::string bad_module_folder = subdet_folder + "/" + "BadModuleList";
488  dqm_store->setCurrentFolder(bad_module_folder);
489 
490  std::ostringstream detid_str;
491  detid_str << detId;
492  std::string full_path = bad_module_folder + "/" + detid_str.str();
493  MonitorElement* me = dqm_store->get(full_path);
494  if (me) me->Reset();
495  else me = dqm_store->bookInt(detid_str.str());
496  me->Fill(it->second);
497  }
498  dqm_store->cd();
499 }
const std::string & pwd() const
Definition: DQMStore.cc:560
void getSubDetFolder(const uint32_t &detid, const TrackerTopology *tTopo, std::string &folder_name)
void Fill(long long x)
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. "my/long/dir/my_histo")
Definition: DQMStore.cc:1655
void Reset()
reset ME (ie. contents, errors, etc)
bool dirExists(const std::string &path) const
true if directory exists
Definition: DQMStore.cc:653
void cd()
go to top directory (ie. root)
Definition: DQMStore.cc:565
const T & get() const
Definition: EventSetup.h:59
std::map< uint32_t, uint16_t > badModuleList
MonitorElement * bookInt(const char *name)
Book int.
Definition: DQMStore.cc:789
static bool goToDir(DQMStore *dqm_store, std::string name)
T const * product() const
Definition: ESHandle.h:86
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:588
void SiStripQualityChecker::fillStatus ( DQMStore dqm_store,
const edm::ESHandle< SiStripDetCabling > &  cabling,
const edm::EventSetup eSetup 
)

Definition at line 206 of file SiStripQualityChecker.cc.

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

Referenced by SiStripActionExecutor::fillStatus().

206  {
207  if (!bookedStripStatus_) bookStatus(dqm_store);
208 
209  edm::ESHandle<TkDetMap> tkMapHandle;
210  eSetup.get<TrackerTopologyRcd>().get(tkMapHandle);
211  tkDetMap_ = tkMapHandle.product();
212 
213  fillDummyStatus();
214  fillDetectorStatus(dqm_store, cabling);
215 
216  int faulty_moduleflag = pSet_.getUntrackedParameter<bool>("PrintFaultyModuleList", false);
217  if (faulty_moduleflag) fillFaultyModuleStatus(dqm_store, eSetup);
218 }
T getUntrackedParameter(std::string const &, T const &) const
void bookStatus(DQMStore *dqm_store)
void fillDetectorStatus(DQMStore *dqm_store, const edm::ESHandle< SiStripDetCabling > &cabling)
void fillFaultyModuleStatus(DQMStore *dqm_store, const edm::EventSetup &eSetup)
const T & get() const
Definition: EventSetup.h:59
T const * product() const
Definition: ESHandle.h:86
void SiStripQualityChecker::fillStatusAtLumi ( DQMStore dqm_store)

Definition at line 511 of file SiStripQualityChecker.cc.

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

Referenced by SiStripActionExecutor::fillStatusAtLumi().

511  {
512  if (!bookedStripStatus_) bookStatus(dqm_store);
513  fillDummyStatus();
514  fillDetectorStatusAtLumi(dqm_store);
515 }
void bookStatus(DQMStore *dqm_store)
void fillDetectorStatusAtLumi(DQMStore *dqm_store)
void SiStripQualityChecker::fillStatusHistogram ( MonitorElement me,
int  xbin,
int  ybin,
float  val 
)
private

Definition at line 456 of file SiStripQualityChecker.cc.

References MonitorElement::DQM_KIND_TH2F, MonitorElement::getTH2F(), and MonitorElement::kind().

Referenced by fillSubDetStatus().

456  {
457  if (me && me->kind() == MonitorElement::DQM_KIND_TH2F) {
458  TH2F* th2d = me->getTH2F();
459  th2d->SetBinContent(xbin, ybin, val);
460  }
461  }
TH2F * getTH2F() const
Kind kind() const
Get the type of the monitor element.
void SiStripQualityChecker::fillSubDetStatus ( DQMStore dqm_store,
const edm::ESHandle< SiStripDetCabling > &  cabling,
SubDetMEs mes,
unsigned int  xbin,
float &  gflag 
)
private

Definition at line 252 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(), MonitorElement::getName(), MonitorElement::getQReports(), 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().

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

379  {
380 
381  std::string lname;
382  std::map<uint32_t,uint16_t> bad_modules;
383  for (std::vector<MonitorElement*>::const_iterator it = layer_mes.begin();
384  it != layer_mes.end(); it++) {
385  MonitorElement * me = (*it);
386  if (!me) continue;
387  std::vector<QReport *> qreports = me->getQReports();
388  if (qreports.empty()) continue;
389  std::string name = me->getName();
390  std::vector<DQMChannel> bad_channels_me;
392  bad_channels_me = qreports[0]->getBadChannels();
393  lname = "";
394  } else if (me->kind() == MonitorElement::DQM_KIND_TPROFILE2D && name.find("TkHMap") != std::string::npos) {
395  bad_channels_me = qreports[0]->getBadChannels();
396  lname = name.substr(name.find("TkHMap_")+7);
397  lname = lname.substr(lname.find("_T")+1);
398 
399  }
400  for (std::vector<DQMChannel>::iterator it = bad_channels_me.begin(); it != bad_channels_me.end(); it++){
401  int xval = (*it).getBinX();
402  int yval = (*it).getBinY();
403  uint32_t detId = tkDetMap_->getDetFromBin(lname, xval, yval);
404  std::map<uint32_t,uint16_t>::iterator iPos = bad_modules.find(detId);
405  uint16_t flag;
406  if (iPos != bad_modules.end()){
407  flag = iPos->second;
409  iPos->second = flag;
410  } else {
411  //
412  //if not in the local bad module list, check the BadModuleList dir
413  //
414  std::ostringstream detid_str;
415  detid_str << detId;
416  //now in the layer/wheel dir
417  const std::string& currentdir = dqm_store->pwd();
418  std::string thisMEpath = currentdir.substr( 0 , currentdir.rfind( "/" ) ) + "/BadModuleList/" + detid_str.str() ;
419 
420  MonitorElement *meBadModule = dqm_store->get ( thisMEpath );
421  if ( meBadModule )
422  {
423  std::string val_str;
424  SiStripUtility::getMEValue ( meBadModule , val_str );
425  flag = atoi ( val_str.c_str() );
426  }
427  else
428  flag = 0;
429 
431  bad_modules.insert(std::pair<uint32_t,uint16_t>(detId,flag));
432  }
433  }
434  }
435  for(std::map<uint32_t,uint16_t>::const_iterator it = bad_modules.begin();
436  it != bad_modules.end(); it++) {
437  uint32_t detId = it->first;
438  uint16_t flag = it->second;
439  if (((flag >> 0) & 0x1) > 0) errdet_hasBadChan++;
440  if (((flag >> 1) & 0x1) > 0) errdet_hasTooManyDigis++;
441  if (((flag >> 2) & 0x1) > 0) errdet_hasTooManyClu++;
442  if (((flag >> 3) & 0x1) > 0) errdet_hasExclFed++;
443  if (((flag >> 4) & 0x1) > 0) errdet_hasDcsErr++;
444  std::map<uint32_t,uint16_t>::iterator iPos = badModuleList.find(detId);
445  if (iPos != badModuleList.end()){
446  iPos->second = flag;
447  } else {
448  badModuleList.insert(std::pair<uint32_t,uint16_t>(detId,flag));
449  }
450  }
451  errdet = bad_modules.size();
452 }
static void setBadModuleFlag(std::string &hname, uint16_t &flg)
const std::string & pwd() const
Definition: DQMStore.cc:560
static void getMEValue(MonitorElement *me, std::string &val)
const std::string & getName() const
get name of ME
currentdir
parse figure configuration if found
Definition: lumiPlot.py:48
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. "my/long/dir/my_histo")
Definition: DQMStore.cc:1655
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 503 of file SiStripQualityChecker.cc.

References badModuleList.

Referenced by fillDetectorStatus().

503  {
504  for (std::map<uint32_t,uint16_t>::iterator it=badModuleList.begin(); it!=badModuleList.end(); it++) {
505  it->second = 0;
506  }
507 }
std::map< uint32_t, uint16_t > badModuleList
void SiStripQualityChecker::printStatusReport ( )

Definition at line 348 of file SiStripQualityChecker.cc.

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

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

Definition at line 182 of file SiStripQualityChecker.cc.

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

Referenced by fillDummyStatus().

182  {
183  if (bookedStripStatus_) {
184  for (std::map<std::string, SubDetMEs>::const_iterator it = SubDetMEsMap.begin();
185  it != SubDetMEsMap.end(); it++) {
186  SubDetMEs local_mes = it->second;
187  local_mes.DetFraction -> Reset();
188  local_mes.SummaryFlag -> Reset();
189  local_mes.SToNFlag -> Reset();
190  }
198  SToNReportMap->Reset();
199 
201  }
202 }
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_
private
float SiStripQualityChecker::cutoffChi2overDoF_
private

Definition at line 85 of file SiStripQualityChecker.h.

float SiStripQualityChecker::cutoffRecHits_
private

Definition at line 86 of file SiStripQualityChecker.h.

float SiStripQualityChecker::cutoffTrackRate_
private

Definition at line 84 of file SiStripQualityChecker.h.

MonitorElement* SiStripQualityChecker::DetFractionReportMap
private

Definition at line 59 of file SiStripQualityChecker.h.

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

MonitorElement* SiStripQualityChecker::DetFractionReportMap_hasBadChan
private

Definition at line 60 of file SiStripQualityChecker.h.

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

MonitorElement* SiStripQualityChecker::DetFractionReportMap_hasDcsErr
private

Definition at line 64 of file SiStripQualityChecker.h.

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

MonitorElement* SiStripQualityChecker::DetFractionReportMap_hasExclFed
private

Definition at line 63 of file SiStripQualityChecker.h.

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

MonitorElement* SiStripQualityChecker::DetFractionReportMap_hasTooManyClu
private

Definition at line 62 of file SiStripQualityChecker.h.

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

MonitorElement* SiStripQualityChecker::DetFractionReportMap_hasTooManyDigis
private

Definition at line 61 of file SiStripQualityChecker.h.

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

int SiStripQualityChecker::globalStatusFilling_
private

Definition at line 79 of file SiStripQualityChecker.h.

edm::ParameterSet SiStripQualityChecker::pSet_
private

Definition at line 76 of file SiStripQualityChecker.h.

Referenced by fillStatus(), and fillSubDetStatus().

MonitorElement* SiStripQualityChecker::SToNReportMap
private

Definition at line 65 of file SiStripQualityChecker.h.

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

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

Definition at line 57 of file SiStripQualityChecker.h.

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

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

Definition at line 66 of file SiStripQualityChecker.h.

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

const TkDetMap* SiStripQualityChecker::tkDetMap_
private

Definition at line 82 of file SiStripQualityChecker.h.

Referenced by fillStatus(), and getModuleStatus().

MonitorElement* SiStripQualityChecker::TrackSummaryReportGlobal
private

Definition at line 72 of file SiStripQualityChecker.h.

MonitorElement* SiStripQualityChecker::TrackSummaryReportMap
private

Definition at line 70 of file SiStripQualityChecker.h.

bool SiStripQualityChecker::useGoodTracks_
private

Definition at line 80 of file SiStripQualityChecker.h.