CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
SiStripPedestals.h
Go to the documentation of this file.
1 #ifndef SiStripPedestals_h
2 #define SiStripPedestals_h
3 
4 #include<vector>
5 #include<map>
6 #include<iostream>
7 #include<boost/cstdint.hpp>
8 
9 // #include "CondFormats/SiStripObjects/interface/SiStripBaseObject.h"
11 
24 // class SiStripPedestals : public SiStripBaseObject
26 {
27 public:
28  /*
29  struct DecodingStructure{
30  unsigned int lth :6;
31  unsigned int hth :6;
32  unsigned int ped :10;
33  };*/
34 
35  struct DetRegistry{
36  uint32_t detid;
37  uint32_t ibegin;
38  uint32_t iend;
39  };
40 
42  public:
43  bool operator() (const DetRegistry& p,const uint32_t& i) const {return p.detid < i;}
44  };
45 
46  typedef std::vector<char> Container;
47  typedef std::vector<char>::const_iterator ContainerIterator;
48  typedef std::pair<ContainerIterator, ContainerIterator> Range;
49  typedef std::vector<DetRegistry> Registry;
50  typedef Registry::const_iterator RegistryIterator;
51  typedef std::vector<uint16_t> InputVector;
52 
55 
56  //bool put(const uint32_t& detID,Range input);
57  bool put(const uint32_t& detID,InputVector &input);
58  const Range getRange(const uint32_t& detID) const;
59  void getDetIds(std::vector<uint32_t>& DetIds_) const;
60 
65 
66  void setData(float ped, InputVector& vped);
67  float getPed (const uint16_t& strip, const Range& range) const;
68  void allPeds (std::vector<int> & pefs, const Range& range) const;
69 
71  void printSummary(std::stringstream& ss) const;
73  void printDebug(std::stringstream& ss) const;
74 
75  private:
76 
77  void encode(InputVector& Vi, std::vector<unsigned char>& Vo_CHAR);
78  uint16_t decode (const uint16_t& strip, const Range& range) const;
79  inline uint16_t get10bits(const uint8_t * &ptr, int8_t skip) const ;
80 
81  Container v_pedestals; //@@@ blob streaming doesn't work with uint16_t and with SiStripData::Data
83 };
84 
85 #endif
int i
Definition: DBlmapReader.cc:9
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)
void printDebug(std::stringstream &ss) const
Prints all pedestals.
uint16_t decode(const uint16_t &strip, const Range &range) const
static std::string const input
Definition: EdmProvDump.cc:44
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
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)
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