CMS 3D CMS Logo

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_, uint32_t detIdOnDemand)
 
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)
 
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

- 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 ( const edm::EventSetup eSetup,
edm::RunNumber_t  iRun,
edm::ParameterSet const &  hPSet,
edm::ParameterSet const &  fPSet 
)

Definition at line 7 of file SiStripQualityDQM.cc.

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

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 }
SiStripBaseCondObjDQM(const edm::EventSetup &eSetup, edm::RunNumber_t iRun, edm::ParameterSet const &hPSet, edm::ParameterSet const &fPSet)
T get() const
Definition: EventSetup.h:71
std::string qualityLabel_
T const * product() const
Definition: ESHandle.h:86
std::unique_ptr< TkHistoMap > Tk_HM_
SiStripQualityDQM::~SiStripQualityDQM ( )
override

Definition at line 24 of file SiStripQualityDQM.cc.

24 {}

Member Function Documentation

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

Definition at line 182 of file SiStripQualityDQM.cc.

References a, DQMStore::book1D(), alignmentValidation::c1, SiStripBadStrip::decode(), SiStripBaseCondObjDQM::dqmStore_, MonitorElement::Fill(), SiStripBaseCondObjDQM::fPSet_, edm::EventSetup::get(), SiStripDetInfoFileReader::getAllDetIds(), SiStripQuality::getBadComponentList(), SiStripBadStrip::getDataVectorBegin(), edm::ParameterSet::getParameter(), SiStripBadStrip::getRegistryVectorBegin(), SiStripBadStrip::getRegistryVectorEnd(), MonitorElement::getTH1(), SiStripBaseCondObjDQM::hPSet_, mps_fire::i, SiStripQuality::IsModuleUsable(), gen::k, LogDebug, dataset::name, NBadComponent, NTkBadComponent, Utilities::operator, edm::ESHandle< T >::product(), qualityHandle_, SiStripBadStrip::data::range, SiStripBaseCondObjDQM::reader, MonitorElement::setAxisTitle(), SetBadComponents(), DQMStore::setCurrentFolder(), ssV, str, AlCaHLTBitMon_QueryRunRegistry::string, DetId::subdetId(), SiStripDetId::TEC, TrackerTopology::tecSide(), TrackerTopology::tecWheel(), SiStripDetId::TIB, TrackerTopology::tibLayer(), SiStripDetId::TID, TrackerTopology::tidSide(), TrackerTopology::tidWheel(), SiStripDetId::TOB, TrackerTopology::tobLayer(), and globals_cff::x1.

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

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 
209 
210  std::string FolderName = fPSet_.getParameter<std::string>("FolderName_For_QualityAndCabling_SummaryHistos");
211 
212  dqmStore_->setCurrentFolder(FolderName);
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 }
#define LogDebug(id)
unsigned short range
T getParameter(std::string const &) const
int NBadComponent[4][19][4]
const std::vector< BadComponent > & getBadComponentList() const
unsigned int tibLayer(const DetId &id) const
unsigned int tidWheel(const DetId &id) const
Registry::const_iterator RegistryIterator
MonitorElement * book1D(char_string const &name, char_string const &title, int const nchX, double const lowX, double const highX)
Book 1D histogram.
Definition: DQMStore.cc:1098
Definition: ME.h:11
RegistryIterator getRegistryVectorEnd() const
unsigned int tidSide(const DetId &id) const
const std::vector< uint32_t > & getAllDetIds() const
SiStripDetInfoFileReader * reader
std::stringstream ssV[4][19]
bool IsModuleUsable(const uint32_t &detid) const
void SetBadComponents(int i, int component, SiStripQuality::BadComponent &BC)
int k[5][pyjets_maxn]
ContainerIterator getDataVectorBegin() const
Detector identifier class for the strip tracker.
Definition: SiStripDetId.h:17
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:571
RegistryIterator getRegistryVectorBegin() const
double a
Definition: hdecay.h:121
std::pair< ContainerIterator, ContainerIterator > Range
T get() const
Definition: EventSetup.h:71
edm::ESHandle< SiStripQuality > qualityHandle_
#define str(s)
unsigned int tecWheel(const DetId &id) const
T const * product() const
Definition: ESHandle.h:86
data decode(const unsigned int &value) const
unsigned int tobLayer(const DetId &id) const
unsigned int tecSide(const DetId &id) const
void SiStripQualityDQM::fillMEsForDet ( const ModMEs selModME_,
uint32_t  selDetId_,
const TrackerTopology tTopo 
)
overridevirtual

Implements SiStripBaseCondObjDQM.

Definition at line 53 of file SiStripQualityDQM.cc.

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

Referenced by fillModMEs().

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 }
const std::pair< unsigned short, double > getNumberOfApvsAndStripLength(uint32_t detId) const
bool IsStripBad(const uint32_t &detid, const short &strip) const
SiStripDetInfoFileReader * reader
void getModMEs(ModMEs &CondObj_ME, const uint32_t &detId_, const TrackerTopology *tTopo)
const Range getRange(const uint32_t detID) const
std::pair< ContainerIterator, ContainerIterator > Range
edm::ESHandle< SiStripQuality > qualityHandle_
void SiStripQualityDQM::fillMEsForLayer ( uint32_t  selDetId_,
const TrackerTopology tTopo 
)
overridevirtual

Implements SiStripBaseCondObjDQM.

Definition at line 98 of file SiStripQualityDQM.cc.

References SiStripBaseCondObjDQM::activeDetIds, alreadyFilledLayers, EnergyCorrector::c, SiStripHistoId::createHistoLayer(), MonitorElement::Fill(), SiStripBaseCondObjDQM::fillTkMap(), plotBeamSpotDB::first, objects.autophobj::float, SiStripBaseCondObjDQM::fPSet_, SiStripBaseCondObjDQM::getLayerNameAndId(), SiStripDetInfoFileReader::getNumberOfApvsAndStripLength(), edm::ParameterSet::getParameter(), SiStripBadStrip::getRange(), SiStripBaseCondObjDQM::GetSameLayerDetId(), SiStripBaseCondObjDQM::getSummaryMEs(), 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().

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 }
T getParameter(std::string const &) const
const std::pair< unsigned short, double > getNumberOfApvsAndStripLength(uint32_t detId) const
bool IsStripBad(const uint32_t &detid, const short &strip) const
void getSummaryMEs(ModMEs &CondObj_ME, const uint32_t &detId_, const TrackerTopology *tTopo)
void fillTkMap(const uint32_t &detid, const float &value)
U second(std::pair< T, U > const &p)
std::map< uint32_t, ModMEs > SummaryMEsMap_
SiStripDetInfoFileReader * reader
std::vector< uint32_t > GetSameLayerDetId(const std::vector< uint32_t > &activeDetIds, uint32_t selDetId, const TrackerTopology *tTopo)
std::vector< uint32_t > alreadyFilledLayers
const Range getRange(const uint32_t detID) const
std::pair< std::string, uint32_t > getLayerNameAndId(const uint32_t &detId_, const TrackerTopology *tTopo)
std::pair< ContainerIterator, ContainerIterator > Range
std::vector< uint32_t > activeDetIds
edm::ESHandle< SiStripQuality > qualityHandle_
std::string createHistoLayer(std::string description, std::string id_type, std::string path, std::string flag)
std::unique_ptr< TkHistoMap > Tk_HM_
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.

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

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 }
T get() const
Definition: EventSetup.h:71
T const * product() const
Definition: ESHandle.h:86
void fillMEsForDet(const ModMEs &selModME_, uint32_t selDetId_, const TrackerTopology *tTopo) override
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.

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

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 }
T getParameter(std::string const &) const
std::map< uint32_t, ModMEs > SummaryMEsMap_
void fillMEsForLayer(uint32_t selDetId_, const TrackerTopology *tTopo) override
T get() const
Definition: EventSetup.h:71
T const * product() const
Definition: ESHandle.h:86
void SiStripQualityDQM::getActiveDetIds ( const edm::EventSetup eSetup)
overridevirtual

Implements SiStripBaseCondObjDQM.

Definition at line 28 of file SiStripQualityDQM.cc.

References SiStripBaseCondObjDQM::activeDetIds, getConditionObject(), SiStripBadStrip::getDetIds(), and qualityHandle_.

28  {
29  getConditionObject(eSetup);
31 }
void getDetIds(std::vector< uint32_t > &DetIds_) const
void getConditionObject(const edm::EventSetup &eSetup) override
std::vector< uint32_t > activeDetIds
edm::ESHandle< SiStripQuality > qualityHandle_
unsigned long long SiStripQualityDQM::getCache ( const edm::EventSetup eSetup)
inlineoverridevirtual

Implements SiStripBaseCondObjDQM.

Definition at line 43 of file SiStripQualityDQM.h.

References edm::EventSetup::get().

43  {
44  return eSetup.get<SiStripQualityRcd>().cacheIdentifier();
45  }
T get() const
Definition: EventSetup.h:71
void SiStripQualityDQM::getConditionObject ( const edm::EventSetup eSetup)
inlineoverridevirtual
void SiStripQualityDQM::SetBadComponents ( int  i,
int  component,
SiStripQuality::BadComponent BC 
)
private

Definition at line 468 of file SiStripQualityDQM.cc.

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

Referenced by fillGrandSummaryMEs().

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 }
int NBadComponent[4][19][4]
const std::pair< unsigned short, double > getNumberOfApvsAndStripLength(uint32_t detId) const
SiStripDetInfoFileReader * reader
std::stringstream ssV[4][19]

Member Data Documentation

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

Definition at line 60 of file SiStripQualityDQM.h.

Referenced by fillMEsForLayer().

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

Definition at line 56 of file SiStripQualityDQM.h.

Referenced by fillGrandSummaryMEs(), and SetBadComponents().

int SiStripQualityDQM::NTkBadComponent[4]
private

Definition at line 55 of file SiStripQualityDQM.h.

Referenced by fillGrandSummaryMEs().

edm::ESHandle<SiStripQuality> SiStripQualityDQM::qualityHandle_
private
std::string SiStripQualityDQM::qualityLabel_
private

Definition at line 53 of file SiStripQualityDQM.h.

Referenced by getConditionObject(), and SiStripQualityDQM().

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

Definition at line 57 of file SiStripQualityDQM.h.

Referenced by fillGrandSummaryMEs(), and SetBadComponents().