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 
5 
6 #include<vector>
7 #include<map>
8 #include<iostream>
9 #include<boost/cstdint.hpp>
10 
11 // #include "CondFormats/SiStripObjects/interface/SiStripBaseObject.h"
13 
26 // class SiStripPedestals : public SiStripBaseObject
28 {
29 public:
30  /*
31  struct DecodingStructure{
32  unsigned int lth :6;
33  unsigned int hth :6;
34  unsigned int ped :10;
35  };*/
36 
37  struct DetRegistry{
38  uint32_t detid;
39  uint32_t ibegin;
40  uint32_t iend;
41 
43 };
44 
46  public:
47  bool operator() (const DetRegistry& p,const uint32_t& i) const {return p.detid < i;}
48  };
49 
50  typedef std::vector<char> Container;
51  typedef std::vector<char>::const_iterator ContainerIterator;
52  typedef std::pair<ContainerIterator, ContainerIterator> Range;
53  typedef std::vector<DetRegistry> Registry;
54  typedef Registry::const_iterator RegistryIterator;
55  typedef std::vector<uint16_t> InputVector;
56 
59 
60  //bool put(const uint32_t& detID,Range input);
61  bool put(const uint32_t& detID,InputVector &input);
62  const Range getRange(const uint32_t& detID) const;
63  void getDetIds(std::vector<uint32_t>& DetIds_) const;
64 
69 
70  void setData(float ped, InputVector& vped);
71  float getPed (const uint16_t& strip, const Range& range) const;
72  void allPeds (std::vector<int> & pefs, const Range& range) const;
73 
75  void printSummary(std::stringstream& ss) const;
77  void printDebug(std::stringstream& ss) const;
78 
79  private:
80 
81  void encode(InputVector& Vi, std::vector<unsigned char>& Vo_CHAR);
82  uint16_t decode (const uint16_t& strip, const Range& range) const;
83  inline uint16_t get10bits(const uint8_t * &ptr, int8_t skip) const ;
84 
85  Container v_pedestals; //@@@ blob streaming doesn't work with uint16_t and with SiStripData::Data
87 
89 };
90 
91 #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