CMS 3D CMS Logo

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