CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
SiStripPedestals.h
Go to the documentation of this file.
1 #ifndef SiStripPedestals_h
2 #define SiStripPedestals_h
3 
5 
6 #include <vector>
7 #include <map>
8 #include <iostream>
9 
10 // #include "CondFormats/SiStripObjects/interface/SiStripBaseObject.h"
12 #include <cstdint>
13 
26 // class SiStripPedestals : public SiStripBaseObject
28 public:
29  /*
30  struct DecodingStructure{
31  unsigned int lth :6;
32  unsigned int hth :6;
33  unsigned int ped :10;
34  };*/
35 
36  struct DetRegistry {
37  uint32_t detid;
38  uint32_t ibegin;
39  uint32_t iend;
40 
42  };
43 
45  public:
46  bool operator()(const DetRegistry& p, const uint32_t& i) const { return p.detid < i; }
47  };
48 
49  typedef std::vector<char> Container;
50  typedef std::vector<char>::const_iterator ContainerIterator;
51  typedef std::pair<ContainerIterator, ContainerIterator> Range;
52  typedef std::vector<DetRegistry> Registry;
53  typedef Registry::const_iterator RegistryIterator;
54  typedef std::vector<uint16_t> InputVector;
55 
58 
59  //bool put(const uint32_t& detID,Range input);
60  bool put(const uint32_t& detID, InputVector& input);
61  const Range getRange(const uint32_t& detID) const;
62  void getDetIds(std::vector<uint32_t>& DetIds_) const;
63 
64  ContainerIterator getDataVectorBegin() const { return v_pedestals.begin(); }
66  RegistryIterator getRegistryVectorBegin() const { return indexes.begin(); }
67  RegistryIterator getRegistryVectorEnd() const { return indexes.end(); }
68 
69  void setData(float ped, InputVector& vped);
70  float getPed(const uint16_t& strip, const Range& range) const;
71  void allPeds(std::vector<int>& pefs, const Range& range) const;
72 
74  void printSummary(std::stringstream& ss, const TrackerTopology* trackerTopo) const;
76  void printDebug(std::stringstream& ss, const TrackerTopology* trackerTopo) const;
77 
78 private:
79  void encode(InputVector& Vi, std::vector<unsigned char>& Vo_CHAR);
80  uint16_t decode(const uint16_t& strip, const Range& range) const;
81  inline uint16_t get10bits(const uint8_t*& ptr, int8_t skip) const;
82 
83  Container v_pedestals; //@@@ blob streaming doesn't work with uint16_t and with SiStripData::Data
85 
87 };
88 
89 #endif
void printDebug(std::stringstream &ss, const TrackerTopology *trackerTopo) const
Prints all pedestals.
bool operator()(const DetRegistry &p, const uint32_t &i) const
std::vector< DetRegistry > Registry
std::pair< ContainerIterator, ContainerIterator > Range
void encode(InputVector &Vi, std::vector< unsigned char > &Vo_CHAR)
uint16_t decode(const uint16_t &strip, const Range &range) const
static std::string const input
Definition: EdmProvDump.cc:47
const uint16_t range(const Frame &aFrame)
float getPed(const uint16_t &strip, const Range &range) const
std::vector< uint16_t > InputVector
ContainerIterator getDataVectorEnd() const
RegistryIterator getRegistryVectorEnd() const
void printSummary(std::stringstream &ss, const TrackerTopology *trackerTopo) const
Prints mean pedestal value divided for subdet, layer and mono/stereo.
RegistryIterator getRegistryVectorBegin() const
ContainerIterator getDataVectorBegin() const
void allPeds(std::vector< int > &pefs, const Range &range) const
void getDetIds(std::vector< uint32_t > &DetIds_) const
bool put(const uint32_t &detID, InputVector &input)
#define COND_SERIALIZABLE
Definition: Serializable.h:39
void setData(float ped, InputVector &vped)
std::vector< char > Container
std::vector< char >::const_iterator ContainerIterator
uint16_t get10bits(const uint8_t *&ptr, int8_t skip) const
const Range getRange(const uint32_t &detID) const
Registry::const_iterator RegistryIterator