Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:50:52

0001 #ifndef mySiStripNoises_h
0002 #define mySiStripNoises_h
0003 
0004 #include "CondFormats/Serialization/interface/Serializable.h"
0005 
0006 #include <vector>
0007 #include <map>
0008 #include <cstdint>
0009 //#include<iostream>
0010 
0011 //typedef float SiStripNoise;
0012 //typedef bool  SiStripDisable;
0013 
0014 class mySiStripNoises {
0015 public:
0016   mySiStripNoises() {}
0017   ~mySiStripNoises() {}
0018 
0019   struct DetRegistry {
0020     uint32_t detid;
0021     uint32_t ibegin;
0022     uint32_t iend;
0023 
0024     COND_SERIALIZABLE;
0025   };
0026   class StrictWeakOrdering {
0027   public:
0028     bool operator()(const DetRegistry& p, const uint32_t& i) const { return p.detid < i; }
0029   };
0030   typedef std::vector<unsigned char> SiStripNoiseVector;
0031   typedef SiStripNoiseVector::const_iterator ContainerIterator;
0032   typedef std::pair<ContainerIterator, ContainerIterator> Range;
0033   typedef std::vector<DetRegistry> Registry;
0034   typedef Registry::const_iterator RegistryIterator;
0035   typedef const std::vector<short> InputVector;
0036 
0037   bool put(const uint32_t detID, InputVector& input);
0038   const Range getRange(const uint32_t& detID) const;
0039   void getDetIds(std::vector<uint32_t>& DetIds) const;
0040   float getNoise(const uint16_t& strip, const Range& range) const;
0041   void setData(float noise_, std::vector<short>& vped);
0042   // private:
0043   //SiStripNoiseVector v_noises;
0044   //Registry indexes;
0045   void encode(InputVector& Vi, std::vector<unsigned char>& Vo_CHAR);
0046   uint16_t decode(const uint16_t& strip, const Range& range) const;
0047   std::vector<unsigned char> v_noises;
0048   std::vector<DetRegistry> indexes;
0049 
0050   COND_SERIALIZABLE;
0051 };
0052 
0053 #endif