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<boost/cstdint.hpp>
10 #include <string>
11 
12 class TrackerTopology;
13 
32 {
33  public:
34 
35  typedef std::vector<uint32_t>::iterator vOffIterator;
36  typedef std::vector<uint32_t>::const_iterator constVoffIterator;
37  typedef std::vector<int>::const_iterator constVboolIterator;
38 
39  // Bitmasks used to retrieve LV and HV information
40  static const short LVmask = 0x1; // <--- 01
41  static const unsigned int LVonMask = 0xFFFFFFFE; // <--- the last 4 bits are 1110. All the other bits are 1.
42  static const short HVmask = 0x2; // <--- 10
43  static const unsigned int HVonMask = 0xFFFFFFFD; // <--- the last 4 bits are 1101. All the other bits are 1.
44  static const unsigned int allOnMask = 0x03; // <--- 2 bits are 11.
45  static const unsigned int eightBitMask = 0xFFFFFFFF;
46  static const short bitShift = 2;
47 
50  SiStripDetVOff( const SiStripDetVOff & toCopy ) { toCopy.getVoff(v_Voff); }
51 
53  void getVoff(std::vector<uint32_t>& vOff_) const { vOff_ = v_Voff; }
54 
56  bool put(const uint32_t DetId, const int HVoff, const int LVoff);
57 
59  bool put(std::vector<uint32_t>& DetId, std::vector<int>& HVoff, std::vector<int>& LVoff);
60 
61  bool operator == (const SiStripDetVOff& d) const { return d.v_Voff==v_Voff; }
62 
63  void getDetIds(std::vector<uint32_t>& DetIds_) const;
64 
66  bool IsModuleVOff(const uint32_t DetID) const;
67 
68  bool IsModuleHVOff(const uint32_t DetID) const;
69 
70  bool IsModuleLVOff(const uint32_t DetID) const;
71 
72  void printDebug(std::stringstream & ss, const TrackerTopology*) const;
73  void printSummary(std::stringstream & ss, const TrackerTopology*) const;
74 
76  int getLVoffCounts() const;
78  int getHVoffCounts() const;
79 
81  void setBits( uint32_t & enDetId, const int HVoff, const int LVoff );
82 
83  private:
84 
85  std::vector<uint32_t> v_Voff;
86 
88 };
89 
90 #endif
static const short bitShift
bool IsModuleHVOff(const uint32_t DetID) const
static const unsigned int LVonMask
static const unsigned int allOnMask
void printSummary(std::stringstream &ss, const TrackerTopology *) const
int getLVoffCounts() const
Returns the total number of modules with LV off.
void printDebug(std::stringstream &ss, const TrackerTopology *) const
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.
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:38
std::vector< uint32_t >::iterator vOffIterator
std::vector< uint32_t >::const_iterator constVoffIterator
SiStripDetVOff(const SiStripDetVOff &toCopy)