CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
SiStripQualityDQM Class Reference

#include <SiStripQualityDQM.h>

Inheritance diagram for SiStripQualityDQM:
SiStripBaseCondObjDQM

Public Member Functions

void fillGrandSummaryMEs (const edm::EventSetup &eSetup)
 
void fillMEsForDet (const ModMEs &selModME_, uint32_t selDetId_, const TrackerTopology *tTopo) override
 
void fillMEsForLayer (uint32_t selDetId_, const TrackerTopology *tTopo) override
 
void fillModMEs (const std::vector< uint32_t > &selectedDetIds, const edm::EventSetup &es) override
 
void fillSummaryMEs (const std::vector< uint32_t > &selectedDetIds, const edm::EventSetup &es) override
 
void getActiveDetIds (const edm::EventSetup &eSetup) override
 
unsigned long long getCache (const edm::EventSetup &eSetup) override
 
void getConditionObject (const edm::EventSetup &eSetup) override
 
 SiStripQualityDQM (const edm::EventSetup &eSetup, edm::RunNumber_t iRun, edm::ParameterSet const &hPSet, edm::ParameterSet const &fPSet)
 
 ~SiStripQualityDQM () override
 
- Public Member Functions inherited from SiStripBaseCondObjDQM
void analysis (const edm::EventSetup &eSetup_)
 
void analysisOnDemand (const edm::EventSetup &eSetup_, const std::vector< uint32_t > &detIdsOnDemand)
 
void analysisOnDemand (const edm::EventSetup &eSetup_, std::string requestedSubDetector, uint32_t requestedSide, uint32_t requestedLayer)
 
void analysisOnDemand (const edm::EventSetup &eSetup_, uint32_t detIdOnDemand)
 
virtual void end ()
 
std::vector< uint32_t > getCabledModules ()
 
void selectModules (std::vector< uint32_t > &detIds_, const TrackerTopology *tTopo)
 
 SiStripBaseCondObjDQM (const edm::EventSetup &eSetup, edm::RunNumber_t iRun, edm::ParameterSet const &hPSet, edm::ParameterSet const &fPSet)
 
virtual ~SiStripBaseCondObjDQM ()
 

Private Member Functions

void SetBadComponents (int i, int component, SiStripQuality::BadComponent &BC)
 

Private Attributes

std::vector< uint32_t > alreadyFilledLayers
 
int NBadComponent [4][19][4]
 
int NTkBadComponent [4]
 
edm::ESHandle< SiStripQualityqualityHandle_
 
std::string qualityLabel_
 
std::stringstream ssV [4][19]
 

Additional Inherited Members

- Public Types inherited from SiStripBaseCondObjDQM
typedef dqm::legacy::DQMStore DQMStore
 
typedef dqm::legacy::MonitorElement MonitorElement
 
- Protected Member Functions inherited from SiStripBaseCondObjDQM
void fillTkMap (const uint32_t &detid, const float &value)
 
std::pair< std::string, uint32_t > getLayerNameAndId (const uint32_t &detId_, const TrackerTopology *tTopo)
 
void getModMEs (ModMEs &CondObj_ME, const uint32_t &detId_, const TrackerTopology *tTopo)
 
std::vector< uint32_t > GetSameLayerDetId (const std::vector< uint32_t > &activeDetIds, uint32_t selDetId, const TrackerTopology *tTopo)
 
std::pair< std::string, uint32_t > getStringNameAndId (const uint32_t &detId_, const TrackerTopology *tTopo)
 
void getSummaryMEs (ModMEs &CondObj_ME, const uint32_t &detId_, const TrackerTopology *tTopo)
 
- Protected Attributes inherited from SiStripBaseCondObjDQM
std::vector< uint32_t > activeDetIds
 
std::vector< uint32_t > all_DetIds
 
unsigned long long cacheID_current
 
unsigned long long cacheID_memory
 
std::string CondObj_fillId_
 
std::string CondObj_name_
 
const edm::EventSetupeSetup_
 
edm::ParameterSet fPSet_
 
bool GrandSummary_On_
 
bool HistoMaps_On_
 
edm::ParameterSet hPSet_
 
double maxValue
 
double minValue
 
bool Mod_On_
 
std::map< uint32_t, ModMEsModMEsMap_
 
SiStripDetInfoFileReaderreader
 
std::map< uint32_t, ModMEsSummaryMEsMap_
 
bool SummaryOnLayerLevel_On_
 
bool SummaryOnStringLevel_On_
 
std::unique_ptr< TkHistoMapTk_HM_
 
std::unique_ptr< TkHistoMapTk_HM_H
 
std::unique_ptr< TkHistoMapTk_HM_L
 
TrackerMaptkMap
 
std::vector< int > tkMapScaler
 

Detailed Description

Definition at line 24 of file SiStripQualityDQM.h.

Constructor & Destructor Documentation

◆ SiStripQualityDQM()

SiStripQualityDQM::SiStripQualityDQM ( const edm::EventSetup eSetup,
edm::RunNumber_t  iRun,
edm::ParameterSet const &  hPSet,
edm::ParameterSet const &  fPSet 
)

Definition at line 7 of file SiStripQualityDQM.cc.

11  : SiStripBaseCondObjDQM(eSetup, iRun, hPSet, fPSet) {
12  qualityLabel_ = fPSet.getParameter<std::string>("StripQualityLabel");
13 
14  // Build the Histo_TkMap:
15  if (HistoMaps_On_) {
16  edm::ESHandle<TkDetMap> tkDetMapHandle;
17  eSetup.get<TrackerTopologyRcd>().get(tkDetMapHandle);
18  Tk_HM_ = std::make_unique<TkHistoMap>(tkDetMapHandle.product(), "SiStrip/Histo_Map", "Quality_TkMap", 0.);
19  }
20 }

References edm::EventSetup::get(), get, edm::ParameterSet::getParameter(), SiStripBaseCondObjDQM::HistoMaps_On_, edm::ESHandle< T >::product(), qualityLabel_, AlCaHLTBitMon_QueryRunRegistry::string, and SiStripBaseCondObjDQM::Tk_HM_.

◆ ~SiStripQualityDQM()

SiStripQualityDQM::~SiStripQualityDQM ( )
override

Definition at line 24 of file SiStripQualityDQM.cc.

24 {}

Member Function Documentation

◆ fillGrandSummaryMEs()

void SiStripQualityDQM::fillGrandSummaryMEs ( const edm::EventSetup eSetup)

Definition at line 182 of file SiStripQualityDQM.cc.

182  {
183  // Retrieve tracker topology from geometry
184  edm::ESHandle<TrackerTopology> tTopoHandle;
185  eSetup.get<TrackerTopologyRcd>().get(tTopoHandle);
186  const TrackerTopology *const tTopo = tTopoHandle.product();
187 
188  std::string hSummary_BadObjects_xTitle = hPSet_.getParameter<std::string>("Summary_BadObjects_histo_xTitle");
189 
190  std::string hSummary_BadModules_name = hPSet_.getParameter<std::string>("Summary_BadModules_histo_name");
191  std::string hSummary_BadModules_yTitle = hPSet_.getParameter<std::string>("Summary_BadModules_histo_yTitle");
192 
193  std::string hSummary_BadFibers_name = hPSet_.getParameter<std::string>("Summary_BadFibers_histo_name");
194  std::string hSummary_BadFibers_yTitle = hPSet_.getParameter<std::string>("Summary_BadFibers_histo_yTitle");
195 
196  std::string hSummary_BadApvs_name = hPSet_.getParameter<std::string>("Summary_BadApvs_histo_name");
197  std::string hSummary_BadApvs_yTitle = hPSet_.getParameter<std::string>("Summary_BadApvs_histo_yTitle");
198 
199  std::string hSummary_BadStrips_name = hPSet_.getParameter<std::string>("Summary_BadStrips_histo_name");
200  std::string hSummary_BadStrips_yTitle = hPSet_.getParameter<std::string>("Summary_BadStrips_histo_yTitle");
201 
202  int NchX = 34;
203  double LowX = 0.5;
204  double HighX = 34.5;
205 
206  MonitorElement *ME[4];
207 
208  DQMStore *dqmStore_ = edm::Service<DQMStore>().operator->();
209 
210  std::string FolderName = fPSet_.getParameter<std::string>("FolderName_For_QualityAndCabling_SummaryHistos");
211 
213 
214  ME[0] = dqmStore_->book1D(hSummary_BadModules_name, hSummary_BadModules_name, NchX, LowX, HighX);
215  ME[0]->setAxisTitle(hSummary_BadObjects_xTitle, 1);
216  ME[0]->setAxisTitle(hSummary_BadModules_yTitle, 2);
217 
218  ME[1] = dqmStore_->book1D(hSummary_BadFibers_name, hSummary_BadFibers_name, NchX, LowX, HighX);
219  ME[1]->setAxisTitle(hSummary_BadObjects_xTitle, 1);
220  ME[1]->setAxisTitle(hSummary_BadFibers_yTitle, 2);
221 
222  ME[2] = dqmStore_->book1D(hSummary_BadApvs_name, hSummary_BadApvs_name, NchX, LowX, HighX);
223  ME[2]->setAxisTitle(hSummary_BadObjects_xTitle, 1);
224  ME[2]->setAxisTitle(hSummary_BadApvs_yTitle, 2);
225 
226  ME[3] = dqmStore_->book1D(hSummary_BadStrips_name, hSummary_BadStrips_name, NchX, LowX, HighX);
227  ME[3]->setAxisTitle(hSummary_BadObjects_xTitle, 1);
228  ME[3]->setAxisTitle(hSummary_BadStrips_yTitle, 2);
229 
230  //==============================
231 
232  for (int i = 0; i < 4; ++i) {
233  NTkBadComponent[i] = 0;
234  for (int j = 0; j < 19; ++j) {
235  ssV[i][j].str("");
236  for (int k = 0; k < 4; ++k)
237  NBadComponent[i][j][k] = 0;
238  }
239  }
240 
241  std::stringstream ss;
242  ss.str("");
243  std::vector<uint32_t> detids = reader->getAllDetIds();
244  std::vector<uint32_t>::const_iterator idet = detids.begin();
245  for (; idet != detids.end(); ++idet) {
246  ss << "detid " << (*idet) << " IsModuleUsable " << qualityHandle_->IsModuleUsable((*idet)) << "\n";
247  }
248  LogDebug("SiStripQualityDQM") << ss.str() << std::endl;
249 
250  std::vector<SiStripQuality::BadComponent> BC = qualityHandle_->getBadComponentList();
251 
252  for (size_t i = 0; i < BC.size(); ++i) {
253  //&&&&&&&&&&&&&
254  // Full Tk
255  //&&&&&&&&&&&&&
256 
257  if (BC[i].BadModule)
258  NTkBadComponent[0]++;
259  if (BC[i].BadFibers)
260  NTkBadComponent[1] += ((BC[i].BadFibers >> 2) & 0x1) + ((BC[i].BadFibers >> 1) & 0x1) + ((BC[i].BadFibers) & 0x1);
261  if (BC[i].BadApvs)
262  NTkBadComponent[2] += ((BC[i].BadApvs >> 5) & 0x1) + ((BC[i].BadApvs >> 4) & 0x1) + ((BC[i].BadApvs >> 3) & 0x1) +
263  ((BC[i].BadApvs >> 2) & 0x1) + ((BC[i].BadApvs >> 1) & 0x1) + ((BC[i].BadApvs) & 0x1);
264 
265  //&&&&&&&&&&&&&&&&&
266  // Single SubSyste
267  //&&&&&&&&&&&&&&&&&
268 
269  int component;
270  SiStripDetId a(BC[i].detid);
271  if (a.subdetId() == SiStripDetId::TIB) {
272  //&&&&&&&&&&&&&&&&&
273  // TIB
274  //&&&&&&&&&&&&&&&&&
275 
276  component = tTopo->tibLayer(BC[i].detid);
277  SetBadComponents(0, component, BC[i]);
278 
279  } else if (a.subdetId() == SiStripDetId::TID) {
280  //&&&&&&&&&&&&&&&&&
281  // TID
282  //&&&&&&&&&&&&&&&&&
283 
284  component = tTopo->tidSide(BC[i].detid) == 2 ? tTopo->tidWheel(BC[i].detid) : tTopo->tidWheel(BC[i].detid) + 3;
285  SetBadComponents(1, component, BC[i]);
286 
287  } else if (a.subdetId() == SiStripDetId::TOB) {
288  //&&&&&&&&&&&&&&&&&
289  // TOB
290  //&&&&&&&&&&&&&&&&&
291 
292  component = tTopo->tobLayer(BC[i].detid);
293  SetBadComponents(2, component, BC[i]);
294 
295  } else if (a.subdetId() == SiStripDetId::TEC) {
296  //&&&&&&&&&&&&&&&&&
297  // TEC
298  //&&&&&&&&&&&&&&&&&
299 
300  component = tTopo->tecSide(BC[i].detid) == 2 ? tTopo->tecWheel(BC[i].detid) : tTopo->tecWheel(BC[i].detid) + 9;
301  SetBadComponents(3, component, BC[i]);
302  }
303  }
304 
305  //&&&&&&&&&&&&&&&&&&
306  // Single Strip Info
307  //&&&&&&&&&&&&&&&&&&
308 
311 
312  for (SiStripBadStrip::RegistryIterator rp = rbegin; rp != rend; ++rp) {
313  uint32_t detid = rp->detid;
314 
315  int subdet = 0;
316  int component = 0;
317  SiStripDetId a(detid);
318  if (a.subdetId() == 3) {
319  subdet = 0;
320  component = tTopo->tibLayer(detid);
321  } else if (a.subdetId() == 4) {
322  subdet = 1;
323  component = tTopo->tidSide(detid) == 2 ? tTopo->tidWheel(detid) : tTopo->tidWheel(detid) + 3;
324  } else if (a.subdetId() == 5) {
325  subdet = 2;
326  component = tTopo->tobLayer(detid);
327  } else if (a.subdetId() == 6) {
328  subdet = 3;
329  component = tTopo->tecSide(detid) == 2 ? tTopo->tecWheel(detid) : tTopo->tecWheel(detid) + 9;
330  }
331 
333  qualityHandle_->getDataVectorBegin() + rp->iend);
334 
335  for (int it = 0; it < sqrange.second - sqrange.first; it++) {
336  unsigned int range = qualityHandle_->decode(*(sqrange.first + it)).range;
337  NTkBadComponent[3] += range;
338  NBadComponent[subdet][0][3] += range;
339  NBadComponent[subdet][component][3] += range;
340  }
341  }
342 
343  //&&&&&&&&&&&&&&&&&&
344  // printout
345  //&&&&&&&&&&&&&&&&&&
346 
347  ss.str("");
348  ss << "\n-----------------\nGlobal Info\n-----------------";
349  ss << "\nBadComponent \t Modules \tFibers "
350  "\tApvs\tStrips\n------------------------------------------------------"
351  "----------";
352  ss << "\nTracker:\t\t" << NTkBadComponent[0] << "\t" << NTkBadComponent[1] << "\t" << NTkBadComponent[2] << "\t"
353  << NTkBadComponent[3];
354  ss << "\n";
355  ss << "\nTIB:\t\t\t" << NBadComponent[0][0][0] << "\t" << NBadComponent[0][0][1] << "\t" << NBadComponent[0][0][2]
356  << "\t" << NBadComponent[0][0][3];
357  ss << "\nTID:\t\t\t" << NBadComponent[1][0][0] << "\t" << NBadComponent[1][0][1] << "\t" << NBadComponent[1][0][2]
358  << "\t" << NBadComponent[1][0][3];
359  ss << "\nTOB:\t\t\t" << NBadComponent[2][0][0] << "\t" << NBadComponent[2][0][1] << "\t" << NBadComponent[2][0][2]
360  << "\t" << NBadComponent[2][0][3];
361  ss << "\nTEC:\t\t\t" << NBadComponent[3][0][0] << "\t" << NBadComponent[3][0][1] << "\t" << NBadComponent[3][0][2]
362  << "\t" << NBadComponent[3][0][3];
363  ss << "\n";
364 
365  for (int i = 1; i < 5; ++i) {
366  ss << "\nTIB Layer " << i << " :\t\t" << NBadComponent[0][i][0] << "\t" << NBadComponent[0][i][1] << "\t"
367  << NBadComponent[0][i][2] << "\t" << NBadComponent[0][i][3];
368  std::stringstream binlabel;
369  binlabel << "TIB L " << i;
370 
371  for (int j = 0; j < 4; j++) {
372  ME[j]->Fill(i, NBadComponent[0][i][j]);
373  ME[j]->getTH1()->GetXaxis()->SetBinLabel(i, binlabel.str().c_str());
374  }
375  }
376  ss << "\n";
377  for (int i = 1; i < 4; ++i) {
378  ss << "\nTID+ Disk " << i << " :\t\t" << NBadComponent[1][i][0] << "\t" << NBadComponent[1][i][1] << "\t"
379  << NBadComponent[1][i][2] << "\t" << NBadComponent[1][i][3];
380  std::stringstream binlabel;
381  binlabel << "TID+ D " << i;
382 
383  for (int j = 0; j < 4; j++) {
384  ME[j]->Fill(i + 4, NBadComponent[1][i][j]);
385  ME[j]->getTH1()->GetXaxis()->SetBinLabel(i + 4, binlabel.str().c_str());
386  }
387  }
388  for (int i = 4; i < 7; ++i) {
389  ss << "\nTID- Disk " << i - 3 << " :\t\t" << NBadComponent[1][i][0] << "\t" << NBadComponent[1][i][1] << "\t"
390  << NBadComponent[1][i][2] << "\t" << NBadComponent[1][i][3];
391  std::stringstream binlabel;
392  binlabel << "TID- D " << i - 3;
393 
394  for (int j = 0; j < 4; j++) {
395  ME[j]->Fill(i + 4, NBadComponent[1][i][j]);
396  ME[j]->getTH1()->GetXaxis()->SetBinLabel(i + 4, binlabel.str().c_str());
397  }
398  }
399  ss << "\n";
400  for (int i = 1; i < 7; ++i) {
401  ss << "\nTOB Layer " << i << " :\t\t" << NBadComponent[2][i][0] << "\t" << NBadComponent[2][i][1] << "\t"
402  << NBadComponent[2][i][2] << "\t" << NBadComponent[2][i][3];
403  std::stringstream binlabel;
404  binlabel << "TOB L " << i;
405 
406  for (int j = 0; j < 4; j++) {
407  ME[j]->Fill(i + 10, NBadComponent[2][i][j]);
408  ME[j]->getTH1()->GetXaxis()->SetBinLabel(i + 10, binlabel.str().c_str());
409  }
410  }
411  ss << "\n";
412  for (int i = 1; i < 10; ++i) {
413  ss << "\nTEC+ Disk " << i << " :\t\t" << NBadComponent[3][i][0] << "\t" << NBadComponent[3][i][1] << "\t"
414  << NBadComponent[3][i][2] << "\t" << NBadComponent[3][i][3];
415  std::stringstream binlabel;
416  binlabel << "TEC+ D " << i;
417 
418  for (int j = 0; j < 4; j++) {
419  ME[j]->Fill(i + 16, NBadComponent[3][i][j]);
420  ME[j]->getTH1()->GetXaxis()->SetBinLabel(i + 16, binlabel.str().c_str());
421  }
422  }
423  for (int i = 10; i < 19; ++i) {
424  ss << "\nTEC- Disk " << i - 9 << " :\t\t" << NBadComponent[3][i][0] << "\t" << NBadComponent[3][i][1] << "\t"
425  << NBadComponent[3][i][2] << "\t" << NBadComponent[3][i][3];
426  std::stringstream binlabel;
427  binlabel << "TEC- D " << i - 9;
428 
429  for (int j = 0; j < 4; j++) {
430  ME[j]->Fill(i + 16, NBadComponent[3][i][j]);
431  ME[j]->getTH1()->GetXaxis()->SetBinLabel(i + 16, binlabel.str().c_str());
432  }
433  }
434  ss << "\n";
435 
436  ss << "\n----------------------------------------------------------------"
437  "\n\t\t Detid \tModules Fibers "
438  "Apvs\n---------------------------------------------------------------"
439  "-";
440  for (int i = 1; i < 5; ++i)
441  ss << "\nTIB Layer " << i << " :" << ssV[0][i].str();
442  ss << "\n";
443  for (int i = 1; i < 4; ++i)
444  ss << "\nTID+ Disk " << i << " :" << ssV[1][i].str();
445  for (int i = 4; i < 7; ++i)
446  ss << "\nTID- Disk " << i - 3 << " :" << ssV[1][i].str();
447  ss << "\n";
448  for (int i = 1; i < 7; ++i)
449  ss << "\nTOB Layer " << i << " :" << ssV[2][i].str();
450  ss << "\n";
451  for (int i = 1; i < 10; ++i)
452  ss << "\nTEC+ Disk " << i << " :" << ssV[3][i].str();
453  for (int i = 10; i < 19; ++i)
454  ss << "\nTEC- Disk " << i - 9 << " :" << ssV[3][i].str();
455 
456  edm::LogInfo("SiStripQualityDQM") << ss.str() << std::endl;
457 
458  for (int i = 0; i < 4; i++) {
459  TCanvas c1("c1");
460  ME[i]->getTH1()->Draw();
461  std::string name(ME[i]->getTH1()->GetTitle());
462  name += ".png";
463  c1.Print(name.c_str());
464  }
465 }

References a, dqm::implementation::IBooker::book1D(), alignmentValidation::c1, SiStripBadStrip::decode(), SiStripBaseCondObjDQM::dqmStore_, PixelVTXMonitor_cfi::FolderName, SiStripBaseCondObjDQM::fPSet_, edm::EventSetup::get(), get, SiStripDetInfoFileReader::getAllDetIds(), SiStripQuality::getBadComponentList(), SiStripBadStrip::getDataVectorBegin(), edm::ParameterSet::getParameter(), SiStripBadStrip::getRegistryVectorBegin(), SiStripBadStrip::getRegistryVectorEnd(), SiStripBaseCondObjDQM::hPSet_, mps_fire::i, SiStripQuality::IsModuleUsable(), dqmiolumiharvest::j, dqmdumpme::k, LogDebug, Skims_PA_cff::name, NBadComponent, NTkBadComponent, edm::ESHandle< T >::product(), qualityHandle_, FastTimerService_cff::range, SiStripBadStrip::data::range, SiStripBaseCondObjDQM::reader, SetBadComponents(), dqm::implementation::DQMStore::setCurrentFolder(), contentValuesCheck::ss, ssV, str, AlCaHLTBitMon_QueryRunRegistry::string, SiStripDetId::TEC, TrackerTopology::tecSide(), TrackerTopology::tecWheel(), SiStripDetId::TIB, TrackerTopology::tibLayer(), SiStripDetId::TID, TrackerTopology::tidSide(), TrackerTopology::tidWheel(), SiStripDetId::TOB, TrackerTopology::tobLayer(), and testProducerWithPsetDescEmpty_cfi::x1.

Referenced by SiStripClassToMonitorCondData::analyseCondData(), SiStripClassToMonitorCondData::getLayerMEsOnDemand(), and SiStripClassToMonitorCondData::getModMEsOnDemand().

◆ fillMEsForDet()

void SiStripQualityDQM::fillMEsForDet ( const ModMEs selModME_,
uint32_t  selDetId_,
const TrackerTopology tTopo 
)
overridevirtual

Implements SiStripBaseCondObjDQM.

Definition at line 53 of file SiStripQualityDQM.cc.

53  {
54  ModMEs selModME_ = _selModME_;
55  getModMEs(selModME_, selDetId_, tTopo);
56 
57  SiStripQuality::Range qualityRange = qualityHandle_->getRange(selDetId_);
58  int nStrip = reader->getNumberOfApvsAndStripLength(selDetId_).first * 128;
59 
60  for (int istrip = 0; istrip < nStrip; ++istrip) {
61  selModME_.ProfileDistr->Fill(istrip + 1, qualityHandle_->IsStripBad(qualityRange, istrip) ? 0. : 1.);
62 
63  } // istrip
64 }

References dqm::impl::MonitorElement::Fill(), SiStripBaseCondObjDQM::getModMEs(), SiStripDetInfoFileReader::getNumberOfApvsAndStripLength(), SiStripBadStrip::getRange(), SiStripQuality::IsStripBad(), SiStripBaseCondObjDQM::ModMEs::ProfileDistr, qualityHandle_, and SiStripBaseCondObjDQM::reader.

Referenced by fillModMEs().

◆ fillMEsForLayer()

void SiStripQualityDQM::fillMEsForLayer ( uint32_t  selDetId_,
const TrackerTopology tTopo 
)
overridevirtual

Implements SiStripBaseCondObjDQM.

Definition at line 98 of file SiStripQualityDQM.cc.

99  {
100  float numberOfBadStrips = 0;
101 
103 
104  if (hPSet_.getParameter<bool>("FillSummaryAtLayerLevel")) {
105  std::string hSummary_description;
106  hSummary_description = hPSet_.getParameter<std::string>("Summary_description");
107 
108  std::string hSummary_name;
109 
110  // ----
111  int subDetId_ = ((selDetId_ >> 25) & 0x7);
112 
113  if (subDetId_ < 3 || subDetId_ > 6) {
114  edm::LogError("SiStripQualityDQM") << "[SiStripQualityDQM::fillMEsForLayer] WRONG INPUT : no such "
115  "subdetector type : "
116  << subDetId_ << " no folder set!" << std::endl;
117  return;
118  }
119  // ----
120 
121  hSummary_name =
122  hidmanager.createHistoLayer(hSummary_description, "layer", getLayerNameAndId(selDetId_, tTopo).first, "");
123 
124  std::map<uint32_t, ModMEs>::iterator selMEsMapIter_ =
125  SummaryMEsMap_.find(getLayerNameAndId(selDetId_, tTopo).second);
126 
127  ModMEs selME_;
128  if (selMEsMapIter_ != SummaryMEsMap_.end())
129  selME_ = selMEsMapIter_->second;
130 
131  getSummaryMEs(selME_, selDetId_, tTopo);
132 
133  std::vector<uint32_t> sameLayerDetIds_;
134  sameLayerDetIds_.clear();
135  sameLayerDetIds_ = GetSameLayerDetId(activeDetIds, selDetId_, tTopo);
136  // -----
137  // unsigned int iBin=0;
138 
139  //%%%%%%%%%%%%%%%%%%%
140  //%%% FIXME: patch to fix the bug causing double counting on each layer
141  //%%%%%%%%%%%%%%%%%%%%%%%
142  if (std::binary_search(alreadyFilledLayers.begin(), alreadyFilledLayers.end(), sameLayerDetIds_[0]))
143  return;
144  alreadyFilledLayers.push_back(sameLayerDetIds_[0]);
145  sort(alreadyFilledLayers.begin(), alreadyFilledLayers.end());
146  //%%%%%%%%%%%%%%%%%%%%%%% END %%%%%%%%%%
147 
148  for (unsigned int i = 0; i < sameLayerDetIds_.size(); i++) {
149  SiStripQuality::Range qualityRange = qualityHandle_->getRange(sameLayerDetIds_[i]);
150  int nStrip = reader->getNumberOfApvsAndStripLength(sameLayerDetIds_[i]).first * 128;
151 
152  numberOfBadStrips = 0;
153 
154  for (int istrip = 0; istrip < nStrip; ++istrip) {
155  if (qualityHandle_->IsStripBad(qualityRange, istrip)) {
156  numberOfBadStrips++;
157  }
158  }
159 
160  float fr = 100 * float(numberOfBadStrips) / nStrip;
161  selME_.SummaryDistr->Fill(i + 1, fr);
162  if (fr > 20) {
163  char c[9];
164  sprintf(c, "%d", sameLayerDetIds_[i]);
165  selME_.SummaryDistr->getTH1()->GetXaxis()->SetBinLabel(i + 1, c);
166  }
167 
168  // Fill the TkHistoMap with Quality output :
169  if (HistoMaps_On_)
170  Tk_HM_->setBinContent(sameLayerDetIds_[i], fr);
171 
172  // Fill the TkMap
173  if (fPSet_.getParameter<bool>("TkMap_On") || hPSet_.getParameter<bool>("TkMap_On")) {
174  fillTkMap(sameLayerDetIds_[i], fr);
175  }
176  }
177  } // if Fill ...
178 }

References SiStripBaseCondObjDQM::activeDetIds, alreadyFilledLayers, HltBtagPostValidation_cff::c, SiStripHistoId::createHistoLayer(), dqm::impl::MonitorElement::Fill(), SiStripBaseCondObjDQM::fillTkMap(), dqmdumpme::first, dqmMemoryStats::float, SiStripBaseCondObjDQM::fPSet_, SiStripBaseCondObjDQM::getLayerNameAndId(), SiStripDetInfoFileReader::getNumberOfApvsAndStripLength(), edm::ParameterSet::getParameter(), SiStripBadStrip::getRange(), SiStripBaseCondObjDQM::GetSameLayerDetId(), SiStripBaseCondObjDQM::getSummaryMEs(), dqm::legacy::MonitorElement::getTH1(), SiStripBaseCondObjDQM::hidmanager, SiStripBaseCondObjDQM::HistoMaps_On_, SiStripBaseCondObjDQM::hPSet_, mps_fire::i, SiStripQuality::IsStripBad(), qualityHandle_, SiStripBaseCondObjDQM::reader, edm::second(), AlCaHLTBitMon_QueryRunRegistry::string, SiStripBaseCondObjDQM::ModMEs::SummaryDistr, SiStripBaseCondObjDQM::SummaryMEsMap_, and SiStripBaseCondObjDQM::Tk_HM_.

Referenced by fillSummaryMEs().

◆ fillModMEs()

void SiStripQualityDQM::fillModMEs ( const std::vector< uint32_t > &  selectedDetIds,
const edm::EventSetup es 
)
overridevirtual

Reimplemented from SiStripBaseCondObjDQM.

Definition at line 36 of file SiStripQualityDQM.cc.

36  {
37  // Retrieve tracker topology from geometry
39  es.get<TrackerTopologyRcd>().get(tTopoHandle);
40  const TrackerTopology *const tTopo = tTopoHandle.product();
41 
42  ModMEs CondObj_ME;
43 
44  for (std::vector<uint32_t>::const_iterator detIter_ = selectedDetIds.begin(); detIter_ != selectedDetIds.end();
45  detIter_++) {
46  fillMEsForDet(CondObj_ME, *detIter_, tTopo);
47  }
48 }

References fillMEsForDet(), edm::EventSetup::get(), get, and edm::ESHandle< T >::product().

◆ fillSummaryMEs()

void SiStripQualityDQM::fillSummaryMEs ( const std::vector< uint32_t > &  selectedDetIds,
const edm::EventSetup es 
)
overridevirtual

Reimplemented from SiStripBaseCondObjDQM.

Definition at line 69 of file SiStripQualityDQM.cc.

69  {
70  // Retrieve tracker topology from geometry
72  es.get<TrackerTopologyRcd>().get(tTopoHandle);
73  const TrackerTopology *const tTopo = tTopoHandle.product();
74 
75  for (std::vector<uint32_t>::const_iterator detIter_ = selectedDetIds.begin(); detIter_ != selectedDetIds.end();
76  detIter_++) {
77  fillMEsForLayer(/*SummaryMEsMap_,*/ *detIter_, tTopo);
78  }
79 
80  for (std::map<uint32_t, ModMEs>::iterator iter = SummaryMEsMap_.begin(); iter != SummaryMEsMap_.end(); iter++) {
81  ModMEs selME;
82  selME = iter->second;
83 
84  if (hPSet_.getParameter<bool>("FillSummaryAtLayerLevel") &&
85  fPSet_.getParameter<bool>("OutputSummaryAtLayerLevelAsImage")) {
86  TCanvas c1("c1");
87  selME.SummaryDistr->getTH1()->Draw();
88  std::string name(selME.SummaryDistr->getTH1()->GetTitle());
89  name += ".png";
90  c1.Print(name.c_str());
91  }
92  }
93 }

References alignmentValidation::c1, fillMEsForLayer(), SiStripBaseCondObjDQM::fPSet_, edm::EventSetup::get(), get, edm::ParameterSet::getParameter(), dqm::legacy::MonitorElement::getTH1(), SiStripBaseCondObjDQM::hPSet_, Skims_PA_cff::name, edm::ESHandle< T >::product(), AlCaHLTBitMon_QueryRunRegistry::string, SiStripBaseCondObjDQM::ModMEs::SummaryDistr, and SiStripBaseCondObjDQM::SummaryMEsMap_.

◆ getActiveDetIds()

void SiStripQualityDQM::getActiveDetIds ( const edm::EventSetup eSetup)
overridevirtual

◆ getCache()

unsigned long long SiStripQualityDQM::getCache ( const edm::EventSetup eSetup)
inlineoverridevirtual

Implements SiStripBaseCondObjDQM.

Definition at line 43 of file SiStripQualityDQM.h.

43  {
44  return eSetup.get<SiStripQualityRcd>().cacheIdentifier();
45  }

References edm::EventSetup::get().

◆ getConditionObject()

void SiStripQualityDQM::getConditionObject ( const edm::EventSetup eSetup)
inlineoverridevirtual

◆ SetBadComponents()

void SiStripQualityDQM::SetBadComponents ( int  i,
int  component,
SiStripQuality::BadComponent BC 
)
private

Definition at line 468 of file SiStripQualityDQM.cc.

468  {
469  int napv = reader->getNumberOfApvsAndStripLength(BC.detid).first;
470 
471  ssV[i][component] << "\n\t\t " << BC.detid << " \t " << BC.BadModule << " \t " << ((BC.BadFibers) & 0x1) << " ";
472  if (napv == 4)
473  ssV[i][component] << "x " << ((BC.BadFibers >> 1) & 0x1);
474 
475  if (napv == 6)
476  ssV[i][component] << ((BC.BadFibers >> 1) & 0x1) << " " << ((BC.BadFibers >> 2) & 0x1);
477  ssV[i][component] << " \t " << ((BC.BadApvs) & 0x1) << " " << ((BC.BadApvs >> 1) & 0x1) << " ";
478  if (napv == 4)
479  ssV[i][component] << "x x " << ((BC.BadApvs >> 2) & 0x1) << " " << ((BC.BadApvs >> 3) & 0x1);
480  if (napv == 6)
481  ssV[i][component] << ((BC.BadApvs >> 2) & 0x1) << " " << ((BC.BadApvs >> 3) & 0x1) << " "
482  << ((BC.BadApvs >> 4) & 0x1) << " " << ((BC.BadApvs >> 5) & 0x1) << " ";
483 
484  if (BC.BadApvs) {
485  NBadComponent[i][0][2] += ((BC.BadApvs >> 5) & 0x1) + ((BC.BadApvs >> 4) & 0x1) + ((BC.BadApvs >> 3) & 0x1) +
486  ((BC.BadApvs >> 2) & 0x1) + ((BC.BadApvs >> 1) & 0x1) + ((BC.BadApvs) & 0x1);
487  NBadComponent[i][component][2] += ((BC.BadApvs >> 5) & 0x1) + ((BC.BadApvs >> 4) & 0x1) +
488  ((BC.BadApvs >> 3) & 0x1) + ((BC.BadApvs >> 2) & 0x1) +
489  ((BC.BadApvs >> 1) & 0x1) + ((BC.BadApvs) & 0x1);
490  // tkMap->fillc(BC.detid,0xff0000);
491  }
492  if (BC.BadFibers) {
493  NBadComponent[i][0][1] += ((BC.BadFibers >> 2) & 0x1) + ((BC.BadFibers >> 1) & 0x1) + ((BC.BadFibers) & 0x1);
494  NBadComponent[i][component][1] +=
495  ((BC.BadFibers >> 2) & 0x1) + ((BC.BadFibers >> 1) & 0x1) + ((BC.BadFibers) & 0x1);
496  // tkMap->fillc(BC.detid,0x0000ff);
497  }
498  if (BC.BadModule) {
499  NBadComponent[i][0][0]++;
500  NBadComponent[i][component][0]++;
501  // tkMap->fillc(BC.detid,0x0);
502  }
503 }

References SiStripQuality::BadComponent::BadApvs, SiStripQuality::BadComponent::BadFibers, SiStripQuality::BadComponent::BadModule, SiStripQuality::BadComponent::detid, SiStripDetInfoFileReader::getNumberOfApvsAndStripLength(), mps_fire::i, NBadComponent, SiStripBaseCondObjDQM::reader, ssV, and testProducerWithPsetDescEmpty_cfi::x1.

Referenced by fillGrandSummaryMEs().

Member Data Documentation

◆ alreadyFilledLayers

std::vector<uint32_t> SiStripQualityDQM::alreadyFilledLayers
private

Definition at line 60 of file SiStripQualityDQM.h.

Referenced by fillMEsForLayer().

◆ NBadComponent

int SiStripQualityDQM::NBadComponent[4][19][4]
private

Definition at line 56 of file SiStripQualityDQM.h.

Referenced by fillGrandSummaryMEs(), and SetBadComponents().

◆ NTkBadComponent

int SiStripQualityDQM::NTkBadComponent[4]
private

Definition at line 55 of file SiStripQualityDQM.h.

Referenced by fillGrandSummaryMEs().

◆ qualityHandle_

edm::ESHandle<SiStripQuality> SiStripQualityDQM::qualityHandle_
private

◆ qualityLabel_

std::string SiStripQualityDQM::qualityLabel_
private

Definition at line 53 of file SiStripQualityDQM.h.

Referenced by getConditionObject(), and SiStripQualityDQM().

◆ ssV

std::stringstream SiStripQualityDQM::ssV[4][19]
private

Definition at line 57 of file SiStripQualityDQM.h.

Referenced by fillGrandSummaryMEs(), and SetBadComponents().

SiStripHistoId::createHistoLayer
std::string createHistoLayer(std::string description, std::string id_type, std::string path, std::string flag)
Definition: SiStripHistoId.cc:51
SiStripQualityDQM::fillMEsForDet
void fillMEsForDet(const ModMEs &selModME_, uint32_t selDetId_, const TrackerTopology *tTopo) override
Definition: SiStripQualityDQM.cc:53
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
SiStripQuality::BadComponent::detid
uint32_t detid
Definition: SiStripQuality.h:35
FastTimerService_cff.range
range
Definition: FastTimerService_cff.py:34
SiStripBaseCondObjDQM::hidmanager
SiStripHistoId hidmanager
Definition: SiStripBaseCondObjDQM.h:157
mps_fire.i
i
Definition: mps_fire.py:355
dqmMemoryStats.float
float
Definition: dqmMemoryStats.py:127
SiStripBadStrip::getRange
const Range getRange(const uint32_t detID) const
Definition: SiStripBadStrip.cc:27
TrackerTopology
Definition: TrackerTopology.h:16
SiStripBaseCondObjDQM::activeDetIds
std::vector< uint32_t > activeDetIds
Definition: SiStripBaseCondObjDQM.h:123
edm::LogInfo
Definition: MessageLogger.h:254
SiStripBadStrip::decode
data decode(const unsigned int &value) const
Definition: SiStripBadStrip.h:78
SiStripQualityDQM::NTkBadComponent
int NTkBadComponent[4]
Definition: SiStripQualityDQM.h:55
SiStripQualityDQM::NBadComponent
int NBadComponent[4][19][4]
Definition: SiStripQualityDQM.h:56
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:215
SiStripQuality::IsModuleUsable
bool IsModuleUsable(const uint32_t &detid) const
Definition: SiStripQuality.cc:590
dqm::legacy::MonitorElement
Definition: MonitorElement.h:461
SiStripBaseCondObjDQM::HistoMaps_On_
bool HistoMaps_On_
Definition: SiStripBaseCondObjDQM.h:109
SiStripBadStrip::getDataVectorBegin
ContainerIterator getDataVectorBegin() const
Definition: SiStripBadStrip.h:73
dqmdumpme.first
first
Definition: dqmdumpme.py:55
SiStripBaseCondObjDQM::SummaryMEsMap_
std::map< uint32_t, ModMEs > SummaryMEsMap_
Definition: SiStripBaseCondObjDQM.h:122
PixelVTXMonitor_cfi.FolderName
FolderName
Definition: PixelVTXMonitor_cfi.py:5
TrackerTopology::tidWheel
unsigned int tidWheel(const DetId &id) const
Definition: TrackerTopology.h:201
SiStripBaseCondObjDQM::reader
SiStripDetInfoFileReader * reader
Definition: SiStripBaseCondObjDQM.h:102
SiStripQualityDQM::SetBadComponents
void SetBadComponents(int i, int component, SiStripQuality::BadComponent &BC)
Definition: SiStripQualityDQM.cc:468
contentValuesCheck.ss
ss
Definition: contentValuesCheck.py:33
SiStripBaseCondObjDQM::fillTkMap
void fillTkMap(const uint32_t &detid, const float &value)
Definition: SiStripBaseCondObjDQM.cc:1144
SiStripBaseCondObjDQM::getLayerNameAndId
std::pair< std::string, uint32_t > getLayerNameAndId(const uint32_t &detId_, const TrackerTopology *tTopo)
Definition: SiStripBaseCondObjDQM.cc:913
testProducerWithPsetDescEmpty_cfi.x1
x1
Definition: testProducerWithPsetDescEmpty_cfi.py:33
SiStripBadStrip::Range
std::pair< ContainerIterator, ContainerIterator > Range
Definition: SiStripBadStrip.h:53
SiStripQuality::getBadComponentList
const std::vector< BadComponent > & getBadComponentList() const
Definition: SiStripQuality.h:119
SiStripBadStrip::getRegistryVectorBegin
RegistryIterator getRegistryVectorBegin() const
Definition: SiStripBadStrip.h:75
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
SiStripQualityRcd
Definition: SiStripDependentRecords.h:56
SiStripBaseCondObjDQM::Tk_HM_
std::unique_ptr< TkHistoMap > Tk_HM_
Definition: SiStripBaseCondObjDQM.h:129
str
#define str(s)
Definition: TestProcessor.cc:48
edm::ESHandle
Definition: DTSurvey.h:22
dqm::implementation::DQMStore::setCurrentFolder
void setCurrentFolder(std::string const &fullpath) override
Definition: DQMStore.h:569
SiStripBaseCondObjDQM::cacheID_memory
unsigned long long cacheID_memory
Definition: SiStripBaseCondObjDQM.h:126
dqmdumpme.k
k
Definition: dqmdumpme.py:60
SiStripDetId::TEC
static constexpr auto TEC
Definition: SiStripDetId.h:40
SiStripQuality::BadComponent::BadFibers
unsigned short BadFibers
Definition: SiStripQuality.h:37
SiStripQuality::IsStripBad
bool IsStripBad(const uint32_t &detid, const short &strip) const
Definition: SiStripQuality.cc:628
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:670
edm::LogError
Definition: MessageLogger.h:183
a
double a
Definition: hdecay.h:119
SiStripQualityDQM::alreadyFilledLayers
std::vector< uint32_t > alreadyFilledLayers
Definition: SiStripQualityDQM.h:60
SiStripQualityDQM::getConditionObject
void getConditionObject(const edm::EventSetup &eSetup) override
Definition: SiStripQualityDQM.h:47
SiStripQualityDQM::ssV
std::stringstream ssV[4][19]
Definition: SiStripQualityDQM.h:57
SiStripQuality::BadComponent::BadModule
bool BadModule
Definition: SiStripQuality.h:38
TrackerTopology::tidSide
unsigned int tidSide(const DetId &id) const
Definition: TrackerTopology.h:190
edm::Service
Definition: Service.h:30
alignmentValidation.c1
c1
do drawing
Definition: alignmentValidation.py:1025
SiStripBadStrip::getDetIds
void getDetIds(std::vector< uint32_t > &DetIds_) const
Definition: SiStripBadStrip.cc:51
SiStripDetId::TOB
static constexpr auto TOB
Definition: SiStripDetId.h:39
SiStripQuality::BadComponent::BadApvs
unsigned short BadApvs
Definition: SiStripQuality.h:36
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
get
#define get
SiStripDetInfoFileReader::getAllDetIds
const std::vector< uint32_t > & getAllDetIds() const
Definition: SiStripDetInfoFileReader.h:52
SiStripBaseCondObjDQM::getModMEs
void getModMEs(ModMEs &CondObj_ME, const uint32_t &detId_, const TrackerTopology *tTopo)
Definition: SiStripBaseCondObjDQM.cc:363
SiStripDetId::TID
static constexpr auto TID
Definition: SiStripDetId.h:38
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
SiStripQualityDQM::fillMEsForLayer
void fillMEsForLayer(uint32_t selDetId_, const TrackerTopology *tTopo) override
Definition: SiStripQualityDQM.cc:98
SiStripHistoId
Definition: SiStripHistoId.h:25
TrackerTopology::tobLayer
unsigned int tobLayer(const DetId &id) const
Definition: TrackerTopology.h:147
SiStripDetInfoFileReader::getNumberOfApvsAndStripLength
const std::pair< unsigned short, double > getNumberOfApvsAndStripLength(uint32_t detId) const
Definition: SiStripDetInfoFileReader.cc:101
SiStripQualityDQM::qualityLabel_
std::string qualityLabel_
Definition: SiStripQualityDQM.h:53
ME
Definition: ME.h:11
SiStripBaseCondObjDQM::SiStripBaseCondObjDQM
SiStripBaseCondObjDQM(const edm::EventSetup &eSetup, edm::RunNumber_t iRun, edm::ParameterSet const &hPSet, edm::ParameterSet const &fPSet)
Definition: SiStripBaseCondObjDQM.cc:10
SiStripQualityDQM::qualityHandle_
edm::ESHandle< SiStripQuality > qualityHandle_
Definition: SiStripQualityDQM.h:54
SiStripBaseCondObjDQM::fPSet_
edm::ParameterSet fPSet_
Definition: SiStripBaseCondObjDQM.h:106
SiStripDetId::TIB
static constexpr auto TIB
Definition: SiStripDetId.h:37
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
SiStripBaseCondObjDQM::getSummaryMEs
void getSummaryMEs(ModMEs &CondObj_ME, const uint32_t &detId_, const TrackerTopology *tTopo)
Definition: SiStripBaseCondObjDQM.cc:399
SiStripBadStrip::RegistryIterator
Registry::const_iterator RegistryIterator
Definition: SiStripBadStrip.h:55
SiStripBaseCondObjDQM::hPSet_
edm::ParameterSet hPSet_
Definition: SiStripBaseCondObjDQM.h:105
SiStripBaseCondObjDQM::DQMStore
dqm::legacy::DQMStore DQMStore
Definition: SiStripBaseCondObjDQM.h:39
SiStripBadStrip::data::range
unsigned short range
Definition: SiStripBadStrip.h:34
TrackerTopologyRcd
Definition: TrackerTopologyRcd.h:10
SiStripDetId
Detector identifier class for the strip tracker.
Definition: SiStripDetId.h:18
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
SiStripBaseCondObjDQM::dqmStore_
DQMStore * dqmStore_
Definition: SiStripBaseCondObjDQM.h:159
TrackerTopology::tecWheel
unsigned int tecWheel(const DetId &id) const
Definition: TrackerTopology.h:198
SiStripBaseCondObjDQM::GetSameLayerDetId
std::vector< uint32_t > GetSameLayerDetId(const std::vector< uint32_t > &activeDetIds, uint32_t selDetId, const TrackerTopology *tTopo)
Definition: SiStripBaseCondObjDQM.cc:1114
SiStripBadStrip::getRegistryVectorEnd
RegistryIterator getRegistryVectorEnd() const
Definition: SiStripBadStrip.h:76
dqm::implementation::IBooker::book1D
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
SiStripBaseCondObjDQM::cacheID_current
unsigned long long cacheID_current
Definition: SiStripBaseCondObjDQM.h:127
TrackerTopology::tibLayer
unsigned int tibLayer(const DetId &id) const
Definition: TrackerTopology.h:150
TrackerTopology::tecSide
unsigned int tecSide(const DetId &id) const
Definition: TrackerTopology.h:184