CMS 3D CMS Logo

SiStripQuality.h
Go to the documentation of this file.
1 #ifndef SiStripObjects_SiStripQuality_h
2 #define SiStripObjects_SiStripQuality_h
3 // -*- C++ -*-
4 // -*- C++ -*-
5 //
6 // Package: SiStripObjects
7 // Class : SiStripQuality
8 //
17 //
18 // Author: Domenico Giordano
19 // Created: Wed Sep 26 17:42:12 CEST 2007
20 //
21 
26 #include <vector>
27 
28 class SiStripDetCabling;
30 class TrackerTopology;
31 
32 class SiStripQuality final : public SiStripBadStrip {
33 public:
34  struct BadComponent {
35  uint32_t detid;
36  unsigned short BadApvs : 6;
37  unsigned short BadFibers : 3;
38  bool BadModule : 1;
39  };
40 
42  public:
43  bool operator()(const BadComponent &p, const uint32_t i) const { return p.detid < i; }
44  };
45 
46  SiStripQuality(); // takes default file for SiStripDetInfoFileReader
48  SiStripQuality(const SiStripQuality &); // copy constructor
49 
50  ~SiStripQuality() override;
51 
52  void clear() {
53  v_badstrips.clear();
54  indexes.clear();
55  BadComponentVect.clear();
56  toCleanUp = false;
57  }
58 
59  void add(const uint32_t &, const SiStripBadStrip::Range &);
60  void add(const SiStripBadStrip *);
61  void add(const SiStripDetCabling *);
62  void add(const SiStripDetVOff *);
69  void add(const RunInfo *);
72 
73  bool cleanUp(bool force = false);
74 
75  void fillBadComponents();
76 
77  void ReduceGranularity(double);
78 
81  const SiStripQuality operator-(const SiStripQuality &) const;
82  bool operator==(const SiStripQuality &) const;
83  bool operator!=(const SiStripQuality &) const;
84 
86 
87  //------- Interface for the user ----------//
88  bool IsModuleUsable(const uint32_t &detid) const;
89 
90  bool IsModuleBad(const uint32_t &detid) const;
91  bool IsFiberBad(const uint32_t &detid, const short &fiberNb) const;
92  bool IsApvBad(const uint32_t &detid, const short &apvNb) const;
93  bool IsStripBad(const uint32_t &detid, const short &strip) const;
94  bool IsStripBad(const Range &range, const short &strip) const;
95  int nBadStripsOnTheLeft(const Range &range,
96  const short &strip) const; // provides number of consecutive bad strips on the left of strip
97  // (including strip)
99  const Range &range, const short &strip) const; // provides number of consecutive bad strips on the right of strip
100  // (including strip)
101 
102  short getBadApvs(const uint32_t &detid) const;
103  // each bad apv correspond to a bit to 1: num=
104  // 0 <-> all good apvs
105  // 1 <-> only apv 0 bad
106  // 2<-> only apv 1 bad
107  // 3<-> apv 0 and 1 bad
108  // 4 <-> only apv 2 bad
109  //...
110  short getBadFibers(const uint32_t &detid) const;
111  // each bad fiber correspond to a bit to 1: num=
112  // 0 <-> all good fibers
113  // 1 <-> only fiber 0 bad
114  // 2<-> only fiber 1 bad
115  // 3<-> fiber 0 and 1 bad
116  // 4 <-> only fiber 2 bad
117  //...
118 
119  const std::vector<BadComponent> &getBadComponentList() const { return BadComponentVect; }
120 
121  void compact(unsigned int &, std::vector<unsigned int> &);
122 
123  inline void setPrintDebugOutput(const bool printDebug) { printDebug_ = printDebug; }
124  inline void setUseEmptyRunInfo(const bool useEmptyRunInfo) { useEmptyRunInfo_ = useEmptyRunInfo; }
125 
126  SiStripDetCabling const *cabling() const { return SiStripDetCabling_; }
127 
128 private:
129  void compact(std::vector<unsigned int> &, std::vector<unsigned int> &, unsigned short &);
130  void subtract(std::vector<unsigned int> &, const std::vector<unsigned int> &);
131  void subtraction(std::vector<unsigned int> &, const unsigned int &);
132  bool put_replace(const uint32_t &DetId, Range input);
133 
138  void turnOffFeds(const std::vector<int> &fedsList, const bool turnOffStrips, const bool printDebug);
139 
141  void printDetInfo(const TrackerTopology *const tTopo,
142  const uint32_t &detId,
143  const uint32_t &apvPairNumber,
144  std::stringstream &ss);
147  void printActiveFedsInfo(const std::vector<uint16_t> &activeFedsFromCabling,
148  const std::vector<int> &activeFedsFromRunInfo,
149  const std::vector<int> &differentFeds,
150  const bool printDebug);
151 
152  bool toCleanUp;
155 
156  std::vector<BadComponent> BadComponentVect;
157 
161 };
162 
163 #endif
SiStripQuality::getBadApvs
short getBadApvs(const uint32_t &detid) const
Definition: SiStripQuality.cc:667
SiStripQuality::operator==
bool operator==(const SiStripQuality &) const
Definition: SiStripQuality.cc:97
SiStripQuality::BadComponent::detid
uint32_t detid
Definition: SiStripQuality.h:35
FastTimerService_cff.range
range
Definition: FastTimerService_cff.py:34
cmsStageWithFailover.force
force
Definition: cmsStageWithFailover.py:19
mps_fire.i
i
Definition: mps_fire.py:428
input
static const std::string input
Definition: EdmProvDump.cc:48
SiStripQuality::add
void add(const uint32_t &, const SiStripBadStrip::Range &)
Definition: SiStripQuality.cc:284
TrackerTopology
Definition: TrackerTopology.h:16
digitizers_cfi.strip
strip
Definition: digitizers_cfi.py:19
SiStripQuality::IsModuleBad
bool IsModuleBad(const uint32_t &detid) const
Definition: SiStripQuality.cc:599
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
SiStripQuality::cleanUp
bool cleanUp(bool force=false)
Definition: SiStripQuality.cc:500
SiStripQuality::IsModuleUsable
bool IsModuleUsable(const uint32_t &detid) const
Definition: SiStripQuality.cc:585
SiStripQuality::getFileInPath
edm::FileInPath getFileInPath() const
Definition: SiStripQuality.h:85
SiStripQuality::setUseEmptyRunInfo
void setUseEmptyRunInfo(const bool useEmptyRunInfo)
Definition: SiStripQuality.h:124
SiStripBadStrip.h
SiStripDetInfoFileReader
Definition: SiStripDetInfoFileReader.h:30
SiStripQuality::printDebug_
bool printDebug_
Definition: SiStripQuality.h:159
SiStripQuality::printDetInfo
void printDetInfo(const TrackerTopology *const tTopo, const uint32_t &detId, const uint32_t &apvPairNumber, std::stringstream &ss)
Prints debug output for a given detId.
Definition: SiStripQuality.cc:683
FileInPath.h
SiStripBadStrip
Definition: SiStripBadStrip.h:30
SiStripQuality::BadComponentVect
std::vector< BadComponent > BadComponentVect
Definition: SiStripQuality.h:156
SiStripQuality::IsFiberBad
bool IsFiberBad(const uint32_t &detid, const short &fiberNb) const
Definition: SiStripQuality.cc:607
contentValuesCheck.ss
ss
Definition: contentValuesCheck.py:33
DetId
Definition: DetId.h:17
edm::FileInPath
Definition: FileInPath.h:64
SiStripBadStrip::Range
std::pair< ContainerIterator, ContainerIterator > Range
Definition: SiStripBadStrip.h:53
RunInfo
Definition: RunInfo.h:18
SiStripQuality::getBadComponentList
const std::vector< BadComponent > & getBadComponentList() const
Definition: SiStripQuality.h:119
SiStripBadStrip::printDebug
void printDebug(std::stringstream &ss, const TrackerTopology *trackerTopo) const
Definition: SiStripBadStrip.cc:76
SiStripQuality::compact
void compact(unsigned int &, std::vector< unsigned int > &)
Definition: SiStripQuality.cc:326
SiStripDetCabling
Definition: SiStripDetCabling.h:21
SiStripQuality::setPrintDebugOutput
void setPrintDebugOutput(const bool printDebug)
Definition: SiStripQuality.h:123
SiStripQuality::BadComponent::BadFibers
unsigned short BadFibers
Definition: SiStripQuality.h:37
SiStripQuality::IsStripBad
bool IsStripBad(const uint32_t &detid, const short &strip) const
Definition: SiStripQuality.cc:623
SiStripQuality::operator+=
SiStripQuality & operator+=(const SiStripQuality &)
Definition: SiStripQuality.cc:48
SiStripQuality::nBadStripsOnTheLeft
int nBadStripsOnTheLeft(const Range &range, const short &strip) const
Definition: SiStripQuality.cc:641
SiStripQuality::nBadStripsOnTheRight
int nBadStripsOnTheRight(const Range &range, const short &strip) const
Definition: SiStripQuality.cc:654
SiStripQuality::getBadFibers
short getBadFibers(const uint32_t &detid) const
Definition: SiStripQuality.cc:675
SiStripQuality::subtract
void subtract(std::vector< unsigned int > &, const std::vector< unsigned int > &)
Definition: SiStripQuality.cc:460
SiStripQuality::SiStripDetCabling_
const SiStripDetCabling * SiStripDetCabling_
Definition: SiStripQuality.h:158
SiStripQuality::BadComponent::BadModule
bool BadModule
Definition: SiStripQuality.h:38
SiStripDetVOff
Definition: SiStripDetVOff.h:31
SiStripBadStrip::indexes
Registry indexes
Definition: SiStripBadStrip.h:96
SiStripBadStrip::v_badstrips
Container v_badstrips
Definition: SiStripBadStrip.h:95
SiStripQuality::BadComponent::BadApvs
unsigned short BadApvs
Definition: SiStripQuality.h:36
SiStripQuality::fillBadComponents
void fillBadComponents()
Definition: SiStripQuality.cc:531
SiStripQuality::printActiveFedsInfo
void printActiveFedsInfo(const std::vector< uint16_t > &activeFedsFromCabling, const std::vector< int > &activeFedsFromRunInfo, const std::vector< int > &differentFeds, const bool printDebug)
Definition: SiStripQuality.cc:717
SiStripQuality::operator-=
SiStripQuality & operator-=(const SiStripQuality &)
Definition: SiStripQuality.cc:55
SiStripQuality::put_replace
bool put_replace(const uint32_t &DetId, Range input)
Definition: SiStripQuality.cc:334
SiStripQuality::subtraction
void subtraction(std::vector< unsigned int > &, const unsigned int &)
Definition: SiStripQuality.cc:468
SiStripQuality::BadComponentStrictWeakOrdering::operator()
bool operator()(const BadComponent &p, const uint32_t i) const
Definition: SiStripQuality.h:43
SiStripQuality::IsApvBad
bool IsApvBad(const uint32_t &detid, const short &apvNb) const
Definition: SiStripQuality.cc:615
SiStripQuality::SiStripQuality
SiStripQuality()
Definition: SiStripQuality.cc:17
RunInfo.h
SiStripQuality::BadComponentStrictWeakOrdering
Definition: SiStripQuality.h:41
SiStripQuality::BadComponent
Definition: SiStripQuality.h:34
SiStripQuality::useEmptyRunInfo_
bool useEmptyRunInfo_
Definition: SiStripQuality.h:160
SiStripQuality::operator-
const SiStripQuality operator-(const SiStripQuality &) const
Definition: SiStripQuality.cc:93
SiStripQuality::reader
SiStripDetInfoFileReader * reader
Definition: SiStripQuality.h:154
SiStripQuality::addInvalidConnectionFromCabling
void addInvalidConnectionFromCabling()
Definition: SiStripQuality.cc:223
SiStripDetVOff.h
SiStripQuality::~SiStripQuality
~SiStripQuality() override
Definition: SiStripQuality.cc:43
SiStripQuality::clear
void clear()
Definition: SiStripQuality.h:52
SiStripQuality::toCleanUp
bool toCleanUp
Definition: SiStripQuality.h:152
SiStripQuality::turnOffFeds
void turnOffFeds(const std::vector< int > &fedsList, const bool turnOffStrips, const bool printDebug)
Definition: SiStripQuality.cc:743
SiStripQuality::cabling
const SiStripDetCabling * cabling() const
Definition: SiStripQuality.h:126
SiStripQuality::operator!=
bool operator!=(const SiStripQuality &) const
Definition: SiStripQuality.cc:102
SiStripQuality::FileInPath_
edm::FileInPath FileInPath_
Definition: SiStripQuality.h:153
SiStripQuality::ReduceGranularity
void ReduceGranularity(double)
Definition: SiStripQuality.cc:365
SiStripQuality::addNotConnectedConnectionFromCabling
void addNotConnectedConnectionFromCabling()
Definition: SiStripQuality.cc:205
SiStripQuality
Definition: SiStripQuality.h:32