CMS 3D CMS Logo

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 public:
37 
38  void clear();
39 
40  unsigned int size() { return allDetSummaries_.size(); }
41 
42  void setTimeStamp(unsigned long long timeStamp) { timeStamp_ = timeStamp; }
43  unsigned long long getTimeStamp() const { return timeStamp_; }
44 
45  void setRunNumber(unsigned int runNumber) { runNumber_ = runNumber; }
46  unsigned int getRunNumber() const { return runNumber_; }
47 
48  void setNumberOfEvents(unsigned int numberOfEvents) { numberOfEvents_ = numberOfEvents; }
49  unsigned int getNumberOfEvents() const { return numberOfEvents_; }
50 
51  void setLuminosityBlock(unsigned int lumBlock) { luminosityBlock_ = lumBlock; }
52  unsigned int getLuminosityBlock() const { return luminosityBlock_; };
53 
54  void print() const;
55  void print(const uint32_t detId) const;
56  void printAll() const;
57 
58  std::vector<uint32_t> getAllDetIds() const;
59  std::vector<DetSummary> getAllDetSummaries() const { return allDetSummaries_; }
60  std::vector<float> getDetSummary(uint32_t detId) const;
61 
62  // RawData
63  bool setRawDataErrorType(uint32_t detId, int bin, float nErrors);
64  // Digi
65  bool setNumberOfDigis(uint32_t detId, float mean, float rms, float emPtn);
66  bool setADC(uint32_t detId, float mean, float rms, float emPtn);
67  // Cluster
68  bool setNumberOfClusters(uint32_t detId, float mean, float rms, float emPtn);
69  bool setClusterCharge(uint32_t detId, float mean, float rms, float emPtn);
70  bool setClusterSize(uint32_t detId, float mean, float rms, float emPtn);
71  bool setClusterSizeX(uint32_t detId, float mean, float rms, float emPtn);
72  bool setClusterSizeY(uint32_t detId, float mean, float rms, float emPtn);
73  // RecHit
74  bool setNumberOfRecHits(uint32_t detId, float mean, float rms, float emPtn);
75  // TrackResidual
76  bool setResidualX(uint32_t detId, float mean, float rms, float emPtn);
77  bool setResidualY(uint32_t detId, float mean, float rms, float emPtn);
78  //
79  bool setNumberOfNoisCells(uint32_t detId, float nNpixCells); // N=4,1..
80  bool setNumberOfDeadCells(uint32_t detId, float nNpixCells); // N=4,1..
81  bool setNumberOfPixelHitsInTrackFit(uint32_t detId, float nPixelHits);
82  // Track
83  bool setFractionOfTracks(uint32_t detId, float mean, float rms);
84  bool setNumberOfOnTrackClusters(uint32_t detId, float nClusters);
85  bool setNumberOfOffTrackClusters(uint32_t detId, float nClusters);
86  bool setClusterChargeOnTrack(uint32_t detId, float mean, float rms);
87  bool setClusterChargeOffTrack(uint32_t detId, float mean, float rms);
88  bool setClusterSizeOnTrack(uint32_t detId, float mean, float rms);
89  bool setClusterSizeOffTrack(uint32_t detId, float mean, float rms);
90 
91 private:
92  std::pair<bool, std::vector<DetSummary>::iterator> initDet(const uint32_t detId);
93  std::pair<bool, std::vector<DetSummary>::iterator> setDet(const uint32_t detId,
94  const std::vector<float>& performanceValues);
95  bool setValue(uint32_t detId, int index, float performanceValue);
96  float getValue(uint32_t detId, int index);
97 
98 private:
99  unsigned long long timeStamp_;
100  unsigned int runNumber_;
101  unsigned int luminosityBlock_;
102  unsigned int numberOfEvents_;
103 
104  std::vector<DetSummary> allDetSummaries_;
105 
107 };
108 
109 
110 #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)
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)
bin
set the eta bin as selection string.
bool setClusterSizeOffTrack(uint32_t detId, float mean, float rms)
bool setClusterChargeOffTrack(uint32_t detId, float mean, float rms)
std::vector< uint32_t > getAllDetIds() const
#define COND_SERIALIZABLE
Definition: Serializable.h:38
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 setNumberOfClusters(uint32_t detId, float mean, float rms, float emPtn)
bool setFractionOfTracks(uint32_t detId, float mean, float rms)
unsigned long long getTimeStamp() const