CMS 3D CMS Logo

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 <string>
10 #include <cstdint>
11 
12 class TrackerTopology;
13 
32 public:
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 
48  SiStripDetVOff(const SiStripDetVOff& toCopy) { toCopy.getVoff(v_Voff); }
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 TrackerTopology*) const;
71  void printSummary(std::stringstream& ss, const TrackerTopology*) 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  std::vector<uint32_t> v_Voff;
83 
85 };
86 
87 #endif
void getDetIds(std::vector< uint32_t > &DetIds_) const
static const short bitShift
static const unsigned int LVonMask
bool IsModuleLVOff(const uint32_t DetID) const
static const unsigned int allOnMask
void getVoff(std::vector< uint32_t > &vOff_) const
Needed by the copy constructor.
bool IsModuleVOff(const uint32_t DetID) const
Returns true if either HV or LV are off.
int getHVoffCounts() const
Returns the total number of modules with HV 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
std::vector< uint32_t > v_Voff
void printSummary(std::stringstream &ss, const TrackerTopology *) 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
bool operator==(const SiStripDetVOff &d) const
static const short HVmask
d
Definition: ztail.py:151
Definition: DetId.h:17
static const short LVmask
static const unsigned int HVonMask
int getLVoffCounts() const
Returns the total number of modules with LV off.
bool IsModuleHVOff(const uint32_t DetID) const
#define COND_SERIALIZABLE
Definition: Serializable.h:39
std::vector< uint32_t >::iterator vOffIterator
std::vector< uint32_t >::const_iterator constVoffIterator
void printDebug(std::stringstream &ss, const TrackerTopology *) const
SiStripDetVOff(const SiStripDetVOff &toCopy)