CMS 3D CMS Logo

SiStripBadStrip.h
Go to the documentation of this file.
1 #ifndef SiStripBadStrip_h
2 #define SiStripBadStrip_h
3 
5 
6 #include <vector>
7 #include <map>
8 #include <iostream>
10 #include <cstdint>
11 
12 class TrackerTopology;
13 
31 public:
32  struct data {
33  unsigned short firstStrip;
34  unsigned short range;
35  unsigned short flag;
36  };
37 
38  struct DetRegistry {
39  uint32_t detid;
40  uint32_t ibegin;
41  uint32_t iend;
42 
44  };
45 
47  public:
48  bool operator()(const DetRegistry& p, const uint32_t& i) const { return p.detid < i; }
49  };
50 
51  typedef std::vector<unsigned int> Container;
52  typedef std::vector<unsigned int>::const_iterator ContainerIterator;
53  typedef std::pair<ContainerIterator, ContainerIterator> Range;
54  typedef std::vector<DetRegistry> Registry;
55  typedef Registry::const_iterator RegistryIterator;
57 
60  v_badstrips = orig.v_badstrips;
61  indexes = orig.indexes;
62  }
63  virtual ~SiStripBadStrip(){};
64 
65  bool put(const uint32_t& detID, const InputVector& vect) { return put(detID, Range(vect.begin(), vect.end())); }
66  bool put(const uint32_t& detID, Range input);
67  const Range getRange(const uint32_t detID) const;
68  Range getRangeByPos(unsigned short pos) const;
69  void getDetIds(std::vector<uint32_t>& DetIds_) const;
70  void printSummary(std::stringstream& ss, const TrackerTopology* trackerTopo) const;
71  void printDebug(std::stringstream& ss, const TrackerTopology* trackerTopo) const;
72 
73  ContainerIterator getDataVectorBegin() const { return v_badstrips.begin(); }
75  RegistryIterator getRegistryVectorBegin() const { return indexes.begin(); }
76  RegistryIterator getRegistryVectorEnd() const { return indexes.end(); }
77 
78  inline data decode(const unsigned int& value) const {
79  data a;
83  return a;
84  }
85 
86  inline unsigned int encode(const unsigned short& first,
87  const unsigned short& NconsecutiveBadStrips,
88  const unsigned short& flag = 0) {
90  ((NconsecutiveBadStrips & sistrip::RangeBadStripMask_) << sistrip::RangeBadStripShift_) |
92  }
93 
94  // additional methods need for Phase-2
95  inline data decodePhase2(const unsigned int& value) const {
96  data a;
100  return a;
101  }
102 
103  inline unsigned int encodePhase2(const unsigned short& first,
104  const unsigned short& NconsecutiveBadStrips,
105  const unsigned short& flag = 0) {
109  }
110 
111 protected:
114 
116 };
117 
118 #endif
unsigned short range
void printSummary(std::stringstream &ss, const TrackerTopology *trackerTopo) const
ContainerIterator getDataVectorBegin() const
static const uint32_t FirstBadStripShift_
ContainerIterator getDataVectorEnd() const
std::vector< unsigned int >::const_iterator ContainerIterator
virtual ~SiStripBadStrip()
static const uint32_t FlagBadStripShift_
Registry::const_iterator RegistryIterator
static const uint32_t RangeBadStripShift_
const Range getRange(const uint32_t detID) const
void getDetIds(std::vector< uint32_t > &DetIds_) const
static std::string const input
Definition: EdmProvDump.cc:47
static const uint32_t RangeBadStripShift_
unsigned int encodePhase2(const unsigned short &first, const unsigned short &NconsecutiveBadStrips, const unsigned short &flag=0)
SiStripBadStrip(const SiStripBadStrip &orig)
static const uint32_t RangeBadStripMask_
static const uint32_t FirstBadStripMask_
RegistryIterator getRegistryVectorEnd() const
Definition: value.py:1
void printDebug(std::stringstream &ss, const TrackerTopology *trackerTopo) const
Range getRangeByPos(unsigned short pos) const
static const uint32_t RangeBadStripMask_
std::vector< DetRegistry > Registry
bool operator()(const DetRegistry &p, const uint32_t &i) const
unsigned short firstStrip
Container v_badstrips
static const uint32_t FlagBadStripMask_
static const uint32_t FlagBadStripShift_
#define COND_SERIALIZABLE
Definition: Serializable.h:39
std::vector< unsigned int > Container
static const uint32_t FirstBadStripMask_
data decodePhase2(const unsigned int &value) const
double a
Definition: hdecay.h:119
std::pair< ContainerIterator, ContainerIterator > Range
data decode(const unsigned int &value) const
bool put(const uint32_t &detID, const InputVector &vect)
RegistryIterator getRegistryVectorBegin() const
unsigned int encode(const unsigned short &first, const unsigned short &NconsecutiveBadStrips, const unsigned short &flag=0)
static const uint32_t FlagBadStripMask_
static const uint32_t FirstBadStripShift_
Container InputVector