CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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)
 
void initialiseBadModuleList ()
 

Private Attributes

std::map< uint32_t, uint16_t > badModuleList
 
bool bookedStripStatus_
 
float cutoffChi2overDoF_
 
float cutoffRecHits_
 
float cutoffTrackRate_
 
MonitorElementDetFractionReportMap
 
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_, cppFunctionSkipper::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, 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.size() == 0) 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  hname = "sToNReportMap";
79  htitle = "SiStrip Report for Signal-to-Noise";
80  SToNReportMap = dqm_store->book2D(hname, htitle, 6,0.5,6.5,9,0.5,9.5);
81  SToNReportMap->setAxisTitle("Sub Detector Type", 1);
82  SToNReportMap->setAxisTitle("Layer/Disc Number", 2);
83 
84  // this is the main reportSummary 2D plot and should be in EventInfo
85  dqm_store->setCurrentFolder(strip_dir+"/EventInfo");
86 
87  hname = "reportSummaryMap";
88  htitle = "SiStrip Report Summary Map";
89  SummaryReportMap = dqm_store->book2D(hname, htitle, 6,0.5,6.5,9,0.5,9.5);
90  SummaryReportMap->setAxisTitle("Sub Detector Type", 1);
91  SummaryReportMap->setAxisTitle("Layer/Disc Number", 2);
92 
93  SummaryReportGlobal = dqm_store->bookFloat("reportSummary");
94  int ibin = 0;
95 
96  dqm_store->setCurrentFolder(strip_dir+"/EventInfo/reportSummaryContents");
97  for (std::map<std::string, std::string>::const_iterator it = SubDetFolderMap.begin();
98  it != SubDetFolderMap.end(); it++) {
99  ibin++;
100  std::string det = it->first;
102  SToNReportMap->setBinLabel(ibin,det);
103  SummaryReportMap->setBinLabel(ibin,det);
104 
105  SubDetMEs local_mes;
106 
107  if (det == "TECF") local_mes.detectorTag = "TEC+";
108  else if (det == "TECB") local_mes.detectorTag = "TEC-";
109  else if (det == "TIDF") local_mes.detectorTag = "TID+";
110  else if (det == "TIDB") local_mes.detectorTag = "TID-";
111  else local_mes.detectorTag = det;
112 
113  std::string me_name;
114  me_name = "SiStrip_" + det;
115  local_mes.SummaryFlag = dqm_store->bookFloat(me_name);
116 
117  me_name = "SiStrip_DetFraction_" + det;
118  local_mes.DetFraction = dqm_store->bookFloat(me_name);
119 
120  me_name = "SiStrip_SToNFlag_" + det;
121  local_mes.SToNFlag = dqm_store->bookFloat(me_name);
122  SubDetMEsMap.insert(std::pair<std::string, SubDetMEs>(det, local_mes));
123  }
124  bookedStripStatus_ = true;
125  }
126 }
std::map< std::string, std::string > SubDetFolderMap
void cd(void)
go to top directory (ie. root)
Definition: DQMStore.cc:644
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:891
std::map< std::string, SubDetMEs > SubDetMEsMap
MonitorElement * DetFractionReportMap
MonitorElement * SummaryReportMap
MonitorElement * SummaryReportGlobal
MonitorElement * SToNReportMap
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:1082
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
static void getTopFolderPath(DQMStore *dqm_store, std::string top_dir, std::string &path)
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:667
void SiStripQualityChecker::fillDetectorStatus ( DQMStore dqm_store,
const edm::ESHandle< SiStripDetCabling > &  cabling 
)
private

Definition at line 186 of file SiStripQualityChecker.cc.

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

Referenced by fillStatus().

186  {
187  unsigned int xbin = 0;
188  float global_flag = 0;
189  dqm_store->cd();
190  std::string mdir = "MechanicalView";
191  if (!SiStripUtility::goToDir(dqm_store, mdir)) return;
192  std::string mechanicalview_dir = dqm_store->pwd();
193 
195  for (std::map<std::string, SubDetMEs>::const_iterator it = SubDetMEsMap.begin();
196  it != SubDetMEsMap.end(); it++) {
197  std::string det = it->first;
198  std::map<std::string, std::string>::const_iterator cPos = SubDetFolderMap.find(det);
199  if (cPos == SubDetFolderMap.end()) continue;
200  std::string dname = mechanicalview_dir + "/" + cPos->second;
201  if (!dqm_store->dirExists(dname)) continue;
202  dqm_store->cd(dname);
203  SubDetMEs local_mes = it->second;
204  xbin++;
205  float flag;
206  fillSubDetStatus(dqm_store, cabling, local_mes, xbin,flag);
207  global_flag += flag;
208  }
209  global_flag = global_flag/xbin*1.0;
210  if (SummaryReportGlobal) SummaryReportGlobal->Fill(global_flag);
211  dqm_store->cd();
212 }
std::map< std::string, std::string > SubDetFolderMap
void cd(void)
go to top directory (ie. root)
Definition: DQMStore.cc:644
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:732
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:639
void SiStripQualityChecker::fillDetectorStatusAtLumi ( DQMStore dqm_store)
private

Definition at line 461 of file SiStripQualityChecker.cc.

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

Referenced by fillStatusAtLumi().

461  {
462 
463 
464 
465  dqm_store->cd();
466  std::string rdir = "ReadoutView";
467  if (!SiStripUtility::goToDir(dqm_store, rdir)) return;
468  std::string fullpath = dqm_store->pwd()
469  // + "/FedSummary/PerLumiSection/"
470  + "/PerLumiSection/"
471  + "lumiErrorFraction";
472  MonitorElement* me = dqm_store->get(fullpath);
473  if (me && me->kind() == MonitorElement::DQM_KIND_TH1F) {
474  TH1F* th1 = me->getTH1F();
475  float global_fraction = 0.0;
476  float dets = 0.0;
477  for (int ibin = 1; ibin <= th1->GetNbinsX(); ibin++) {
478  std::string label = th1->GetXaxis()->GetBinLabel(ibin);
479  std::map<std::string, SubDetMEs>::iterator iPos = SubDetMEsMap.find(label);
480  if (iPos != SubDetMEsMap.end()) {
481  float fraction = 1.0 - th1->GetBinContent(ibin);
482  global_fraction += fraction;
483  dets++;
484  iPos->second.DetFraction -> Fill(fraction);
485  iPos->second.SToNFlag -> Fill(-1.0);
486  iPos->second.SummaryFlag -> Fill(fraction);
487  }
488  }
489  global_fraction = global_fraction/dets;
490  if (SummaryReportGlobal) SummaryReportGlobal->Fill(global_fraction);
491  }
492  dqm_store->cd();
493 }
void cd(void)
go to top directory (ie. root)
Definition: DQMStore.cc:644
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. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1708
TH1F * getTH1F(void) const
MonitorElement * SummaryReportGlobal
static bool goToDir(DQMStore *dqm_store, std::string name)
const std::string & pwd(void) const
Definition: DQMStore.cc:639
void SiStripQualityChecker::fillDummyStatus ( )

Definition at line 130 of file SiStripQualityChecker.cc.

References bookedStripStatus_, SiStripQualityChecker::SubDetMEs::DetFraction, DetFractionReportMap, 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().

130  {
131 
132  resetStatus();
133  if (bookedStripStatus_) {
134  for (std::map<std::string, SubDetMEs>::const_iterator it = SubDetMEsMap.begin();
135  it != SubDetMEsMap.end(); it++) {
136  SubDetMEs local_mes = it->second;
137  local_mes.SummaryFlag -> Fill(-1.0);
138  local_mes.DetFraction -> Fill(-1.0);
139  local_mes.SToNFlag -> Fill(-1.0);
140  }
141 
142  for (int xbin = 1; xbin < SummaryReportMap->getNbinsX()+1; xbin++) {
143  for (int ybin = 1; ybin < SummaryReportMap->getNbinsY()+1; ybin++) {
144  SummaryReportMap -> Fill(xbin, ybin, -1.0);
145  DetFractionReportMap -> Fill(xbin, ybin, -1.0);
146  SToNReportMap -> Fill(xbin, ybin, -1.0);
147  }
148  }
149  SummaryReportGlobal->Fill(-1.0);
150  }
151 }
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 * SummaryReportMap
MonitorElement * SummaryReportGlobal
MonitorElement * SToNReportMap
int getNbinsX(void) const
get # of bins in X-axis
void SiStripQualityChecker::fillFaultyModuleStatus ( DQMStore dqm_store,
const edm::EventSetup eSetup 
)

Definition at line 407 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< class >::product(), DQMStore::pwd(), MonitorElement::Reset(), DQMStore::setCurrentFolder(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by fillStatus().

407  {
408  if (badModuleList.size() == 0) return;
409 
410  //Retrieve tracker topology from geometry
411  edm::ESHandle<TrackerTopology> tTopoHandle;
412  eSetup.get<IdealGeometryRecord>().get(tTopoHandle);
413  const TrackerTopology* const tTopo = tTopoHandle.product();
414 
415  dqm_store->cd();
416  std::string mdir = "MechanicalView";
417  if (!SiStripUtility::goToDir(dqm_store, mdir)) return;
418  std::string mechanical_dir = dqm_store->pwd();
419 
420  SiStripFolderOrganizer folder_organizer;
421  for (std::map<uint32_t,uint16_t>::const_iterator it = badModuleList.begin() ; it != badModuleList.end(); it++) {
422  uint32_t detId = it->first;
423  std::string subdet_folder ;
424  folder_organizer.getSubDetFolder(detId,tTopo,subdet_folder);
425  if (!dqm_store->dirExists(subdet_folder)) {
426  subdet_folder = mechanical_dir + subdet_folder.substr(subdet_folder.find("MechanicalView")+14);
427  if (!dqm_store->dirExists(subdet_folder)) continue;
428  }
429  std::string bad_module_folder = subdet_folder + "/" + "BadModuleList";
430  dqm_store->setCurrentFolder(bad_module_folder);
431 
432  std::ostringstream detid_str;
433  detid_str << detId;
434  std::string full_path = bad_module_folder + "/" + detid_str.str();
435  MonitorElement* me = dqm_store->get(full_path);
436  if (me) me->Reset();
437  else me = dqm_store->bookInt(detid_str.str());
438  me->Fill(it->second);
439  }
440  dqm_store->cd();
441 }
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:644
void Fill(long long x)
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1708
bool dirExists(const std::string &path) const
true if directory exists
Definition: DQMStore.cc:732
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:62
std::map< uint32_t, uint16_t > badModuleList
MonitorElement * bookInt(const char *name)
Book int.
Definition: DQMStore.cc:861
void Reset(void)
reset ME (ie. contents, errors, etc)
static bool goToDir(DQMStore *dqm_store, std::string name)
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:667
const std::string & pwd(void) const
Definition: DQMStore.cc:639
void SiStripQualityChecker::fillStatus ( DQMStore dqm_store,
const edm::ESHandle< SiStripDetCabling > &  cabling,
const edm::EventSetup eSetup 
)

Definition at line 174 of file SiStripQualityChecker.cc.

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

Referenced by SiStripActionExecutor::fillStatus().

174  {
175  if (!bookedStripStatus_) bookStatus(dqm_store);
176 
177  fillDummyStatus();
178  fillDetectorStatus(dqm_store, cabling);
179 
180  int faulty_moduleflag = pSet_.getUntrackedParameter<bool>("PrintFaultyModuleList", false);
181  if (faulty_moduleflag) fillFaultyModuleStatus(dqm_store, eSetup);
182 }
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 453 of file SiStripQualityChecker.cc.

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

Referenced by SiStripActionExecutor::fillStatusAtLumi().

453  {
454  if (!bookedStripStatus_) bookStatus(dqm_store);
455  fillDummyStatus();
456  fillDetectorStatusAtLumi(dqm_store);
457 }
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 398 of file SiStripQualityChecker.cc.

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

Referenced by fillSubDetStatus().

398  {
399  if (me && me->kind() == MonitorElement::DQM_KIND_TH2F) {
400  TH2F* th2d = me->getTH2F();
401  th2d->SetBinContent(xbin, ybin, val);
402  }
403  }
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 216 of file SiStripQualityChecker.cc.

References DQMStore::cd(), SiStripQualityChecker::SubDetMEs::detectorTag, SiStripQualityChecker::SubDetMEs::DetFraction, DetFractionReportMap, RefreshWebPage::dname, dqm::qstatus::ERROR, MonitorElement::Fill(), fillStatusHistogram(), DQMStore::getContents(), SiStripUtility::getMEStatus(), getModuleStatus(), MonitorElement::getName(), MonitorElement::getQReports(), DQMStore::getSubdirs(), edm::ParameterSet::getUntrackedParameter(), bookConverter::min, mergeVDriftHistosByStation::name, pSet_, dqm::qstatus::STATUS_OK, SiStripQualityChecker::SubDetMEs::SToNFlag, SToNReportMap, AlCaHLTBitMon_QueryRunRegistry::string, SiStripQualityChecker::SubDetMEs::SummaryFlag, and SummaryReportMap.

Referenced by fillDetectorStatus().

218  {
219 
220  int status_flag = pSet_.getUntrackedParameter<int>("GlobalStatusFilling", 1);
221  if (status_flag < 1) return;
222 
223  std::vector<std::string> subDirVec = dqm_store->getSubdirs();
224 
225  unsigned int ybin = 0;
226  int tot_ndet = 0;
227  int tot_errdet = 0;
228  float tot_ston_stat = 0;
229 
230  for (std::vector<std::string>::const_iterator ic = subDirVec.begin();
231  ic != subDirVec.end(); ic++) {
232  std::string dname = (*ic);
233  if (dname.find("BadModuleList") != std::string::npos) continue;
234  std::vector<MonitorElement*> meVec;
235  ybin++;
236  dqm_store->cd((*ic));
237  meVec = dqm_store->getContents((*ic));
238  uint16_t ndet = 100;
239  int errdet = 0;
240 
241  int ston_stat = 1;
242  int lnum = atoi(dname.substr(dname.find_last_of("_")+1).c_str());
243  ndet = cabling->connectedNumber(mes.detectorTag, lnum);
244 
245  getModuleStatus(dqm_store, meVec, errdet);
246 
247  for (std::vector<MonitorElement*>::const_iterator it = meVec.begin();
248  it != meVec.end(); it++) {
249  MonitorElement * me = (*it);
250  if (!me) continue;
251  std::vector<QReport *> reports = me->getQReports();
252 
253  if (reports.size() == 0) continue;
254  std::string name = me->getName();
255 
256  if( name.find("Summary_ClusterStoNCorr__OnTrack") != std::string::npos){
257  int istat = SiStripUtility::getMEStatus((*it));
258  if (reports[0]->getQTresult() == -1) {
259  ston_stat =-1;
260  } else {
261  if (istat == dqm::qstatus::ERROR) ston_stat = 0;
262  else if (istat == dqm::qstatus::STATUS_OK) ston_stat = 1;
263  }
264  }
265  }
266  if (ndet > 0) {
267  float eff_fac = 1 - (errdet*1.0/ndet);
268  fillStatusHistogram(SToNReportMap, xbin, ybin, ston_stat);
269  fillStatusHistogram(DetFractionReportMap, xbin, ybin, eff_fac);
270  if (ston_stat < 0) fillStatusHistogram(SummaryReportMap, xbin, ybin, eff_fac);
271  else fillStatusHistogram(SummaryReportMap, xbin, ybin, ston_stat*eff_fac);
272 
273  tot_ndet += ndet;
274  tot_errdet += errdet;
275  tot_ston_stat += ston_stat;
276  }
277  dqm_store->cd((*ic));
278  }
279  if (tot_ndet > 0) {
280  float tot_eff_fac = 1 - (tot_errdet*1.0/tot_ndet);
281  if (mes.DetFraction) mes.DetFraction->Fill(tot_eff_fac);
282  float tot_ston_fac = tot_ston_stat/ybin;
283  if (mes.SToNFlag) mes.SToNFlag->Fill(tot_ston_fac);
284  if (tot_ston_fac < 0){
285  gflag = tot_eff_fac;
286  }else{
287  gflag = std::min(tot_eff_fac,tot_ston_fac);
288  }
289  if (mes.SummaryFlag) mes.SummaryFlag->Fill(gflag);
290  }
291 }
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:1659
void cd(void)
go to top directory (ie. root)
Definition: DQMStore.cc:644
void getModuleStatus(DQMStore *dqm_store, std::vector< MonitorElement * > &layer_mes, int &errdet)
std::vector< MonitorElement * > getContents(const std::string &path) const
Definition: DQMStore.cc:1737
MonitorElement * DetFractionReportMap
std::vector< QReport * > getQReports(void) const
get map of QReports
static int getMEStatus(MonitorElement *me)
MonitorElement * SummaryReportMap
MonitorElement * SToNReportMap
static const int STATUS_OK
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 
)
private

Definition at line 326 of file SiStripQualityChecker.cc.

References badModuleList, lumiPlot::currentdir, MonitorElement::DQM_KIND_TPROFILE, MonitorElement::DQM_KIND_TPROFILE2D, archive::flag, DQMStore::get(), TkDetMap::getDetFromBin(), SiStripUtility::getMEValue(), MonitorElement::getName(), MonitorElement::getQReports(), MonitorElement::kind(), mergeVDriftHistosByStation::name, DQMStore::pwd(), SiStripUtility::setBadModuleFlag(), AlCaHLTBitMon_QueryRunRegistry::string, and tkDetMap_.

Referenced by fillSubDetStatus().

326  {
327 
328  std::string lname;
329  std::map<uint32_t,uint16_t> bad_modules;
330  for (std::vector<MonitorElement*>::const_iterator it = layer_mes.begin();
331  it != layer_mes.end(); it++) {
332  MonitorElement * me = (*it);
333  if (!me) continue;
334  std::vector<QReport *> qreports = me->getQReports();
335  if (qreports.size() == 0) continue;
336  std::string name = me->getName();
337  std::vector<DQMChannel> bad_channels_me;
339  bad_channels_me = qreports[0]->getBadChannels();
340  lname = "";
341  } else if (me->kind() == MonitorElement::DQM_KIND_TPROFILE2D && name.find("TkHMap") != std::string::npos) {
342  bad_channels_me = qreports[0]->getBadChannels();
343  lname = name.substr(name.find("TkHMap_")+7);
344  lname = lname.substr(lname.find("_T")+1);
345 
346  }
347  for (std::vector<DQMChannel>::iterator it = bad_channels_me.begin(); it != bad_channels_me.end(); it++){
348  int xval = (*it).getBinX();
349  int yval = (*it).getBinY();
350  uint32_t detId = tkDetMap_->getDetFromBin(lname, xval, yval);
351  std::map<uint32_t,uint16_t>::iterator iPos = bad_modules.find(detId);
352  uint16_t flag;
353  if (iPos != bad_modules.end()){
354  flag = iPos->second;
356  iPos->second = flag;
357  } else {
358  //
359  //if not in the local bad module list, check the BadModuleList dir
360  //
361  std::ostringstream detid_str;
362  detid_str << detId;
363  //now in the layer/wheel dir
364  std::string currentdir = dqm_store->pwd();
365  std::string thisMEpath = currentdir.substr( 0 , currentdir.rfind( "/" ) ) + "/BadModuleList/" + detid_str.str() ;
366 
367  MonitorElement *meBadModule = dqm_store->get ( thisMEpath );
368  if ( meBadModule )
369  {
370  std::string val_str;
371  SiStripUtility::getMEValue ( meBadModule , val_str );
372  flag = atoi ( val_str.c_str() );
373  }
374  else
375  flag = 0;
376 
378  bad_modules.insert(std::pair<uint32_t,uint16_t>(detId,flag));
379  }
380  }
381  }
382  for(std::map<uint32_t,uint16_t>::const_iterator it = bad_modules.begin();
383  it != bad_modules.end(); it++) {
384  uint32_t detId = it->first;
385  uint16_t flag = it->second;
386  std::map<uint32_t,uint16_t>::iterator iPos = badModuleList.find(detId);
387  if (iPos != badModuleList.end()){
388  iPos->second = flag;
389  } else {
390  badModuleList.insert(std::pair<uint32_t,uint16_t>(detId,flag));
391  }
392  }
393  errdet = bad_modules.size();
394 }
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)
tuple currentdir
parse figure configuration if found
Definition: lumiPlot.py:48
uint32_t getDetFromBin(int layer, int ix, int iy) const
Definition: TkDetMap.h:128
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. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1708
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:639
void SiStripQualityChecker::initialiseBadModuleList ( )
private

Definition at line 445 of file SiStripQualityChecker.cc.

References badModuleList.

Referenced by fillDetectorStatus().

445  {
446  for (std::map<uint32_t,uint16_t>::iterator it=badModuleList.begin(); it!=badModuleList.end(); it++) {
447  it->second = 0;
448  }
449 }
std::map< uint32_t, uint16_t > badModuleList
void SiStripQualityChecker::printStatusReport ( )

Definition at line 295 of file SiStripQualityChecker.cc.

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

295  {
296  std::ostringstream det_summary_str;
297  for (std::map<std::string, SubDetMEs>::const_iterator it = SubDetMEsMap.begin();
298  it != SubDetMEsMap.end(); it++) {
299  std::string det = it->first;
300  det_summary_str << std::setprecision(4);
301  det_summary_str << std::setiosflags(std::ios::fixed);
302 
303  det_summary_str << " Printing Status for " << det << " : " << std::endl;
304  SubDetMEs local_mes = it->second;
305 
306  std::string sval;
307  float fval1, fval2, fval3;
308  fval1 = fval2 = fval3 = -1.0;
309 
310 
311  SiStripUtility::getMEValue(local_mes.DetFraction, sval);
312  if (sval.size() > 0) fval1 = atof(sval.c_str());
313  SiStripUtility::getMEValue(local_mes.SToNFlag, sval);
314  if (sval.size() > 0) fval2 = atof(sval.c_str());
315  SiStripUtility::getMEValue(local_mes.SummaryFlag, sval);
316  if (sval.size() > 0) fval3 = atof(sval.c_str());
317 
318  det_summary_str << std::setw(7) << " % of good detectors " << fval1
319  << " SToN Flag " << fval2
320  << " Summary Flag " << fval3 << std::endl;
321  }
322 }
static void getMEValue(MonitorElement *me, std::string &val)
std::map< std::string, SubDetMEs > SubDetMEsMap
void SiStripQualityChecker::resetStatus ( )

Definition at line 155 of file SiStripQualityChecker.cc.

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

Referenced by fillDummyStatus().

155  {
156  if (bookedStripStatus_) {
157  for (std::map<std::string, SubDetMEs>::const_iterator it = SubDetMEsMap.begin();
158  it != SubDetMEsMap.end(); it++) {
159  SubDetMEs local_mes = it->second;
160  local_mes.DetFraction -> Reset();
161  local_mes.SummaryFlag -> Reset();
162  local_mes.SToNFlag -> Reset();
163  }
166  SToNReportMap->Reset();
167 
169  }
170 }
std::map< std::string, SubDetMEs > SubDetMEsMap
MonitorElement * DetFractionReportMap
MonitorElement * SummaryReportMap
MonitorElement * SummaryReportGlobal
MonitorElement * SToNReportMap
void Reset(std::vector< TH2F > &depth)
void Reset(void)
reset ME (ie. contents, errors, etc)

Member Data Documentation

std::map<uint32_t,uint16_t> SiStripQualityChecker::badModuleList
private
bool SiStripQualityChecker::bookedStripStatus_
private
float SiStripQualityChecker::cutoffChi2overDoF_
private

Definition at line 80 of file SiStripQualityChecker.h.

float SiStripQualityChecker::cutoffRecHits_
private

Definition at line 81 of file SiStripQualityChecker.h.

float SiStripQualityChecker::cutoffTrackRate_
private

Definition at line 79 of file SiStripQualityChecker.h.

MonitorElement* SiStripQualityChecker::DetFractionReportMap
private

Definition at line 59 of file SiStripQualityChecker.h.

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

int SiStripQualityChecker::globalStatusFilling_
private

Definition at line 74 of file SiStripQualityChecker.h.

edm::ParameterSet SiStripQualityChecker::pSet_
private

Definition at line 71 of file SiStripQualityChecker.h.

Referenced by fillStatus(), and fillSubDetStatus().

MonitorElement* SiStripQualityChecker::SToNReportMap
private

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

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

TkDetMap* SiStripQualityChecker::tkDetMap_
private

Definition at line 77 of file SiStripQualityChecker.h.

Referenced by getModuleStatus(), and SiStripQualityChecker().

MonitorElement* SiStripQualityChecker::TrackSummaryReportGlobal
private

Definition at line 67 of file SiStripQualityChecker.h.

MonitorElement* SiStripQualityChecker::TrackSummaryReportMap
private

Definition at line 65 of file SiStripQualityChecker.h.

bool SiStripQualityChecker::useGoodTracks_
private

Definition at line 75 of file SiStripQualityChecker.h.