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 
13  CSCBadChambers() : numberOfBadChambers( 0 ), chambers( std::vector<int>() ) {};
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  {
31  const IndexType nschin[32] =
32  { 1,37,73,1, 109,127,0,0, 163,181,0,0, 217,469,0,0,
33  235,271,307,235, 343,361,0,0, 397,415,0,0, 451,505,0,0 };
34  return nschin[(ie - 1)*16 + (is - 1)*4 + ir - 1];
35  }
36 
37  IndexType chamberIndex(IndexType ie, IndexType is, IndexType ir, IndexType ic) const
38  {
39  return startChamberIndexInEndcap(ie, is, ir) + ic - 1; // -1 so start index _is_ ic=1
40  }
41 
42  private:
44  std::vector<int> chambers;
45 
47 };
48 
49 #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>