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