CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
11 #include <vector>
12 #include <utility>
13 
23 
24 class TrackerGeometry;
25 
27 
28  public:
30  uint32_t DetID;
31  int errorType;
32  unsigned short BadRocs;
33  };
34 
36  // errortype "whole" = int 0 in DB //
37  // errortype "tbmA" = int 1 in DB //
38  // errortype "tbmB" = int 2 in DB //
39  // errortype "none" = int 3 in DB //
41 
43  //each bad roc correspond to a bit to 1: num= //
44  // 0 <-> all good rocs //
45  // 1 <-> only roc 0 bad //
46  // 2<-> only roc 1 bad //
47  // 3<-> roc 0 and 1 bad //
48  // 4 <-> only roc 2 bad //
49  // ... //
51 
52 
53 
54 
55 
57  public:
58  bool operator() (const disabledModuleType& p,const uint32_t i) const {return p.DetID < i;}
59  bool operator() (const disabledModuleType& p,const disabledModuleType& q) const {return p.DetID < q.DetID;}
60  };
61 
62 
63 
65 
66  // constructor from a list of disabled modules
67  SiPixelQuality(std::vector<disabledModuleType> & disabledModules) : theDisabledModules(disabledModules) {;}
68 
69  virtual ~SiPixelQuality() {;}
70 
71  // set the list of disabled modules (current list is lost)
72  void setDisabledModuleList(std::vector<disabledModuleType> & disabledModules)
73  { theDisabledModules = disabledModules; }
74 
75  // add a single module to the vector of disabled modules
77  { theDisabledModules.push_back(module); }
78 
79  // add a vector of modules to the vector of disabled modules
80  void addDisabledModule(std::vector<disabledModuleType> & idVector);
81 
82  // remove disabled module from the list
83  // returns false if id not in disable list, true otherwise
84  // bool removeDisabledModule(const disabledModuleType & module);
85  // bool removeDisabledModule(const uint32_t & detid);
86 
87 
88 //--------------- Interface for the user -----------------//
89 //------- designed to match SiStripQuality methods ----------//
90  //method copied from the SiStripQuality
91  void add(const SiStripDetVOff*);
92  //----------------------------------------
93  //number of Bad modules
94  int BadModuleNumber();
95 
96  bool IsModuleBad(const uint32_t & detid) const; //returns True if module disabled
97  bool IsModuleUsable(const uint32_t& detid) const; //returns True if module NOT disabled
98  bool IsRocBad(const uint32_t& detid, const short& rocNb) const; //returns True if ROC is disabled
99  bool IsAreaBad(uint32_t detid, sipixelobjects::GlobalPixel global, const edm::EventSetup& es, const SiPixelFedCabling* map ) const;
100  short getBadRocs(const uint32_t& detid) const; //returns bad Rocs for given DetId
101  //each bad roc correspond to a bit to 1: num=
102  //0 <-> all good rocs
103  //1 <-> only roc 0 bad
104  //2<-> only roc 1 bad
105  //3<-> roc 0 and 1 bad
106  // 4 <-> only roc 2 bad
107  //...
108  const std::vector<disabledModuleType> getBadComponentList() const //returns list of disabled modules/ROCs
109  { return theDisabledModules; }
110  const std::vector< LocalPoint > getBadRocPositions(const uint32_t & detid, const TrackerGeometry& theTracker, const SiPixelFedCabling* map ) const;
111  // const std::vector< std::pair <uint8_t, uint8_t> > getBadRocPositions(const uint32_t & detid, const edm::EventSetup& es, const SiPixelFedCabling* map ) const;
112 
113 
114 
115  private:
116  std::vector<disabledModuleType> theDisabledModules;
117  bool IsFedBad(const uint32_t & detid) const;
118 
119 }; // class SiPixelQuality
120 
121 
122 #endif
void addDisabledModule(disabledModuleType module)
int i
Definition: DBlmapReader.cc:9
void add(const SiStripDetVOff *)
SiPixelQuality(std::vector< disabledModuleType > &disabledModules)
bool operator()(const disabledModuleType &p, const uint32_t i) const
bool IsFedBad(const uint32_t &detid) const
bool IsRocBad(const uint32_t &detid, const short &rocNb) const
dictionary map
Definition: Association.py:205
global coordinates (row and column in DetUnit, as in PixelDigi)
Definition: GlobalPixel.h:6
virtual ~SiPixelQuality()
const std::vector< LocalPoint > getBadRocPositions(const uint32_t &detid, const TrackerGeometry &theTracker, const SiPixelFedCabling *map) const
const std::vector< disabledModuleType > getBadComponentList() const
bool IsModuleUsable(const uint32_t &detid) const
bool IsModuleBad(const uint32_t &detid) const
std::vector< disabledModuleType > theDisabledModules
string const
Definition: compareJSON.py:14
short getBadRocs(const uint32_t &detid) const
bool IsAreaBad(uint32_t detid, sipixelobjects::GlobalPixel global, const edm::EventSetup &es, const SiPixelFedCabling *map) const
void setDisabledModuleList(std::vector< disabledModuleType > &disabledModules)
Definition: vlib.h:209