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