CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
SiStripDetVOff.h
Go to the documentation of this file.
1 #ifndef SiStripDetVOff_h
2 #define SiStripDetVOff_h
3 
4 #include<vector>
5 #include<map>
6 #include<iostream>
7 #include<boost/cstdint.hpp>
8 #include <string>
9 
28 {
29  public:
30 
31  typedef std::vector<uint32_t>::iterator vOffIterator;
32  typedef std::vector<uint32_t>::const_iterator constVoffIterator;
33  typedef std::vector<int>::const_iterator constVboolIterator;
34 
35  // Bitmasks used to retrieve LV and HV information
36  static const short LVmask = 0x1; // <--- 01
37  static const unsigned int LVonMask = 0xFFFFFFFE; // <--- the last 4 bits are 1110. All the other bits are 1.
38  static const short HVmask = 0x2; // <--- 10
39  static const unsigned int HVonMask = 0xFFFFFFFD; // <--- the last 4 bits are 1101. All the other bits are 1.
40  static const unsigned int allOnMask = 0x03; // <--- 2 bits are 11.
41  static const unsigned int eightBitMask = 0xFFFFFFFF;
42  static const short bitShift = 2;
43 
47 
49  void getVoff(std::vector<uint32_t>& vOff_) const { vOff_ = v_Voff; }
50 
52  bool put(const uint32_t DetId, const int HVoff, const int LVoff);
53 
55  bool put(std::vector<uint32_t>& DetId, std::vector<int>& HVoff, std::vector<int>& LVoff);
56 
57  bool operator == (const SiStripDetVOff& d) const { return d.v_Voff==v_Voff; }
58 
59  void getDetIds(std::vector<uint32_t>& DetIds_) const;
60 
62  bool IsModuleVOff(const uint32_t DetID) const;
63 
64  bool IsModuleHVOff(const uint32_t DetID) const;
65 
66  bool IsModuleLVOff(const uint32_t DetID) const;
67 
68  void printDebug(std::stringstream & ss) const;
69  void printSummary(std::stringstream & ss) const;
70 
72  int getLVoffCounts() const;
74  int getHVoffCounts() const;
75 
77  void setBits( uint32_t & enDetId, const int HVoff, const int LVoff );
78 
79  private:
80 
81  std::vector<uint32_t> v_Voff;
82 };
83 
84 #endif
static const short bitShift
bool IsModuleHVOff(const uint32_t DetID) const
static const unsigned int LVonMask
static const unsigned int allOnMask
int getLVoffCounts() const
Returns the total number of modules with LV off.
bool put(const uint32_t DetId, const int HVoff, const int LVoff)
Insert information for a single detId.
std::vector< int >::const_iterator constVboolIterator
bool operator==(const SiStripDetVOff &d) const
bool IsModuleVOff(const uint32_t DetID) const
Returns true if either HV or LV are off.
std::vector< uint32_t > v_Voff
bool IsModuleLVOff(const uint32_t DetID) const
void getDetIds(std::vector< uint32_t > &DetIds_) const
void setBits(uint32_t &enDetId, const int HVoff, const int LVoff)
Changes the bits in the stored value according to on/off voltages.
static const unsigned int eightBitMask
static const short HVmask
int getHVoffCounts() const
Returns the total number of modules with HV off.
void printSummary(std::stringstream &ss) const
Definition: DetId.h:20
static const short LVmask
void getVoff(std::vector< uint32_t > &vOff_) const
Needed by the copy constructor.
static const unsigned int HVonMask
std::vector< uint32_t >::iterator vOffIterator
std::vector< uint32_t >::const_iterator constVoffIterator
SiStripDetVOff(const SiStripDetVOff &toCopy)
void printDebug(std::stringstream &ss) const