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 7 of file SiStripQualityDQM.cc.

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

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

Definition at line 21 of file SiStripQualityDQM.cc.

21 {}

Member Function Documentation

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

Definition at line 194 of file SiStripQualityDQM.cc.

References a, DQMStore::book1D(), alignmentValidation::c1, SiStripBaseCondObjDQM::dqmStore_, MonitorElement::Fill(), SiStripBaseCondObjDQM::fPSet_, edm::EventSetup::get(), SiStripDetInfoFileReader::getAllDetIds(), edm::ParameterSet::getParameter(), MonitorElement::getTH1(), SiStripBaseCondObjDQM::hPSet_, i, j, relval_2017::k, LogDebug, mergeVDriftHistosByStation::name, NBadComponent, NTkBadComponent, cppFunctionSkipper::operator, edm::ESHandle< class >::product(), qualityHandle_, SiStripBaseCondObjDQM::reader, MonitorElement::setAxisTitle(), SetBadComponents(), DQMStore::setCurrentFolder(), contentValuesCheck::ss, 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().

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

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

Referenced by fillModMEs().

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

Implements SiStripBaseCondObjDQM.

Definition at line 107 of file SiStripQualityDQM.cc.

References SiStripBaseCondObjDQM::activeDetIds, alreadyFilledLayers, EnergyCorrector::c, SiStripHistoId::createHistoLayer(), MonitorElement::Fill(), SiStripBaseCondObjDQM::fillTkMap(), plotBeamSpotDB::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(), AlCaHLTBitMon_QueryRunRegistry::string, SiStripBaseCondObjDQM::ModMEs::SummaryDistr, SiStripBaseCondObjDQM::SummaryMEsMap_, and SiStripBaseCondObjDQM::Tk_HM_.

Referenced by fillSummaryMEs().

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

Reimplemented from SiStripBaseCondObjDQM.

Definition at line 35 of file SiStripQualityDQM.cc.

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

35  {
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();
45  detIter_!= selectedDetIds.end();detIter_++){
46  fillMEsForDet(CondObj_ME,*detIter_,tTopo);
47 
48  }
49 }
const T & get() const
Definition: EventSetup.h:56
T const * product() const
Definition: ESHandle.h:86
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 73 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_.

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

Implements SiStripBaseCondObjDQM.

Definition at line 26 of file SiStripQualityDQM.cc.

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

26  {
27  getConditionObject(eSetup);
28  qualityHandle_->getDetIds(activeDetIds);
29 
30 }
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:56
void SiStripQualityDQM::getConditionObject ( const edm::EventSetup eSetup)
inlinevirtual
void SiStripQualityDQM::SetBadComponents ( int  i,
int  component,
SiStripQuality::BadComponent BC 
)
private

Definition at line 475 of file SiStripQualityDQM.cc.

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

Referenced by fillGrandSummaryMEs().

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