CMS 3D CMS Logo

Classes | Typedefs | Enumerations | Functions
SiStripPI Namespace Reference

Classes

class  Entry
 
class  Monitor1D
 
class  Monitor2D
 

Typedefs

using MetaData = std::tuple< cond::Time_t, cond::Hash >
 

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)
 
double getMaximum (TObjArray *array)
 
std::string getStringFromSubdet (StripSubdetector::SubDetector sub)
 
std::pair< float, float > getTheRange (std::map< uint32_t, float > values, const float nsigma)
 
void makeNicePlotStyle (TH1 *hist)
 
template<class T >
void makeNiceStyle (T *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)
 

Typedef Documentation

◆ MetaData

using SiStripPI::MetaData = typedef std::tuple<cond::Time_t, cond::Hash>

Definition at line 32 of file SiStripPayloadInspectorHelper.h.

Enumeration Type Documentation

◆ estimator

◆ OpMode

◆ palette

◆ TrackerRegion

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 216 of file SiStripPayloadInspectorHelper.h.

216  {
217  TIB1r = 1010,
218  TIB1s = 1011,
219  TIB2r = 1020,
220  TIB2s = 1021,
221  TIB3r = 1030,
222  TIB4r = 1040,
223  TOB1r = 2010,
224  TOB1s = 2011,
225  TOB2r = 2020,
226  TOB2s = 2021,
227  TOB3r = 2030,
228  TOB4r = 2040,
229  TOB5r = 2050,
230  TOB6r = 2060,
231  TEC1r = 3010,
232  TEC1s = 3011,
233  TEC2r = 3020,
234  TEC2s = 3021,
235  TEC3r = 3030,
236  TEC3s = 3031,
237  TEC4r = 3040,
238  TEC4s = 3041,
239  TEC5r = 3050,
240  TEC5s = 3051,
241  TEC6r = 3060,
242  TEC6s = 3061,
243  TEC7r = 3070,
244  TEC7s = 3071,
245  TEC8r = 3080,
246  TEC8s = 3081,
247  TEC9r = 3090,
248  TEC9s = 3091,
249  TID1r = 4010,
250  TID1s = 4011,
251  TID2r = 4020,
252  TID2s = 4021,
253  TID3r = 4030,
254  TID3s = 4031,
256  };

Function Documentation

◆ drawStatBox()

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 
)
inline

Definition at line 374 of file SiStripPayloadInspectorHelper.h.

References edmScanValgrind::buffer, data-class-funcs::H, combine::histos, mps_fire::i, compareTotals::legend, X, and beamSpotPI::Y.

382  {
383  char buffer[255];
384 
385  int i = 0;
386  for (const auto& element : legend) {
387  TPaveText* stat = new TPaveText(X, Y - (i * H), X + W, Y - (i + 1) * H, "NDC");
388  i++;
389  auto Histo = histos[element];
390  sprintf(buffer, "Entries : %i\n", (int)Histo->GetEntries());
391  stat->AddText(buffer);
392 
393  sprintf(buffer, "Mean : %6.2f\n", Histo->GetMean());
394  stat->AddText(buffer);
395 
396  sprintf(buffer, "RMS : %6.2f\n", Histo->GetRMS());
397  stat->AddText(buffer);
398 
399  stat->SetFillColor(0);
400  stat->SetLineColor(colormap[element]);
401  stat->SetTextColor(colormap[element]);
402  stat->SetTextSize(0.03);
403  stat->SetBorderSize(0);
404  stat->SetMargin(0.05);
405  stat->SetTextAlign(12);
406  stat->Draw();
407  }
408  }
#define X(str)
Definition: MuonsGrabber.cc:38
histos
Definition: combine.py:4

◆ estimatorType()

std::string SiStripPI::estimatorType ( SiStripPI::estimator  e)
inline

Definition at line 181 of file SiStripPayloadInspectorHelper.h.

References MillePedeFileConverter_cfg::e, max, mean, min, and rms.

Referenced by SiStripCondObjectRepresent::SiStripDataContainer< Item, type >::fillTrackerMap().

183  {
184  switch (e) {
185  case SiStripPI::min:
186  return "minimum";
187  case SiStripPI::max:
188  return "maximum";
189  case SiStripPI::mean:
190  return "mean";
191  case SiStripPI::rms:
192  return "RMS";
193  default:
194  return "should never be here";
195  }
196  }

◆ fillBCArrays()

void SiStripPI::fillBCArrays ( const SiStripQuality siStripQuality_,
int  NTkBadComponent[4],
int  NBadComponent[4][19][4],
const TrackerTopology  m_trackerTopo 
)
inline

Definition at line 656 of file SiStripPayloadInspectorHelper.h.

References SiStripBadStrip::decode(), contentValuesFiles::fullPath, SiStripQuality::getBadComponentList(), SiStripBadStrip::getDataVectorBegin(), SiStripBadStrip::getRegistryVectorBegin(), SiStripBadStrip::getRegistryVectorEnd(), mps_fire::i, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, SiStripDetInfoFileReader::kDefaultFile, FastTimerService_cff::range, SiStripBadStrip::data::range, SiStripDetInfoFileReader::read(), setBadComponents(), sistrip::STRIPS_PER_APV, DetId::subdetId(), StripSubdetector::TEC, TrackerTopology::tecSide(), TrackerTopology::tecWheel(), StripSubdetector::TIB, TrackerTopology::tibLayer(), StripSubdetector::TID, TrackerTopology::tidSide(), TrackerTopology::tidWheel(), StripSubdetector::TOB, and TrackerTopology::tobLayer().

661  {
662  std::vector<SiStripQuality::BadComponent> BC = siStripQuality_->getBadComponentList();
663 
664  for (size_t i = 0; i < BC.size(); ++i) {
665  //&&&&&&&&&&&&&
666  //Full Tk
667  //&&&&&&&&&&&&&
668 
669  if (BC.at(i).BadModule)
670  NTkBadComponent[0]++;
671  if (BC.at(i).BadFibers)
672  NTkBadComponent[1] +=
673  ((BC.at(i).BadFibers >> 2) & 0x1) + ((BC.at(i).BadFibers >> 1) & 0x1) + ((BC.at(i).BadFibers) & 0x1);
674  if (BC.at(i).BadApvs)
675  NTkBadComponent[2] += ((BC.at(i).BadApvs >> 5) & 0x1) + ((BC.at(i).BadApvs >> 4) & 0x1) +
676  ((BC.at(i).BadApvs >> 3) & 0x1) + ((BC.at(i).BadApvs >> 2) & 0x1) +
677  ((BC.at(i).BadApvs >> 1) & 0x1) + ((BC.at(i).BadApvs) & 0x1);
678 
679  //&&&&&&&&&&&&&&&&&
680  //Single SubSyste
681  //&&&&&&&&&&&&&&&&&
682  int component;
683  DetId detectorId = DetId(BC.at(i).detid);
684  int subDet = detectorId.subdetId();
685  if (subDet == StripSubdetector::TIB) {
686  //&&&&&&&&&&&&&&&&&
687  //TIB
688  //&&&&&&&&&&&&&&&&&
689 
690  component = m_trackerTopo.tibLayer(BC.at(i).detid);
691  SiStripPI::setBadComponents(0, component, BC.at(i), NBadComponent);
692 
693  } else if (subDet == StripSubdetector::TID) {
694  //&&&&&&&&&&&&&&&&&
695  //TID
696  //&&&&&&&&&&&&&&&&&
697 
698  component = m_trackerTopo.tidSide(BC.at(i).detid) == 2 ? m_trackerTopo.tidWheel(BC.at(i).detid)
699  : m_trackerTopo.tidWheel(BC.at(i).detid) + 3;
700  SiStripPI::setBadComponents(1, component, BC.at(i), NBadComponent);
701 
702  } else if (subDet == StripSubdetector::TOB) {
703  //&&&&&&&&&&&&&&&&&
704  //TOB
705  //&&&&&&&&&&&&&&&&&
706 
707  component = m_trackerTopo.tobLayer(BC.at(i).detid);
708  SiStripPI::setBadComponents(2, component, BC.at(i), NBadComponent);
709 
710  } else if (subDet == StripSubdetector::TEC) {
711  //&&&&&&&&&&&&&&&&&
712  //TEC
713  //&&&&&&&&&&&&&&&&&
714 
715  component = m_trackerTopo.tecSide(BC.at(i).detid) == 2 ? m_trackerTopo.tecWheel(BC.at(i).detid)
716  : m_trackerTopo.tecWheel(BC.at(i).detid) + 9;
717  SiStripPI::setBadComponents(3, component, BC.at(i), NBadComponent);
718  }
719  }
720 
721  //&&&&&&&&&&&&&&&&&&
722  // Single Strip Info
723  //&&&&&&&&&&&&&&&&&&
724 
725  const auto detInfo =
727 
728  float percentage = 0;
729 
730  SiStripQuality::RegistryIterator rbegin = siStripQuality_->getRegistryVectorBegin();
731  SiStripQuality::RegistryIterator rend = siStripQuality_->getRegistryVectorEnd();
732 
733  for (SiStripBadStrip::RegistryIterator rp = rbegin; rp != rend; ++rp) {
734  uint32_t detid = rp->detid;
735 
736  int subdet = -999;
737  int component = -999;
738  DetId detectorId = DetId(detid);
739  int subDet = detectorId.subdetId();
740  if (subDet == StripSubdetector::TIB) {
741  subdet = 0;
742  component = m_trackerTopo.tibLayer(detid);
743  } else if (subDet == StripSubdetector::TID) {
744  subdet = 1;
745  component =
746  m_trackerTopo.tidSide(detid) == 2 ? m_trackerTopo.tidWheel(detid) : m_trackerTopo.tidWheel(detid) + 3;
747  } else if (subDet == StripSubdetector::TOB) {
748  subdet = 2;
749  component = m_trackerTopo.tobLayer(detid);
750  } else if (subDet == StripSubdetector::TEC) {
751  subdet = 3;
752  component =
753  m_trackerTopo.tecSide(detid) == 2 ? m_trackerTopo.tecWheel(detid) : m_trackerTopo.tecWheel(detid) + 9;
754  }
755 
756  SiStripQuality::Range sqrange = SiStripQuality::Range(siStripQuality_->getDataVectorBegin() + rp->ibegin,
757  siStripQuality_->getDataVectorBegin() + rp->iend);
758 
759  percentage = 0;
760  for (int it = 0; it < sqrange.second - sqrange.first; it++) {
761  unsigned int range = siStripQuality_->decode(*(sqrange.first + it)).range;
762  NTkBadComponent[3] += range;
763  NBadComponent[subdet][0][3] += range;
764  NBadComponent[subdet][component][3] += range;
765  percentage += range;
766  }
767  if (percentage != 0)
768  percentage /= sistrip::STRIPS_PER_APV * detInfo.getNumberOfApvsAndStripLength(detid).first;
769  if (percentage > 1)
770  edm::LogError("SiStripBadStrip_PayloadInspector")
771  << "PROBLEM detid " << detid << " value " << percentage << std::endl;
772  }
773  }
unsigned short range
static constexpr auto TEC
ContainerIterator getDataVectorBegin() const
unsigned int tobLayer(const DetId &id) const
unsigned int tidSide(const DetId &id) const
unsigned int tidWheel(const DetId &id) const
unsigned int tecWheel(const DetId &id) const
Registry::const_iterator RegistryIterator
Log< level::Error, false > LogError
const std::vector< BadComponent > & getBadComponentList() const
unsigned int tecSide(const DetId &id) const
RegistryIterator getRegistryVectorEnd() const
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
SiStripDetInfo read(std::string filePath)
static constexpr auto TOB
Definition: DetId.h:17
void setBadComponents(int i, int component, const SiStripQuality::BadComponent &BC, int NBadComponent[4][19][4])
static constexpr auto TIB
static const uint16_t STRIPS_PER_APV
std::pair< ContainerIterator, ContainerIterator > Range
data decode(const unsigned int &value) const
static constexpr char const *const kDefaultFile
unsigned int tibLayer(const DetId &id) const
static constexpr auto TID
RegistryIterator getRegistryVectorBegin() const

◆ fillNoiseDetSummary()

void SiStripPI::fillNoiseDetSummary ( SiStripDetSummary summaryNoise,
std::shared_ptr< SiStripNoises payload,
SiStripPI::estimator  est 
)
inline

Definition at line 546 of file SiStripPayloadInspectorHelper.h.

References SiStripDetSummary::add(), hcalRecHitTable_cff::detId, mps_fire::i, max, mean, min, jetsAK4_Puppi_cff::payload, rms, and mathSSE::sqrt().

550  {
551  SiStripNoises::RegistryIterator rit = payload->getRegistryVectorBegin(), erit = payload->getRegistryVectorEnd();
552  uint16_t Nstrips;
553  std::vector<float> vstripnoise;
554  double mean, rms, min, max;
555  for (; rit != erit; ++rit) {
556  Nstrips = (rit->iend - rit->ibegin) * 8 / 9; //number of strips = number of chars * char size / strip noise size
557  vstripnoise.resize(Nstrips);
558  payload->allNoises(
559  vstripnoise,
560  make_pair(payload->getDataVectorBegin() + rit->ibegin, payload->getDataVectorBegin() + rit->iend));
561 
562  mean = 0;
563  rms = 0;
564  min = 10000;
565  max = 0;
566 
567  DetId detId(rit->detid);
568 
569  for (size_t i = 0; i < Nstrips; ++i) {
570  mean += vstripnoise[i];
571  rms += vstripnoise[i] * vstripnoise[i];
572  if (vstripnoise[i] < min)
573  min = vstripnoise[i];
574  if (vstripnoise[i] > max)
575  max = vstripnoise[i];
576  }
577 
578  mean /= Nstrips;
579  if ((rms / Nstrips - mean * mean) > 0.) {
580  rms = sqrt(rms / Nstrips - mean * mean);
581  } else {
582  rms = 0.;
583  }
584 
585  switch (est) {
586  case SiStripPI::min:
587  summaryNoise.add(detId, min);
588  break;
589  case SiStripPI::max:
590  summaryNoise.add(detId, max);
591  break;
592  case SiStripPI::mean:
593  summaryNoise.add(detId, mean);
594  break;
595  case SiStripPI::rms:
596  summaryNoise.add(detId, rms);
597  break;
598  default:
599  edm::LogWarning("LogicError") << "Unknown estimator: " << est;
600  break;
601  }
602  }
603  }
T sqrt(T t)
Definition: SSEVec.h:19
Registry::const_iterator RegistryIterator
Definition: SiStripNoises.h:49
void add(DetId detid, float value)
Used to compute the mean value of the value variable divided by subdetector, layer and mono/stereo...
Definition: DetId.h:17
Log< level::Warning, false > LogWarning

◆ fillTotalComponents()

void SiStripPI::fillTotalComponents ( int  NTkComponents[4],
int  NComponents[4][19][4],
const TrackerTopology  m_trackerTopo 
)
inline

Definition at line 606 of file SiStripPayloadInspectorHelper.h.

References contentValuesFiles::fullPath, SiStripDetInfoFileReader::kDefaultFile, me0TriggerPseudoDigis_cff::nStrips, SiStripDetInfoFileReader::read(), sistrip::STRIPS_PER_APV, DetId::subdetId(), StripSubdetector::TEC, TrackerTopology::tecSide(), TrackerTopology::tecWheel(), StripSubdetector::TIB, TrackerTopology::tibLayer(), StripSubdetector::TID, TrackerTopology::tidSide(), TrackerTopology::tidWheel(), StripSubdetector::TOB, and TrackerTopology::tobLayer().

608  {
609  const auto detInfo =
611  for (const auto& det : detInfo.getAllData()) {
612  int nAPVs = detInfo.getNumberOfApvsAndStripLength(det.first).first;
613  // one fiber connects to 2 APVs
614  int nFibers = nAPVs / 2;
615  int nStrips = (sistrip::STRIPS_PER_APV * detInfo.getNumberOfApvsAndStripLength(det.first).first);
616  NTkComponents[0]++;
617  NTkComponents[1] += nFibers;
618  NTkComponents[2] += nAPVs;
619  NTkComponents[3] += nStrips;
620 
621  DetId detectorId = DetId(det.first);
622  int subDet = detectorId.subdetId();
623 
624  int subDetIndex = -1;
625  int component = -1;
626  if (subDet == StripSubdetector::TIB) {
627  subDetIndex = 0;
628  component = m_trackerTopo.tibLayer(det.first);
629  } else if (subDet == StripSubdetector::TID) {
630  subDetIndex = 1;
631  component = m_trackerTopo.tidSide(det.first) == 2 ? m_trackerTopo.tidWheel(det.first)
632  : m_trackerTopo.tidWheel(det.first) + 3;
633  } else if (subDet == StripSubdetector::TOB) {
634  subDetIndex = 2;
635  component = m_trackerTopo.tobLayer(det.first);
636  } else if (subDet == StripSubdetector::TEC) {
637  subDetIndex = 3;
638  component = m_trackerTopo.tecSide(det.first) == 2 ? m_trackerTopo.tecWheel(det.first)
639  : m_trackerTopo.tecWheel(det.first) + 9;
640  }
641 
642  NComponents[subDetIndex][0][0]++;
643  NComponents[subDetIndex][0][1] += nFibers;
644  NComponents[subDetIndex][0][2] += nAPVs;
645  NComponents[subDetIndex][0][3] += nStrips;
646 
647  NComponents[subDetIndex][component][0]++;
648  NComponents[subDetIndex][component][1] += nFibers;
649  NComponents[subDetIndex][component][2] += nAPVs;
650  NComponents[subDetIndex][component][3] += nStrips;
651  }
652  }
static constexpr auto TEC
unsigned int tobLayer(const DetId &id) const
unsigned int tidSide(const DetId &id) const
unsigned int tidWheel(const DetId &id) const
unsigned int tecWheel(const DetId &id) const
nStrips
1.2 is to make the matching window safely the two nearest strips 0.35 is the size of an ME0 chamber i...
unsigned int tecSide(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:48
SiStripDetInfo read(std::string filePath)
static constexpr auto TOB
Definition: DetId.h:17
static constexpr auto TIB
static const uint16_t STRIPS_PER_APV
static constexpr char const *const kDefaultFile
unsigned int tibLayer(const DetId &id) const
static constexpr auto TID

◆ getExtrema()

std::pair<float, float> SiStripPI::getExtrema ( TH1 *  h1,
TH1 *  h2 
)
inline

Definition at line 411 of file SiStripPayloadInspectorHelper.h.

References mps_fire::result.

413  {
414  float theMax(-9999.);
415  float theMin(9999.);
416  theMax = h1->GetMaximum() > h2->GetMaximum() ? h1->GetMaximum() : h2->GetMaximum();
417  theMin = h1->GetMinimum() < h2->GetMaximum() ? h1->GetMinimum() : h2->GetMinimum();
418 
419  float add_min = theMin > 0. ? -0.05 : 0.05;
420  float add_max = theMax > 0. ? 0.05 : -0.05;
421 
422  auto result = std::make_pair(theMin * (1 + add_min), theMax * (1 + add_max));
423  return result;
424  }

◆ getMaximum()

double SiStripPI::getMaximum ( TObjArray *  array)
inline

Definition at line 427 of file SiStripPayloadInspectorHelper.h.

References mps_check::array, and mps_fire::i.

Referenced by ContainmentCorrectionAnalyzer::analyze(), EcalClusterSeverityLevelAlgo::closestProblematic(), EcalClusterToolsT< noZS >::covariances(), InvRingCalib::duringLoop(), EcalEleCalibLooper::duringLoop(), EcalClusterToolsT< noZS >::e1x3(), EcalClusterToolsT< noZS >::e1x5(), EcalClusterToolsT< noZS >::e2x2(), EcalClusterToolsT< noZS >::e2x5Bottom(), EcalClusterToolsT< noZS >::e2x5Left(), EcalClusterToolsT< noZS >::e2x5Max(), EcalClusterToolsT< noZS >::e2x5Right(), EcalClusterToolsT< noZS >::e2x5Top(), EcalClusterToolsT< noZS >::e3x1(), EcalClusterToolsT< noZS >::e3x2(), EcalClusterToolsT< noZS >::e3x3(), EcalClusterToolsT< noZS >::e4x4(), EcalClusterToolsT< noZS >::e5x1(), EcalClusterToolsT< noZS >::e5x5(), EcalClusterToolsT< noZS >::eBottom(), EcalClusterToolsT< noZS >::eLeft(), EcalClusterToolsT< noZS >::eMax(), EcalClusterLazyToolsT< ClusterTools >::energyMatrix(), EcalClusterToolsT< noZS >::eRight(), EcalClusterSeverityLevelAlgo::etaphiDistanceClosestProblematic(), EcalClusterToolsT< noZS >::eTop(), EcalClusterToolsT< noZS >::getMaximum(), EcalClusterLazyToolsT< ClusterTools >::getMaximum(), HLTDisplacedEgammaFilter::hltFilter(), ReducedEGProducer::linkCaloClusters(), EcalClusterToolsT< noZS >::localCovariances(), EcalClusterToolsT< noZS >::mean5x5PositionInLocalCrysCoord(), EcalClusterToolsT< noZS >::mean5x5PositionInXY(), EcalClusterToolsT< noZS >::meanClusterPosition(), EcalClusterToolsT< noZS >::n5x5(), EcalDigiSelector::produce(), and EcalClusterToolsT< noZS >::scLocalCovariances().

429  {
430  double theMaximum = (static_cast<TH1*>(array->At(0)))->GetMaximum();
431  for (int i = 0; i < array->GetSize(); i++) {
432  if ((static_cast<TH1*>(array->At(i)))->GetMaximum() > theMaximum) {
433  theMaximum = (static_cast<TH1*>(array->At(i)))->GetMaximum();
434  }
435  }
436  return theMaximum;
437  }

◆ getStringFromSubdet()

std::string SiStripPI::getStringFromSubdet ( StripSubdetector::SubDetector  sub)
inline

Definition at line 199 of file SiStripPayloadInspectorHelper.h.

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

201  {
202  switch (sub) {
204  return "TIB";
206  return "TOB";
208  return "TID";
210  return "TEC";
211  default:
212  return "should never be here";
213  }
214  }
static constexpr auto TEC
static constexpr auto TOB
static constexpr auto TIB
static constexpr auto TID

◆ getTheRange()

std::pair<float, float> SiStripPI::getTheRange ( std::map< uint32_t, float >  values,
const float  nsigma 
)
inline

Definition at line 349 of file SiStripPayloadInspectorHelper.h.

References visualization-live-secondInstance_cfg::m, AlCaHLTBitMon_ParallelJobs::p, mathSSE::sqrt(), plotscripts::stdev(), and contentValuesCheck::values.

Referenced by SiStripCondObjectRepresent::SiStripDataContainer< Item, type >::fillTrackerMap(), and SiStripMiscalibrate::getTruncatedRange().

351  {
352  float sum = std::accumulate(
353  std::begin(values), std::end(values), 0.0, [](float value, const std::map<uint32_t, float>::value_type& p) {
354  return value + p.second;
355  });
356 
357  float m = sum / values.size();
358 
359  float accum = 0.0;
360  std::for_each(std::begin(values), std::end(values), [&](const std::map<uint32_t, float>::value_type& p) {
361  accum += (p.second - m) * (p.second - m);
362  });
363 
364  float stdev = sqrt(accum / (values.size() - 1));
365 
366  if (stdev != 0.) {
367  return std::make_pair(m - nsigma * stdev, m + nsigma * stdev);
368  } else {
369  return std::make_pair(m > 0. ? 0.95 * m : 1.05 * m, m > 0 ? 1.05 * m : 0.95 * m);
370  }
371  }
T sqrt(T t)
Definition: SSEVec.h:19
Definition: value.py:1
def stdev(xlist)
Definition: plotscripts.py:69

◆ makeNicePlotStyle()

void SiStripPI::makeNicePlotStyle ( TH1 *  hist)
inline

Definition at line 440 of file SiStripPayloadInspectorHelper.h.

References compareTotals::hist.

Referenced by SiStripCondObjectRepresent::SiStripDataContainer< Item, type >::fillByPartition(), SiStripCondObjectRepresent::SiStripDataContainer< Item, type >::fillCorrelationByPartition(), and SiStripCondObjectRepresent::SiStripDataContainer< Item, type >::fillValuePlot().

442  {
443  hist->SetStats(kFALSE);
444  hist->SetLineWidth(2);
445  hist->GetXaxis()->CenterTitle(true);
446  hist->GetYaxis()->CenterTitle(true);
447  hist->GetXaxis()->SetTitleFont(42);
448  hist->GetYaxis()->SetTitleFont(42);
449  hist->GetXaxis()->SetTitleSize(0.05);
450  hist->GetYaxis()->SetTitleSize(0.05);
451  hist->GetXaxis()->SetTitleOffset(0.9);
452  hist->GetYaxis()->SetTitleOffset(1.3);
453  hist->GetXaxis()->SetLabelFont(42);
454  hist->GetYaxis()->SetLabelFont(42);
455  hist->GetYaxis()->SetLabelSize(.05);
456  hist->GetXaxis()->SetLabelSize(.05);
457  }

◆ makeNiceStyle()

template<class T >
void SiStripPI::makeNiceStyle ( T hist)
inline

Definition at line 461 of file SiStripPayloadInspectorHelper.h.

References ALPAKA_ACCELERATOR_NAMESPACE::brokenline::constexpr(), compareTotals::hist, and relativeConstraints::value.

463  {
464  // only for TH1s and inherited classes
466  hist->SetStats(kFALSE);
467  hist->SetLineWidth(2);
468  }
469  hist->GetXaxis()->CenterTitle(true);
470  hist->GetYaxis()->CenterTitle(true);
471  hist->GetXaxis()->SetTitleFont(42);
472  hist->GetYaxis()->SetTitleFont(42);
473  hist->GetXaxis()->SetTitleSize(0.05);
474  hist->GetYaxis()->SetTitleSize(0.05);
475  hist->GetXaxis()->SetTitleOffset(0.9);
476  hist->GetYaxis()->SetTitleOffset(1.3);
477  hist->GetXaxis()->SetLabelFont(42);
478  hist->GetYaxis()->SetLabelFont(42);
479  hist->GetYaxis()->SetLabelSize(.05);
480  hist->GetXaxis()->SetLabelSize(.05);
481  }

◆ printBCDebug()

void SiStripPI::printBCDebug ( int  NTkBadComponent[4],
int  NBadComponent[4][19][4] 
)
inline

Definition at line 776 of file SiStripPayloadInspectorHelper.h.

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

778  {
779  //&&&&&&&&&&&&&&&&&&
780  // printout
781  //&&&&&&&&&&&&&&&&&&
782 
783  std::stringstream ss;
784  ss.str("");
785  ss << "\n-----------------\nGlobal Info\n-----------------";
786  ss << "\nBadComponent \t Modules \tFibers "
787  "\tApvs\tStrips\n----------------------------------------------------------------";
788  ss << "\nTracker:\t\t" << NTkBadComponent[0] << "\t" << NTkBadComponent[1] << "\t" << NTkBadComponent[2] << "\t"
789  << NTkBadComponent[3];
790  ss << "\n";
791  ss << "\nTIB:\t\t\t" << NBadComponent[0][0][0] << "\t" << NBadComponent[0][0][1] << "\t" << NBadComponent[0][0][2]
792  << "\t" << NBadComponent[0][0][3];
793  ss << "\nTID:\t\t\t" << NBadComponent[1][0][0] << "\t" << NBadComponent[1][0][1] << "\t" << NBadComponent[1][0][2]
794  << "\t" << NBadComponent[1][0][3];
795  ss << "\nTOB:\t\t\t" << NBadComponent[2][0][0] << "\t" << NBadComponent[2][0][1] << "\t" << NBadComponent[2][0][2]
796  << "\t" << NBadComponent[2][0][3];
797  ss << "\nTEC:\t\t\t" << NBadComponent[3][0][0] << "\t" << NBadComponent[3][0][1] << "\t" << NBadComponent[3][0][2]
798  << "\t" << NBadComponent[3][0][3];
799  ss << "\n";
800 
801  for (int i = 1; i < 5; ++i)
802  ss << "\nTIB Layer " << i << " :\t\t" << NBadComponent[0][i][0] << "\t" << NBadComponent[0][i][1] << "\t"
803  << NBadComponent[0][i][2] << "\t" << NBadComponent[0][i][3];
804  ss << "\n";
805  for (int i = 1; i < 4; ++i)
806  ss << "\nTID+ Disk " << i << " :\t\t" << NBadComponent[1][i][0] << "\t" << NBadComponent[1][i][1] << "\t"
807  << NBadComponent[1][i][2] << "\t" << NBadComponent[1][i][3];
808  for (int i = 4; i < 7; ++i)
809  ss << "\nTID- Disk " << i - 3 << " :\t\t" << NBadComponent[1][i][0] << "\t" << NBadComponent[1][i][1] << "\t"
810  << NBadComponent[1][i][2] << "\t" << NBadComponent[1][i][3];
811  ss << "\n";
812  for (int i = 1; i < 7; ++i)
813  ss << "\nTOB Layer " << i << " :\t\t" << NBadComponent[2][i][0] << "\t" << NBadComponent[2][i][1] << "\t"
814  << NBadComponent[2][i][2] << "\t" << NBadComponent[2][i][3];
815  ss << "\n";
816  for (int i = 1; i < 10; ++i)
817  ss << "\nTEC+ Disk " << i << " :\t\t" << NBadComponent[3][i][0] << "\t" << NBadComponent[3][i][1] << "\t"
818  << NBadComponent[3][i][2] << "\t" << NBadComponent[3][i][3];
819  for (int i = 10; i < 19; ++i)
820  ss << "\nTEC- Disk " << i - 9 << " :\t\t" << NBadComponent[3][i][0] << "\t" << NBadComponent[3][i][1] << "\t"
821  << NBadComponent[3][i][2] << "\t" << NBadComponent[3][i][3];
822  ss << "\n";
823 
824  //edm::LogInfo("SiStripBadStrip_PayloadInspector") << ss.str() << std::endl;
825  std::cout << ss.str() << std::endl;
826  }

◆ printSummary()

void SiStripPI::printSummary ( const std::map< unsigned int, SiStripDetSummary::Values > &  map)
inline

Definition at line 484 of file SiStripPayloadInspectorHelper.h.

References submitPVResolutionJobs::count, gather_cfg::cout, hgcalTestNeighbor_cfi::detector, genParticles_cff::map, mean, regionType(), rms, mathSSE::sqrt(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by FastTimerService::postEndJob(), and FastTimerService::postGlobalEndRun().

486  {
487  for (const auto& element : map) {
488  int count = element.second.count;
489  double mean = count > 0 ? (element.second.mean) / count : 0.;
490  double rms = count > 0 ? (element.second.rms) / count - mean * mean : 0.;
491  if (rms <= 0)
492  rms = 0;
493  else
494  rms = sqrt(rms);
495 
497 
498  switch ((element.first) / 1000) {
499  case 1:
500  detector = "TIB ";
501  break;
502  case 2:
503  detector = "TOB ";
504  break;
505  case 3:
506  detector = "TEC ";
507  break;
508  case 4:
509  detector = "TID ";
510  break;
511  }
512 
513  int layer = (element.first) / 10 - (element.first) / 1000 * 100;
514  int stereo = (element.first) - (layer * 10) - (element.first) / 1000 * 1000;
515 
516  std::cout << "key of the map:" << element.first << " ( region: " << regionType(element.first).second << " ) "
517  << detector << " layer: " << layer << " stereo:" << stereo << "| count:" << count << " mean: " << mean
518  << " rms: " << rms << std::endl;
519  }
520  }
std::pair< int, const char * > regionType(int index)
T sqrt(T t)
Definition: SSEVec.h:19

◆ regionType()

std::pair<int, const char*> SiStripPI::regionType ( int  index)
inline

Definition at line 259 of file SiStripPayloadInspectorHelper.h.

References END_OF_REGIONS, nano_mu_digi_cff::region, 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 SiStripCondObjectRepresent::SiStripDataContainer< Item, type >::fillSummary(), and printSummary().

261  {
262  auto region = static_cast<std::underlying_type_t<SiStripPI::TrackerRegion>>(index);
263 
264  switch (region) {
265  case SiStripPI::TIB1r:
266  return std::make_pair(1, "TIB L1 r-#varphi");
267  case SiStripPI::TIB1s:
268  return std::make_pair(2, "TIB L1 stereo");
269  case SiStripPI::TIB2r:
270  return std::make_pair(3, "TIB L2 r-#varphi");
271  case SiStripPI::TIB2s:
272  return std::make_pair(4, "TIB L2 stereo");
273  case SiStripPI::TIB3r:
274  return std::make_pair(5, "TIB L3");
275  case SiStripPI::TIB4r:
276  return std::make_pair(6, "TIB L4");
277  case SiStripPI::TOB1r:
278  return std::make_pair(7, "TOB L1 r-#varphi");
279  case SiStripPI::TOB1s:
280  return std::make_pair(8, "TOB L1 stereo");
281  case SiStripPI::TOB2r:
282  return std::make_pair(9, "TOB L2 r-#varphi");
283  case SiStripPI::TOB2s:
284  return std::make_pair(10, "TOB L2 stereo");
285  case SiStripPI::TOB3r:
286  return std::make_pair(11, "TOB L3 r-#varphi");
287  case SiStripPI::TOB4r:
288  return std::make_pair(12, "TOB L4");
289  case SiStripPI::TOB5r:
290  return std::make_pair(13, "TOB L5");
291  case SiStripPI::TOB6r:
292  return std::make_pair(14, "TOB L6");
293  case SiStripPI::TEC1r:
294  return std::make_pair(15, "TEC D1 r-#varphi");
295  case SiStripPI::TEC1s:
296  return std::make_pair(16, "TEC D1 stereo");
297  case SiStripPI::TEC2r:
298  return std::make_pair(17, "TEC D2 r-#varphi");
299  case SiStripPI::TEC2s:
300  return std::make_pair(18, "TEC D2 stereo");
301  case SiStripPI::TEC3r:
302  return std::make_pair(19, "TEC D3 r-#varphi");
303  case SiStripPI::TEC3s:
304  return std::make_pair(20, "TEC D3 stereo");
305  case SiStripPI::TEC4r:
306  return std::make_pair(21, "TEC D4 r-#varphi");
307  case SiStripPI::TEC4s:
308  return std::make_pair(22, "TEC D4 stereo");
309  case SiStripPI::TEC5r:
310  return std::make_pair(23, "TEC D5 r-#varphi");
311  case SiStripPI::TEC5s:
312  return std::make_pair(24, "TEC D5 stereo");
313  case SiStripPI::TEC6r:
314  return std::make_pair(25, "TEC D6 r-#varphi");
315  case SiStripPI::TEC6s:
316  return std::make_pair(26, "TEC D6 stereo");
317  case SiStripPI::TEC7r:
318  return std::make_pair(27, "TEC D7 r-#varphi");
319  case SiStripPI::TEC7s:
320  return std::make_pair(28, "TEC D7 stereo");
321  case SiStripPI::TEC8r:
322  return std::make_pair(29, "TEC D8 r-#varphi");
323  case SiStripPI::TEC8s:
324  return std::make_pair(30, "TEC D8 stereo");
325  case SiStripPI::TEC9r:
326  return std::make_pair(31, "TEC D9 r-#varphi");
327  case SiStripPI::TEC9s:
328  return std::make_pair(32, "TEC D9 stereo");
329  case SiStripPI::TID1r:
330  return std::make_pair(33, "TID D1 r-#varphi");
331  case SiStripPI::TID1s:
332  return std::make_pair(34, "TID D1 stereo");
333  case SiStripPI::TID2r:
334  return std::make_pair(35, "TID D2 r-#varphi");
335  case SiStripPI::TID2s:
336  return std::make_pair(36, "TID D2 stereo");
337  case SiStripPI::TID3r:
338  return std::make_pair(37, "TID D3 r-#varphi");
339  case SiStripPI::TID3s:
340  return std::make_pair(38, "TID D3 stereo");
342  return std::make_pair(-1, "undefined");
343  default:
344  return std::make_pair(999, "should never be here");
345  }
346  }

◆ setBadComponents()

void SiStripPI::setBadComponents ( int  i,
int  component,
const SiStripQuality::BadComponent BC,
int  NBadComponent[4][19][4] 
)
inline

Definition at line 525 of file SiStripPayloadInspectorHelper.h.

References SiStripQuality::BadComponent::BadApvs, SiStripQuality::BadComponent::BadFibers, SiStripQuality::BadComponent::BadModule, submitPVResolutionJobs::count, and mps_fire::i.

Referenced by fillBCArrays(), and SiStripHitEfficiencyHarvester::printAndWriteBadModules().

527  {
528  if (BC.BadApvs) {
529  NBadComponent[i][0][2] += std::bitset<16>(BC.BadApvs & 0x3f).count();
530  NBadComponent[i][component][2] += std::bitset<16>(BC.BadApvs & 0x3f).count();
531  }
532 
533  if (BC.BadFibers) {
534  NBadComponent[i][0][1] += std::bitset<4>(BC.BadFibers & 0x7).count();
535  NBadComponent[i][component][1] += std::bitset<4>(BC.BadFibers & 0x7).count();
536  }
537 
538  if (BC.BadModule) {
539  NBadComponent[i][0][0]++;
540  NBadComponent[i][component][0]++;
541  }
542  }

◆ setPaletteStyle()

void SiStripPI::setPaletteStyle ( SiStripPI::palette  palette)
inline

Definition at line 831 of file SiStripPayloadInspectorHelper.h.

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

Referenced by SiStripCondObjectRepresent::SiStripDataContainer< Item, type >::fillCorrelationByPartition().

833  {
834  TStyle* palettestyle = new TStyle("palettestyle", "Style for P-TDR");
835 
836  const int NRGBs = 5;
837  const int NCont = 255;
838 
839  switch (palette) {
840  case HALFGRAY: {
841  double stops[NRGBs] = {0.00, 0.34, 0.61, 0.84, 1.00};
842  double red[NRGBs] = {1.00, 0.91, 0.80, 0.67, 1.00};
843  double green[NRGBs] = {1.00, 0.91, 0.80, 0.67, 1.00};
844  double blue[NRGBs] = {1.00, 0.91, 0.80, 0.67, 1.00};
845  TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont);
846  } break;
847 
848  case GRAY: {
849  double stops[NRGBs] = {0.00, 0.01, 0.05, 0.09, 0.1};
850  double red[NRGBs] = {1.00, 0.84, 0.61, 0.34, 0.00};
851  double green[NRGBs] = {1.00, 0.84, 0.61, 0.34, 0.00};
852  double blue[NRGBs] = {1.00, 0.84, 0.61, 0.34, 0.00};
853  TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont);
854  } break;
855 
856  case BLUES: {
857  double stops[NRGBs] = {0.00, 0.34, 0.61, 0.84, 1.00};
858  double red[NRGBs] = {1.00, 0.84, 0.61, 0.34, 0.00};
859  double green[NRGBs] = {1.00, 0.84, 0.61, 0.34, 0.00};
860  double blue[NRGBs] = {1.00, 1.00, 1.00, 1.00, 1.00};
861  TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont);
862 
863  } break;
864 
865  case REDS: {
866  double stops[NRGBs] = {0.00, 0.34, 0.61, 0.84, 1.00};
867  double red[NRGBs] = {1.00, 1.00, 1.00, 1.00, 1.00};
868  double green[NRGBs] = {1.00, 0.84, 0.61, 0.34, 0.00};
869  double blue[NRGBs] = {1.00, 0.84, 0.61, 0.34, 0.00};
870  TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont);
871  } break;
872 
873  case ANTIGRAY: {
874  double stops[NRGBs] = {0.00, 0.34, 0.61, 0.84, 1.00};
875  double red[NRGBs] = {0.00, 0.34, 0.61, 0.84, 1.00};
876  double green[NRGBs] = {0.00, 0.34, 0.61, 0.84, 1.00};
877  double blue[NRGBs] = {0.00, 0.34, 0.61, 0.84, 1.00};
878  TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont);
879  } break;
880 
881  case FIRE: {
882  const int NCOLs = 4;
883  double stops[NCOLs] = {0.00, 0.20, 0.80, 1.00};
884  double red[NCOLs] = {1.00, 1.00, 1.00, 0.50};
885  double green[NCOLs] = {1.00, 1.00, 0.00, 0.00};
886  double blue[NCOLs] = {0.20, 0.00, 0.00, 0.00};
887  TColor::CreateGradientColorTable(NCOLs, stops, red, green, blue, NCont);
888  } break;
889 
890  case ANTIFIRE: {
891  const int NCOLs = 4;
892  double stops[NCOLs] = {0.00, 0.20, 0.80, 1.00};
893  double red[NCOLs] = {0.50, 1.00, 1.00, 1.00};
894  double green[NCOLs] = {0.00, 0.00, 1.00, 1.00};
895  double blue[NCOLs] = {0.00, 0.00, 0.00, 0.20};
896  TColor::CreateGradientColorTable(NCOLs, stops, red, green, blue, NCont);
897  } break;
898 
899  case LOGREDBLUE: {
900  double stops[NRGBs] = {0.0001, 0.0010, 0.0100, 0.1000, 1.0000};
901  double red[NRGBs] = {1.00, 0.75, 0.50, 0.25, 0.00};
902  double green[NRGBs] = {0.00, 0.00, 0.00, 0.00, 0.00};
903  double blue[NRGBs] = {0.00, 0.25, 0.50, 0.75, 1.00};
904  TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont);
905  } break;
906 
907  case LOGBLUERED: {
908  double stops[NRGBs] = {0.0001, 0.0010, 0.0100, 0.1000, 1.0000};
909  double red[NRGBs] = {0.00, 0.25, 0.50, 0.75, 1.00};
910  double green[NRGBs] = {0.00, 0.00, 0.00, 0.00, 0.00};
911  double blue[NRGBs] = {1.00, 0.75, 0.50, 0.25, 0.00};
912  TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont);
913  } break;
914 
915  case BLUERED: {
916  double stops[NRGBs] = {0.00, 0.34, 0.61, 0.84, 1.00};
917  double red[NRGBs] = {0.00, 0.25, 0.50, 0.75, 1.00};
918  double green[NRGBs] = {0.00, 0.00, 0.00, 0.00, 0.00};
919  double blue[NRGBs] = {1.00, 0.75, 0.50, 0.25, 0.00};
920  TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont);
921  } break;
922 
923  case DEFAULT: {
924  double stops[NRGBs] = {0.00, 0.34, 0.61, 0.84, 1.00};
925  double red[NRGBs] = {0.00, 0.00, 0.87, 1.00, 0.51};
926  double green[NRGBs] = {0.00, 0.81, 1.00, 0.20, 0.00};
927  double blue[NRGBs] = {0.51, 1.00, 0.12, 0.00, 0.00};
928  TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont);
929  } break;
930  default:
931  std::cout << "should nevere be here" << std::endl;
932  break;
933  }
934 
935  palettestyle->SetNumberContours(NCont);
936  }