test
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 
5 
6 #include<vector>
7 #include<map>
8 #include<iostream>
9 #include<boost/cstdint.hpp>
10 #include <string>
11 
30 {
31  public:
32 
33  typedef std::vector<uint32_t>::iterator vOffIterator;
34  typedef std::vector<uint32_t>::const_iterator constVoffIterator;
35  typedef std::vector<int>::const_iterator constVboolIterator;
36 
37  // Bitmasks used to retrieve LV and HV information
38  static const short LVmask = 0x1; // <--- 01
39  static const unsigned int LVonMask = 0xFFFFFFFE; // <--- the last 4 bits are 1110. All the other bits are 1.
40  static const short HVmask = 0x2; // <--- 10
41  static const unsigned int HVonMask = 0xFFFFFFFD; // <--- the last 4 bits are 1101. All the other bits are 1.
42  static const unsigned int allOnMask = 0x03; // <--- 2 bits are 11.
43  static const unsigned int eightBitMask = 0xFFFFFFFF;
44  static const short bitShift = 2;
45 
49 
51  void getVoff(std::vector<uint32_t>& vOff_) const { vOff_ = v_Voff; }
52 
54  bool put(const uint32_t DetId, const int HVoff, const int LVoff);
55 
57  bool put(std::vector<uint32_t>& DetId, std::vector<int>& HVoff, std::vector<int>& LVoff);
58 
59  bool operator == (const SiStripDetVOff& d) const { return d.v_Voff==v_Voff; }
60 
61  void getDetIds(std::vector<uint32_t>& DetIds_) const;
62 
64  bool IsModuleVOff(const uint32_t DetID) const;
65 
66  bool IsModuleHVOff(const uint32_t DetID) const;
67 
68  bool IsModuleLVOff(const uint32_t DetID) const;
69 
70  void printDebug(std::stringstream & ss) const;
71  void printSummary(std::stringstream & ss) const;
72 
74  int getLVoffCounts() const;
76  int getHVoffCounts() const;
77 
79  void setBits( uint32_t & enDetId, const int HVoff, const int LVoff );
80 
81  private:
82 
83  std::vector<uint32_t> v_Voff;
84 
86 };
87 
88 #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
tuple d
Definition: ztail.py:151
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:18
static const short LVmask
void getVoff(std::vector< uint32_t > &vOff_) const
Needed by the copy constructor.
static const unsigned int HVonMask
#define COND_SERIALIZABLE
Definition: Serializable.h:37
std::vector< uint32_t >::iterator vOffIterator
std::vector< uint32_t >::const_iterator constVoffIterator
SiStripDetVOff(const SiStripDetVOff &toCopy)
void printDebug(std::stringstream &ss) const