CMS 3D CMS Logo

SiPixelPerformanceSummary.h

Go to the documentation of this file.
00001 #ifndef SiPixelPerformanceSummary_h
00002 #define SiPixelPerformanceSummary_h
00003 
00004 
00005 #include<vector>
00006 #include<map>
00007 #include<iostream>
00008 #include<boost/cstdint.hpp>
00009 
00010 
00011 #define kDetSummarySize 3 // number of values kept in DetSummary.performanceValues
00012 #define kDefaultValue -99.9 
00013 
00014 
00015 class SiPixelPerformanceSummary {
00016 public:
00017   struct DetSummary { 
00018     uint32_t detId_;
00019     std::vector<float> performanceValues_;
00020   }; 
00021   class StrictWeakOrdering { // sort DetSummaries by detId
00022   public:
00023     bool operator() (const DetSummary& detSumm, const uint32_t& otherDetId) const { 
00024       return (detSumm.detId_ < otherDetId); 
00025     };
00026   };
00027   class MatchDetSummaryDetId : public std::unary_function<DetSummary, bool> { 
00028   public: 
00029     MatchDetSummaryDetId(const uint32_t& detId) : detId_(detId) {} 
00030     bool operator() (const DetSummary& detSumm) const { return (detSumm.detId_==detId_); } 
00031   private:
00032     uint32_t detId_;
00033   };
00034   
00035 public:
00036   SiPixelPerformanceSummary(const SiPixelPerformanceSummary&);
00037   SiPixelPerformanceSummary();
00038  ~SiPixelPerformanceSummary();
00039   
00040   void clear() { allDetSummaries_.clear(); }; 
00041   unsigned int size() { return allDetSummaries_.size(); };
00042 
00043   std::vector<DetSummary> getAllDetSummaries() const { return allDetSummaries_; };
00044 
00045           void setRunNumber(unsigned int runNumber) { runNumber_ = runNumber; }; 
00046   unsigned int getRunNumber() const { return runNumber_; };
00047   
00048                 void setTimeValue(unsigned long long timeValue) { timeValue_ = timeValue; };
00049   unsigned long long getTimeValue() const { return timeValue_; };
00050     
00051   void print() const; 
00052   void print(const uint32_t detId) const; 
00053   void print(const std::vector<float>& performanceValues) const; 
00054   void printall() const;  
00055   
00056   std::pair<bool, std::vector<DetSummary>::iterator> initDet(const uint32_t detId); 
00057   std::pair<bool, std::vector<DetSummary>::iterator>  setDet(const uint32_t detId, 
00058                                                              const std::vector<float>& performanceValues); 
00059   void getAllDetIds(std::vector<uint32_t>& vDetIds) const;
00060   void getDetSummary(const uint32_t detId, std::vector<float>& performanceValues) const;
00061 
00062    bool setNumberOfDigis(uint32_t detId, float mean, float RMS);
00063    bool setNoisePercentage(uint32_t detId, float percentage);
00064 
00065 private:
00066    bool setValue(uint32_t detid, int index, float performanceValue);
00067   float getValue(uint32_t detid, int index);
00068 
00069 private: 
00070   std::vector<DetSummary> allDetSummaries_;
00071   unsigned int runNumber_;
00072   unsigned long long timeValue_;
00073 };
00074 
00075 
00076 #endif

Generated on Tue Jun 9 17:26:46 2009 for CMSSW by  doxygen 1.5.4