CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
22 
27 #include <vector>
28 
30 
31 class SiStripDetCabling;
33 
35 
36  public:
37 
38  struct BadComponent{
39  uint32_t detid;
40  unsigned short BadApvs : 6;
41  unsigned short BadFibers :3;
42  bool BadModule :1;
43  };
44 
46  public:
47  bool operator() (const BadComponent& p,const uint32_t i) const {return p.detid < i;}
48  };
49 
50  SiStripQuality(); //takes default file for SiStripDetInfoFileReader
52  SiStripQuality(const SiStripQuality&); //copy constructor
53 
54  ~SiStripQuality();
55 
56  void clear(){
57  v_badstrips.clear();
58  indexes.clear();
59  BadComponentVect.clear();
60  toCleanUp=false;
61  }
62 
63  void add(const uint32_t&,const SiStripBadStrip::Range&);
64  void add(const SiStripBadStrip*);
65  void add(const SiStripDetCabling*);
66  void add(const SiStripDetVOff*);
73  void add(const RunInfo *);
74  void addInvalidConnectionFromCabling();
75  void addNotConnectedConnectionFromCabling();
76 
77  bool cleanUp(bool force=false);
78 
79  void fillBadComponents();
80 
81  void ReduceGranularity(double);
82 
85  const SiStripQuality operator -(const SiStripQuality&) const ;
86  bool operator ==(const SiStripQuality&) const;
87  bool operator !=(const SiStripQuality&) const;
88 
89  edm::FileInPath getFileInPath() const {return FileInPath_;}
90 
91  //------- Interface for the user ----------//
92  bool IsModuleUsable(const uint32_t& detid) const;
93 
94  bool IsModuleBad(const uint32_t& detid) const;
95  bool IsFiberBad(const uint32_t& detid, const short& fiberNb) const;
96  bool IsApvBad(const uint32_t& detid, const short& apvNb) const;
97  bool IsStripBad(const uint32_t& detid, const short& strip) const;
98  bool IsStripBad(const Range& range, const short& strip) const;
99  int nBadStripsOnTheLeft(const Range& range, const short& strip) const; //provides number of consecutive bad strips on the left of strip (including strip)
100  int nBadStripsOnTheRight(const Range& range, const short& strip) const; //provides number of consecutive bad strips on the right of strip (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 
127  SiStripDetCabling const * cabling() const { return SiStripDetCabling_;}
128 
129 
130  private:
131 
132  void compact(std::vector<unsigned int>&,std::vector<unsigned int>&,unsigned short&);
133  void subtract(std::vector<unsigned int>&,const std::vector<unsigned int>&);
134  void subtraction(std::vector<unsigned int>&,const unsigned int&);
135  bool put_replace(const uint32_t& DetId, Range input);
136 
141  void turnOffFeds(const std::vector<int> & fedsList, const bool turnOffStrips, const bool printDebug);
142 
144  void printDetInfo(const uint32_t &detId, const uint32_t &apvPairNumber, std::stringstream &ss);
146  void printActiveFedsInfo( const std::vector<uint16_t> & activeFedsFromCabling,
147  const std::vector<int> & activeFedsFromRunInfo,
148  const std::vector<int> & differentFeds,
149  const bool printDebug );
150 
151  bool toCleanUp;
154 
155  std::vector<BadComponent> BadComponentVect;
156 
160 };
161 
162 #endif
SiStripDetInfoFileReader * reader
int i
Definition: DBlmapReader.cc:9
SiStripDetCabling const * cabling() const
MatrixMeschach operator-(const MatrixMeschach &mat1, const MatrixMeschach &mat2)
Basic3DVector & operator-=(const Basic3DVector< U > &p)
bool operator!=(debugging_allocator< X > const &, debugging_allocator< Y > const &)
void add(const std::vector< const T * > &source, std::vector< const T * > &dest)
edm::FileInPath FileInPath_
const SiStripDetCabling * SiStripDetCabling_
static std::string const input
Definition: EdmProvDump.cc:44
edm::FileInPath getFileInPath() const
bool useEmptyRunInfo_
bool operator==(const QGLikelihoodParameters &lhs, const QGLikelihoodCategory &rhs)
Test if parameters are compatible with category.
Definition: DetId.h:18
PixelRecoRange< float > Range
std::vector< BadComponent > BadComponentVect
void cleanUp(const std::string &connectionString, std::set< std::string > exclusionList=std::set< std::string >())
Definition: SchemaUtils.cc:22
void setUseEmptyRunInfo(const bool useEmptyRunInfo)
const std::vector< BadComponent > & getBadComponentList() const
std::pair< ContainerIterator, ContainerIterator > Range
void setPrintDebugOutput(const bool printDebug)
Basic3DVector & operator+=(const Basic3DVector< U > &p)
Unlimited (trivial) bounds.