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
 
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_, Utilities::operator, SubDetFolderMap, and tkDetMap_.

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 
40  if(!edm::Service<TkDetMap>().isAvailable()){
41  edm::LogError("TkHistoMap") <<
42  "\n------------------------------------------"
43  "\nUnAvailable Service TkHistoMap: please insert in the configuration file an instance like"
44  "\n\tprocess.TkDetMap = cms.Service(\"TkDetMap\")"
45  "\n------------------------------------------";
46  }
48 
49 }
std::map< std::string, std::string > SubDetFolderMap
std::map< uint32_t, uint16_t > badModuleList
SiStripQualityChecker::~SiStripQualityChecker ( )
virtual

Definition at line 53 of file SiStripQualityChecker.cc.

53  {
54  edm::LogInfo("SiStripQualityChecker") <<
55  " Deleting SiStripQualityChecker " << "\n" ;
56 }

Member Function Documentation

void SiStripQualityChecker::bookStatus ( DQMStore dqm_store)

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

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

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

228  {
229  unsigned int xbin = 0;
230  float global_flag = 0;
231  dqm_store->cd();
232  std::string mdir = "MechanicalView";
233  if (!SiStripUtility::goToDir(dqm_store, mdir)) return;
234  std::string mechanicalview_dir = dqm_store->pwd();
235 
237  for (std::map<std::string, SubDetMEs>::const_iterator it = SubDetMEsMap.begin();
238  it != SubDetMEsMap.end(); it++) {
239  std::string det = it->first;
240  std::map<std::string, std::string>::const_iterator cPos = SubDetFolderMap.find(det);
241  if (cPos == SubDetFolderMap.end()) continue;
242  std::string dname = mechanicalview_dir + "/" + cPos->second;
243  if (!dqm_store->dirExists(dname)) continue;
244  dqm_store->cd(dname);
245  SubDetMEs local_mes = it->second;
246  xbin++;
247  float flag;
248  fillSubDetStatus(dqm_store, cabling, local_mes, xbin,flag);
249  global_flag += flag;
250  }
251  global_flag = global_flag/xbin*1.0;
252  if (SummaryReportGlobal) SummaryReportGlobal->Fill(global_flag);
253  dqm_store->cd();
254 }
std::map< std::string, std::string > SubDetFolderMap
void cd(void)
go to top directory (ie. root)
Definition: DQMStore.cc:718
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:806
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)
const std::string & pwd(void) const
Definition: DQMStore.cc:713
void SiStripQualityChecker::fillDetectorStatusAtLumi ( DQMStore dqm_store)
private

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

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

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

162  {
163 
164  resetStatus();
165  if (bookedStripStatus_) {
166  for (std::map<std::string, SubDetMEs>::const_iterator it = SubDetMEsMap.begin();
167  it != SubDetMEsMap.end(); it++) {
168  SubDetMEs local_mes = it->second;
169  local_mes.SummaryFlag -> Fill(-1.0);
170  local_mes.DetFraction -> Fill(-1.0);
171  local_mes.SToNFlag -> Fill(-1.0);
172  }
173 
174  for (int xbin = 1; xbin < SummaryReportMap->getNbinsX()+1; xbin++) {
175  for (int ybin = 1; ybin < SummaryReportMap->getNbinsY()+1; ybin++) {
176  SummaryReportMap -> Fill(xbin, ybin, -1.0);
177  DetFractionReportMap -> Fill(xbin, ybin, -1.0);
178  DetFractionReportMap_hasBadChan -> Fill(xbin, ybin, -1.0);
179  DetFractionReportMap_hasTooManyDigis -> Fill(xbin, ybin, -1.0);
180  DetFractionReportMap_hasTooManyClu -> Fill(xbin, ybin, -1.0);
181  DetFractionReportMap_hasExclFed -> Fill(xbin, ybin, -1.0);
182  DetFractionReportMap_hasDcsErr -> Fill(xbin, ybin, -1.0);
183  SToNReportMap -> Fill(xbin, ybin, -1.0);
184  }
185  }
186  SummaryReportGlobal->Fill(-1.0);
187  }
188 }
MonitorElement * DetFractionReportMap_hasTooManyDigis
int getNbinsY(void) const
get # of bins in Y-axis
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
MonitorElement * SummaryReportGlobal
MonitorElement * SToNReportMap
MonitorElement * DetFractionReportMap_hasExclFed
int getNbinsX(void) const
get # of bins in X-axis
MonitorElement * DetFractionReportMap_hasDcsErr
void SiStripQualityChecker::fillFaultyModuleStatus ( DQMStore dqm_store,
const edm::EventSetup eSetup 
)

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

471  {
472  if (badModuleList.empty()) return;
473 
474  //Retrieve tracker topology from geometry
475  edm::ESHandle<TrackerTopology> tTopoHandle;
476  eSetup.get<TrackerTopologyRcd>().get(tTopoHandle);
477  const TrackerTopology* const tTopo = tTopoHandle.product();
478 
479  dqm_store->cd();
480  std::string mdir = "MechanicalView";
481  if (!SiStripUtility::goToDir(dqm_store, mdir)) return;
482  std::string mechanical_dir = dqm_store->pwd();
483 
484  SiStripFolderOrganizer folder_organizer;
485  for (std::map<uint32_t,uint16_t>::const_iterator it = badModuleList.begin() ; it != badModuleList.end(); it++) {
486  uint32_t detId = it->first;
487  std::string subdet_folder ;
488  folder_organizer.getSubDetFolder(detId,tTopo,subdet_folder);
489  if (!dqm_store->dirExists(subdet_folder)) {
490  subdet_folder = mechanical_dir + subdet_folder.substr(subdet_folder.find("MechanicalView")+14);
491  if (!dqm_store->dirExists(subdet_folder)) continue;
492  }
493  std::string bad_module_folder = subdet_folder + "/" + "BadModuleList";
494  dqm_store->setCurrentFolder(bad_module_folder);
495 
496  std::ostringstream detid_str;
497  detid_str << detId;
498  std::string full_path = bad_module_folder + "/" + detid_str.str();
499  MonitorElement* me = dqm_store->get(full_path);
500  if (me) me->Reset();
501  else me = dqm_store->bookInt(detid_str.str());
502  me->Fill(it->second);
503  }
504  dqm_store->cd();
505 }
void getSubDetFolder(const uint32_t &detid, const TrackerTopology *tTopo, std::string &folder_name)
void cd(void)
go to top directory (ie. root)
Definition: DQMStore.cc:718
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:1807
bool dirExists(const std::string &path) const
true if directory exists
Definition: DQMStore.cc:806
const T & get() const
Definition: EventSetup.h:55
std::map< uint32_t, uint16_t > badModuleList
MonitorElement * bookInt(const char *name)
Book int.
Definition: DQMStore.cc:942
void Reset(void)
reset ME (ie. contents, errors, etc)
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:741
const std::string & pwd(void) const
Definition: DQMStore.cc:713
void SiStripQualityChecker::fillStatus ( DQMStore dqm_store,
const edm::ESHandle< SiStripDetCabling > &  cabling,
const edm::EventSetup eSetup 
)

Definition at line 216 of file SiStripQualityChecker.cc.

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

Referenced by SiStripActionExecutor::fillStatus().

216  {
217  if (!bookedStripStatus_) bookStatus(dqm_store);
218 
219  fillDummyStatus();
220  fillDetectorStatus(dqm_store, cabling);
221 
222  int faulty_moduleflag = pSet_.getUntrackedParameter<bool>("PrintFaultyModuleList", false);
223  if (faulty_moduleflag) fillFaultyModuleStatus(dqm_store, eSetup);
224 }
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)
void SiStripQualityChecker::fillStatusAtLumi ( DQMStore dqm_store)

Definition at line 517 of file SiStripQualityChecker.cc.

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

Referenced by SiStripActionExecutor::fillStatusAtLumi().

517  {
518  if (!bookedStripStatus_) bookStatus(dqm_store);
519  fillDummyStatus();
520  fillDetectorStatusAtLumi(dqm_store);
521 }
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 462 of file SiStripQualityChecker.cc.

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

Referenced by fillSubDetStatus().

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

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

260  {
261 
262  int status_flag = pSet_.getUntrackedParameter<int>("GlobalStatusFilling", 1);
263  if (status_flag < 1) return;
264 
265  std::vector<std::string> subDirVec = dqm_store->getSubdirs();
266 
267  unsigned int ybin = 0;
268  int tot_ndet = 0;
269  int tot_errdet = 0;
270  float tot_ston_stat = 0;
271 
272  for (std::vector<std::string>::const_iterator ic = subDirVec.begin();
273  ic != subDirVec.end(); ic++) {
274  std::string dname = (*ic);
275  if (dname.find("BadModuleList") != std::string::npos) continue;
276  if (dname.find("ring") !=std::string::npos) continue;
277  std::vector<MonitorElement*> meVec;
278 
279  ybin++;
280  dqm_store->cd((*ic));
281  meVec = dqm_store->getContents((*ic));
282  uint16_t ndet = 100;
283  int errdet = 0;
284  int errdet_hasBadChan = 0;
285  int errdet_hasTooManyDigis = 0;
286  int errdet_hasTooManyClu = 0;
287  int errdet_hasExclFed = 0;
288  int errdet_hasDcsErr = 0;
289 
290  int ston_stat = 1;
291  int lnum = atoi(dname.substr(dname.find_last_of("_")+1).c_str());
292  ndet = cabling->connectedNumber(mes.detectorTag, lnum);
293 
294  getModuleStatus(dqm_store, meVec, errdet, errdet_hasBadChan, errdet_hasTooManyDigis, errdet_hasTooManyClu, errdet_hasExclFed, errdet_hasDcsErr);
295 
296  for (std::vector<MonitorElement*>::const_iterator it = meVec.begin();
297  it != meVec.end(); it++) {
298  MonitorElement * me = (*it);
299  if (!me) continue;
300  std::vector<QReport *> reports = me->getQReports();
301 
302  if (reports.empty()) continue;
303  std::string name = me->getName();
304 
305  if( name.find("Summary_ClusterStoNCorr__OnTrack") != std::string::npos){
306  int istat = SiStripUtility::getMEStatus((*it));
307  if (reports[0]->getQTresult() == -1) {
308  ston_stat =-1;
309  } else {
310  if (istat == dqm::qstatus::ERROR) ston_stat = 0;
311  else if (istat == dqm::qstatus::STATUS_OK) 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) fillStatusHistogram(SummaryReportMap, xbin, ybin, eff_fac);
330  else fillStatusHistogram(SummaryReportMap, xbin, ybin, ston_stat*eff_fac);
331 
332  tot_ndet += ndet;
333  tot_errdet += errdet;
334  tot_ston_stat += ston_stat;
335  }
336  dqm_store->cd((*ic));
337  }
338  if (tot_ndet > 0) {
339  float tot_eff_fac = 1 - (tot_errdet*1.0/tot_ndet);
340  if (mes.DetFraction) mes.DetFraction->Fill(tot_eff_fac);
341  float tot_ston_fac = tot_ston_stat/ybin;
342  if (mes.SToNFlag) mes.SToNFlag->Fill(tot_ston_fac);
343  if (tot_ston_fac < 0){
344  gflag = tot_eff_fac;
345  }else{
346  gflag = std::min(tot_eff_fac,tot_ston_fac);
347  }
348  if (mes.SummaryFlag) mes.SummaryFlag->Fill(gflag);
349  }
350 }
T getUntrackedParameter(std::string const &, T const &) const
const std::string & getName(void) const
get name of ME
std::vector< std::string > getSubdirs(void) const
Definition: DQMStore.cc:1758
void cd(void)
go to top directory (ie. root)
Definition: DQMStore.cc:718
MonitorElement * DetFractionReportMap_hasTooManyDigis
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:1836
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)
std::vector< QReport * > getQReports(void) const
get map of QReports
static int getMEStatus(MonitorElement *me)
MonitorElement * DetFractionReportMap_hasBadChan
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 385 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().

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

Definition at line 509 of file SiStripQualityChecker.cc.

References badModuleList.

Referenced by fillDetectorStatus().

509  {
510  for (std::map<uint32_t,uint16_t>::iterator it=badModuleList.begin(); it!=badModuleList.end(); it++) {
511  it->second = 0;
512  }
513 }
std::map< uint32_t, uint16_t > badModuleList
void SiStripQualityChecker::printStatusReport ( )

Definition at line 354 of file SiStripQualityChecker.cc.

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

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

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

192  {
193  if (bookedStripStatus_) {
194  for (std::map<std::string, SubDetMEs>::const_iterator it = SubDetMEsMap.begin();
195  it != SubDetMEsMap.end(); it++) {
196  SubDetMEs local_mes = it->second;
197  local_mes.DetFraction -> Reset();
198  local_mes.SummaryFlag -> Reset();
199  local_mes.SToNFlag -> Reset();
200  }
208  SToNReportMap->Reset();
209 
211  }
212 }
MonitorElement * DetFractionReportMap_hasTooManyDigis
std::map< std::string, SubDetMEs > SubDetMEsMap
MonitorElement * DetFractionReportMap
MonitorElement * DetFractionReportMap_hasTooManyClu
MonitorElement * DetFractionReportMap_hasBadChan
MonitorElement * SummaryReportMap
MonitorElement * SummaryReportGlobal
MonitorElement * SToNReportMap
MonitorElement * DetFractionReportMap_hasExclFed
void Reset(std::vector< TH2F > &depth)
void Reset(void)
reset ME (ie. contents, errors, etc)
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().

TkDetMap* SiStripQualityChecker::tkDetMap_
private

Definition at line 82 of file SiStripQualityChecker.h.

Referenced by getModuleStatus(), and SiStripQualityChecker().

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.