CMS 3D CMS Logo

CSCBadChambers.h
Go to the documentation of this file.
1 #ifndef CSCBadChambers_h
2 #define CSCBadChambers_h
3 
5 
7 #include <vector>
8 
10 public:
11  typedef uint16_t IndexType;
12 
14  CSCBadChambers(int nch, const std::vector<int>& ch) : numberOfBadChambers(nch), chambers(ch){};
16 
18  int numberOfChambers() const { return numberOfBadChambers; }
19 
21  std::vector<int> container() const { return chambers; }
22 
24  bool isInBadChamber(IndexType ichamber) const;
25 
27  bool isInBadChamber(const CSCDetId& id) const;
28 
29  IndexType startChamberIndexInEndcap(IndexType ie, IndexType is, IndexType ir) const {
30  const IndexType nschin[32] = {1, 37, 73, 1, 109, 127, 0, 0, 163, 181, 0, 0, 217, 469, 0, 0,
31  235, 271, 307, 235, 343, 361, 0, 0, 397, 415, 0, 0, 451, 505, 0, 0};
32  return nschin[(ie - 1) * 16 + (is - 1) * 4 + ir - 1];
33  }
34 
35  IndexType chamberIndex(IndexType ie, IndexType is, IndexType ir, IndexType ic) const {
36  return startChamberIndexInEndcap(ie, is, ir) + ic - 1; // -1 so start index _is_ ic=1
37  }
38 
39 private:
41  std::vector<int> chambers;
42 
44 };
45 
46 #endif
IndexType startChamberIndexInEndcap(IndexType ie, IndexType is, IndexType ir) const
std::vector< int > chambers
CSCBadChambers(int nch, const std::vector< int > &ch)
bool isInBadChamber(IndexType ichamber) const
Is the chamber with index &#39;ichamber&#39; flagged as bad?
uint16_t IndexType
IndexType chamberIndex(IndexType ie, IndexType is, IndexType ir, IndexType ic) const
std::vector< int > container() const
Return the container of bad chambers.
#define COND_SERIALIZABLE
Definition: Serializable.h:38
int numberOfChambers() const
How many bad chambers are there>