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:
SiStripBaseCondObjDQMGet< SiStripQuality, SiStripQualityRcd > SiStripBaseCondObjDQM

Public Member Functions

void fillGrandSummaryMEs ()
 
void fillMEsForDet (const ModMEs &selModME_, uint32_t selDetId_) override
 
void fillMEsForLayer (uint32_t selDetId_) override
 
void fillModMEs (const std::vector< uint32_t > &selectedDetIds) override
 
void fillSummaryMEs (const std::vector< uint32_t > &selectedDetIds) override
 
void getActiveDetIds (const edm::EventSetup &eSetup) override
 
 SiStripQualityDQM (edm::ESGetToken< SiStripQuality, SiStripQualityRcd > token, edm::RunNumber_t iRun, edm::ParameterSet const &hPSet, edm::ParameterSet const &fPSet, const TrackerTopology *tTopo, const TkDetMap *tkDetMap)
 
 ~SiStripQualityDQM () override
 
- Public Member Functions inherited from SiStripBaseCondObjDQMGet< SiStripQuality, SiStripQualityRcd >
bool checkChanged (const edm::EventSetup &eSetup) override
 
void getConditionObject (const edm::EventSetup &eSetup) override
 
 SiStripBaseCondObjDQMGet (tokentype token, edm::RunNumber_t iRun, edm::ParameterSet const &hPSet, edm::ParameterSet const &fPSet, const TrackerTopology *tTopo)
 
 ~SiStripBaseCondObjDQMGet () 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 ()
 
void selectModules (std::vector< uint32_t > &detIds_)
 
 SiStripBaseCondObjDQM (edm::RunNumber_t iRun, edm::ParameterSet const &hPSet, edm::ParameterSet const &fPSet, const TrackerTopology *tTopo)
 
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]
 
std::stringstream ssV [4][19]
 

Additional Inherited Members

- Public Types inherited from SiStripBaseCondObjDQMGet< SiStripQuality, SiStripQualityRcd >
using tokentype = typename edm::ESGetToken< SiStripQuality, SiStripQualityRcd >
 
- 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_)
 
void getModMEs (ModMEs &CondObj_ME, const uint32_t &detId_)
 
std::vector< uint32_t > GetSameLayerDetId (const std::vector< uint32_t > &activeDetIds, uint32_t selDetId)
 
std::pair< std::string, uint32_t > getStringNameAndId (const uint32_t &detId_)
 
void getSummaryMEs (ModMEs &CondObj_ME, const uint32_t &detId_)
 
- Protected Attributes inherited from SiStripBaseCondObjDQMGet< SiStripQuality, SiStripQualityRcd >
const SiStripQualitycondObj_
 
- Protected Attributes inherited from SiStripBaseCondObjDQM
std::vector< uint32_t > activeDetIds
 
std::vector< uint32_t > all_DetIds
 
std::string CondObj_fillId_
 
std::string CondObj_name_
 
SiStripDetInfo detInfo_
 
edm::ParameterSet fPSet_
 
bool GrandSummary_On_
 
bool HistoMaps_On_
 
edm::ParameterSet hPSet_
 
double maxValue
 
double minValue
 
bool Mod_On_
 
std::map< uint32_t, ModMEsModMEsMap_
 
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
 
const TrackerTopologytTopo_
 

Detailed Description

Definition at line 9 of file SiStripQualityDQM.h.

Constructor & Destructor Documentation

◆ SiStripQualityDQM()

SiStripQualityDQM::SiStripQualityDQM ( edm::ESGetToken< SiStripQuality, SiStripQualityRcd token,
edm::RunNumber_t  iRun,
edm::ParameterSet const &  hPSet,
edm::ParameterSet const &  fPSet,
const TrackerTopology tTopo,
const TkDetMap tkDetMap 
)

Definition at line 5 of file SiStripQualityDQM.cc.

References unpackBuffers-CaloStage2::token.

12  if (HistoMaps_On_) {
13  Tk_HM_ = std::make_unique<TkHistoMap>(tkDetMap, "SiStrip/Histo_Map", "Quality_TkMap", 0.);
14  }
15 }
std::unique_ptr< TkHistoMap > Tk_HM_

◆ ~SiStripQualityDQM()

SiStripQualityDQM::~SiStripQualityDQM ( )
override

Definition at line 17 of file SiStripQualityDQM.cc.

17 {}

Member Function Documentation

◆ fillGrandSummaryMEs()

void SiStripQualityDQM::fillGrandSummaryMEs ( )

Definition at line 144 of file SiStripQualityDQM.cc.

References a, dqm::implementation::IBooker::book1D(), alignmentValidation::c1, SiStripBaseCondObjDQMGet< SiStripQuality, SiStripQualityRcd >::condObj_, SiStripBadStrip::decode(), SiStripBaseCondObjDQM::detInfo_, SiStripBaseCondObjDQM::dqmStore_, PixelVTXMonitor_cfi::FolderName, SiStripBaseCondObjDQM::fPSet_, SiStripDetInfo::getAllDetIds(), SiStripQuality::getBadComponentList(), SiStripBadStrip::getDataVectorBegin(), edm::ParameterSet::getParameter(), SiStripBadStrip::getRegistryVectorBegin(), SiStripBadStrip::getRegistryVectorEnd(), SiStripBaseCondObjDQM::hPSet_, mps_fire::i, SiStripQuality::IsModuleUsable(), ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, dqmiolumiharvest::j, dqmdumpme::k, LogDebug, Skims_PA_cff::name, NBadComponent, NTkBadComponent, Utilities::operator, FastTimerService_cff::range, SiStripBadStrip::data::range, 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(), SiStripBaseCondObjDQM::tTopo_, and testProducerWithPsetDescEmpty_cfi::x1.

144  {
145  std::string hSummary_BadObjects_xTitle = hPSet_.getParameter<std::string>("Summary_BadObjects_histo_xTitle");
146 
147  std::string hSummary_BadModules_name = hPSet_.getParameter<std::string>("Summary_BadModules_histo_name");
148  std::string hSummary_BadModules_yTitle = hPSet_.getParameter<std::string>("Summary_BadModules_histo_yTitle");
149 
150  std::string hSummary_BadFibers_name = hPSet_.getParameter<std::string>("Summary_BadFibers_histo_name");
151  std::string hSummary_BadFibers_yTitle = hPSet_.getParameter<std::string>("Summary_BadFibers_histo_yTitle");
152 
153  std::string hSummary_BadApvs_name = hPSet_.getParameter<std::string>("Summary_BadApvs_histo_name");
154  std::string hSummary_BadApvs_yTitle = hPSet_.getParameter<std::string>("Summary_BadApvs_histo_yTitle");
155 
156  std::string hSummary_BadStrips_name = hPSet_.getParameter<std::string>("Summary_BadStrips_histo_name");
157  std::string hSummary_BadStrips_yTitle = hPSet_.getParameter<std::string>("Summary_BadStrips_histo_yTitle");
158 
159  int NchX = 34;
160  double LowX = 0.5;
161  double HighX = 34.5;
162 
163  MonitorElement *ME[4];
164 
166 
167  std::string FolderName = fPSet_.getParameter<std::string>("FolderName_For_QualityAndCabling_SummaryHistos");
168 
170 
171  ME[0] = dqmStore_->book1D(hSummary_BadModules_name, hSummary_BadModules_name, NchX, LowX, HighX);
172  ME[0]->setAxisTitle(hSummary_BadObjects_xTitle, 1);
173  ME[0]->setAxisTitle(hSummary_BadModules_yTitle, 2);
174 
175  ME[1] = dqmStore_->book1D(hSummary_BadFibers_name, hSummary_BadFibers_name, NchX, LowX, HighX);
176  ME[1]->setAxisTitle(hSummary_BadObjects_xTitle, 1);
177  ME[1]->setAxisTitle(hSummary_BadFibers_yTitle, 2);
178 
179  ME[2] = dqmStore_->book1D(hSummary_BadApvs_name, hSummary_BadApvs_name, NchX, LowX, HighX);
180  ME[2]->setAxisTitle(hSummary_BadObjects_xTitle, 1);
181  ME[2]->setAxisTitle(hSummary_BadApvs_yTitle, 2);
182 
183  ME[3] = dqmStore_->book1D(hSummary_BadStrips_name, hSummary_BadStrips_name, NchX, LowX, HighX);
184  ME[3]->setAxisTitle(hSummary_BadObjects_xTitle, 1);
185  ME[3]->setAxisTitle(hSummary_BadStrips_yTitle, 2);
186 
187  //==============================
188 
189  for (int i = 0; i < 4; ++i) {
190  NTkBadComponent[i] = 0;
191  for (int j = 0; j < 19; ++j) {
192  ssV[i][j].str("");
193  for (int k = 0; k < 4; ++k)
194  NBadComponent[i][j][k] = 0;
195  }
196  }
197 
198  std::stringstream ss;
199  ss.str("");
200  for (const auto det : detInfo_.getAllDetIds()) {
201  ss << "detid " << det << " IsModuleUsable " << condObj_->IsModuleUsable(det) << "\n";
202  }
203  LogDebug("SiStripQualityDQM") << ss.str() << std::endl;
204 
205  std::vector<SiStripQuality::BadComponent> BC = condObj_->getBadComponentList();
206 
207  for (size_t i = 0; i < BC.size(); ++i) {
208  //&&&&&&&&&&&&&
209  // Full Tk
210  //&&&&&&&&&&&&&
211 
212  if (BC[i].BadModule)
213  NTkBadComponent[0]++;
214  if (BC[i].BadFibers)
215  NTkBadComponent[1] += ((BC[i].BadFibers >> 2) & 0x1) + ((BC[i].BadFibers >> 1) & 0x1) + ((BC[i].BadFibers) & 0x1);
216  if (BC[i].BadApvs)
217  NTkBadComponent[2] += ((BC[i].BadApvs >> 5) & 0x1) + ((BC[i].BadApvs >> 4) & 0x1) + ((BC[i].BadApvs >> 3) & 0x1) +
218  ((BC[i].BadApvs >> 2) & 0x1) + ((BC[i].BadApvs >> 1) & 0x1) + ((BC[i].BadApvs) & 0x1);
219 
220  //&&&&&&&&&&&&&&&&&
221  // Single SubSyste
222  //&&&&&&&&&&&&&&&&&
223 
224  int component;
225  SiStripDetId a(BC[i].detid);
226  if (a.subdetId() == SiStripDetId::TIB) {
227  //&&&&&&&&&&&&&&&&&
228  // TIB
229  //&&&&&&&&&&&&&&&&&
230 
231  component = tTopo_->tibLayer(BC[i].detid);
232  SetBadComponents(0, component, BC[i]);
233 
234  } else if (a.subdetId() == SiStripDetId::TID) {
235  //&&&&&&&&&&&&&&&&&
236  // TID
237  //&&&&&&&&&&&&&&&&&
238 
239  component = tTopo_->tidSide(BC[i].detid) == 2 ? tTopo_->tidWheel(BC[i].detid) : tTopo_->tidWheel(BC[i].detid) + 3;
240  SetBadComponents(1, component, BC[i]);
241 
242  } else if (a.subdetId() == SiStripDetId::TOB) {
243  //&&&&&&&&&&&&&&&&&
244  // TOB
245  //&&&&&&&&&&&&&&&&&
246 
247  component = tTopo_->tobLayer(BC[i].detid);
248  SetBadComponents(2, component, BC[i]);
249 
250  } else if (a.subdetId() == SiStripDetId::TEC) {
251  //&&&&&&&&&&&&&&&&&
252  // TEC
253  //&&&&&&&&&&&&&&&&&
254 
255  component = tTopo_->tecSide(BC[i].detid) == 2 ? tTopo_->tecWheel(BC[i].detid) : tTopo_->tecWheel(BC[i].detid) + 9;
256  SetBadComponents(3, component, BC[i]);
257  }
258  }
259 
260  //&&&&&&&&&&&&&&&&&&
261  // Single Strip Info
262  //&&&&&&&&&&&&&&&&&&
263 
266 
267  for (SiStripBadStrip::RegistryIterator rp = rbegin; rp != rend; ++rp) {
268  uint32_t detid = rp->detid;
269 
270  int subdet = 0;
271  int component = 0;
272  SiStripDetId a(detid);
273  if (a.subdetId() == 3) {
274  subdet = 0;
275  component = tTopo_->tibLayer(detid);
276  } else if (a.subdetId() == 4) {
277  subdet = 1;
278  component = tTopo_->tidSide(detid) == 2 ? tTopo_->tidWheel(detid) : tTopo_->tidWheel(detid) + 3;
279  } else if (a.subdetId() == 5) {
280  subdet = 2;
281  component = tTopo_->tobLayer(detid);
282  } else if (a.subdetId() == 6) {
283  subdet = 3;
284  component = tTopo_->tecSide(detid) == 2 ? tTopo_->tecWheel(detid) : tTopo_->tecWheel(detid) + 9;
285  }
286 
287  SiStripQuality::Range sqrange =
289 
290  for (int it = 0; it < sqrange.second - sqrange.first; it++) {
291  unsigned int range = condObj_->decode(*(sqrange.first + it)).range;
292  NTkBadComponent[3] += range;
293  NBadComponent[subdet][0][3] += range;
294  NBadComponent[subdet][component][3] += range;
295  }
296  }
297 
298  //&&&&&&&&&&&&&&&&&&
299  // printout
300  //&&&&&&&&&&&&&&&&&&
301 
302  ss.str("");
303  ss << "\n-----------------\nGlobal Info\n-----------------";
304  ss << "\nBadComponent \t Modules \tFibers "
305  "\tApvs\tStrips\n------------------------------------------------------"
306  "----------";
307  ss << "\nTracker:\t\t" << NTkBadComponent[0] << "\t" << NTkBadComponent[1] << "\t" << NTkBadComponent[2] << "\t"
308  << NTkBadComponent[3];
309  ss << "\n";
310  ss << "\nTIB:\t\t\t" << NBadComponent[0][0][0] << "\t" << NBadComponent[0][0][1] << "\t" << NBadComponent[0][0][2]
311  << "\t" << NBadComponent[0][0][3];
312  ss << "\nTID:\t\t\t" << NBadComponent[1][0][0] << "\t" << NBadComponent[1][0][1] << "\t" << NBadComponent[1][0][2]
313  << "\t" << NBadComponent[1][0][3];
314  ss << "\nTOB:\t\t\t" << NBadComponent[2][0][0] << "\t" << NBadComponent[2][0][1] << "\t" << NBadComponent[2][0][2]
315  << "\t" << NBadComponent[2][0][3];
316  ss << "\nTEC:\t\t\t" << NBadComponent[3][0][0] << "\t" << NBadComponent[3][0][1] << "\t" << NBadComponent[3][0][2]
317  << "\t" << NBadComponent[3][0][3];
318  ss << "\n";
319 
320  for (int i = 1; i < 5; ++i) {
321  ss << "\nTIB Layer " << i << " :\t\t" << NBadComponent[0][i][0] << "\t" << NBadComponent[0][i][1] << "\t"
322  << NBadComponent[0][i][2] << "\t" << NBadComponent[0][i][3];
323  std::stringstream binlabel;
324  binlabel << "TIB L " << i;
325 
326  for (int j = 0; j < 4; j++) {
327  ME[j]->Fill(i, NBadComponent[0][i][j]);
328  ME[j]->setBinLabel(i, binlabel.str());
329  }
330  }
331  ss << "\n";
332  for (int i = 1; i < 4; ++i) {
333  ss << "\nTID+ Disk " << i << " :\t\t" << NBadComponent[1][i][0] << "\t" << NBadComponent[1][i][1] << "\t"
334  << NBadComponent[1][i][2] << "\t" << NBadComponent[1][i][3];
335  std::stringstream binlabel;
336  binlabel << "TID+ D " << i;
337 
338  for (int j = 0; j < 4; j++) {
339  ME[j]->Fill(i + 4, NBadComponent[1][i][j]);
340  ME[j]->setBinLabel(i + 4, binlabel.str());
341  }
342  }
343  for (int i = 4; i < 7; ++i) {
344  ss << "\nTID- Disk " << i - 3 << " :\t\t" << NBadComponent[1][i][0] << "\t" << NBadComponent[1][i][1] << "\t"
345  << NBadComponent[1][i][2] << "\t" << NBadComponent[1][i][3];
346  std::stringstream binlabel;
347  binlabel << "TID- D " << i - 3;
348 
349  for (int j = 0; j < 4; j++) {
350  ME[j]->Fill(i + 4, NBadComponent[1][i][j]);
351  ME[j]->setBinLabel(i + 4, binlabel.str());
352  }
353  }
354  ss << "\n";
355  for (int i = 1; i < 7; ++i) {
356  ss << "\nTOB Layer " << i << " :\t\t" << NBadComponent[2][i][0] << "\t" << NBadComponent[2][i][1] << "\t"
357  << NBadComponent[2][i][2] << "\t" << NBadComponent[2][i][3];
358  std::stringstream binlabel;
359  binlabel << "TOB L " << i;
360 
361  for (int j = 0; j < 4; j++) {
362  ME[j]->Fill(i + 10, NBadComponent[2][i][j]);
363  ME[j]->setBinLabel(i + 10, binlabel.str());
364  }
365  }
366  ss << "\n";
367  for (int i = 1; i < 10; ++i) {
368  ss << "\nTEC+ Disk " << i << " :\t\t" << NBadComponent[3][i][0] << "\t" << NBadComponent[3][i][1] << "\t"
369  << NBadComponent[3][i][2] << "\t" << NBadComponent[3][i][3];
370  std::stringstream binlabel;
371  binlabel << "TEC+ D " << i;
372 
373  for (int j = 0; j < 4; j++) {
374  ME[j]->Fill(i + 16, NBadComponent[3][i][j]);
375  ME[j]->setBinLabel(i + 16, binlabel.str());
376  }
377  }
378  for (int i = 10; i < 19; ++i) {
379  ss << "\nTEC- Disk " << i - 9 << " :\t\t" << NBadComponent[3][i][0] << "\t" << NBadComponent[3][i][1] << "\t"
380  << NBadComponent[3][i][2] << "\t" << NBadComponent[3][i][3];
381  std::stringstream binlabel;
382  binlabel << "TEC- D " << i - 9;
383 
384  for (int j = 0; j < 4; j++) {
385  ME[j]->Fill(i + 16, NBadComponent[3][i][j]);
386  ME[j]->setBinLabel(i + 16, binlabel.str());
387  }
388  }
389  ss << "\n";
390 
391  ss << "\n----------------------------------------------------------------"
392  "\n\t\t Detid \tModules Fibers "
393  "Apvs\n---------------------------------------------------------------"
394  "-";
395  for (int i = 1; i < 5; ++i)
396  ss << "\nTIB Layer " << i << " :" << ssV[0][i].str();
397  ss << "\n";
398  for (int i = 1; i < 4; ++i)
399  ss << "\nTID+ Disk " << i << " :" << ssV[1][i].str();
400  for (int i = 4; i < 7; ++i)
401  ss << "\nTID- Disk " << i - 3 << " :" << ssV[1][i].str();
402  ss << "\n";
403  for (int i = 1; i < 7; ++i)
404  ss << "\nTOB Layer " << i << " :" << ssV[2][i].str();
405  ss << "\n";
406  for (int i = 1; i < 10; ++i)
407  ss << "\nTEC+ Disk " << i << " :" << ssV[3][i].str();
408  for (int i = 10; i < 19; ++i)
409  ss << "\nTEC- Disk " << i - 9 << " :" << ssV[3][i].str();
410 
411  edm::LogInfo("SiStripQualityDQM") << ss.str() << std::endl;
412 
413  for (int i = 0; i < 4; i++) {
414  TCanvas c1("c1");
415  ME[i]->getTH1()->Draw();
416  std::string name(ME[i]->getTitle());
417  name += ".png";
418  c1.Print(name.c_str());
419  }
420 }
unsigned short range
ContainerIterator getDataVectorBegin() const
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
unsigned int tobLayer(const DetId &id) const
int NBadComponent[4][19][4]
const TrackerTopology * tTopo_
static constexpr auto TID
Definition: SiStripDetId.h:38
unsigned int tidSide(const DetId &id) const
unsigned int tidWheel(const DetId &id) const
unsigned int tecWheel(const DetId &id) const
void setCurrentFolder(std::string const &fullpath) override
Definition: DQMStore.h:647
Registry::const_iterator RegistryIterator
const std::vector< BadComponent > & getBadComponentList() const
Definition: ME.h:11
std::stringstream ssV[4][19]
unsigned int tecSide(const DetId &id) const
void SetBadComponents(int i, int component, SiStripQuality::BadComponent &BC)
RegistryIterator getRegistryVectorEnd() const
static constexpr auto TOB
Definition: SiStripDetId.h:39
Log< level::Info, false > LogInfo
Detector identifier class for the strip tracker.
Definition: SiStripDetId.h:18
static constexpr auto TIB
Definition: SiStripDetId.h:37
double a
Definition: hdecay.h:121
std::pair< ContainerIterator, ContainerIterator > Range
data decode(const unsigned int &value) const
unsigned int tibLayer(const DetId &id) const
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
#define str(s)
bool IsModuleUsable(uint32_t detid) const
const std::vector< uint32_t > & getAllDetIds() const noexcept
RegistryIterator getRegistryVectorBegin() const
static constexpr auto TEC
Definition: SiStripDetId.h:40
#define LogDebug(id)

◆ fillMEsForDet()

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

Implements SiStripBaseCondObjDQM.

Definition at line 31 of file SiStripQualityDQM.cc.

References SiStripBaseCondObjDQMGet< SiStripQuality, SiStripQualityRcd >::condObj_, SiStripBaseCondObjDQM::detInfo_, dqm::impl::MonitorElement::Fill(), SiStripBaseCondObjDQM::getModMEs(), SiStripDetInfo::getNumberOfApvsAndStripLength(), SiStripBadStrip::getRange(), SiStripQuality::IsStripBad(), and SiStripBaseCondObjDQM::ModMEs::ProfileDistr.

Referenced by fillModMEs().

31  {
32  ModMEs selModME_ = _selModME_;
33  getModMEs(selModME_, selDetId_);
34 
35  const auto qualityRange = condObj_->getRange(selDetId_);
36  int nStrip = detInfo_.getNumberOfApvsAndStripLength(selDetId_).first * 128;
37 
38  for (int istrip = 0; istrip < nStrip; ++istrip) {
39  selModME_.ProfileDistr->Fill(istrip + 1, condObj_->IsStripBad(qualityRange, istrip) ? 0. : 1.);
40 
41  } // istrip
42 }
void getModMEs(ModMEs &CondObj_ME, const uint32_t &detId_)
const Range getRange(const uint32_t detID) const
const std::pair< unsigned short, double > getNumberOfApvsAndStripLength(uint32_t detId) const
bool IsStripBad(uint32_t detid, short strip) const

◆ fillMEsForLayer()

void SiStripQualityDQM::fillMEsForLayer ( uint32_t  selDetId_)
overridevirtual

Implements SiStripBaseCondObjDQM.

Definition at line 64 of file SiStripQualityDQM.cc.

References SiStripBaseCondObjDQM::activeDetIds, alreadyFilledLayers, HltBtagPostValidation_cff::c, SiStripBaseCondObjDQMGet< SiStripQuality, SiStripQualityRcd >::condObj_, SiStripHistoId::createHistoLayer(), SiStripBaseCondObjDQM::detInfo_, dqm::impl::MonitorElement::Fill(), SiStripBaseCondObjDQM::fillTkMap(), dqmdumpme::first, nano_mu_digi_cff::float, SiStripBaseCondObjDQM::fPSet_, SiStripBaseCondObjDQM::getLayerNameAndId(), SiStripDetInfo::getNumberOfApvsAndStripLength(), edm::ParameterSet::getParameter(), SiStripBadStrip::getRange(), SiStripBaseCondObjDQM::GetSameLayerDetId(), SiStripBaseCondObjDQM::getSummaryMEs(), SiStripBaseCondObjDQM::hidmanager, SiStripBaseCondObjDQM::HistoMaps_On_, SiStripBaseCondObjDQM::hPSet_, mps_fire::i, SiStripQuality::IsStripBad(), edm::second(), dqm::impl::MonitorElement::setBinLabel(), jetUpdater_cfi::sort, AlCaHLTBitMon_QueryRunRegistry::string, SiStripBaseCondObjDQM::ModMEs::SummaryDistr, SiStripBaseCondObjDQM::SummaryMEsMap_, and SiStripBaseCondObjDQM::Tk_HM_.

Referenced by fillSummaryMEs().

65  {
66  float numberOfBadStrips = 0;
67 
69 
70  if (hPSet_.getParameter<bool>("FillSummaryAtLayerLevel")) {
71  std::string hSummary_description;
72  hSummary_description = hPSet_.getParameter<std::string>("Summary_description");
73 
74  std::string hSummary_name;
75 
76  // ----
77  int subDetId_ = ((selDetId_ >> 25) & 0x7);
78 
79  if (subDetId_ < 3 || subDetId_ > 6) {
80  edm::LogError("SiStripQualityDQM") << "[SiStripQualityDQM::fillMEsForLayer] WRONG INPUT : no such "
81  "subdetector type : "
82  << subDetId_ << " no folder set!" << std::endl;
83  return;
84  }
85  // ----
86 
87  hSummary_name = hidmanager.createHistoLayer(hSummary_description, "layer", getLayerNameAndId(selDetId_).first, "");
88 
89  const auto selMEsMapIter_ = SummaryMEsMap_.find(getLayerNameAndId(selDetId_).second);
90 
91  ModMEs selME_;
92  if (selMEsMapIter_ != SummaryMEsMap_.end())
93  selME_ = selMEsMapIter_->second;
94 
95  getSummaryMEs(selME_, selDetId_);
96 
97  std::vector<uint32_t> sameLayerDetIds_;
98  sameLayerDetIds_.clear();
99  sameLayerDetIds_ = GetSameLayerDetId(activeDetIds, selDetId_);
100  // -----
101  // unsigned int iBin=0;
102 
103  //%%%%%%%%%%%%%%%%%%%
104  //%%% FIXME: patch to fix the bug causing double counting on each layer
105  //%%%%%%%%%%%%%%%%%%%%%%%
106  if (std::binary_search(alreadyFilledLayers.begin(), alreadyFilledLayers.end(), sameLayerDetIds_[0]))
107  return;
108  alreadyFilledLayers.push_back(sameLayerDetIds_[0]);
110  //%%%%%%%%%%%%%%%%%%%%%%% END %%%%%%%%%%
111 
112  for (unsigned int i = 0; i < sameLayerDetIds_.size(); i++) {
113  const auto qualityRange = condObj_->getRange(sameLayerDetIds_[i]);
114  int nStrip = detInfo_.getNumberOfApvsAndStripLength(sameLayerDetIds_[i]).first * 128;
115 
116  numberOfBadStrips = 0;
117 
118  for (int istrip = 0; istrip < nStrip; ++istrip) {
119  if (condObj_->IsStripBad(qualityRange, istrip)) {
120  numberOfBadStrips++;
121  }
122  }
123 
124  float fr = 100 * float(numberOfBadStrips) / nStrip;
125  selME_.SummaryDistr->Fill(i + 1, fr);
126  if (fr > 20) {
127  char c[9];
128  sprintf(c, "%d", sameLayerDetIds_[i]);
129  selME_.SummaryDistr->setBinLabel(i + 1, c);
130  }
131 
132  // Fill the TkHistoMap with Quality output :
133  if (HistoMaps_On_)
134  Tk_HM_->setBinContent(sameLayerDetIds_[i], fr);
135 
136  // Fill the TkMap
137  if (fPSet_.getParameter<bool>("TkMap_On") || hPSet_.getParameter<bool>("TkMap_On")) {
138  fillTkMap(sameLayerDetIds_[i], fr);
139  }
140  }
141  } // if Fill ...
142 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
Log< level::Error, false > LogError
const Range getRange(const uint32_t detID) const
void fillTkMap(const uint32_t &detid, const float &value)
U second(std::pair< T, U > const &p)
std::map< uint32_t, ModMEs > SummaryMEsMap_
const std::pair< unsigned short, double > getNumberOfApvsAndStripLength(uint32_t detId) const
bool IsStripBad(uint32_t detid, short strip) const
std::vector< uint32_t > alreadyFilledLayers
std::pair< std::string, uint32_t > getLayerNameAndId(const uint32_t &detId_)
std::vector< uint32_t > GetSameLayerDetId(const std::vector< uint32_t > &activeDetIds, uint32_t selDetId)
std::vector< uint32_t > activeDetIds
std::string createHistoLayer(std::string description, std::string id_type, std::string path, std::string flag)
void getSummaryMEs(ModMEs &CondObj_ME, const uint32_t &detId_)
std::unique_ptr< TkHistoMap > Tk_HM_

◆ fillModMEs()

void SiStripQualityDQM::fillModMEs ( const std::vector< uint32_t > &  selectedDetIds)
overridevirtual

Reimplemented from SiStripBaseCondObjDQM.

Definition at line 24 of file SiStripQualityDQM.cc.

References fillMEsForDet().

24  {
25  ModMEs CondObj_ME;
26  for (const auto det : selectedDetIds) {
27  fillMEsForDet(CondObj_ME, det);
28  }
29 }
void fillMEsForDet(const ModMEs &selModME_, uint32_t selDetId_) override

◆ fillSummaryMEs()

void SiStripQualityDQM::fillSummaryMEs ( const std::vector< uint32_t > &  selectedDetIds)
overridevirtual

Reimplemented from SiStripBaseCondObjDQM.

Definition at line 44 of file SiStripQualityDQM.cc.

References alignmentValidation::c1, fillMEsForLayer(), SiStripBaseCondObjDQM::fPSet_, edm::ParameterSet::getParameter(), dqm::legacy::MonitorElement::getTH1(), dqm::impl::MonitorElement::getTitle(), SiStripBaseCondObjDQM::hPSet_, Skims_PA_cff::name, AlCaHLTBitMon_QueryRunRegistry::string, SiStripBaseCondObjDQM::ModMEs::SummaryDistr, and SiStripBaseCondObjDQM::SummaryMEsMap_.

44  {
45  for (const auto det : selectedDetIds) {
46  fillMEsForLayer(/*SummaryMEsMap_,*/ det);
47  }
48 
49  for (const auto &itm : SummaryMEsMap_) {
50  ModMEs selME;
51  selME = itm.second;
52 
53  if (hPSet_.getParameter<bool>("FillSummaryAtLayerLevel") &&
54  fPSet_.getParameter<bool>("OutputSummaryAtLayerLevelAsImage")) {
55  TCanvas c1("c1");
56  selME.SummaryDistr->getTH1()->Draw();
57  std::string name(selME.SummaryDistr->getTitle());
58  name += ".png";
59  c1.Print(name.c_str());
60  }
61  }
62 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
std::map< uint32_t, ModMEs > SummaryMEsMap_
void fillMEsForLayer(uint32_t selDetId_) override

◆ getActiveDetIds()

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

◆ SetBadComponents()

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

Definition at line 422 of file SiStripQualityDQM.cc.

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

Referenced by fillGrandSummaryMEs().

422  {
423  int napv = detInfo_.getNumberOfApvsAndStripLength(BC.detid).first;
424 
425  ssV[i][component] << "\n\t\t " << BC.detid << " \t " << BC.BadModule << " \t " << ((BC.BadFibers) & 0x1) << " ";
426  if (napv == 4)
427  ssV[i][component] << "x " << ((BC.BadFibers >> 1) & 0x1);
428 
429  if (napv == 6)
430  ssV[i][component] << ((BC.BadFibers >> 1) & 0x1) << " " << ((BC.BadFibers >> 2) & 0x1);
431  ssV[i][component] << " \t " << ((BC.BadApvs) & 0x1) << " " << ((BC.BadApvs >> 1) & 0x1) << " ";
432  if (napv == 4)
433  ssV[i][component] << "x x " << ((BC.BadApvs >> 2) & 0x1) << " " << ((BC.BadApvs >> 3) & 0x1);
434  if (napv == 6)
435  ssV[i][component] << ((BC.BadApvs >> 2) & 0x1) << " " << ((BC.BadApvs >> 3) & 0x1) << " "
436  << ((BC.BadApvs >> 4) & 0x1) << " " << ((BC.BadApvs >> 5) & 0x1) << " ";
437 
438  if (BC.BadApvs) {
439  NBadComponent[i][0][2] += ((BC.BadApvs >> 5) & 0x1) + ((BC.BadApvs >> 4) & 0x1) + ((BC.BadApvs >> 3) & 0x1) +
440  ((BC.BadApvs >> 2) & 0x1) + ((BC.BadApvs >> 1) & 0x1) + ((BC.BadApvs) & 0x1);
441  NBadComponent[i][component][2] += ((BC.BadApvs >> 5) & 0x1) + ((BC.BadApvs >> 4) & 0x1) +
442  ((BC.BadApvs >> 3) & 0x1) + ((BC.BadApvs >> 2) & 0x1) +
443  ((BC.BadApvs >> 1) & 0x1) + ((BC.BadApvs) & 0x1);
444  // tkMap->fillc(BC.detid,0xff0000);
445  }
446  if (BC.BadFibers) {
447  NBadComponent[i][0][1] += ((BC.BadFibers >> 2) & 0x1) + ((BC.BadFibers >> 1) & 0x1) + ((BC.BadFibers) & 0x1);
448  NBadComponent[i][component][1] +=
449  ((BC.BadFibers >> 2) & 0x1) + ((BC.BadFibers >> 1) & 0x1) + ((BC.BadFibers) & 0x1);
450  // tkMap->fillc(BC.detid,0x0000ff);
451  }
452  if (BC.BadModule) {
453  NBadComponent[i][0][0]++;
454  NBadComponent[i][component][0]++;
455  // tkMap->fillc(BC.detid,0x0);
456  }
457 }
int NBadComponent[4][19][4]
std::stringstream ssV[4][19]
const std::pair< unsigned short, double > getNumberOfApvsAndStripLength(uint32_t detId) const

Member Data Documentation

◆ alreadyFilledLayers

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

Definition at line 36 of file SiStripQualityDQM.h.

Referenced by fillMEsForLayer().

◆ NBadComponent

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

Definition at line 32 of file SiStripQualityDQM.h.

Referenced by fillGrandSummaryMEs(), and SetBadComponents().

◆ NTkBadComponent

int SiStripQualityDQM::NTkBadComponent[4]
private

Definition at line 31 of file SiStripQualityDQM.h.

Referenced by fillGrandSummaryMEs().

◆ ssV

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

Definition at line 33 of file SiStripQualityDQM.h.

Referenced by fillGrandSummaryMEs(), and SetBadComponents().