CMS 3D CMS Logo

SPYHistograms.h
Go to the documentation of this file.
1 #ifndef DQM_SiStripMonitorHardware_SPYHistograms_HH
2 #define DQM_SiStripMonitorHardware_SPYHistograms_HH
3 
4 #include <sstream>
5 
7 
9 
11 #include "DQM/SiStripMonitorHardware/interface/HistogramBase.hh"
12 
13 class SPYHistograms : public HistogramBase {
14 public:
15  struct Trends {
16  unsigned int meanDigitalLow; // digitalLow averaged over all channels
17  };
18 
19  struct ErrorCounters {
20  unsigned int nNoData; //max=min=0
21  unsigned int nLowRange; // max-min < min value to tune
22  unsigned int nHighRange; // max-min > max value to tune
23  unsigned int nMinZero; // min = 0
24  unsigned int nMaxSat; //max = 1023
25  unsigned int nLowPb; //min < min value to tune but > 0
26  unsigned int nHighPb; //max > max value to tune but < 1023
27  unsigned int nOOS; //header+trailer found with right distance between them but not in expected position
28  // or header found above 16 (no trailer found)
29  // or 2*2-high separated by 70 samples found (last in right position...)
30  unsigned int nOtherPbs;
31  unsigned int nAPVError; //number of APVs with error bit 0
32  unsigned int nAPVAddressError; //number of APV pairs with different APV addresses
33  unsigned int nNegPeds; //ped subtr value = 0
34  };
35 
36  //helper structs to fill histograms
37  struct Errors {
38  bool hasNoData;
41  bool hasMinZero;
42  bool hasMaxSat;
43  bool hasLowPb;
44  bool hasHighPb;
45  bool hasOOS;
51  bool hasNegPeds;
52  };
53 
54  SPYHistograms();
55 
56  ~SPYHistograms() override;
57 
58  //initialise histograms
59  void initialise(const edm::ParameterSet& iConfig, std::ostringstream* pDebugStream) override;
60 
61  //book the top level histograms
63 
64  //book individual FED histograms or book all FED level histograms at once
65  void bookFEDHistograms(DQMStore::IBooker&, const unsigned int fedId, const Errors& aErr, bool doAll = false);
66 
68 
69  void fillCountersHistograms(const ErrorCounters& aCounter, const double aTime);
70 
71  void fillGainHistograms(const Trends& aTrendElement, const double aTime);
72 
73  void fillFEDHistograms(const Errors& aErr, const unsigned int aFedId);
74 
75  void fillDetailedHistograms(const Errors& aErr,
76  const sistrip::SpyUtilities::Frame& aFrame,
77  const unsigned int aFedId,
78  const unsigned int aFedChannel);
79 
80  bool tkHistoMapEnabled(unsigned int aIndex = 0) override { return false; };
81 
82  TkHistoMap* tkHistoMapPointer(unsigned int aIndex = 0) override { return nullptr; };
83 
84 protected:
85 private:
86  //histos
87 
88  //counting histograms (histogram of number of problems per event)
89  HistogramConfig nNoData_;
90  HistogramConfig nLowRange_;
91  HistogramConfig nHighRange_;
92  HistogramConfig nMinZero_;
93  HistogramConfig nMaxSat_;
94  HistogramConfig nLowPb_;
95  HistogramConfig nHighPb_;
96  HistogramConfig nOutOfSync_;
97  HistogramConfig nOtherPbs_;
98  HistogramConfig nApvErrorBit_;
99  HistogramConfig nApvAddressError_;
100  HistogramConfig nNegativePeds_;
101 
102  //vsTime
103  HistogramConfig nNoDatavsTime_;
104  HistogramConfig nLowRangevsTime_;
105  HistogramConfig nHighRangevsTime_;
106  HistogramConfig nMinZerovsTime_;
107  HistogramConfig nMaxSatvsTime_;
108  HistogramConfig nLowPbvsTime_;
109  HistogramConfig nHighPbvsTime_;
110  HistogramConfig nOutOfSyncvsTime_;
111  HistogramConfig nOtherPbsvsTime_;
112  HistogramConfig nApvErrorBitvsTime_;
113  HistogramConfig nApvAddressErrorvsTime_;
114  HistogramConfig nNegativePedsvsTime_;
115  HistogramConfig meanDigitalLowvsTime_;
116 
117  //top level histograms
118  HistogramConfig noData_;
119  HistogramConfig lowRange_;
120  HistogramConfig highRange_;
121  HistogramConfig minZero_;
122  HistogramConfig maxSat_;
123  HistogramConfig lowPb_;
124  HistogramConfig highPb_;
125  HistogramConfig outOfSync_;
126  HistogramConfig otherPbs_;
127  HistogramConfig apvErrorBit_;
128  HistogramConfig apvAddressError_;
129  HistogramConfig negativePeds_;
130 
131  HistogramConfig frameRange_;
132  HistogramConfig frameMin_;
133  HistogramConfig frameMax_;
134  HistogramConfig baseline_;
135 
136  //FED level histograms
137  HistogramConfig noDataDetailed_;
138  HistogramConfig lowRangeDetailed_;
139  HistogramConfig highRangeDetailed_;
140  HistogramConfig minZeroDetailed_;
141  HistogramConfig maxSatDetailed_;
142  HistogramConfig lowPbDetailed_;
143  HistogramConfig highPbDetailed_;
144  HistogramConfig outOfSyncDetailed_;
145  HistogramConfig otherPbsDetailed_;
146  HistogramConfig apvErrorBitDetailed_;
147  HistogramConfig apvAddressErrorDetailed_;
148  HistogramConfig negativePedsDetailed_;
149 
153 
154  std::map<unsigned int, MonitorElement*> noDataDetailedMap_;
155  std::map<unsigned int, MonitorElement*> lowRangeDetailedMap_;
156  std::map<unsigned int, MonitorElement*> highRangeDetailedMap_;
157  std::map<unsigned int, MonitorElement*> minZeroDetailedMap_;
158  std::map<unsigned int, MonitorElement*> maxSatDetailedMap_;
159  std::map<unsigned int, MonitorElement*> lowPbDetailedMap_;
160  std::map<unsigned int, MonitorElement*> highPbDetailedMap_;
161  std::map<unsigned int, MonitorElement*> outOfSyncDetailedMap_;
162  std::map<unsigned int, MonitorElement*> otherPbsDetailedMap_;
163  std::map<unsigned int, MonitorElement*> apvErrorBitDetailedMap_;
164  std::map<unsigned int, MonitorElement*> apvAddressErrorDetailedMap_;
165  std::map<unsigned int, MonitorElement*> negativePedsDetailedMap_;
166 
167  std::map<unsigned int, MonitorElement*> positionOfFirstHeaderBitDetailedMap_;
168  std::map<unsigned int, MonitorElement*> positionOfFirstTrailerBitDetailedMap_;
169  std::map<unsigned int, MonitorElement*> distanceHeaderTrailerDetailedMap_;
170 
171  std::vector<bool> histosBooked_;
172 
173 }; //class
174 
175 #endif //DQM_SiStripMonitorHardware_SPYHistograms_HH
std::map< unsigned int, MonitorElement * > maxSatDetailedMap_
HistogramConfig nApvAddressErrorvsTime_
HistogramConfig frameMin_
HistogramConfig negativePedsDetailed_
HistogramConfig apvAddressError_
HistogramConfig nNegativePedsvsTime_
unsigned int meanDigitalLow
Definition: SPYHistograms.h:16
std::map< unsigned int, MonitorElement * > lowPbDetailedMap_
HistogramConfig nHighRangevsTime_
void initialise(const edm::ParameterSet &iConfig, std::ostringstream *pDebugStream) override
HistogramConfig lowPbDetailed_
HistogramConfig highRange_
std::map< unsigned int, MonitorElement * > highPbDetailedMap_
HistogramConfig negativePeds_
HistogramConfig maxSat_
void bookTopLevelHistograms(DQMStore::IBooker &, const TkDetMap *)
std::map< unsigned int, MonitorElement * > negativePedsDetailedMap_
HistogramConfig minZeroDetailed_
HistogramConfig frameMax_
HistogramConfig nOutOfSyncvsTime_
HistogramConfig maxSatDetailed_
HistogramConfig positionOfFirstTrailerBitDetailed_
void bookAllFEDHistograms(DQMStore::IBooker &)
HistogramConfig noData_
HistogramConfig highPbDetailed_
TkHistoMap * tkHistoMapPointer(unsigned int aIndex=0) override
Definition: SPYHistograms.h:82
HistogramConfig nOtherPbs_
Definition: SPYHistograms.h:97
void fillCountersHistograms(const ErrorCounters &aCounter, const double aTime)
HistogramConfig outOfSyncDetailed_
HistogramConfig noDataDetailed_
std::map< unsigned int, MonitorElement * > positionOfFirstTrailerBitDetailedMap_
bool tkHistoMapEnabled(unsigned int aIndex=0) override
Definition: SPYHistograms.h:80
HistogramConfig positionOfFirstHeaderBitDetailed_
HistogramConfig baseline_
std::map< unsigned int, MonitorElement * > lowRangeDetailedMap_
HistogramConfig lowPb_
HistogramConfig nApvAddressError_
Definition: SPYHistograms.h:99
HistogramConfig meanDigitalLowvsTime_
std::map< unsigned int, MonitorElement * > outOfSyncDetailedMap_
std::map< unsigned int, MonitorElement * > highRangeDetailedMap_
void bookFEDHistograms(DQMStore::IBooker &, const unsigned int fedId, const Errors &aErr, bool doAll=false)
HistogramConfig otherPbs_
HistogramConfig outOfSync_
HistogramConfig lowRangeDetailed_
HistogramConfig nHighRange_
Definition: SPYHistograms.h:91
HistogramConfig lowRange_
HistogramConfig distanceHeaderTrailerDetailed_
HistogramConfig nNoDatavsTime_
std::map< unsigned int, MonitorElement * > positionOfFirstHeaderBitDetailedMap_
HistogramConfig highPb_
std::map< unsigned int, MonitorElement * > distanceHeaderTrailerDetailedMap_
~SPYHistograms() override
HistogramConfig nHighPbvsTime_
HistogramConfig nLowPb_
Definition: SPYHistograms.h:94
std::map< unsigned int, MonitorElement * > noDataDetailedMap_
void fillFEDHistograms(const Errors &aErr, const unsigned int aFedId)
HistogramConfig nMaxSat_
Definition: SPYHistograms.h:93
std::map< unsigned int, MonitorElement * > apvErrorBitDetailedMap_
HistogramConfig highRangeDetailed_
HistogramConfig frameRange_
HistogramConfig nOtherPbsvsTime_
void fillGainHistograms(const Trends &aTrendElement, const double aTime)
HistogramConfig nMaxSatvsTime_
std::map< unsigned int, MonitorElement * > apvAddressErrorDetailedMap_
HistogramConfig apvAddressErrorDetailed_
HistogramConfig minZero_
HistogramConfig otherPbsDetailed_
HistogramConfig apvErrorBitDetailed_
HistogramConfig nNegativePeds_
void fillDetailedHistograms(const Errors &aErr, const sistrip::SpyUtilities::Frame &aFrame, const unsigned int aFedId, const unsigned int aFedChannel)
HistogramConfig nApvErrorBit_
Definition: SPYHistograms.h:98
std::map< unsigned int, MonitorElement * > otherPbsDetailedMap_
HistogramConfig nNoData_
Definition: SPYHistograms.h:82
HistogramConfig nApvErrorBitvsTime_
HistogramConfig nLowRangevsTime_
HistogramConfig nLowRange_
Definition: SPYHistograms.h:90
std::vector< bool > histosBooked_
HistogramConfig nMinZerovsTime_
HistogramConfig apvErrorBit_
HistogramConfig nHighPb_
Definition: SPYHistograms.h:95
std::map< unsigned int, MonitorElement * > minZeroDetailedMap_
HistogramConfig nMinZero_
Definition: SPYHistograms.h:92
HistogramConfig nLowPbvsTime_
HistogramConfig nOutOfSync_
Definition: SPYHistograms.h:96