CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
SiPixelPerformanceSummary.h
Go to the documentation of this file.
1 #ifndef SiPixelPerformanceSummary_h
2 #define SiPixelPerformanceSummary_h
3 
4 
6 
7 #include<vector>
8 #include<map>
9 #include<iostream>
10 #include<boost/cstdint.hpp>
11 
12 
13 #define kDetSummarySize 60 // float numbers kept in DetSummary.performanceValues
14 #define kDefaultValue -99.9
15 
16 
18 public:
19  struct DetSummary {
20  uint32_t detId_;
21  std::vector<float> performanceValues_;
22 
24 };
25 
26  class StrictWeakOrdering { // sort detSummaries by detId
27  public:
28  bool operator() (const DetSummary& detSumm, const uint32_t& otherDetId) const {
29  return (detSumm.detId_ < otherDetId);
30  };
31  };
32 
33  class MatchDetSummaryDetId : public std::unary_function<DetSummary, bool> {
34  public:
35  MatchDetSummaryDetId(const uint32_t& detId) : detId_(detId) {}
36  bool operator() (const DetSummary& detSumm) const { return (detSumm.detId_==detId_); }
37  private:
38  uint32_t detId_;
39  };
40 
41 public:
45 
46  void clear();
47 
48  unsigned int size() { return allDetSummaries_.size(); }
49 
50  void setTimeStamp(unsigned long long timeStamp) { timeStamp_ = timeStamp; }
51  unsigned long long getTimeStamp() const { return timeStamp_; }
52 
53  void setRunNumber(unsigned int runNumber) { runNumber_ = runNumber; }
54  unsigned int getRunNumber() const { return runNumber_; }
55 
56  void setNumberOfEvents(unsigned int numberOfEvents) { numberOfEvents_ = numberOfEvents; }
57  unsigned int getNumberOfEvents() const { return numberOfEvents_; }
58 
59  void setLuminosityBlock(unsigned int lumBlock) { luminosityBlock_ = lumBlock; }
60  unsigned int getLuminosityBlock() const { return luminosityBlock_; };
61 
62  void print() const;
63  void print(const uint32_t detId) const;
64  void printAll() const;
65 
66  std::vector<uint32_t> getAllDetIds() const;
67  std::vector<DetSummary> getAllDetSummaries() const { return allDetSummaries_; }
68  std::vector<float> getDetSummary(uint32_t detId) const;
69 
70  // RawData
71  bool setRawDataErrorType(uint32_t detId, int bin, float nErrors);
72  // Digi
73  bool setNumberOfDigis(uint32_t detId, float mean, float rms, float emPtn);
74  bool setADC(uint32_t detId, float mean, float rms, float emPtn);
75  // Cluster
76  bool setNumberOfClusters(uint32_t detId, float mean, float rms, float emPtn);
77  bool setClusterCharge(uint32_t detId, float mean, float rms, float emPtn);
78  bool setClusterSize(uint32_t detId, float mean, float rms, float emPtn);
79  bool setClusterSizeX(uint32_t detId, float mean, float rms, float emPtn);
80  bool setClusterSizeY(uint32_t detId, float mean, float rms, float emPtn);
81  // RecHit
82  bool setNumberOfRecHits(uint32_t detId, float mean, float rms, float emPtn);
83  // TrackResidual
84  bool setResidualX(uint32_t detId, float mean, float rms, float emPtn);
85  bool setResidualY(uint32_t detId, float mean, float rms, float emPtn);
86  //
87  bool setNumberOfNoisCells(uint32_t detId, float nNpixCells); // N=4,1..
88  bool setNumberOfDeadCells(uint32_t detId, float nNpixCells); // N=4,1..
89  bool setNumberOfPixelHitsInTrackFit(uint32_t detId, float nPixelHits);
90  // Track
91  bool setFractionOfTracks(uint32_t detId, float mean, float rms);
92  bool setNumberOfOnTrackClusters(uint32_t detId, float nClusters);
93  bool setNumberOfOffTrackClusters(uint32_t detId, float nClusters);
94  bool setClusterChargeOnTrack(uint32_t detId, float mean, float rms);
95  bool setClusterChargeOffTrack(uint32_t detId, float mean, float rms);
96  bool setClusterSizeOnTrack(uint32_t detId, float mean, float rms);
97  bool setClusterSizeOffTrack(uint32_t detId, float mean, float rms);
98 
99 private:
100  std::pair<bool, std::vector<DetSummary>::iterator> initDet(const uint32_t detId);
101  std::pair<bool, std::vector<DetSummary>::iterator> setDet(const uint32_t detId,
102  const std::vector<float>& performanceValues);
103  bool setValue(uint32_t detId, int index, float performanceValue);
104  float getValue(uint32_t detId, int index);
105 
106 private:
107  unsigned long long timeStamp_;
108  unsigned int runNumber_;
109  unsigned int luminosityBlock_;
110  unsigned int numberOfEvents_;
111 
112  std::vector<DetSummary> allDetSummaries_;
113 
115 };
116 
117 
118 #endif
bool setRawDataErrorType(uint32_t detId, int bin, float nErrors)
bool setValue(uint32_t detId, int index, float performanceValue)
std::vector< float > getDetSummary(uint32_t detId) const
std::vector< DetSummary > getAllDetSummaries() const
void setTimeStamp(unsigned long long timeStamp)
std::pair< bool, std::vector< DetSummary >::iterator > setDet(const uint32_t detId, const std::vector< float > &performanceValues)
bool setADC(uint32_t detId, float mean, float rms, float emPtn)
unsigned int getRunNumber() const
std::pair< bool, std::vector< DetSummary >::iterator > initDet(const uint32_t detId)
bool setNumberOfOnTrackClusters(uint32_t detId, float nClusters)
bool setClusterSizeY(uint32_t detId, float mean, float rms, float emPtn)
std::vector< DetSummary > allDetSummaries_
bool setNumberOfDigis(uint32_t detId, float mean, float rms, float emPtn)
float getValue(uint32_t detId, int index)
bool setNumberOfDeadCells(uint32_t detId, float nNpixCells)
bool setResidualY(uint32_t detId, float mean, float rms, float emPtn)
bool setClusterSize(uint32_t detId, float mean, float rms, float emPtn)
bool setNumberOfOffTrackClusters(uint32_t detId, float nClusters)
bool setResidualX(uint32_t detId, float mean, float rms, float emPtn)
bool setClusterSizeX(uint32_t detId, float mean, float rms, float emPtn)
bool operator()(const DetSummary &detSumm, const uint32_t &otherDetId) const
void setRunNumber(unsigned int runNumber)
bool setNumberOfRecHits(uint32_t detId, float mean, float rms, float emPtn)
bool setClusterCharge(uint32_t detId, float mean, float rms, float emPtn)
bool setClusterSizeOffTrack(uint32_t detId, float mean, float rms)
bool setClusterChargeOffTrack(uint32_t detId, float mean, float rms)
std::vector< uint32_t > getAllDetIds() const
bool setNumberOfPixelHitsInTrackFit(uint32_t detId, float nPixelHits)
bool setNumberOfNoisCells(uint32_t detId, float nNpixCells)
unsigned int getNumberOfEvents() const
bool setClusterChargeOnTrack(uint32_t detId, float mean, float rms)
void setLuminosityBlock(unsigned int lumBlock)
unsigned int getLuminosityBlock() const
void setNumberOfEvents(unsigned int numberOfEvents)
bool setClusterSizeOnTrack(uint32_t detId, float mean, float rms)
bool operator()(const DetSummary &detSumm) const
bool setNumberOfClusters(uint32_t detId, float mean, float rms, float emPtn)
bool setFractionOfTracks(uint32_t detId, float mean, float rms)
unsigned long long getTimeStamp() const