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 
59  virtual ~SiStripBadStrip(){};
60 
61  bool put(const uint32_t& detID, const InputVector& vect) { return put(detID, Range(vect.begin(), vect.end())); }
62  bool put(const uint32_t& detID, Range input);
63  const Range getRange(const uint32_t detID) const;
64  Range getRangeByPos(unsigned short pos) const;
65  void getDetIds(std::vector<uint32_t>& DetIds_) const;
66  void printSummary(std::stringstream& ss, const TrackerTopology* trackerTopo) const;
67  void printDebug(std::stringstream& ss, const TrackerTopology* trackerTopo) const;
68 
69  ContainerIterator getDataVectorBegin() const { return v_badstrips.begin(); }
71  RegistryIterator getRegistryVectorBegin() const { return indexes.begin(); }
72  RegistryIterator getRegistryVectorEnd() const { return indexes.end(); }
73 
74  inline data decode(const unsigned int& value) const {
75  data a;
79  return a;
80  }
81 
82  inline unsigned int encode(const unsigned short& first,
83  const unsigned short& NconsecutiveBadStrips,
84  const unsigned short& flag = 0) {
86  ((NconsecutiveBadStrips & sistrip::RangeBadStripMask_) << sistrip::RangeBadStripShift_) |
88  }
89 
90  // additional methods need for Phase-2
91  inline data decodePhase2(const unsigned int& value) const {
92  data a;
96  return a;
97  }
98 
99  inline unsigned int encodePhase2(const unsigned short& first,
100  const unsigned short& NconsecutiveBadStrips,
101  const unsigned short& flag = 0) {
105  }
106 
107 protected:
110 
112 };
113 
114 #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:50
static const uint32_t RangeBadStripShift_
unsigned int encodePhase2(const unsigned short &first, const unsigned short &NconsecutiveBadStrips, const unsigned short &flag=0)
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:121
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