CMS 3D CMS Logo

Classes | Enumerations | Functions
SiStripPI Namespace Reference

Classes

class  Entry
 
class  Monitor1D
 
class  Monitor2D
 

Enumerations

enum  estimator { min, max, mean, rms }
 
enum  OpMode { STRIP_BASED, APV_BASED, MODULE_BASED }
 
enum  palette {
  HALFGRAY, GRAY, BLUES, REDS,
  ANTIGRAY, FIRE, ANTIFIRE, LOGREDBLUE,
  BLUERED, LOGBLUERED, DEFAULT
}
 
enum  TrackerRegion {
  TIB1r = 1010, TIB1s = 1011, TIB2r = 1020, TIB2s = 1021,
  TIB3r = 1030, TIB4r = 1040, TOB1r = 2010, TOB1s = 2011,
  TOB2r = 2020, TOB2s = 2021, TOB3r = 2030, TOB4r = 2040,
  TOB5r = 2050, TOB6r = 2060, TEC1r = 3010, TEC1s = 3011,
  TEC2r = 3020, TEC2s = 3021, TEC3r = 3030, TEC3s = 3031,
  TEC4r = 3040, TEC4s = 3041, TEC5r = 3050, TEC5s = 3051,
  TEC6r = 3060, TEC6s = 3061, TEC7r = 3070, TEC7s = 3071,
  TEC8r = 3080, TEC8s = 3081, TEC9r = 3090, TEC9s = 3091,
  TID1r = 4010, TID1s = 4011, TID2r = 4020, TID2s = 4021,
  TID3r = 4030, TID3s = 4031, END_OF_REGIONS
}
 

Functions

void drawStatBox (std::map< std::string, std::shared_ptr< TH1F >> histos, std::map< std::string, int > colormap, std::vector< std::string > legend, double X=0.15, double Y=0.93, double W=0.15, double H=0.10)
 
std::string estimatorType (SiStripPI::estimator e)
 
void fillBCArrays (const SiStripQuality *siStripQuality_, int NTkBadComponent[4], int NBadComponent[4][19][4], const TrackerTopology m_trackerTopo)
 
void fillNoiseDetSummary (SiStripDetSummary &summaryNoise, std::shared_ptr< SiStripNoises > payload, SiStripPI::estimator est)
 
void fillTotalComponents (int NTkComponents[4], int NComponents[4][19][4], const TrackerTopology m_trackerTopo)
 
std::pair< float, float > getExtrema (TH1 *h1, TH1 *h2)
 
std::string getStringFromSubdet (StripSubdetector::SubDetector sub)
 
std::pair< float, float > getTheRange (std::map< uint32_t, float > values, const float nsigma)
 
void makeNicePlotStyle (TH1 *hist)
 
void printBCDebug (int NTkBadComponent[4], int NBadComponent[4][19][4])
 
void printSummary (const std::map< unsigned int, SiStripDetSummary::Values > &map)
 
std::pair< int, const char * > regionType (int index)
 
void setBadComponents (int i, int component, const SiStripQuality::BadComponent &BC, int NBadComponent[4][19][4])
 
void setPaletteStyle (SiStripPI::palette palette)
 

Enumeration Type Documentation

Enumerator
min 
max 
mean 
rms 

Definition at line 176 of file SiStripPayloadInspectorHelper.h.

Enumerator
TIB1r 
TIB1s 
TIB2r 
TIB2s 
TIB3r 
TIB4r 
TOB1r 
TOB1s 
TOB2r 
TOB2s 
TOB3r 
TOB4r 
TOB5r 
TOB6r 
TEC1r 
TEC1s 
TEC2r 
TEC2s 
TEC3r 
TEC3s 
TEC4r 
TEC4s 
TEC5r 
TEC5s 
TEC6r 
TEC6s 
TEC7r 
TEC7s 
TEC8r 
TEC8s 
TEC9r 
TEC9s 
TID1r 
TID1s 
TID2r 
TID2s 
TID3r 
TID3s 
END_OF_REGIONS 

Definition at line 209 of file SiStripPayloadInspectorHelper.h.

209  {
210  TIB1r = 1010, TIB1s = 1011,
211  TIB2r = 1020, TIB2s = 1021,
212  TIB3r = 1030,
213  TIB4r = 1040,
214  TOB1r = 2010, TOB1s = 2011,
215  TOB2r = 2020, TOB2s = 2021,
216  TOB3r = 2030,
217  TOB4r = 2040,
218  TOB5r = 2050,
219  TOB6r = 2060,
220  TEC1r = 3010, TEC1s = 3011,
221  TEC2r = 3020, TEC2s = 3021,
222  TEC3r = 3030, TEC3s = 3031,
223  TEC4r = 3040, TEC4s = 3041,
224  TEC5r = 3050, TEC5s = 3051,
225  TEC6r = 3060, TEC6s = 3061,
226  TEC7r = 3070, TEC7s = 3071,
227  TEC8r = 3080, TEC8s = 3081,
228  TEC9r = 3090, TEC9s = 3091,
229  TID1r = 4010, TID1s = 4011,
230  TID2r = 4020, TID2s = 4021,
231  TID3r = 4030, TID3s = 4031,
233  };

Function Documentation

void SiStripPI::drawStatBox ( std::map< std::string, std::shared_ptr< TH1F >>  histos,
std::map< std::string, int >  colormap,
std::vector< std::string >  legend,
double  X = 0.15,
double  Y = 0.93,
double  W = 0.15,
double  H = 0.10 
)

Definition at line 316 of file SiStripPayloadInspectorHelper.h.

References edmScanValgrind::buffer, class-composition::H, plotFactory::histos, mps_fire::i, X, and DOFs::Y.

318  {
319  char buffer[255];
320 
321  int i=0;
322  for ( const auto &element : legend ){
323  TPaveText* stat = new TPaveText(X,Y-(i*H), X+W, Y-(i+1)*H, "NDC");
324  i++;
325  auto Histo = histos[element];
326  sprintf(buffer,"Entries : %i\n",(int)Histo->GetEntries());
327  stat->AddText(buffer);
328 
329  sprintf(buffer,"Mean : %6.2f\n",Histo->GetMean());
330  stat->AddText(buffer);
331 
332  sprintf(buffer,"RMS : %6.2f\n",Histo->GetRMS());
333  stat->AddText(buffer);
334 
335  stat->SetFillColor(0);
336  stat->SetLineColor(colormap[element]);
337  stat->SetTextColor(colormap[element]);
338  stat->SetTextSize(0.03);
339  stat->SetBorderSize(0);
340  stat->SetMargin(0.05);
341  stat->SetTextAlign(12);
342  stat->Draw();
343  }
344  }
#define X(str)
Definition: MuonsGrabber.cc:48
std::string SiStripPI::estimatorType ( SiStripPI::estimator  e)

Definition at line 184 of file SiStripPayloadInspectorHelper.h.

References max, mean, min, and rms.

186  {
187  switch(e){
188  case SiStripPI::min : return "minimum";
189  case SiStripPI::max : return "maximum";
190  case SiStripPI::mean : return "mean";
191  case SiStripPI::rms : return "RMS";
192  default: return "should never be here";
193  }
194  }
void SiStripPI::fillBCArrays ( const SiStripQuality siStripQuality_,
int  NTkBadComponent[4],
int  NBadComponent[4][19][4],
const TrackerTopology  m_trackerTopo 
)

Definition at line 554 of file SiStripPayloadInspectorHelper.h.

References SiStripBadStrip::decode(), SiStripQuality::getBadComponentList(), SiStripBadStrip::getDataVectorBegin(), SiStripDetInfoFileReader::getNumberOfApvsAndStripLength(), SiStripBadStrip::getRegistryVectorBegin(), SiStripBadStrip::getRegistryVectorEnd(), mps_fire::i, SiStripBadStrip::data::range, matplotRender::reader, setBadComponents(), DetId::subdetId(), StripSubdetector::TEC, TrackerTopology::tecSide(), TrackerTopology::tecWheel(), StripSubdetector::TIB, TrackerTopology::tibLayer(), StripSubdetector::TID, TrackerTopology::tidSide(), TrackerTopology::tidWheel(), StripSubdetector::TOB, TrackerTopology::tobLayer(), and globals_cff::x1.

556  {
557 
558  std::vector<SiStripQuality::BadComponent> BC = siStripQuality_->getBadComponentList();
559 
560  for (size_t i=0;i<BC.size();++i){
561 
562  //&&&&&&&&&&&&&
563  //Full Tk
564  //&&&&&&&&&&&&&
565 
566  if (BC.at(i).BadModule)
567  NTkBadComponent[0]++;
568  if (BC.at(i).BadFibers)
569  NTkBadComponent[1]+= ( (BC.at(i).BadFibers>>2)&0x1 )+ ( (BC.at(i).BadFibers>>1)&0x1 ) + ( (BC.at(i).BadFibers)&0x1 );
570  if (BC.at(i).BadApvs)
571  NTkBadComponent[2]+= ( (BC.at(i).BadApvs>>5)&0x1 )+ ( (BC.at(i).BadApvs>>4)&0x1 ) + ( (BC.at(i).BadApvs>>3)&0x1 ) +
572  ( (BC.at(i).BadApvs>>2)&0x1 )+ ( (BC.at(i).BadApvs>>1)&0x1 ) + ( (BC.at(i).BadApvs)&0x1 );
573 
574  //&&&&&&&&&&&&&&&&&
575  //Single SubSyste
576  //&&&&&&&&&&&&&&&&&
577  int component;
578  DetId detectorId=DetId(BC.at(i).detid);
579  int subDet = detectorId.subdetId();
580  if ( subDet == StripSubdetector::TIB ){
581  //&&&&&&&&&&&&&&&&&
582  //TIB
583  //&&&&&&&&&&&&&&&&&
584 
585  component=m_trackerTopo.tibLayer(BC.at(i).detid);
586  SiStripPI::setBadComponents(0, component, BC.at(i),NBadComponent);
587 
588  } else if ( subDet == StripSubdetector::TID ) {
589  //&&&&&&&&&&&&&&&&&
590  //TID
591  //&&&&&&&&&&&&&&&&&
592 
593  component=m_trackerTopo.tidSide(BC.at(i).detid)==2?m_trackerTopo.tidWheel(BC.at(i).detid):m_trackerTopo.tidWheel(BC.at(i).detid)+3;
594  SiStripPI::setBadComponents(1, component, BC.at(i),NBadComponent);
595 
596  } else if ( subDet == StripSubdetector::TOB ) {
597  //&&&&&&&&&&&&&&&&&
598  //TOB
599  //&&&&&&&&&&&&&&&&&
600 
601  component=m_trackerTopo.tobLayer(BC.at(i).detid);
602  SiStripPI::setBadComponents(2, component, BC.at(i),NBadComponent);
603 
604  } else if ( subDet == StripSubdetector::TEC ) {
605  //&&&&&&&&&&&&&&&&&
606  //TEC
607  //&&&&&&&&&&&&&&&&&
608 
609  component=m_trackerTopo.tecSide(BC.at(i).detid)==2?m_trackerTopo.tecWheel(BC.at(i).detid):m_trackerTopo.tecWheel(BC.at(i).detid)+9;
610  SiStripPI::setBadComponents(3, component, BC.at(i),NBadComponent);
611  }
612  }
613 
614  //&&&&&&&&&&&&&&&&&&
615  // Single Strip Info
616  //&&&&&&&&&&&&&&&&&&
617 
618  edm::FileInPath fp_ = edm::FileInPath("CalibTracker/SiStripCommon/data/SiStripDetInfo.dat");
620 
621  float percentage=0;
622 
623  SiStripQuality::RegistryIterator rbegin = siStripQuality_->getRegistryVectorBegin();
624  SiStripQuality::RegistryIterator rend = siStripQuality_->getRegistryVectorEnd();
625 
626  for (SiStripBadStrip::RegistryIterator rp=rbegin; rp != rend; ++rp) {
627  uint32_t detid=rp->detid;
628 
629  int subdet=-999; int component=-999;
630  DetId detectorId=DetId(detid);
631  int subDet = detectorId.subdetId();
632  if ( subDet == StripSubdetector::TIB ){
633  subdet=0;
634  component=m_trackerTopo.tibLayer(detid);
635  } else if ( subDet == StripSubdetector::TID ) {
636  subdet=1;
637  component=m_trackerTopo.tidSide(detid)==2?m_trackerTopo.tidWheel(detid):m_trackerTopo.tidWheel(detid)+3;
638  } else if ( subDet == StripSubdetector::TOB ) {
639  subdet=2;
640  component=m_trackerTopo.tobLayer(detid);
641  } else if ( subDet == StripSubdetector::TEC ) {
642  subdet=3;
643  component=m_trackerTopo.tecSide(detid)==2?m_trackerTopo.tecWheel(detid):m_trackerTopo.tecWheel(detid)+9;
644  }
645 
646  SiStripQuality::Range sqrange = SiStripQuality::Range( siStripQuality_->getDataVectorBegin()+rp->ibegin , siStripQuality_->getDataVectorBegin()+rp->iend );
647 
648  percentage=0;
649  for(int it=0;it<sqrange.second-sqrange.first;it++){
650  unsigned int range=siStripQuality_->decode( *(sqrange.first+it) ).range;
651  NTkBadComponent[3]+=range;
652  NBadComponent[subdet][0][3]+=range;
653  NBadComponent[subdet][component][3]+=range;
654  percentage+=range;
655  }
656  if(percentage!=0)
657  percentage/=128.*reader->getNumberOfApvsAndStripLength(detid).first;
658  if(percentage>1)
659  edm::LogError("SiStripBadStrip_PayloadInspector") << "PROBLEM detid " << detid << " value " << percentage<< std::endl;
660  }
661 
662  delete reader;
663 
664  }
unsigned short range
const std::vector< BadComponent > & getBadComponentList() const
unsigned int tibLayer(const DetId &id) const
const std::pair< unsigned short, double > getNumberOfApvsAndStripLength(uint32_t detId) const
unsigned int tidWheel(const DetId &id) const
Registry::const_iterator RegistryIterator
RegistryIterator getRegistryVectorEnd() const
unsigned int tidSide(const DetId &id) const
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:41
ContainerIterator getDataVectorBegin() const
Definition: DetId.h:18
void setBadComponents(int i, int component, const SiStripQuality::BadComponent &BC, int NBadComponent[4][19][4])
RegistryIterator getRegistryVectorBegin() const
std::pair< ContainerIterator, ContainerIterator > Range
unsigned int tecWheel(const DetId &id) const
data decode(const unsigned int &value) const
unsigned int tobLayer(const DetId &id) const
unsigned int tecSide(const DetId &id) const
void SiStripPI::fillNoiseDetSummary ( SiStripDetSummary summaryNoise,
std::shared_ptr< SiStripNoises payload,
SiStripPI::estimator  est 
)

Definition at line 452 of file SiStripPayloadInspectorHelper.h.

References SiStripDetSummary::add(), mps_fire::i, max, SiStripPI::Entry::mean(), mean, min, rms, and mathSSE::sqrt().

454  {
455  SiStripNoises::RegistryIterator rit=payload->getRegistryVectorBegin(), erit=payload->getRegistryVectorEnd();
456  uint16_t Nstrips;
457  std::vector<float> vstripnoise;
458  double mean,rms,min, max;
459  for(;rit!=erit;++rit){
460  Nstrips = (rit->iend-rit->ibegin)*8/9; //number of strips = number of chars * char size / strip noise size
461  vstripnoise.resize(Nstrips);
462  payload->allNoises(vstripnoise,make_pair(payload->getDataVectorBegin()+rit->ibegin,payload->getDataVectorBegin()+rit->iend));
463 
464  mean=0; rms=0; min=10000; max=0;
465 
466  DetId detId(rit->detid);
467 
468  for(size_t i=0;i<Nstrips;++i){
469  mean+=vstripnoise[i];
470  rms+=vstripnoise[i]*vstripnoise[i];
471  if(vstripnoise[i]<min) min=vstripnoise[i];
472  if(vstripnoise[i]>max) max=vstripnoise[i];
473  }
474 
475  mean/=Nstrips;
476  if((rms/Nstrips-mean*mean)>0.){
477  rms = sqrt(rms/Nstrips-mean*mean);
478  } else {
479  rms=0.;
480  }
481 
482  switch(est){
483  case SiStripPI::min:
484  summaryNoise.add(detId,min);
485  break;
486  case SiStripPI::max:
487  summaryNoise.add(detId,max);
488  break;
489  case SiStripPI::mean:
490  summaryNoise.add(detId,mean);
491  break;
492  case SiStripPI::rms:
493  summaryNoise.add(detId,rms);
494  break;
495  default:
496  edm::LogWarning("LogicError") << "Unknown estimator: " << est;
497  break;
498  }
499  }
500  }
T sqrt(T t)
Definition: SSEVec.h:18
Registry::const_iterator RegistryIterator
Definition: SiStripNoises.h:52
void add(DetId detid, float value)
Used to compute the mean value of the value variable divided by subdetector, layer and mono/stereo...
T min(T a, T b)
Definition: MathUtil.h:58
Definition: DetId.h:18
void SiStripPI::fillTotalComponents ( int  NTkComponents[4],
int  NComponents[4][19][4],
const TrackerTopology  m_trackerTopo 
)

Definition at line 503 of file SiStripPayloadInspectorHelper.h.

References edm::FileInPath::fullPath(), SiStripDetInfoFileReader::getAllData(), SiStripDetInfoFileReader::getNumberOfApvsAndStripLength(), matplotRender::reader, DetId::subdetId(), StripSubdetector::TEC, TrackerTopology::tecSide(), TrackerTopology::tecWheel(), StripSubdetector::TIB, TrackerTopology::tibLayer(), StripSubdetector::TID, TrackerTopology::tidSide(), TrackerTopology::tidWheel(), StripSubdetector::TOB, and TrackerTopology::tobLayer().

505  {
506  edm::FileInPath fp_ = edm::FileInPath("CalibTracker/SiStripCommon/data/SiStripDetInfo.dat");
508  const std::map<uint32_t, SiStripDetInfoFileReader::DetInfo >& DetInfos = reader->getAllData();
509  for (const auto& det : DetInfos){
510 
511  int nAPVs = reader->getNumberOfApvsAndStripLength(det.first).first;
512  // one fiber connects to 2 APVs
513  int nFibers = nAPVs/2;
514  int nStrips = (128*reader->getNumberOfApvsAndStripLength(det.first).first);
515  NTkComponents[0]++;
516  NTkComponents[1]+=nFibers;
517  NTkComponents[2]+=nAPVs;
518  NTkComponents[3]+=nStrips;
519 
520  DetId detectorId=DetId(det.first);
521  int subDet = detectorId.subdetId();
522 
523  int subDetIndex = -1;
524  int component = -1;
525  if ( subDet == StripSubdetector::TIB ){
526  subDetIndex=0;
527  component=m_trackerTopo.tibLayer(det.first);
528  } else if ( subDet == StripSubdetector::TID ){
529  subDetIndex=1;
530  component=m_trackerTopo.tidSide(det.first)==2?m_trackerTopo.tidWheel(det.first):m_trackerTopo.tidWheel(det.first)+3;
531  } else if ( subDet == StripSubdetector::TOB ){
532  subDetIndex=2;
533  component=m_trackerTopo.tobLayer(det.first);
534  } else if ( subDet == StripSubdetector::TEC ){
535  subDetIndex=3;
536  component=m_trackerTopo.tecSide(det.first)==2?m_trackerTopo.tecWheel(det.first):m_trackerTopo.tecWheel(det.first)+9;
537  }
538 
539  NComponents[subDetIndex][0][0]++;
540  NComponents[subDetIndex][0][1]+=nFibers;
541  NComponents[subDetIndex][0][2]+=nAPVs;
542  NComponents[subDetIndex][0][3]+=nStrips;
543 
544  NComponents[subDetIndex][component][0]++;
545  NComponents[subDetIndex][component][1]+=nFibers;
546  NComponents[subDetIndex][component][2]+=nAPVs;
547  NComponents[subDetIndex][component][3]+=nStrips;
548  }
549  delete reader;
550  }
unsigned int tibLayer(const DetId &id) const
const std::pair< unsigned short, double > getNumberOfApvsAndStripLength(uint32_t detId) const
unsigned int tidWheel(const DetId &id) const
const std::map< uint32_t, DetInfo > & getAllData() const
unsigned int tidSide(const DetId &id) const
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:41
Definition: DetId.h:18
std::string fullPath() const
Definition: FileInPath.cc:163
unsigned int tecWheel(const DetId &id) const
unsigned int tobLayer(const DetId &id) const
unsigned int tecSide(const DetId &id) const
std::pair<float,float> SiStripPI::getExtrema ( TH1 *  h1,
TH1 *  h2 
)

Definition at line 347 of file SiStripPayloadInspectorHelper.h.

References mps_fire::result.

349  {
350  float theMax(-9999.);
351  float theMin(9999.);
352  theMax = h1->GetMaximum() > h2->GetMaximum() ? h1->GetMaximum() : h2->GetMaximum();
353  theMin = h1->GetMinimum() < h2->GetMaximum() ? h1->GetMinimum() : h2->GetMinimum();
354 
355  float add_min = theMin>0. ? -0.05 : 0.05;
356  float add_max = theMax>0. ? 0.05 : -0.05;
357 
358  auto result = std::make_pair(theMin*(1+add_min),theMax*(1+add_max));
359  return result;
360 
361  }
std::string SiStripPI::getStringFromSubdet ( StripSubdetector::SubDetector  sub)

Definition at line 197 of file SiStripPayloadInspectorHelper.h.

References StripSubdetector::TEC, StripSubdetector::TIB, StripSubdetector::TID, and StripSubdetector::TOB.

199  {
200  switch(sub){
201  case StripSubdetector::TIB : return "TIB";
202  case StripSubdetector::TOB : return "TOB";
203  case StripSubdetector::TID : return "TID";
204  case StripSubdetector::TEC : return "TEC";
205  default : return "should never be here";
206  }
207  }
std::pair<float,float> SiStripPI::getTheRange ( std::map< uint32_t, float >  values,
const float  nsigma 
)

Definition at line 287 of file SiStripPayloadInspectorHelper.h.

References begin, end, funct::m, AlCaHLTBitMon_ParallelJobs::p, mathSSE::sqrt(), plotscripts::stdev(), and SiStripPI::Entry::sum.

Referenced by SiStripMiscalibrate::getTruncatedRange().

289  {
290  float sum = std::accumulate(std::begin(values),
291  std::end(values),
292  0.0,
293  [] (float value, const std::map<uint32_t,float>::value_type& p)
294  { return value + p.second; }
295  );
296 
297  float m = sum / values.size();
298 
299  float accum = 0.0;
300  std::for_each (std::begin(values),
301  std::end(values),
303  {accum += (p.second - m) * (p.second - m);}
304  );
305 
306  float stdev = sqrt(accum / (values.size()-1));
307 
308  if(stdev!=0.){
309  return std::make_pair(m-nsigma*stdev,m+nsigma*stdev);
310  } else {
311  return std::make_pair(m>0.? 0.95*m : 1.05*m, m>0? 1.05*m : 0.95*m);
312  }
313  }
T sqrt(T t)
Definition: SSEVec.h:18
#define end
Definition: vmac.h:39
Definition: value.py:1
#define begin
Definition: vmac.h:32
def stdev(xlist)
Definition: plotscripts.py:69
void SiStripPI::makeNicePlotStyle ( TH1 *  hist)

Definition at line 365 of file SiStripPayloadInspectorHelper.h.

367  {
368  hist->SetStats(kFALSE);
369  hist->SetLineWidth(2);
370  hist->GetXaxis()->CenterTitle(true);
371  hist->GetYaxis()->CenterTitle(true);
372  hist->GetXaxis()->SetTitleFont(42);
373  hist->GetYaxis()->SetTitleFont(42);
374  hist->GetXaxis()->SetTitleSize(0.05);
375  hist->GetYaxis()->SetTitleSize(0.05);
376  hist->GetXaxis()->SetTitleOffset(0.9);
377  hist->GetYaxis()->SetTitleOffset(1.3);
378  hist->GetXaxis()->SetLabelFont(42);
379  hist->GetYaxis()->SetLabelFont(42);
380  hist->GetYaxis()->SetLabelSize(.05);
381  hist->GetXaxis()->SetLabelSize(.05);
382  }
void SiStripPI::printBCDebug ( int  NTkBadComponent[4],
int  NBadComponent[4][19][4] 
)

Definition at line 667 of file SiStripPayloadInspectorHelper.h.

References gather_cfg::cout, and mps_fire::i.

669  {
670  //&&&&&&&&&&&&&&&&&&
671  // printout
672  //&&&&&&&&&&&&&&&&&&
673 
674  std::stringstream ss;
675  ss.str("");
676  ss << "\n-----------------\nGlobal Info\n-----------------";
677  ss << "\nBadComponent \t Modules \tFibers \tApvs\tStrips\n----------------------------------------------------------------";
678  ss << "\nTracker:\t\t"<<NTkBadComponent[0]<<"\t"<<NTkBadComponent[1]<<"\t"<<NTkBadComponent[2]<<"\t"<<NTkBadComponent[3];
679  ss<< "\n";
680  ss << "\nTIB:\t\t\t"<<NBadComponent[0][0][0]<<"\t"<<NBadComponent[0][0][1]<<"\t"<<NBadComponent[0][0][2]<<"\t"<<NBadComponent[0][0][3];
681  ss << "\nTID:\t\t\t"<<NBadComponent[1][0][0]<<"\t"<<NBadComponent[1][0][1]<<"\t"<<NBadComponent[1][0][2]<<"\t"<<NBadComponent[1][0][3];
682  ss << "\nTOB:\t\t\t"<<NBadComponent[2][0][0]<<"\t"<<NBadComponent[2][0][1]<<"\t"<<NBadComponent[2][0][2]<<"\t"<<NBadComponent[2][0][3];
683  ss << "\nTEC:\t\t\t"<<NBadComponent[3][0][0]<<"\t"<<NBadComponent[3][0][1]<<"\t"<<NBadComponent[3][0][2]<<"\t"<<NBadComponent[3][0][3];
684  ss << "\n";
685 
686  for (int i=1;i<5;++i)
687  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];
688  ss << "\n";
689  for (int i=1;i<4;++i)
690  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];
691  for (int i=4;i<7;++i)
692  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];
693  ss << "\n";
694  for (int i=1;i<7;++i)
695  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];
696  ss << "\n";
697  for (int i=1;i<10;++i)
698  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];
699  for (int i=10;i<19;++i)
700  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];
701  ss<< "\n";
702 
703  //edm::LogInfo("SiStripBadStrip_PayloadInspector") << ss.str() << std::endl;
704  std::cout<< ss.str() << std::endl;
705 
706  }
void SiStripPI::printSummary ( const std::map< unsigned int, SiStripDetSummary::Values > &  map)

Definition at line 386 of file SiStripPayloadInspectorHelper.h.

References KineDebug3::count(), gather_cfg::cout, gamEcalExtractorBlocks_cff::detector, SiStripPI::Entry::mean(), regionType(), rms, mathSSE::sqrt(), and AlCaHLTBitMon_QueryRunRegistry::string.

388  {
389  for (const auto &element : map){
390  int count = element.second.count;
391  double mean = count>0 ? (element.second.mean)/count : 0. ;
392  double rms = count>0 ? (element.second.rms)/count - mean*mean : 0.;
393  if(rms <= 0)
394  rms = 0;
395  else
396  rms = sqrt(rms);
397 
399 
400  switch ((element.first)/1000)
401  {
402  case 1:
403  detector = "TIB ";
404  break;
405  case 2:
406  detector = "TOB ";
407  break;
408  case 3:
409  detector = "TEC ";
410  break;
411  case 4:
412  detector = "TID ";
413  break;
414  }
415 
416  int layer = (element.first)/10 - (element.first)/1000*100;
417  int stereo = (element.first) - (layer*10) -(element.first)/1000*1000;
418 
419  std::cout<<"key of the map:"<<element.first <<" ( region: "<<regionType(element.first).second <<" ) "
420  << detector<<" layer: "<<layer<<" stereo:"<<stereo
421  <<"| count:"<<count<<" mean: "<<mean<<" rms: "<<rms<<std::endl;
422 
423  }
424  }
T sqrt(T t)
Definition: SSEVec.h:18
std::pair< int, const char * > regionType(int index)
std::pair<int,const char *> SiStripPI::regionType ( int  index)

Definition at line 236 of file SiStripPayloadInspectorHelper.h.

References END_OF_REGIONS, TEC1r, TEC1s, TEC2r, TEC2s, TEC3r, TEC3s, TEC4r, TEC4s, TEC5r, TEC5s, TEC6r, TEC6s, TEC7r, TEC7s, TEC8r, TEC8s, TEC9r, TEC9s, TIB1r, TIB1s, TIB2r, TIB2s, TIB3r, TIB4r, TID1r, TID1s, TID2r, TID2s, TID3r, TID3s, TOB1r, TOB1s, TOB2r, TOB2s, TOB3r, TOB4r, TOB5r, and TOB6r.

Referenced by printSummary().

238  {
239 
240  auto region = static_cast<std::underlying_type_t<SiStripPI::TrackerRegion> >(index);
241 
242  switch(region){
243  case SiStripPI::TIB1r: return std::make_pair(1 ,"TIB L1 r-#varphi");
244  case SiStripPI::TIB1s: return std::make_pair(2 ,"TIB L1 stereo");
245  case SiStripPI::TIB2r: return std::make_pair(3 ,"TIB L2 r-#varphi");
246  case SiStripPI::TIB2s: return std::make_pair(4 ,"TIB L2 stereo");
247  case SiStripPI::TIB3r: return std::make_pair(5 ,"TIB L3");
248  case SiStripPI::TIB4r: return std::make_pair(6 ,"TIB L4");
249  case SiStripPI::TOB1r: return std::make_pair(7 ,"TOB L1 r-#varphi");
250  case SiStripPI::TOB1s: return std::make_pair(8 ,"TOB L1 stereo");
251  case SiStripPI::TOB2r: return std::make_pair(9 ,"TOB L2 r-#varphi");
252  case SiStripPI::TOB2s: return std::make_pair(10,"TOB L2 stereo");
253  case SiStripPI::TOB3r: return std::make_pair(11,"TOB L3 r-#varphi");
254  case SiStripPI::TOB4r: return std::make_pair(12,"TOB L4");
255  case SiStripPI::TOB5r: return std::make_pair(13,"TOB L5");
256  case SiStripPI::TOB6r: return std::make_pair(14,"TOB L6");
257  case SiStripPI::TEC1r: return std::make_pair(15,"TEC D1 r-#varphi");
258  case SiStripPI::TEC1s: return std::make_pair(16,"TEC D1 stereo");
259  case SiStripPI::TEC2r: return std::make_pair(17,"TEC D2 r-#varphi");
260  case SiStripPI::TEC2s: return std::make_pair(18,"TEC D2 stereo");
261  case SiStripPI::TEC3r: return std::make_pair(19,"TEC D3 r-#varphi");
262  case SiStripPI::TEC3s: return std::make_pair(20,"TEC D3 stereo");
263  case SiStripPI::TEC4r: return std::make_pair(21,"TEC D4 r-#varphi");
264  case SiStripPI::TEC4s: return std::make_pair(22,"TEC D4 stereo");
265  case SiStripPI::TEC5r: return std::make_pair(23,"TEC D5 r-#varphi");
266  case SiStripPI::TEC5s: return std::make_pair(24,"TEC D5 stereo");
267  case SiStripPI::TEC6r: return std::make_pair(25,"TEC D6 r-#varphi");
268  case SiStripPI::TEC6s: return std::make_pair(26,"TEC D6 stereo");
269  case SiStripPI::TEC7r: return std::make_pair(27,"TEC D7 r-#varphi");
270  case SiStripPI::TEC7s: return std::make_pair(28,"TEC D7 stereo");
271  case SiStripPI::TEC8r: return std::make_pair(29,"TEC D8 r-#varphi");
272  case SiStripPI::TEC8s: return std::make_pair(30,"TEC D8 stereo");
273  case SiStripPI::TEC9r: return std::make_pair(31,"TEC D9 r-#varphi");
274  case SiStripPI::TEC9s: return std::make_pair(32,"TEC D9 stereo");
275  case SiStripPI::TID1r: return std::make_pair(33,"TID D1 r-#varphi");
276  case SiStripPI::TID1s: return std::make_pair(34,"TID D1 stereo");
277  case SiStripPI::TID2r: return std::make_pair(35,"TID D2 r-#varphi");
278  case SiStripPI::TID2s: return std::make_pair(36,"TID D2 stereo");
279  case SiStripPI::TID3r: return std::make_pair(37,"TID D3 r-#varphi");
280  case SiStripPI::TID3s: return std::make_pair(38,"TID D3 stereo");
281  case SiStripPI::END_OF_REGIONS : std::make_pair(-1,"undefined");
282  default : return std::make_pair(999,"should never be here");
283  }
284  }
void SiStripPI::setBadComponents ( int  i,
int  component,
const SiStripQuality::BadComponent BC,
int  NBadComponent[4][19][4] 
)

Definition at line 429 of file SiStripPayloadInspectorHelper.h.

References SiStripQuality::BadComponent::BadApvs, SiStripQuality::BadComponent::BadFibers, SiStripQuality::BadComponent::BadModule, KineDebug3::count(), and mps_fire::i.

Referenced by fillBCArrays().

431  {
432 
433  if (BC.BadApvs){
434  NBadComponent[i][0][2]+= std::bitset<16>(BC.BadApvs&0x3f).count();
435  NBadComponent[i][component][2]+= std::bitset<16>(BC.BadApvs&0x3f).count();
436  }
437 
438  if (BC.BadFibers){
439  NBadComponent[i][0][1]+= std::bitset<4>(BC.BadFibers&0x7).count();
440  NBadComponent[i][component][1]+= std::bitset<4>(BC.BadFibers&0x7).count();
441  }
442 
443  if (BC.BadModule){
444  NBadComponent[i][0][0]++;
445  NBadComponent[i][component][0]++;
446  }
447  }
void SiStripPI::setPaletteStyle ( SiStripPI::palette  palette)

Definition at line 712 of file SiStripPayloadInspectorHelper.h.

References ANTIFIRE, ANTIGRAY, DivergingColor::blue, BLUERED, BLUES, gather_cfg::cout, FIRE, GRAY, cmsRelvalreport::green(), HALFGRAY, LOGBLUERED, LOGREDBLUE, DivergingColor::red, and REDS.

714  {
715 
716  TStyle *palettestyle = new TStyle("palettestyle","Style for P-TDR");
717 
718  const int NRGBs = 5;
719  const int NCont = 255;
720 
721  switch(palette){
722 
723  case HALFGRAY:
724  {
725  double stops[NRGBs] = {0.00, 0.34, 0.61, 0.84, 1.00};
726  double red[NRGBs] = {1.00, 0.91, 0.80, 0.67, 1.00};
727  double green[NRGBs] = {1.00, 0.91, 0.80, 0.67, 1.00};
728  double blue[NRGBs] = {1.00, 0.91, 0.80, 0.67, 1.00};
729  TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont);
730  }
731  break;
732 
733  case GRAY:
734  {
735  double stops[NRGBs] = {0.00, 0.01, 0.05, 0.09, 0.1};
736  double red[NRGBs] = {1.00, 0.84, 0.61, 0.34, 0.00};
737  double green[NRGBs] = {1.00, 0.84, 0.61, 0.34, 0.00};
738  double blue[NRGBs] = {1.00, 0.84, 0.61, 0.34, 0.00};
739  TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont);
740  }
741  break;
742 
743  case BLUES:
744  {
745  double stops[NRGBs] = {0.00, 0.34, 0.61, 0.84, 1.00};
746  double red[NRGBs] = {1.00, 0.84, 0.61, 0.34, 0.00};
747  double green[NRGBs] = {1.00, 0.84, 0.61, 0.34, 0.00};
748  double blue[NRGBs] = {1.00, 1.00, 1.00, 1.00, 1.00};
749  TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont);
750 
751  }
752  break;
753 
754  case REDS:
755  {
756  double stops[NRGBs] = {0.00, 0.34, 0.61, 0.84, 1.00};
757  double red[NRGBs] = {1.00, 1.00, 1.00, 1.00, 1.00};
758  double green[NRGBs] = {1.00, 0.84, 0.61, 0.34, 0.00};
759  double blue[NRGBs] = {1.00, 0.84, 0.61, 0.34, 0.00};
760  TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont);
761  }
762  break;
763 
764  case ANTIGRAY:
765  {
766  double stops[NRGBs] = {0.00, 0.34, 0.61, 0.84, 1.00};
767  double red[NRGBs] = {0.00, 0.34, 0.61, 0.84, 1.00};
768  double green[NRGBs] = {0.00, 0.34, 0.61, 0.84, 1.00};
769  double blue[NRGBs] = {0.00, 0.34, 0.61, 0.84, 1.00};
770  TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont);
771  }
772  break;
773 
774  case FIRE:
775  {
776  double stops[NRGBs] = {0.00, 0.20, 0.80, 1.00};
777  double red[NRGBs] = {1.00, 1.00, 1.00, 0.50};
778  double green[NRGBs] = {1.00, 1.00, 0.00, 0.00};
779  double blue[NRGBs] = {0.20, 0.00, 0.00, 0.00};
780  TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont);
781  }
782  break;
783 
784  case ANTIFIRE:
785  {
786  double stops[NRGBs] = {0.00, 0.20, 0.80, 1.00};
787  double red[NRGBs] = {0.50, 1.00, 1.00, 1.00};
788  double green[NRGBs] = {0.00, 0.00, 1.00, 1.00};
789  double blue[NRGBs] = {0.00, 0.00, 0.00, 0.20};
790  TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont);
791  }
792  break;
793 
794  case LOGREDBLUE:
795  {
796  double stops[NRGBs] = {0.0001, 0.0010, 0.0100, 0.1000, 1.0000};
797  double red[NRGBs] = {1.00, 0.75, 0.50, 0.25, 0.00};
798  double green[NRGBs] = {0.00, 0.00, 0.00, 0.00, 0.00};
799  double blue[NRGBs] = {0.00, 0.25, 0.50, 0.75, 1.00};
800  TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont);
801  }
802  break;
803 
804  case LOGBLUERED:
805  {
806  double stops[NRGBs] = {0.0001, 0.0010, 0.0100, 0.1000, 1.0000};
807  double red[NRGBs] = {0.00, 0.25, 0.50, 0.75, 1.00};
808  double green[NRGBs] = {0.00, 0.00, 0.00, 0.00, 0.00};
809  double blue[NRGBs] = {1.00, 0.75, 0.50, 0.25, 0.00};
810  TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont);
811  }
812  break;
813 
814  case BLUERED:
815  {
816  double stops[NRGBs] = {0.00, 0.34, 0.61, 0.84, 1.00};
817  double red[NRGBs] = {0.00, 0.25, 0.50, 0.75, 1.00};
818  double green[NRGBs] = {0.00, 0.00, 0.00, 0.00, 0.00};
819  double blue[NRGBs] = {1.00, 0.75, 0.50, 0.25, 0.00};
820  TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont);
821  }
822  break;
823 
824  case DEFAULT:
825  {
826  double stops[NRGBs] = {0.00, 0.34, 0.61, 0.84, 1.00};
827  double red[NRGBs] = {0.00, 0.00, 0.87, 1.00, 0.51};
828  double green[NRGBs] = {0.00, 0.81, 1.00, 0.20, 0.00};
829  double blue[NRGBs] = {0.51, 1.00, 0.12, 0.00, 0.00};
830  TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont);
831  }
832  break;
833  default:
834  std::cout<<"should nevere be here" << std::endl;
835  break;
836  }
837 
838  palettestyle->SetNumberContours(NCont);
839  }
def green(string)