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 28 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_.

10  :SiStripBaseCondObjDQM(eSetup, iRun, hPSet, fPSet){
11  qualityLabel_ = fPSet.getParameter<std::string>("StripQualityLabel");
12 
13  // Build the Histo_TkMap:
14  if ( HistoMaps_On_ ) {
15  edm::ESHandle<TkDetMap> tkDetMapHandle;
16  eSetup.get<TrackerTopologyRcd>().get(tkDetMapHandle);
17  Tk_HM_ = std::make_unique<TkHistoMap>(tkDetMapHandle.product(), "SiStrip/Histo_Map","Quality_TkMap",0.);
18  }
19 }
SiStripBaseCondObjDQM(const edm::EventSetup &eSetup, edm::RunNumber_t iRun, edm::ParameterSet const &hPSet, edm::ParameterSet const &fPSet)
T get() const
Definition: EventSetup.h:62
std::string qualityLabel_
T const * product() const
Definition: ESHandle.h:86
std::unique_ptr< TkHistoMap > Tk_HM_
SiStripQualityDQM::~SiStripQualityDQM ( )
override

Definition at line 25 of file SiStripQualityDQM.cc.

25 {}

Member Function Documentation

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

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

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

60  {
61  ModMEs selModME_ = _selModME_;
62  getModMEs(selModME_,selDetId_, tTopo);
63 
64  SiStripQuality::Range qualityRange = qualityHandle_->getRange(selDetId_);
65  int nStrip = reader->getNumberOfApvsAndStripLength(selDetId_).first*128;
66 
67  for( int istrip=0;istrip<nStrip;++istrip){
68  selModME_.ProfileDistr->Fill(istrip+1,qualityHandle_->IsStripBad(qualityRange,istrip)?0.:1.);
69 
70  }// istrip
71 
72 }
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 111 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().

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

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

39  {
40 
41  //Retrieve tracker topology from geometry
43  es.get<TrackerTopologyRcd>().get(tTopoHandle);
44  const TrackerTopology* const tTopo = tTopoHandle.product();
45 
46  ModMEs CondObj_ME;
47 
48  for(std::vector<uint32_t>::const_iterator detIter_ = selectedDetIds.begin();
49  detIter_!= selectedDetIds.end();detIter_++){
50  fillMEsForDet(CondObj_ME,*detIter_,tTopo);
51 
52  }
53 }
T get() const
Definition: EventSetup.h:62
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 77 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_.

77  {
78 
79  //Retrieve tracker topology from geometry
81  es.get<TrackerTopologyRcd>().get(tTopoHandle);
82  const TrackerTopology* const tTopo = tTopoHandle.product();
83 
84  for(std::vector<uint32_t>::const_iterator detIter_ = selectedDetIds.begin();
85  detIter_!= selectedDetIds.end();detIter_++){
86  fillMEsForLayer(/*SummaryMEsMap_,*/ *detIter_,tTopo);
87 
88  }
89 
90  for (std::map<uint32_t, ModMEs>::iterator iter=SummaryMEsMap_.begin(); iter!=SummaryMEsMap_.end(); iter++){
91 
92  ModMEs selME;
93  selME = iter->second;
94 
95  if(hPSet_.getParameter<bool>("FillSummaryAtLayerLevel") && fPSet_.getParameter<bool>("OutputSummaryAtLayerLevelAsImage")){
96 
97  TCanvas c1("c1");
98  selME.SummaryDistr->getTH1()->Draw();
99  std::string name (selME.SummaryDistr->getTH1()->GetTitle());
100  name+=".png";
101  c1.Print(name.c_str());
102  }
103  }
104 
105 }
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:62
T const * product() const
Definition: ESHandle.h:86
void SiStripQualityDQM::getActiveDetIds ( const edm::EventSetup eSetup)
overridevirtual

Implements SiStripBaseCondObjDQM.

Definition at line 30 of file SiStripQualityDQM.cc.

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

30  {
31  getConditionObject(eSetup);
33 
34 }
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 49 of file SiStripQualityDQM.h.

References edm::EventSetup::get().

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

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

479  {
480 
481  int napv=reader->getNumberOfApvsAndStripLength(BC.detid).first;
482 
483  ssV[i][component] << "\n\t\t "
484  << BC.detid
485  << " \t " << BC.BadModule << " \t "
486  << ( (BC.BadFibers)&0x1 ) << " ";
487  if (napv==4)
488  ssV[i][component] << "x " <<( (BC.BadFibers>>1)&0x1 );
489 
490  if (napv==6)
491  ssV[i][component] << ( (BC.BadFibers>>1)&0x1 ) << " "
492  << ( (BC.BadFibers>>2)&0x1 );
493  ssV[i][component] << " \t "
494  << ( (BC.BadApvs)&0x1 ) << " "
495  << ( (BC.BadApvs>>1)&0x1 ) << " ";
496  if (napv==4)
497  ssV[i][component] << "x x " << ( (BC.BadApvs>>2)&0x1 ) << " "
498  << ( (BC.BadApvs>>3)&0x1 );
499  if (napv==6)
500  ssV[i][component] << ( (BC.BadApvs>>2)&0x1 ) << " "
501  << ( (BC.BadApvs>>3)&0x1 ) << " "
502  << ( (BC.BadApvs>>4)&0x1 ) << " "
503  << ( (BC.BadApvs>>5)&0x1 ) << " ";
504 
505  if (BC.BadApvs){
506  NBadComponent[i][0][2]+= ( (BC.BadApvs>>5)&0x1 )+ ( (BC.BadApvs>>4)&0x1 ) + ( (BC.BadApvs>>3)&0x1 ) +
507  ( (BC.BadApvs>>2)&0x1 )+ ( (BC.BadApvs>>1)&0x1 ) + ( (BC.BadApvs)&0x1 );
508  NBadComponent[i][component][2]+= ( (BC.BadApvs>>5)&0x1 )+ ( (BC.BadApvs>>4)&0x1 ) + ( (BC.BadApvs>>3)&0x1 ) +
509  ( (BC.BadApvs>>2)&0x1 )+ ( (BC.BadApvs>>1)&0x1 ) + ( (BC.BadApvs)&0x1 );
510  // tkMap->fillc(BC.detid,0xff0000);
511  }
512  if (BC.BadFibers){
513  NBadComponent[i][0][1]+= ( (BC.BadFibers>>2)&0x1 )+ ( (BC.BadFibers>>1)&0x1 ) + ( (BC.BadFibers)&0x1 );
514  NBadComponent[i][component][1]+= ( (BC.BadFibers>>2)&0x1 )+ ( (BC.BadFibers>>1)&0x1 ) + ( (BC.BadFibers)&0x1 );
515  // tkMap->fillc(BC.detid,0x0000ff);
516  }
517  if (BC.BadModule){
518  NBadComponent[i][0][0]++;
519  NBadComponent[i][component][0]++;
520  // tkMap->fillc(BC.detid,0x0);
521  }
522 }
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 64 of file SiStripQualityDQM.h.

Referenced by fillMEsForLayer().

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

Definition at line 60 of file SiStripQualityDQM.h.

Referenced by fillGrandSummaryMEs(), and SetBadComponents().

int SiStripQualityDQM::NTkBadComponent[4]
private

Definition at line 59 of file SiStripQualityDQM.h.

Referenced by fillGrandSummaryMEs().

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

Definition at line 57 of file SiStripQualityDQM.h.

Referenced by getConditionObject(), and SiStripQualityDQM().

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

Definition at line 61 of file SiStripQualityDQM.h.

Referenced by fillGrandSummaryMEs(), and SetBadComponents().