CMS 3D CMS Logo

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

#include <SiStripQualityDQM.h>

Inheritance diagram for SiStripQualityDQM:
SiStripBaseCondObjDQM

Public Member Functions

void fillGrandSummaryMEs (const edm::EventSetup &eSetup)
 
void fillMEsForDet (const ModMEs &selModME_, uint32_t selDetId_, const TrackerTopology *tTopo)
 
void fillMEsForLayer (uint32_t selDetId_, const TrackerTopology *tTopo)
 
void fillModMEs (const std::vector< uint32_t > &selectedDetIds, const edm::EventSetup &es)
 
void fillSummaryMEs (const std::vector< uint32_t > &selectedDetIds, const edm::EventSetup &es)
 
void getActiveDetIds (const edm::EventSetup &eSetup)
 
unsigned long long getCache (const edm::EventSetup &eSetup)
 
void getConditionObject (const edm::EventSetup &eSetup)
 
 SiStripQualityDQM (const edm::EventSetup &eSetup, edm::ParameterSet const &hPSet, edm::ParameterSet const &fPSet)
 
virtual ~SiStripQualityDQM ()
 
- 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_)
 
 SiStripBaseCondObjDQM (const edm::EventSetup &eSetup, 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_
 
TkHistoMapTk_HM_
 
TkHistoMapTk_HM_H
 
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::ParameterSet const &  hPSet,
edm::ParameterSet const &  fPSet 
)

Definition at line 6 of file SiStripQualityDQM.cc.

References edm::ParameterSet::getParameter(), SiStripBaseCondObjDQM::HistoMaps_On_, qualityLabel_, AlCaHLTBitMon_QueryRunRegistry::string, and SiStripBaseCondObjDQM::Tk_HM_.

8  :SiStripBaseCondObjDQM(eSetup, hPSet, fPSet){
9  qualityLabel_ = fPSet.getParameter<std::string>("StripQualityLabel");
10 
11  // Build the Histo_TkMap:
12  if(HistoMaps_On_ ) Tk_HM_ = new TkHistoMap("SiStrip/Histo_Map","Quality_TkMap",0.);
13 
14 }
SiStripBaseCondObjDQM(const edm::EventSetup &eSetup, edm::ParameterSet const &hPSet, edm::ParameterSet const &fPSet)
std::string qualityLabel_
SiStripQualityDQM::~SiStripQualityDQM ( )
virtual

Definition at line 20 of file SiStripQualityDQM.cc.

20 {}

Member Function Documentation

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

Definition at line 193 of file SiStripQualityDQM.cc.

References a, DQMStore::book1D(), alignmentValidation::c1, cond::rpcobgas::detid, SiStripBaseCondObjDQM::dqmStore_, MonitorElement::Fill(), SiStripBaseCondObjDQM::fPSet_, edm::EventSetup::get(), SiStripDetInfoFileReader::getAllDetIds(), edm::ParameterSet::getParameter(), MonitorElement::getTH1(), SiStripBaseCondObjDQM::hPSet_, i, j, gen::k, LogDebug, mergeVDriftHistosByStation::name, NBadComponent, NTkBadComponent, cppFunctionSkipper::operator, edm::ESHandle< class >::product(), qualityHandle_, SiStripBaseCondObjDQM::reader, MonitorElement::setAxisTitle(), SetBadComponents(), DQMStore::setCurrentFolder(), ssV, AlCaHLTBitMon_QueryRunRegistry::string, DetId::subdetId(), SiStripDetId::TEC, TrackerTopology::tecSide(), TrackerTopology::tecWheel(), SiStripDetId::TIB, TrackerTopology::tibLayer(), SiStripDetId::TID, TrackerTopology::tidSide(), TrackerTopology::tidWheel(), SiStripDetId::TOB, and TrackerTopology::tobLayer().

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

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

Implements SiStripBaseCondObjDQM.

Definition at line 55 of file SiStripQualityDQM.cc.

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

Referenced by fillModMEs().

55  {
56  ModMEs selModME_ = _selModME_;
57  getModMEs(selModME_,selDetId_, tTopo);
58 
59  SiStripQuality::Range qualityRange = qualityHandle_->getRange(selDetId_);
60  int nStrip = reader->getNumberOfApvsAndStripLength(selDetId_).first*128;
61 
62  for( int istrip=0;istrip<nStrip;++istrip){
63  selModME_.ProfileDistr->Fill(istrip+1,qualityHandle_->IsStripBad(qualityRange,istrip)?0.:1.);
64 
65  }// istrip
66 
67 }
const std::pair< unsigned short, double > getNumberOfApvsAndStripLength(uint32_t detId) const
SiStripDetInfoFileReader * reader
PixelRecoRange< float > Range
void getModMEs(ModMEs &CondObj_ME, const uint32_t &detId_, const TrackerTopology *tTopo)
edm::ESHandle< SiStripQuality > qualityHandle_
void SiStripQualityDQM::fillMEsForLayer ( uint32_t  selDetId_,
const TrackerTopology tTopo 
)
virtual

Implements SiStripBaseCondObjDQM.

Definition at line 106 of file SiStripQualityDQM.cc.

References SiStripBaseCondObjDQM::activeDetIds, alreadyFilledLayers, trackerHits::c, SiStripHistoId::createHistoLayer(), MonitorElement::Fill(), SiStripBaseCondObjDQM::fillTkMap(), first, SiStripBaseCondObjDQM::fPSet_, SiStripBaseCondObjDQM::getLayerNameAndId(), SiStripDetInfoFileReader::getNumberOfApvsAndStripLength(), edm::ParameterSet::getParameter(), SiStripBaseCondObjDQM::GetSameLayerDetId(), SiStripBaseCondObjDQM::getSummaryMEs(), MonitorElement::getTH1(), SiStripBaseCondObjDQM::hidmanager, SiStripBaseCondObjDQM::HistoMaps_On_, SiStripBaseCondObjDQM::hPSet_, i, qualityHandle_, SiStripBaseCondObjDQM::reader, edm::second(), TkHistoMap::setBinContent(), python.multivaluedict::sort(), AlCaHLTBitMon_QueryRunRegistry::string, SiStripBaseCondObjDQM::ModMEs::SummaryDistr, SiStripBaseCondObjDQM::SummaryMEsMap_, and SiStripBaseCondObjDQM::Tk_HM_.

Referenced by fillSummaryMEs().

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

Reimplemented from SiStripBaseCondObjDQM.

Definition at line 34 of file SiStripQualityDQM.cc.

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

34  {
35 
36  //Retrieve tracker topology from geometry
38  es.get<IdealGeometryRecord>().get(tTopoHandle);
39  const TrackerTopology* const tTopo = tTopoHandle.product();
40 
41  ModMEs CondObj_ME;
42 
43  for(std::vector<uint32_t>::const_iterator detIter_ = selectedDetIds.begin();
44  detIter_!= selectedDetIds.end();detIter_++){
45  fillMEsForDet(CondObj_ME,*detIter_,tTopo);
46 
47  }
48 }
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:62
void fillMEsForDet(const ModMEs &selModME_, uint32_t selDetId_, const TrackerTopology *tTopo)
void SiStripQualityDQM::fillSummaryMEs ( const std::vector< uint32_t > &  selectedDetIds,
const edm::EventSetup es 
)
virtual

Reimplemented from SiStripBaseCondObjDQM.

Definition at line 72 of file SiStripQualityDQM.cc.

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

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

Implements SiStripBaseCondObjDQM.

Definition at line 25 of file SiStripQualityDQM.cc.

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

25  {
26  getConditionObject(eSetup);
27  qualityHandle_->getDetIds(activeDetIds);
28 
29 }
std::vector< uint32_t > activeDetIds
edm::ESHandle< SiStripQuality > qualityHandle_
void getConditionObject(const edm::EventSetup &eSetup)
unsigned long long SiStripQualityDQM::getCache ( const edm::EventSetup eSetup)
inlinevirtual

Implements SiStripBaseCondObjDQM.

Definition at line 48 of file SiStripQualityDQM.h.

References edm::EventSetup::get().

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

Definition at line 474 of file SiStripQualityDQM.cc.

References SiStripDetInfoFileReader::getNumberOfApvsAndStripLength(), i, NBadComponent, SiStripBaseCondObjDQM::reader, and ssV.

Referenced by fillGrandSummaryMEs().

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

Referenced by fillMEsForLayer().

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

Definition at line 59 of file SiStripQualityDQM.h.

Referenced by fillGrandSummaryMEs(), and SetBadComponents().

int SiStripQualityDQM::NTkBadComponent[4]
private

Definition at line 58 of file SiStripQualityDQM.h.

Referenced by fillGrandSummaryMEs().

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

Definition at line 56 of file SiStripQualityDQM.h.

Referenced by getConditionObject(), and SiStripQualityDQM().

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

Definition at line 60 of file SiStripQualityDQM.h.

Referenced by fillGrandSummaryMEs(), and SetBadComponents().