Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:51:31

0001 #ifndef CondFormats_SiPixelObjects_SiPixelQualityProbabilities_h
0002 #define CondFormats_SiPixelObjects_SiPixelQualityProbabilities_h
0003 
0004 #include "CondFormats/Serialization/interface/Serializable.h"
0005 
0006 #include <map>
0007 #include <string>
0008 #include <vector>
0009 
0010 class SiPixelQualityProbabilities {
0011 public:
0012   typedef std::vector<std::pair<std::string, float> > probabilityVec;
0013   typedef std::map<unsigned int, probabilityVec> probabilityMap;
0014 
0015   SiPixelQualityProbabilities() {}
0016   SiPixelQualityProbabilities(const SiPixelQualityProbabilities& rhs) { m_probabilities = rhs.getProbability_Map(); };
0017   virtual ~SiPixelQualityProbabilities() {}
0018 
0019   void setProbabilities(const unsigned int puBin, const probabilityVec& theProbabilities);
0020 
0021   const probabilityMap& getProbability_Map() const { return m_probabilities; }
0022 
0023   probabilityVec getProbabilities(const unsigned int puBin) const;
0024   const probabilityVec& getProbabilities(const unsigned int puBin);
0025 
0026   double size() const { return m_probabilities.size(); }
0027   double nelements(const int puBin) const { return m_probabilities.at(puBin).size(); }
0028   std::vector<unsigned int> getPileUpBins() const;
0029 
0030   void printAll() const;
0031 
0032   //dumping values on output stream
0033   void print(std::ostream& os) const;
0034 
0035 private:
0036   probabilityMap m_probabilities;
0037 
0038   COND_SERIALIZABLE;
0039 };
0040 
0041 std::ostream& operator<<(std::ostream&, SiPixelQualityProbabilities theProbabilities);
0042 
0043 #endif  //CondFormats_SiPixelObjects_SiPixelQualityProbabilities_h