CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_3/src/CondFormats/SiPixelObjects/interface/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 60 // float numbers 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   
00022   class StrictWeakOrdering { // sort detSummaries by detId
00023   public:
00024     bool operator() (const DetSummary& detSumm, const uint32_t& otherDetId) const { 
00025       return (detSumm.detId_ < otherDetId); 
00026     };
00027   };
00028   
00029   class MatchDetSummaryDetId : public std::unary_function<DetSummary, bool> { 
00030   public: 
00031     MatchDetSummaryDetId(const uint32_t& detId) : detId_(detId) {} 
00032     bool operator() (const DetSummary& detSumm) const { return (detSumm.detId_==detId_); } 
00033   private:
00034     uint32_t detId_;
00035   };
00036   
00037 public:
00038   SiPixelPerformanceSummary(const SiPixelPerformanceSummary&);
00039   SiPixelPerformanceSummary();
00040  ~SiPixelPerformanceSummary();
00041   
00042   void clear();
00043 
00044   unsigned int size() { return allDetSummaries_.size(); }
00045 
00046                 void setTimeStamp(unsigned long long timeStamp) { timeStamp_ = timeStamp; }
00047   unsigned long long getTimeStamp() const { return timeStamp_; }
00048   
00049           void setRunNumber(unsigned int runNumber) { runNumber_ = runNumber; }
00050   unsigned int getRunNumber() const { return runNumber_; }
00051   
00052           void setNumberOfEvents(unsigned int numberOfEvents) { numberOfEvents_ = numberOfEvents; }
00053   unsigned int getNumberOfEvents() const { return numberOfEvents_; }
00054   
00055                 void setLuminosityBlock(unsigned int lumBlock) { luminosityBlock_ = lumBlock; }
00056   unsigned int getLuminosityBlock() const { return luminosityBlock_; };
00057     
00058   void print() const; 
00059   void print(const uint32_t detId) const; 
00060   void printAll() const;  
00061   
00062   std::vector<uint32_t> getAllDetIds() const;
00063   std::vector<DetSummary> getAllDetSummaries() const { return allDetSummaries_; }
00064   std::vector<float> getDetSummary(uint32_t detId) const;
00065 
00066   // RawData 
00067   bool setRawDataErrorType(uint32_t detId, int bin, float nErrors);
00068   // Digi
00069   bool setNumberOfDigis(uint32_t detId, float mean, float rms, float emPtn);
00070   bool setADC(uint32_t detId, float mean, float rms, float emPtn);
00071   // Cluster
00072   bool setNumberOfClusters(uint32_t detId, float mean, float rms, float emPtn);
00073   bool setClusterCharge(uint32_t detId, float mean, float rms, float emPtn); 
00074   bool setClusterSize(uint32_t detId, float mean, float rms, float emPtn);
00075   bool setClusterSizeX(uint32_t detId, float mean, float rms, float emPtn);
00076   bool setClusterSizeY(uint32_t detId, float mean, float rms, float emPtn);
00077   // RecHit
00078   bool setNumberOfRecHits(uint32_t detId, float mean, float rms, float emPtn);
00079   // TrackResidual
00080   bool setResidualX(uint32_t detId, float mean, float rms, float emPtn);
00081   bool setResidualY(uint32_t detId, float mean, float rms, float emPtn);  
00082   //
00083   bool setNumberOfNoisCells(uint32_t detId, float nNpixCells); // N=4,1..
00084   bool setNumberOfDeadCells(uint32_t detId, float nNpixCells); // N=4,1..
00085   bool setNumberOfPixelHitsInTrackFit(uint32_t detId, float nPixelHits); 
00086   // Track
00087   bool setFractionOfTracks(uint32_t detId, float mean, float rms); 
00088   bool setNumberOfOnTrackClusters(uint32_t detId, float nClusters); 
00089   bool setNumberOfOffTrackClusters(uint32_t detId, float nClusters); 
00090   bool setClusterChargeOnTrack(uint32_t detId, float mean, float rms); 
00091   bool setClusterChargeOffTrack(uint32_t detId, float mean, float rms);  
00092   bool setClusterSizeOnTrack(uint32_t detId, float mean, float rms); 
00093   bool setClusterSizeOffTrack(uint32_t detId, float mean, float rms);  
00094 
00095 private:
00096   std::pair<bool, std::vector<DetSummary>::iterator> initDet(const uint32_t detId); 
00097   std::pair<bool, std::vector<DetSummary>::iterator>  setDet(const uint32_t detId, 
00098                                                              const std::vector<float>& performanceValues); 
00099    bool setValue(uint32_t detId, int index, float performanceValue);
00100   float getValue(uint32_t detId, int index);
00101 
00102 private: 
00103   unsigned long long timeStamp_;  
00104   unsigned int runNumber_;
00105   unsigned int luminosityBlock_;
00106   unsigned int numberOfEvents_;
00107   
00108   std::vector<DetSummary> allDetSummaries_;
00109 };
00110 
00111 
00112 #endif