CMS 3D CMS Logo

SiPixelQuality.h
Go to the documentation of this file.
1 // SiPixelQuality.h
2 //
3 // class definition to hold a list of disabled pixel modules
4 //
5 // M. Eads
6 // Apr 2008
7 
8 #ifndef SiPixelQuality_H
9 #define SiPixelQuality_H
10 
12 
13 #include <vector>
14 #include <utility>
15 
24 
25 namespace edm {
26  class EventSetup;
27 }
28 
29 class TrackerGeometry;
30 
32 
33  public:
35  uint32_t DetID;
36  int errorType;
37  unsigned short BadRocs;
38 
40 };
41 
43  // errortype "whole" = int 0 in DB //
44  // errortype "tbmA" = int 1 in DB //
45  // errortype "tbmB" = int 2 in DB //
46  // errortype "none" = int 3 in DB //
48 
50  //each bad roc correspond to a bit to 1: num= //
51  // 0 <-> all good rocs //
52  // 1 <-> only roc 0 bad //
53  // 2<-> only roc 1 bad //
54  // 3<-> roc 0 and 1 bad //
55  // 4 <-> only roc 2 bad //
56  // ... //
58 
59 
60 
61 
62 
64  public:
65  bool operator() (const disabledModuleType& p,const uint32_t i) const {return p.DetID < i;}
66  bool operator() (const disabledModuleType& p,const disabledModuleType& q) const {return p.DetID < q.DetID;}
67  };
68 
69 
70 
71  SiPixelQuality() : theDisabledModules(0) {;}
72 
73  // constructor from a list of disabled modules
74  SiPixelQuality(std::vector<disabledModuleType> & disabledModules) : theDisabledModules(disabledModules) {;}
75 
76  virtual ~SiPixelQuality() {;}
77 
78  // set the list of disabled modules (current list is lost)
79  void setDisabledModuleList(std::vector<disabledModuleType> & disabledModules)
80  { theDisabledModules = disabledModules; }
81 
82  // add a single module to the vector of disabled modules
84  { theDisabledModules.push_back(module); }
85 
86  // add a vector of modules to the vector of disabled modules
87  void addDisabledModule(std::vector<disabledModuleType> & idVector);
88 
89  // remove disabled module from the list
90  // returns false if id not in disable list, true otherwise
91  // bool removeDisabledModule(const disabledModuleType & module);
92  // bool removeDisabledModule(const uint32_t & detid);
93 
94 
95 //--------------- Interface for the user -----------------//
96 //------- designed to match SiStripQuality methods ----------//
97  //method copied from the SiStripQuality
98  void add(const SiStripDetVOff*);
99  //----------------------------------------
100  //number of Bad modules
101  int BadModuleNumber();
102 
103  bool IsModuleBad(const uint32_t & detid) const; //returns True if module disabled
104  bool IsModuleUsable(const uint32_t& detid) const; //returns True if module NOT disabled
105  bool IsRocBad(const uint32_t& detid, const short& rocNb) const; //returns True if ROC is disabled
106  bool IsAreaBad(uint32_t detid, sipixelobjects::GlobalPixel global, const edm::EventSetup& es, const SiPixelFedCabling* map ) const;
107  short getBadRocs(const uint32_t& detid) const; //returns bad Rocs for given DetId
108  //each bad roc correspond to a bit to 1: num=
109  //0 <-> all good rocs
110  //1 <-> only roc 0 bad
111  //2<-> only roc 1 bad
112  //3<-> roc 0 and 1 bad
113  // 4 <-> only roc 2 bad
114  //...
115  const std::vector<disabledModuleType> getBadComponentList() const //returns list of disabled modules/ROCs
116  { return theDisabledModules; }
117  const std::vector< LocalPoint > getBadRocPositions(const uint32_t & detid, const TrackerGeometry& theTracker, const SiPixelFedCabling* map ) const;
118  // const std::vector< std::pair <uint8_t, uint8_t> > getBadRocPositions(const uint32_t & detid, const edm::EventSetup& es, const SiPixelFedCabling* map ) const;
119 
120 
121 
122  private:
123  std::vector<disabledModuleType> theDisabledModules;
124  bool IsFedBad(const uint32_t & detid) const;
125 
126 
128 }; // class SiPixelQuality
129 
130 
131 #endif
void addDisabledModule(disabledModuleType module)
int i
Definition: DBlmapReader.cc:9
SiPixelQuality(std::vector< disabledModuleType > &disabledModules)
void add(const std::vector< const T * > &source, std::vector< const T * > &dest)
global coordinates (row and column in DetUnit, as in PixelDigi)
Definition: GlobalPixel.h:6
virtual ~SiPixelQuality()
const std::vector< disabledModuleType > getBadComponentList() const
std::vector< disabledModuleType > theDisabledModules
#define COND_SERIALIZABLE
Definition: Serializable.h:38
HLT enums.
void setDisabledModuleList(std::vector< disabledModuleType > &disabledModules)
Definition: vlib.h:208