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
SPYHistograms::ErrorCounters::nHighPb
unsigned int nHighPb
Definition: SPYHistograms.h:26
SPYHistograms::ErrorCounters::nOOS
unsigned int nOOS
Definition: SPYHistograms.h:27
SPYHistograms::frameRange_
HistogramConfig frameRange_
Definition: SPYHistograms.h:131
SPYHistograms::lowPbDetailedMap_
std::map< unsigned int, MonitorElement * > lowPbDetailedMap_
Definition: SPYHistograms.h:159
SPYHistograms::nOtherPbsvsTime_
HistogramConfig nOtherPbsvsTime_
Definition: SPYHistograms.h:111
SPYHistograms::nHighRangevsTime_
HistogramConfig nHighRangevsTime_
Definition: SPYHistograms.h:105
SPYHistograms::Trends
Definition: SPYHistograms.h:15
SPYHistograms::nLowPbvsTime_
HistogramConfig nLowPbvsTime_
Definition: SPYHistograms.h:108
SPYHistograms::lowPbDetailed_
HistogramConfig lowPbDetailed_
Definition: SPYHistograms.h:142
SPYHistograms::Errors::hasAPVAddressError1
bool hasAPVAddressError1
Definition: SPYHistograms.h:50
SPYHistograms::nOutOfSync_
HistogramConfig nOutOfSync_
Definition: SPYHistograms.h:96
SPYHistograms::ErrorCounters::nOtherPbs
unsigned int nOtherPbs
Definition: SPYHistograms.h:30
SPYHistograms::frameMin_
HistogramConfig frameMin_
Definition: SPYHistograms.h:132
SPYHistograms::ErrorCounters::nMaxSat
unsigned int nMaxSat
Definition: SPYHistograms.h:24
SPYHistograms::maxSatDetailedMap_
std::map< unsigned int, MonitorElement * > maxSatDetailedMap_
Definition: SPYHistograms.h:158
SPYHistograms::ErrorCounters
Definition: SPYHistograms.h:19
SPYHistograms::ErrorCounters::nAPVError
unsigned int nAPVError
Definition: SPYHistograms.h:31
SPYHistograms::nOutOfSyncvsTime_
HistogramConfig nOutOfSyncvsTime_
Definition: SPYHistograms.h:110
SPYHistograms::positionOfFirstTrailerBitDetailed_
HistogramConfig positionOfFirstTrailerBitDetailed_
Definition: SPYHistograms.h:151
SPYHistograms::nNegativePedsvsTime_
HistogramConfig nNegativePedsvsTime_
Definition: SPYHistograms.h:114
DQMStore.h
SPYHistograms::ErrorCounters::nAPVAddressError
unsigned int nAPVAddressError
Definition: SPYHistograms.h:32
SPYHistograms::tkHistoMapPointer
TkHistoMap * tkHistoMapPointer(unsigned int aIndex=0) override
Definition: SPYHistograms.h:82
SPYHistograms::nOtherPbs_
HistogramConfig nOtherPbs_
Definition: SPYHistograms.h:97
SPYHistograms::meanDigitalLowvsTime_
HistogramConfig meanDigitalLowvsTime_
Definition: SPYHistograms.h:115
SPYHistograms::fillCountersHistograms
void fillCountersHistograms(const ErrorCounters &aCounter, const double aTime)
Definition: SPYHistograms.cc:86
SPYHistograms::Errors::hasAPVAddressError0
bool hasAPVAddressError0
Definition: SPYHistograms.h:49
SPYHistograms::highRange_
HistogramConfig highRange_
Definition: SPYHistograms.h:120
SiStripSpyUtilities.h
SPYHistograms::bookTopLevelHistograms
void bookTopLevelHistograms(DQMStore::IBooker &, const TkDetMap *)
Definition: SPYHistograms.cc:227
SPYHistograms::ErrorCounters::nLowRange
unsigned int nLowRange
Definition: SPYHistograms.h:21
SPYHistograms::highPbDetailedMap_
std::map< unsigned int, MonitorElement * > highPbDetailedMap_
Definition: SPYHistograms.h:160
SPYHistograms::outOfSyncDetailed_
HistogramConfig outOfSyncDetailed_
Definition: SPYHistograms.h:144
SPYHistograms::Errors::hasNoData
bool hasNoData
Definition: SPYHistograms.h:38
SPYHistograms::noDataDetailed_
HistogramConfig noDataDetailed_
Definition: SPYHistograms.h:137
SPYHistograms::Errors::hasNegPeds
bool hasNegPeds
Definition: SPYHistograms.h:51
SPYHistograms::minZeroDetailed_
HistogramConfig minZeroDetailed_
Definition: SPYHistograms.h:140
SPYHistograms::negativePedsDetailedMap_
std::map< unsigned int, MonitorElement * > negativePedsDetailedMap_
Definition: SPYHistograms.h:165
SPYHistograms::positionOfFirstHeaderBitDetailed_
HistogramConfig positionOfFirstHeaderBitDetailed_
Definition: SPYHistograms.h:150
SPYHistograms::frameMax_
HistogramConfig frameMax_
Definition: SPYHistograms.h:133
SPYHistograms::highPbDetailed_
HistogramConfig highPbDetailed_
Definition: SPYHistograms.h:143
SPYHistograms::maxSatDetailed_
HistogramConfig maxSatDetailed_
Definition: SPYHistograms.h:141
SPYHistograms::bookAllFEDHistograms
void bookAllFEDHistograms(DQMStore::IBooker &)
Definition: SPYHistograms.cc:680
SPYHistograms::apvErrorBitDetailedMap_
std::map< unsigned int, MonitorElement * > apvErrorBitDetailedMap_
Definition: SPYHistograms.h:163
TkDetMap
Definition: TkDetMap.h:175
SPYHistograms::outOfSyncDetailedMap_
std::map< unsigned int, MonitorElement * > outOfSyncDetailedMap_
Definition: SPYHistograms.h:161
SPYHistograms::outOfSync_
HistogramConfig outOfSync_
Definition: SPYHistograms.h:125
SPYHistograms::nMaxSatvsTime_
HistogramConfig nMaxSatvsTime_
Definition: SPYHistograms.h:107
SPYHistograms::SPYHistograms
SPYHistograms()
Definition: SPYHistograms.cc:13
SPYHistograms::otherPbs_
HistogramConfig otherPbs_
Definition: SPYHistograms.h:126
SPYHistograms::Errors::hasLowPb
bool hasLowPb
Definition: SPYHistograms.h:43
SPYHistograms::Errors::hasOOS
bool hasOOS
Definition: SPYHistograms.h:45
SPYHistograms::Errors::hasHighPb
bool hasHighPb
Definition: SPYHistograms.h:44
SPYHistograms::minZero_
HistogramConfig minZero_
Definition: SPYHistograms.h:121
SPYHistograms::Errors
Definition: SPYHistograms.h:37
SPYHistograms::ErrorCounters::nLowPb
unsigned int nLowPb
Definition: SPYHistograms.h:25
SPYHistograms::nHighRange_
HistogramConfig nHighRange_
Definition: SPYHistograms.h:91
SPYHistograms::lowRange_
HistogramConfig lowRange_
Definition: SPYHistograms.h:119
SPYHistograms::distanceHeaderTrailerDetailed_
HistogramConfig distanceHeaderTrailerDetailed_
Definition: SPYHistograms.h:152
SPYHistograms::Errors::hasMaxSat
bool hasMaxSat
Definition: SPYHistograms.h:42
SPYHistograms::Errors::hasErrorBit1
bool hasErrorBit1
Definition: SPYHistograms.h:48
SPYHistograms::fillDetailedHistograms
void fillDetailedHistograms(const Errors &aErr, const sistrip::SpyUtilities::Frame &aFrame, const unsigned int aFedId, const unsigned int aFedChannel)
Definition: SPYHistograms.cc:158
SPYHistograms::ErrorCounters::nMinZero
unsigned int nMinZero
Definition: SPYHistograms.h:23
SPYHistograms::nApvErrorBit_
HistogramConfig nApvErrorBit_
Definition: SPYHistograms.h:98
edm::ParameterSet
Definition: ParameterSet.h:47
SPYHistograms::baseline_
HistogramConfig baseline_
Definition: SPYHistograms.h:134
SPYHistograms::nLowRangevsTime_
HistogramConfig nLowRangevsTime_
Definition: SPYHistograms.h:104
SPYHistograms::lowRangeDetailedMap_
std::map< unsigned int, MonitorElement * > lowRangeDetailedMap_
Definition: SPYHistograms.h:155
SPYHistograms::noData_
HistogramConfig noData_
Definition: SPYHistograms.h:118
SPYHistograms::ErrorCounters::nNegPeds
unsigned int nNegPeds
Definition: SPYHistograms.h:33
SPYHistograms::ErrorCounters::nHighRange
unsigned int nHighRange
Definition: SPYHistograms.h:22
SPYHistograms::nLowPb_
HistogramConfig nLowPb_
Definition: SPYHistograms.h:94
SPYHistograms::Errors::hasHighRange
bool hasHighRange
Definition: SPYHistograms.h:40
SPYHistograms::ErrorCounters::nNoData
unsigned int nNoData
Definition: SPYHistograms.h:20
SPYHistograms::apvAddressErrorDetailed_
HistogramConfig apvAddressErrorDetailed_
Definition: SPYHistograms.h:147
l1tstage2_dqm_sourceclient-live_cfg.fedId
fedId
Definition: l1tstage2_dqm_sourceclient-live_cfg.py:88
SPYHistograms::apvAddressErrorDetailedMap_
std::map< unsigned int, MonitorElement * > apvAddressErrorDetailedMap_
Definition: SPYHistograms.h:164
SPYHistograms::Trends::meanDigitalLow
unsigned int meanDigitalLow
Definition: SPYHistograms.h:16
TkHistoMap
Definition: TkHistoMap.h:12
SPYHistograms::nApvAddressErrorvsTime_
HistogramConfig nApvAddressErrorvsTime_
Definition: SPYHistograms.h:113
SPYHistograms::Errors::hasLowRange
bool hasLowRange
Definition: SPYHistograms.h:39
SPYHistograms::positionOfFirstTrailerBitDetailedMap_
std::map< unsigned int, MonitorElement * > positionOfFirstTrailerBitDetailedMap_
Definition: SPYHistograms.h:168
SPYHistograms::tkHistoMapEnabled
bool tkHistoMapEnabled(unsigned int aIndex=0) override
Definition: SPYHistograms.h:80
SPYHistograms::histosBooked_
std::vector< bool > histosBooked_
Definition: SPYHistograms.h:171
SPYHistograms::nMinZerovsTime_
HistogramConfig nMinZerovsTime_
Definition: SPYHistograms.h:106
SPYHistograms::positionOfFirstHeaderBitDetailedMap_
std::map< unsigned int, MonitorElement * > positionOfFirstHeaderBitDetailedMap_
Definition: SPYHistograms.h:167
SPYHistograms::highPb_
HistogramConfig highPb_
Definition: SPYHistograms.h:124
SPYHistograms::lowPb_
HistogramConfig lowPb_
Definition: SPYHistograms.h:123
SPYHistograms::~SPYHistograms
~SPYHistograms() override
Definition: SPYHistograms.cc:15
SPYHistograms::apvAddressError_
HistogramConfig apvAddressError_
Definition: SPYHistograms.h:128
SPYHistograms::Errors::hasErrorBit0
bool hasErrorBit0
Definition: SPYHistograms.h:47
SPYHistograms::nHighPbvsTime_
HistogramConfig nHighPbvsTime_
Definition: SPYHistograms.h:109
SPYHistograms::nApvAddressError_
HistogramConfig nApvAddressError_
Definition: SPYHistograms.h:99
SPYHistograms::nMaxSat_
HistogramConfig nMaxSat_
Definition: SPYHistograms.h:93
SPYHistograms::nHighPb_
HistogramConfig nHighPb_
Definition: SPYHistograms.h:95
SPYHistograms::fillFEDHistograms
void fillFEDHistograms(const Errors &aErr, const unsigned int aFedId)
Definition: SPYHistograms.cc:114
SPYHistograms::minZeroDetailedMap_
std::map< unsigned int, MonitorElement * > minZeroDetailedMap_
Definition: SPYHistograms.h:157
SPYHistograms::nMinZero_
HistogramConfig nMinZero_
Definition: SPYHistograms.h:92
SPYHistograms::highRangeDetailed_
HistogramConfig highRangeDetailed_
Definition: SPYHistograms.h:139
dqm::implementation::IBooker
Definition: DQMStore.h:43
SPYHistograms::highRangeDetailedMap_
std::map< unsigned int, MonitorElement * > highRangeDetailedMap_
Definition: SPYHistograms.h:156
SPYHistograms::bookFEDHistograms
void bookFEDHistograms(DQMStore::IBooker &, const unsigned int fedId, const Errors &aErr, bool doAll=false)
Definition: SPYHistograms.cc:503
SPYHistograms::fillGainHistograms
void fillGainHistograms(const Trends &aTrendElement, const double aTime)
Definition: SPYHistograms.cc:82
SPYHistograms::lowRangeDetailed_
HistogramConfig lowRangeDetailed_
Definition: SPYHistograms.h:138
SPYHistograms::initialise
void initialise(const edm::ParameterSet &iConfig, std::ostringstream *pDebugStream) override
Definition: SPYHistograms.cc:17
SPYHistograms::nNegativePeds_
HistogramConfig nNegativePeds_
Definition: SPYHistograms.h:100
sistrip::SpyUtilities::Frame
Definition: SiStripSpyUtilities.h:20
SPYHistograms::otherPbsDetailed_
HistogramConfig otherPbsDetailed_
Definition: SPYHistograms.h:145
ParameterSet.h
SPYHistograms::apvErrorBitDetailed_
HistogramConfig apvErrorBitDetailed_
Definition: SPYHistograms.h:146
SPYHistograms::otherPbsDetailedMap_
std::map< unsigned int, MonitorElement * > otherPbsDetailedMap_
Definition: SPYHistograms.h:162
SPYHistograms
Definition: SPYHistograms.h:13
SPYHistograms::negativePeds_
HistogramConfig negativePeds_
Definition: SPYHistograms.h:129
SPYHistograms::maxSat_
HistogramConfig maxSat_
Definition: SPYHistograms.h:122
SPYHistograms::nNoDatavsTime_
HistogramConfig nNoDatavsTime_
Definition: SPYHistograms.h:103
SPYHistograms::Errors::hasMinZero
bool hasMinZero
Definition: SPYHistograms.h:41
SPYHistograms::negativePedsDetailed_
HistogramConfig negativePedsDetailed_
Definition: SPYHistograms.h:148
SPYHistograms::nNoData_
HistogramConfig nNoData_
Definition: SPYHistograms.h:82
SPYHistograms::nApvErrorBitvsTime_
HistogramConfig nApvErrorBitvsTime_
Definition: SPYHistograms.h:112
SPYHistograms::Errors::hasOtherPbs
bool hasOtherPbs
Definition: SPYHistograms.h:46
SPYHistograms::distanceHeaderTrailerDetailedMap_
std::map< unsigned int, MonitorElement * > distanceHeaderTrailerDetailedMap_
Definition: SPYHistograms.h:169
SPYHistograms::apvErrorBit_
HistogramConfig apvErrorBit_
Definition: SPYHistograms.h:127
SPYHistograms::nLowRange_
HistogramConfig nLowRange_
Definition: SPYHistograms.h:90
SPYHistograms::noDataDetailedMap_
std::map< unsigned int, MonitorElement * > noDataDetailedMap_
Definition: SPYHistograms.h:154