CMS 3D CMS Logo

DTDataIntegrityTask.cc
Go to the documentation of this file.
1 /*
2  * \file DTDataIntegrityTask.cc
3  *
4  * \author M. Zanetti (INFN Padova), S. Bolognesi (INFN Torino), G. Cerminara (INFN Torino)
5  *
6  */
7 
20 
21 #include <cmath>
22 #include <fstream>
23 #include <map>
24 #include <string>
25 #include <vector>
26 
27 using namespace std;
28 using namespace edm;
29 
31  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask") << "[DTDataIntegrityTask]: Constructor" << endl;
32 
33  checkUros = ps.getUntrackedParameter<bool>("checkUros", true);
34 
35  if (checkUros) {
36  fedToken = consumes<DTuROSFEDDataCollection>(ps.getParameter<InputTag>("dtFEDlabel"));
39  } else {
40  dduToken = consumes<DTDDUCollection>(ps.getParameter<InputTag>("dtDDULabel"));
41  ros25Token = consumes<DTROS25Collection>(ps.getParameter<InputTag>("dtROS25Label"));
44  }
45 
46  neventsFED = 0;
47  neventsuROS = 0;
48 
49  // If you want info VS time histos
50  // doTimeHisto = ps.getUntrackedParameter<bool>("doTimeHisto", false);
51  // Plot quantities about SC
52  getSCInfo = ps.getUntrackedParameter<bool>("getSCInfo", false);
53 
54  fedIntegrityFolder = ps.getUntrackedParameter<string>("fedIntegrityFolder", "DT/FEDIntegrity");
55 
56  string processingMode = ps.getUntrackedParameter<string>("processingMode", "Online");
57 
58  // processing mode flag to select plots to be produced and basedirs CB vedi se farlo meglio...
59  if (processingMode == "Online") {
60  mode = 0;
61  } else if (processingMode == "SM") {
62  mode = 1;
63  } else if (processingMode == "Offline") {
64  mode = 2;
65  } else if (processingMode == "HLT") {
66  mode = 3;
67  } else {
68  throw cms::Exception("MissingParameter") << "[DTDataIntegrityTask]: processingMode :" << processingMode
69  << " invalid! Must be Online, SM, Offline or HLT !" << endl;
70  }
71 }
72 
74  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
75  << "[DTDataIntegrityTask]: Destructor. Analyzed " << neventsFED << " events" << endl;
76  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
77  << "[DTDataIntegrityTask]: postEndJob called!" << endl;
78 }
79 
80 /*
81  Folder Structure (ROS Legacy):
82  - One folder for each DDU, named FEDn
83  - Inside each DDU folder the DDU histos and the ROSn folder
84  - Inside each ROS folder the ROS histos and the ROBn folder
85  - Inside each ROB folder one occupancy plot and the TimeBoxes
86  with the chosen granularity (simply change the histo name)
87 
88  uROS (starting 2018):
89  - 3 uROS Summary plots: Wheel-1/-2 (FED1369), Wheel0 (FED1370), Wheel+1/+2 (FED1371)
90  - One folder for each FED
91  - Inside each FED folder the uROSStatus histos, FED histos
92  - One folder for each wheel and the corresponding ROSn folders
93  - Inside each ROS folder the TDC and ROS errors histos, 24 Links/plot
94 */
95 
97  edm::Run const& iRun,
98  edm::EventSetup const& iSetup) {
99  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask") << "[DTDataIntegrityTask]: postBeginJob" << endl;
100 
101  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
102  << "[DTDataIntegrityTask] Get DQMStore service" << endl;
103 
104  // Loop over the DT FEDs
105 
106  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
107  << " FEDS: " << FEDIDmin << " to " << FEDIDmax << " in the RO" << endl;
108 
109  // book FED integrity histos
110  bookHistos(ibooker, FEDIDmin, FEDIDmax);
111 
112  if (checkUros) { //uROS starting on 2018
113  // static booking of the histograms
114 
115  if (mode == 0 || mode == 2) {
116  for (int fed = FEDIDmin; fed <= FEDIDmax; ++fed) { // loop over the FEDs in the readout
117 
118  bookHistos(ibooker, string("FED"), fed);
119 
120  bookHistos(ibooker, string("CRATE"), fed);
121 
122  for (int uRos = 1; uRos <= NuROS; ++uRos) { // loop over all ROS
123  bookHistosuROS(ibooker, fed, uRos);
124  }
125  }
126 
127  for (int wheel = -2; wheel < 3; ++wheel) {
128  for (int ros = 1; ros <= NuROS; ++ros) { // loop over all ROS
129  bookHistosROS(ibooker, wheel, ros);
130  }
131  }
132 
133  } //Not in HLT or SM mode
134  } //uROS
135 
136  else { //Legacy ROS
137 
138  if (mode == 0 || mode == 2) {
139  // static booking of the histograms
140 
141  for (int fed = FEDIDmin; fed <= FEDIDmax; ++fed) { // loop over the FEDs in the readout
142  DTROChainCoding code;
143  code.setDDU(fed);
144  bookHistos(ibooker, string("ROS_S"), code);
145 
146  bookHistos(ibooker, string("DDU"), code);
147 
148  for (int ros = 1; ros <= NuROS; ++ros) { // loop over all ROS
149  code.setROS(ros);
150  bookHistosROS25(ibooker, code);
151  }
152  }
153  } //Not in HLT or SM mode
154  } //Legacy ROS
155 }
156 
157 void DTDataIntegrityTask::bookHistos(DQMStore::IBooker& ibooker, const int fedMin, const int fedMax) {
158  ibooker.setCurrentFolder("DT/EventInfo/Counters");
159  nEventMonitor = ibooker.bookFloat("nProcessedEventsDataIntegrity");
160 
161  // Standard FED integrity histos
162  ibooker.setCurrentFolder(topFolder(true));
163 
164  int nFED = (fedMax - fedMin) + 1;
165 
166  hFEDEntry = ibooker.book1D("FEDEntries", "# entries per DT FED", nFED, fedMin, fedMax + 1);
167 
168  if (checkUros) {
169  if (mode == 3 || mode == 1) {
170  //Booked for completion in general CMS FED test. Not filled
171  hFEDFatal = ibooker.book1D("FEDFatal", "# fatal errors DT FED", nFED, fedMin, fedMax + 1); //No available in uROS
172  hFEDNonFatal =
173  ibooker.book1D("FEDNonFatal", "# NON fatal errors DT FED", nFED, fedMin, fedMax + 1); //No available in uROS
174  return; //Avoid duplication of Info in FEDIntegrity_EvF
175  }
176 
177  string histoType = "ROSSummary";
178  for (int wheel = -2; wheel < 3; ++wheel) {
179  string wheel_s = to_string(wheel);
180  string histoName = "ROSSummary_W" + wheel_s;
181  string fed_s = to_string(FEDIDmin + 1); //3 FEDs from 2018 onwards
182  if (wheel < 0)
183  fed_s = to_string(FEDIDmin);
184  else if (wheel > 0)
185  fed_s = to_string(FEDIDmax);
186  string histoTitle = "Summary Wheel" + wheel_s + " (FED " + fed_s + ")";
187 
188  ((summaryHistos[histoType])[wheel]) = ibooker.book2D(histoName, histoTitle, 11, 0, 11, 12, 1, 13);
189  MonitorElement* histo = ((summaryHistos[histoType])[wheel]);
190  histo->setBinLabel(1, "Error 1", 1);
191  histo->setBinLabel(2, "Error 2", 1);
192  histo->setBinLabel(3, "Error 3", 1);
193  histo->setBinLabel(4, "Error 4", 1);
194  histo->setBinLabel(5, "Not OKflag", 1);
195  // TDC error bins
196  histo->setBinLabel(6, "TDC Fatal", 1);
197  histo->setBinLabel(7, "TDC RO FIFO ov.", 1);
198  histo->setBinLabel(8, "TDC L1 buf. ov.", 1);
199  histo->setBinLabel(9, "TDC L1A FIFO ov.", 1);
200  histo->setBinLabel(10, "TDC hit err.", 1);
201  histo->setBinLabel(11, "TDC hit rej.", 1);
202 
203  histo->setBinLabel(1, "ROS1", 2);
204  histo->setBinLabel(2, "ROS2", 2);
205  histo->setBinLabel(3, "ROS3", 2);
206  histo->setBinLabel(4, "ROS4", 2);
207  histo->setBinLabel(5, "ROS5", 2);
208  histo->setBinLabel(6, "ROS6", 2);
209  histo->setBinLabel(7, "ROS7", 2);
210  histo->setBinLabel(8, "ROS8", 2);
211  histo->setBinLabel(9, "ROS9", 2);
212  histo->setBinLabel(10, "ROS10", 2);
213  histo->setBinLabel(11, "ROS11", 2);
214  histo->setBinLabel(12, "ROS12", 2);
215  }
216  }
217 
218  else { //if(!checkUros){
219  hFEDFatal = ibooker.book1D("FEDFatal", "# fatal errors DT FED", nFED, fedMin, fedMax + 1);
220  hFEDNonFatal = ibooker.book1D("FEDNonFatal", "# NON fatal errors DT FED", nFED, fedMin, fedMax + 1);
221 
222  if (mode == 3 || mode == 1)
223  return; //Avoid duplication of Info in FEDIntegrity_EvF
224 
225  ibooker.setCurrentFolder(topFolder(false));
226  hTTSSummary = ibooker.book2D("TTSSummary", "Summary Status TTS", nFED, fedMin, fedMax + 1, 9, 1, 10);
227  hTTSSummary->setAxisTitle("FED", 1);
228  hTTSSummary->setBinLabel(1, "ROS PAF", 2);
229  hTTSSummary->setBinLabel(2, "DDU PAF", 2);
230  hTTSSummary->setBinLabel(3, "ROS PAF", 2);
231  hTTSSummary->setBinLabel(4, "DDU PAF", 2);
232  hTTSSummary->setBinLabel(5, "DDU Full", 2);
233  hTTSSummary->setBinLabel(6, "L1A Mism.", 2);
234  hTTSSummary->setBinLabel(7, "ROS Error", 2);
235  hTTSSummary->setBinLabel(8, "BX Mism.", 2);
236  hTTSSummary->setBinLabel(9, "DDU Logic Err.", 2);
237 
238  // bookkeeping of the
240  ibooker.book2D("DataCorruptionSummary", "Data Corruption Sources", nFED, fedMin, fedMax + 1, 8, 1, 9);
241  hCorruptionSummary->setAxisTitle("FED", 1);
242  hCorruptionSummary->setBinLabel(1, "Miss Ch.", 2);
243  hCorruptionSummary->setBinLabel(2, "ROS BX mism", 2);
244  hCorruptionSummary->setBinLabel(3, "DDU BX mism", 2);
245  hCorruptionSummary->setBinLabel(4, "ROS L1A mism", 2);
246  hCorruptionSummary->setBinLabel(5, "Miss Payload", 2);
247  hCorruptionSummary->setBinLabel(6, "FCRC bit", 2);
248  hCorruptionSummary->setBinLabel(7, "Header check", 2);
249  hCorruptionSummary->setBinLabel(8, "Trailer Check", 2);
250  }
251 }
252 
253 // ******************uROS******************** //
254 void DTDataIntegrityTask::bookHistos(DQMStore::IBooker& ibooker, string folder, const int fed) {
255  string wheel = "ZERO";
256  if (fed == FEDIDmin)
257  wheel = "NEG";
258  else if (fed == FEDIDmax)
259  wheel = "POS";
260  string fed_s = to_string(fed);
261  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
262  << " Booking histos for FED: " << fed_s << " folder: " << folder << endl;
263 
264  string histoType;
265  string histoName;
266  string histoTitle;
267  MonitorElement* histo = nullptr;
268 
269  // Crate (old DDU) Histograms
270  if (folder == "CRATE") {
271  ibooker.setCurrentFolder(topFolder(false) + "FED" + fed_s);
272 
273  histoType = "EventLength";
274  histoName = "FED" + fed_s + "_" + histoType;
275  histoTitle = "Event Length (Bytes) FED " + fed_s;
276  (fedHistos[histoType])[fed] = ibooker.book1D(histoName, histoTitle, 501, 0, 30000);
277 
278  if (mode == 3 || mode == 1)
279  return; //Avoid duplication of Info in FEDIntegrity_EvF
280 
281  histoType = "uROSStatus";
282  histoName = "FED" + fed_s + "_" + histoType;
283  (fedHistos[histoType])[fed] = ibooker.book2D(histoName, histoName, 12, 0, 12, 12, 1, 13);
284  histo = (fedHistos[histoType])[fed];
285  // only placeholders for the moment
286  histo->setBinLabel(1, "Error G 1", 1);
287  histo->setBinLabel(2, "Error G 2", 1);
288  histo->setBinLabel(3, "Error G 3", 1);
289  histo->setBinLabel(4, "Error G 4", 1);
290  histo->setBinLabel(5, "Error G 5", 1);
291  histo->setBinLabel(6, "Error G 6", 1);
292  histo->setBinLabel(7, "Error G 7", 1);
293  histo->setBinLabel(8, "Error G 8", 1);
294  histo->setBinLabel(9, "Error G 9", 1);
295  histo->setBinLabel(10, "Error G 10", 1);
296  histo->setBinLabel(11, "Error G 11", 1);
297  histo->setBinLabel(12, "Error G 12", 1);
298 
299  histo->setBinLabel(1, "uROS 1", 2);
300  histo->setBinLabel(2, "uROS 2", 2);
301  histo->setBinLabel(3, "uROS 3", 2);
302  histo->setBinLabel(4, "uROS 4", 2);
303  histo->setBinLabel(5, "uROS 5", 2);
304  histo->setBinLabel(6, "uROS 6", 2);
305  histo->setBinLabel(7, "uROS 7", 2);
306  histo->setBinLabel(8, "uROS 8", 2);
307  histo->setBinLabel(9, "uROS 9", 2);
308  histo->setBinLabel(10, "uROS 10", 2);
309  histo->setBinLabel(11, "uROS 11", 2);
310  histo->setBinLabel(12, "uROS 12", 2);
311 
312  if (mode > 0)
313  return; //Info for Online only
314 
315  histoType = "FEDAvgEvLengthvsLumi";
316  histoName = "FED" + fed_s + "_" + histoType;
317  histoTitle = "Avg Event Length (Bytes) vs LumiSec FED " + fed_s;
318  (fedTimeHistos[histoType])[fed] = new DTTimeEvolutionHisto(ibooker, histoName, histoTitle, 200, 10, true, 0);
319 
320  histoType = "TTSValues";
321  histoName = "FED" + fed_s + "_" + histoType;
322  (fedHistos[histoType])[fed] = ibooker.book1D(histoName, histoName, 8, 0, 8);
323  histo = (fedHistos[histoType])[fed];
324  histo->setBinLabel(1, "Disconnected", 1);
325  histo->setBinLabel(2, "Overflow Warning ", 1);
326  histo->setBinLabel(3, "Out of synch", 1);
327  histo->setBinLabel(4, "Busy", 1);
328  histo->setBinLabel(5, "Ready", 1);
329  histo->setBinLabel(6, "Error", 1);
330  histo->setBinLabel(7, "Disconnected", 1);
331  histo->setBinLabel(8, "Unknown", 1);
332 
333  histoType = "uROSList";
334  histoName = "FED" + fed_s + "_" + histoType;
335  histoTitle = "# of uROS in the FED payload (FED" + fed_s + ")";
336  (fedHistos[histoType])[fed] = ibooker.book1D(histoName, histoTitle, 13, 0, 13);
337 
338  histoType = "BXID";
339  histoName = "FED" + fed_s + "_BXID";
340  histoTitle = "Distrib. BX ID (FED" + fed_s + ")";
341  (fedHistos[histoType])[fed] = ibooker.book1D(histoName, histoTitle, 3600, 0, 3600);
342  }
343 
344  // uROS Histograms
345  if (folder == "FED") { // The summary of the error of the ROS on the same FED
346  ibooker.setCurrentFolder(topFolder(false));
347 
348  if (mode == 3 || mode == 1)
349  return; //Avoid duplication of Info in FEDIntegrity_EvF
350 
351  histoType = "uROSSummary";
352  histoName = "FED" + fed_s + "_uROSSummary";
353  string histoTitle = "Summary Wheel" + wheel + " (FED " + fed_s + ")";
354 
355  ((summaryHistos[histoType])[fed]) = ibooker.book2D(histoName, histoTitle, 12, 0, 12, 12, 1, 13);
356  MonitorElement* histo = ((summaryHistos[histoType])[fed]);
357  // ROS error bins
358  // Placeholders for Global Errors for the moment
359  histo->setBinLabel(1, "Error G 1", 1);
360  histo->setBinLabel(2, "Error G 2", 1);
361  histo->setBinLabel(3, "Error G 3", 1);
362  histo->setBinLabel(4, "Error G 4", 1);
363  histo->setBinLabel(5, "Error G 5", 1);
364  histo->setBinLabel(6, "Error G 6", 1);
365  histo->setBinLabel(7, "Error G 7", 1);
366  histo->setBinLabel(8, "Error G 8", 1);
367  histo->setBinLabel(9, "Error G 9", 1);
368  histo->setBinLabel(10, "Error G 10", 1);
369  histo->setBinLabel(11, "Error G 11", 1);
370  histo->setBinLabel(12, "Error G 12", 1);
371 
372  histo->setBinLabel(1, "uROS1", 2);
373  histo->setBinLabel(2, "uROS2", 2);
374  histo->setBinLabel(3, "uROS3", 2);
375  histo->setBinLabel(4, "uROS4", 2);
376  histo->setBinLabel(5, "uROS5", 2);
377  histo->setBinLabel(6, "uROS6", 2);
378  histo->setBinLabel(7, "uROS7", 2);
379  histo->setBinLabel(8, "uROS8", 2);
380  histo->setBinLabel(9, "uROS9", 2);
381  histo->setBinLabel(10, "uROS10", 2);
382  histo->setBinLabel(11, "uROS11", 2);
383  histo->setBinLabel(12, "uROS12", 2);
384  }
385 }
386 // ******************End uROS******************** //
387 
389  string dduID_s = to_string(code.getDDU());
390  string rosID_s = to_string(code.getROS());
391  string robID_s = to_string(code.getROB());
392  int wheel = (code.getDDUID() - 770) % 5 - 2;
393  string wheel_s = to_string(wheel);
394 
395  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
396  << " Booking histos for FED: " << code.getDDU() << " ROS: " << code.getROS() << " ROB: " << code.getROB()
397  << " folder: " << folder << endl;
398 
399  string histoType;
400  string histoName;
401  string histoTitle;
402  MonitorElement* histo = nullptr;
403 
404  // DDU Histograms
405  if (folder == "DDU") {
406  ibooker.setCurrentFolder(topFolder(false) + "FED" + dduID_s);
407 
408  histoType = "EventLength";
409  histoName = "FED" + dduID_s + "_" + histoType;
410  histoTitle = "Event Length (Bytes) FED " + dduID_s;
411  (fedHistos[histoType])[code.getDDUID()] = ibooker.book1D(histoName, histoTitle, 501, 0, 16032);
412 
413  if (mode == 3 || mode == 1)
414  return; //Avoid duplication of Info in FEDIntegrity_EvF
415 
416  histoType = "ROSStatus";
417  histoName = "FED" + dduID_s + "_" + histoType;
418  (fedHistos[histoType])[code.getDDUID()] = ibooker.book2D(histoName, histoName, 12, 0, 12, 12, 0, 12);
419  histo = (fedHistos[histoType])[code.getDDUID()];
420  histo->setBinLabel(1, "ch.enabled", 1);
421  histo->setBinLabel(2, "timeout", 1);
422  histo->setBinLabel(3, "ev.trailer lost", 1);
423  histo->setBinLabel(4, "opt.fiber lost", 1);
424  histo->setBinLabel(5, "tlk.prop.error", 1);
425  histo->setBinLabel(6, "tlk.pattern error", 1);
426  histo->setBinLabel(7, "tlk.sign.lost", 1);
427  histo->setBinLabel(8, "error from ROS", 1);
428  histo->setBinLabel(9, "if ROS in events", 1);
429  histo->setBinLabel(10, "Miss. Evt.", 1);
430  histo->setBinLabel(11, "Evt. ID Mismatch", 1);
431  histo->setBinLabel(12, "BX Mismatch", 1);
432 
433  histo->setBinLabel(1, "ROS 1", 2);
434  histo->setBinLabel(2, "ROS 2", 2);
435  histo->setBinLabel(3, "ROS 3", 2);
436  histo->setBinLabel(4, "ROS 4", 2);
437  histo->setBinLabel(5, "ROS 5", 2);
438  histo->setBinLabel(6, "ROS 6", 2);
439  histo->setBinLabel(7, "ROS 7", 2);
440  histo->setBinLabel(8, "ROS 8", 2);
441  histo->setBinLabel(9, "ROS 9", 2);
442  histo->setBinLabel(10, "ROS 10", 2);
443  histo->setBinLabel(11, "ROS 11", 2);
444  histo->setBinLabel(12, "ROS 12", 2);
445 
446  if (mode > 0)
447  return; //Info for Online only
448 
449  histoType = "FEDAvgEvLengthvsLumi";
450  histoName = "FED" + dduID_s + "_" + histoType;
451  histoTitle = "Avg Event Length (Bytes) vs LumiSec FED " + dduID_s;
452  fedTimeHistos[histoType][code.getDDUID()] =
453  new DTTimeEvolutionHisto(ibooker, histoName, histoTitle, 200, 10, true, 0);
454 
455  histoType = "TTSValues";
456  histoName = "FED" + dduID_s + "_" + histoType;
457  (fedHistos[histoType])[code.getDDUID()] = ibooker.book1D(histoName, histoName, 8, 0, 8);
458  histo = (fedHistos[histoType])[code.getDDUID()];
459  histo->setBinLabel(1, "disconnected", 1);
460  histo->setBinLabel(2, "warning overflow", 1);
461  histo->setBinLabel(3, "out of synch", 1);
462  histo->setBinLabel(4, "busy", 1);
463  histo->setBinLabel(5, "ready", 1);
464  histo->setBinLabel(6, "error", 1);
465  histo->setBinLabel(7, "disconnected", 1);
466  histo->setBinLabel(8, "unknown", 1);
467 
468  histoType = "EventType";
469  histoName = "FED" + dduID_s + "_" + histoType;
470  (fedHistos[histoType])[code.getDDUID()] = ibooker.book1D(histoName, histoName, 2, 1, 3);
471  histo = (fedHistos[histoType])[code.getDDUID()];
472  histo->setBinLabel(1, "physics", 1);
473  histo->setBinLabel(2, "calibration", 1);
474 
475  histoType = "ROSList";
476  histoName = "FED" + dduID_s + "_" + histoType;
477  histoTitle = "# of ROS in the FED payload (FED" + dduID_s + ")";
478  (fedHistos[histoType])[code.getDDUID()] = ibooker.book1D(histoName, histoTitle, 13, 0, 13);
479 
480  histoType = "FIFOStatus";
481  histoName = "FED" + dduID_s + "_" + histoType;
482  (fedHistos[histoType])[code.getDDUID()] = ibooker.book2D(histoName, histoName, 7, 0, 7, 3, 0, 3);
483  histo = (fedHistos[histoType])[code.getDDUID()];
484  histo->setBinLabel(1, "Input ch1-4", 1);
485  histo->setBinLabel(2, "Input ch5-8", 1);
486  histo->setBinLabel(3, "Input ch9-12", 1);
487  histo->setBinLabel(4, "Error/L1A ch1-4", 1);
488  histo->setBinLabel(5, "Error/L1A ch5-8", 1);
489  histo->setBinLabel(6, "Error/L1A ch9-12", 1);
490  histo->setBinLabel(7, "Output", 1);
491  histo->setBinLabel(1, "Full", 2);
492  histo->setBinLabel(2, "Almost Full", 2);
493  histo->setBinLabel(3, "Not Full", 2);
494 
495  histoType = "BXID";
496  histoName = "FED" + dduID_s + "_BXID";
497  histoTitle = "Distrib. BX ID (FED" + dduID_s + ")";
498  (fedHistos[histoType])[code.getDDUID()] = ibooker.book1D(histoName, histoTitle, 3600, 0, 3600);
499  }
500 
501  // ROS Histograms
502  if (folder == "ROS_S") { // The summary of the error of the ROS on the same FED
503  ibooker.setCurrentFolder(topFolder(false));
504 
505  if (mode == 3 || mode == 1)
506  return; //Avoid duplication of Info in FEDIntegrity_EvF
507 
508  histoType = "ROSSummary";
509  histoName = "FED" + dduID_s + "_ROSSummary";
510  string histoTitle = "Summary Wheel" + wheel_s + " (FED " + dduID_s + ")";
511 
512  ((summaryHistos[histoType])[code.getDDUID()]) = ibooker.book2D(histoName, histoTitle, 20, 0, 20, 12, 1, 13);
513  MonitorElement* histo = ((summaryHistos[histoType])[code.getDDUID()]);
514  // ROS error bins
515  histo->setBinLabel(1, "Link TimeOut", 1);
516  histo->setBinLabel(2, "Ev.Id.Mis.", 1);
517  histo->setBinLabel(3, "FIFO almost full", 1);
518  histo->setBinLabel(4, "FIFO full", 1);
519  histo->setBinLabel(5, "CEROS timeout", 1);
520  histo->setBinLabel(6, "Max. wds", 1);
521  histo->setBinLabel(7, "WO L1A FIFO", 1);
522  histo->setBinLabel(8, "TDC parity err.", 1);
523  histo->setBinLabel(9, "BX ID Mis.", 1);
524  histo->setBinLabel(10, "TXP", 1);
525  histo->setBinLabel(11, "L1A almost full", 1);
526  histo->setBinLabel(12, "Ch. blocked", 1);
527  histo->setBinLabel(13, "Ev. Id. Mis.", 1);
528  histo->setBinLabel(14, "CEROS blocked", 1);
529  // TDC error bins
530  histo->setBinLabel(15, "TDC Fatal", 1);
531  histo->setBinLabel(16, "TDC RO FIFO ov.", 1);
532  histo->setBinLabel(17, "TDC L1 buf. ov.", 1);
533  histo->setBinLabel(18, "TDC L1A FIFO ov.", 1);
534  histo->setBinLabel(19, "TDC hit err.", 1);
535  histo->setBinLabel(20, "TDC hit rej.", 1);
536 
537  histo->setBinLabel(1, "ROS1", 2);
538  histo->setBinLabel(2, "ROS2", 2);
539  histo->setBinLabel(3, "ROS3", 2);
540  histo->setBinLabel(4, "ROS4", 2);
541  histo->setBinLabel(5, "ROS5", 2);
542  histo->setBinLabel(6, "ROS6", 2);
543  histo->setBinLabel(7, "ROS7", 2);
544  histo->setBinLabel(8, "ROS8", 2);
545  histo->setBinLabel(9, "ROS9", 2);
546  histo->setBinLabel(10, "ROS10", 2);
547  histo->setBinLabel(11, "ROS11", 2);
548  histo->setBinLabel(12, "ROS12", 2);
549  }
550 
551  if (folder == "ROS") {
552  ibooker.setCurrentFolder(topFolder(false) + "FED" + dduID_s + "/" + folder + rosID_s);
553 
554  if (mode == 3 || mode == 1)
555  return; //Avoid duplication of Info in FEDIntegrity_EvF
556 
557  histoType = "ROSError";
558  histoName = "FED" + dduID_s + "_" + folder + rosID_s + "_ROSError";
559  histoTitle = histoName + " (ROBID error summary)";
560  if (mode < 1) //Online only
561  (rosHistos[histoType])[code.getROSID()] = ibooker.book2D(histoName, histoTitle, 17, 0, 17, 26, 0, 26);
562  else
563  (rosHistos[histoType])[code.getROSID()] = ibooker.book2D(histoName, histoTitle, 11, 0, 11, 26, 0, 26);
564 
565  MonitorElement* histo = (rosHistos[histoType])[code.getROSID()];
566  // ROS error bins
567  histo->setBinLabel(1, "Link TimeOut", 1);
568  histo->setBinLabel(2, "Ev.Id.Mis.", 1);
569  histo->setBinLabel(3, "FIFO almost full", 1);
570  histo->setBinLabel(4, "FIFO full", 1);
571  histo->setBinLabel(5, "CEROS timeout", 1);
572  histo->setBinLabel(6, "Max. wds", 1);
573  histo->setBinLabel(7, "TDC parity err.", 1);
574  histo->setBinLabel(8, "BX ID Mis.", 1);
575  histo->setBinLabel(9, "Ch. blocked", 1);
576  histo->setBinLabel(10, "Ev. Id. Mis.", 1);
577  histo->setBinLabel(11, "CEROS blocked", 1);
578  if (mode < 1) { //Online only
579  // TDC error bins
580  histo->setBinLabel(12, "TDC Fatal", 1);
581  histo->setBinLabel(13, "TDC RO FIFO ov.", 1);
582  histo->setBinLabel(14, "TDC L1 buf. ov.", 1);
583  histo->setBinLabel(15, "TDC L1A FIFO ov.", 1);
584  histo->setBinLabel(16, "TDC hit err.", 1);
585  histo->setBinLabel(17, "TDC hit rej.", 1);
586  }
587  histo->setBinLabel(1, "ROB0", 2);
588  histo->setBinLabel(2, "ROB1", 2);
589  histo->setBinLabel(3, "ROB2", 2);
590  histo->setBinLabel(4, "ROB3", 2);
591  histo->setBinLabel(5, "ROB4", 2);
592  histo->setBinLabel(6, "ROB5", 2);
593  histo->setBinLabel(7, "ROB6", 2);
594  histo->setBinLabel(8, "ROB7", 2);
595  histo->setBinLabel(9, "ROB8", 2);
596  histo->setBinLabel(10, "ROB9", 2);
597  histo->setBinLabel(11, "ROB10", 2);
598  histo->setBinLabel(12, "ROB11", 2);
599  histo->setBinLabel(13, "ROB12", 2);
600  histo->setBinLabel(14, "ROB13", 2);
601  histo->setBinLabel(15, "ROB14", 2);
602  histo->setBinLabel(16, "ROB15", 2);
603  histo->setBinLabel(17, "ROB16", 2);
604  histo->setBinLabel(18, "ROB17", 2);
605  histo->setBinLabel(19, "ROB18", 2);
606  histo->setBinLabel(20, "ROB19", 2);
607  histo->setBinLabel(21, "ROB20", 2);
608  histo->setBinLabel(22, "ROB21", 2);
609  histo->setBinLabel(23, "ROB22", 2);
610  histo->setBinLabel(24, "ROB23", 2);
611  histo->setBinLabel(25, "ROB24", 2);
612  histo->setBinLabel(26, "SC", 2);
613 
614  if (mode > 1)
615  return;
616 
617  histoType = "ROSEventLength";
618  histoName = "FED" + dduID_s + "_" + folder + rosID_s + "_ROSEventLength";
619  histoTitle = "Event Length (Bytes) FED " + dduID_s + " ROS " + rosID_s;
620  (rosHistos[histoType])[code.getROSID()] = ibooker.book1D(histoName, histoTitle, 101, 0, 1616);
621 
622  histoType = "ROSAvgEventLengthvsLumi";
623  histoName = "FED" + dduID_s + "_" + folder + rosID_s + histoType;
624  histoTitle = "Event Length (Bytes) FED " + dduID_s + " ROS " + rosID_s;
625  rosTimeHistos[histoType][code.getROSID()] =
626  new DTTimeEvolutionHisto(ibooker, histoName, histoTitle, 200, 10, true, 0);
627 
628  histoType = "TDCError";
629  histoName = "FED" + dduID_s + "_" + folder + rosID_s + "_TDCError";
630  histoTitle = histoName + " (ROBID error summary)";
631  (rosHistos[histoType])[code.getROSID()] = ibooker.book2D(histoName, histoTitle, 24, 0, 24, 25, 0, 25);
632  histo = (rosHistos[histoType])[code.getROSID()];
633  // TDC error bins
634  histo->setBinLabel(1, "Fatal", 1);
635  histo->setBinLabel(2, "RO FIFO ov.", 1);
636  histo->setBinLabel(3, "L1 buf. ov.", 1);
637  histo->setBinLabel(4, "L1A FIFO ov.", 1);
638  histo->setBinLabel(5, "hit err.", 1);
639  histo->setBinLabel(6, "hit rej.", 1);
640  histo->setBinLabel(7, "Fatal", 1);
641  histo->setBinLabel(8, "RO FIFO ov.", 1);
642  histo->setBinLabel(9, "L1 buf. ov.", 1);
643  histo->setBinLabel(10, "L1A FIFO ov.", 1);
644  histo->setBinLabel(11, "hit err.", 1);
645  histo->setBinLabel(12, "hit rej.", 1);
646  histo->setBinLabel(13, "Fatal", 1);
647  histo->setBinLabel(14, "RO FIFO ov.", 1);
648  histo->setBinLabel(15, "L1 buf. ov.", 1);
649  histo->setBinLabel(16, "L1A FIFO ov.", 1);
650  histo->setBinLabel(17, "hit err.", 1);
651  histo->setBinLabel(18, "hit rej.", 1);
652  histo->setBinLabel(19, "Fatal", 1);
653  histo->setBinLabel(20, "RO FIFO ov.", 1);
654  histo->setBinLabel(21, "L1 buf. ov.", 1);
655  histo->setBinLabel(22, "L1A FIFO ov.", 1);
656  histo->setBinLabel(23, "hit err.", 1);
657  histo->setBinLabel(24, "hit rej.", 1);
658 
659  histo->setBinLabel(1, "ROB0", 2);
660  histo->setBinLabel(2, "ROB1", 2);
661  histo->setBinLabel(3, "ROB2", 2);
662  histo->setBinLabel(4, "ROB3", 2);
663  histo->setBinLabel(5, "ROB4", 2);
664  histo->setBinLabel(6, "ROB5", 2);
665  histo->setBinLabel(7, "ROB6", 2);
666  histo->setBinLabel(8, "ROB7", 2);
667  histo->setBinLabel(9, "ROB8", 2);
668  histo->setBinLabel(10, "ROB9", 2);
669  histo->setBinLabel(11, "ROB10", 2);
670  histo->setBinLabel(12, "ROB11", 2);
671  histo->setBinLabel(13, "ROB12", 2);
672  histo->setBinLabel(14, "ROB13", 2);
673  histo->setBinLabel(15, "ROB14", 2);
674  histo->setBinLabel(16, "ROB15", 2);
675  histo->setBinLabel(17, "ROB16", 2);
676  histo->setBinLabel(18, "ROB17", 2);
677  histo->setBinLabel(19, "ROB18", 2);
678  histo->setBinLabel(20, "ROB19", 2);
679  histo->setBinLabel(21, "ROB20", 2);
680  histo->setBinLabel(22, "ROB21", 2);
681  histo->setBinLabel(23, "ROB22", 2);
682  histo->setBinLabel(24, "ROB23", 2);
683  histo->setBinLabel(25, "ROB24", 2);
684 
685  histoType = "ROB_mean";
686  histoName = "FED" + dduID_s + "_" + "ROS" + rosID_s + "_ROB_mean";
687  string fullName = topFolder(false) + "FED" + dduID_s + "/" + folder + rosID_s + "/" + histoName;
688  names.insert(pair<std::string, std::string>(histoType, string(fullName)));
689  (rosHistos[histoType])[code.getROSID()] = ibooker.book2D(histoName, histoName, 25, 0, 25, 100, 0, 100);
690  (rosHistos[histoType])[code.getROSID()]->setAxisTitle("ROB #", 1);
691  (rosHistos[histoType])[code.getROSID()]->setAxisTitle("ROB wordcounts", 2);
692  }
693 
694  // SC Histograms
695  if (folder == "SC") {
696  // The plots are per wheel
697  ibooker.setCurrentFolder(topFolder(false) + "FED" + dduID_s);
698  if (mode == 3 || mode == 1)
699  return; //Avoid duplication of Info in FEDIntegrity_EvF
700 
701  // SC data Size
702  histoType = "SCSizeVsROSSize";
703  histoName = "FED" + dduID_s + "_SCSizeVsROSSize";
704  histoTitle = "SC size vs SC (FED " + dduID_s + ")";
705  rosHistos[histoType][code.getSCID()] = ibooker.book2D(histoName, histoTitle, 12, 1, 13, 51, -1, 50);
706  rosHistos[histoType][code.getSCID()]->setAxisTitle("SC", 1);
707  }
708 }
709 
711  bookHistos(ibooker, string("ROS"), code);
712 
713  if (mode < 1)
714  if (getSCInfo)
715  bookHistos(ibooker, string("SC"), code);
716 }
717 
718 // ******************uROS******************** //
719 void DTDataIntegrityTask::bookHistosROS(DQMStore::IBooker& ibooker, const int wheel, const int ros) {
720  string wheel_s = to_string(wheel);
721  string ros_s = to_string(ros);
722  ibooker.setCurrentFolder(topFolder(false) + "Wheel" + wheel_s + "/ROS" + ros_s);
723 
724  string histoType = "ROSError";
725  int linkDown = 0;
726  string linkDown_s = to_string(linkDown);
727  int linkUp = linkDown + 24;
728  string linkUp_s = to_string(linkUp);
729  string histoName = "W" + wheel_s + "_" + "ROS" + ros_s + "_" + histoType;
730  string histoTitle = histoName + " (Link " + linkDown_s + "-" + linkUp_s + " error summary)";
731  unsigned int keyHisto = (uROSError)*1000 + (wheel + 2) * 100 + (ros - 1);
732  if (mode < 1) // Online only
733  urosHistos[keyHisto] = ibooker.book2D(histoName, histoTitle, 11, 0, 11, 25, 0, 25);
734  else
735  urosHistos[keyHisto] = ibooker.book2D(histoName, histoTitle, 5, 0, 5, 25, 0, 25);
736 
738  // uROS error bins
739  // Placeholders for the moment
740  histo->setBinLabel(1, "Error 1", 1);
741  histo->setBinLabel(2, "Error 2", 1);
742  histo->setBinLabel(3, "Error 3", 1);
743  histo->setBinLabel(4, "Error 4", 1);
744  histo->setBinLabel(5, "Not OKFlag", 1);
745  if (mode < 1) { //Online only
746  // TDC error bins
747  histo->setBinLabel(6, "TDC Fatal", 1);
748  histo->setBinLabel(7, "TDC RO FIFO ov.", 1);
749  histo->setBinLabel(8, "TDC L1 buf. ov.", 1);
750  histo->setBinLabel(9, "TDC L1A FIFO ov.", 1);
751  histo->setBinLabel(10, "TDC hit err.", 1);
752  histo->setBinLabel(11, "TDC hit rej.", 1);
753  }
754  for (int link = linkDown; link < (linkUp + 1); ++link) {
755  string link_s = to_string(link);
756  histo->setBinLabel(link + 1, "Link" + link_s, 2);
757  }
758 
759  if (mode > 1)
760  return;
761 
762  histoType = "TDCError";
763  linkDown = 0;
764  linkDown_s = to_string(linkDown);
765  linkUp = linkDown + 24;
766  linkUp_s = to_string(linkUp);
767  histoName = "W" + wheel_s + "_" + "ROS" + ros_s + "_" + histoType;
768  histoTitle = histoName + " (Link " + linkDown_s + "-" + linkUp_s + " error summary)";
769  keyHisto = (TDCError)*1000 + (wheel + 2) * 100 + (ros - 1);
770  urosHistos[keyHisto] = ibooker.book2D(histoName, histoTitle, 24, 0, 24, 25, 0, 25);
771  histo = urosHistos[keyHisto];
772  // TDC error bins
773  histo->setBinLabel(1, "Fatal", 1);
774  histo->setBinLabel(2, "RO FIFO ov.", 1);
775  histo->setBinLabel(3, "L1 buf. ov.", 1);
776  histo->setBinLabel(4, "L1A FIFO ov.", 1);
777  histo->setBinLabel(5, "hit err.", 1);
778  histo->setBinLabel(6, "hit rej.", 1);
779  histo->setBinLabel(7, "Fatal", 1);
780  histo->setBinLabel(8, "RO FIFO ov.", 1);
781  histo->setBinLabel(9, "L1 buf. ov.", 1);
782  histo->setBinLabel(10, "L1A FIFO ov.", 1);
783  histo->setBinLabel(11, "hit err.", 1);
784  histo->setBinLabel(12, "hit rej.", 1);
785  histo->setBinLabel(13, "Fatal", 1);
786  histo->setBinLabel(14, "RO FIFO ov.", 1);
787  histo->setBinLabel(15, "L1 buf. ov.", 1);
788  histo->setBinLabel(16, "L1A FIFO ov.", 1);
789  histo->setBinLabel(17, "hit err.", 1);
790  histo->setBinLabel(18, "hit rej.", 1);
791  histo->setBinLabel(19, "Fatal", 1);
792  histo->setBinLabel(20, "RO FIFO ov.", 1);
793  histo->setBinLabel(21, "L1 buf. ov.", 1);
794  histo->setBinLabel(22, "L1A FIFO ov.", 1);
795  histo->setBinLabel(23, "hit err.", 1);
796  histo->setBinLabel(24, "hit rej.", 1);
797 
798  for (int link = linkDown; link < (linkUp + 1); ++link) {
799  string link_s = to_string(link);
800  histo->setBinLabel(link + 1, "Link" + link_s, 2);
801  }
802 } //bookHistosROS
803 
804 void DTDataIntegrityTask::bookHistosuROS(DQMStore::IBooker& ibooker, const int fed, const int uRos) {
805  string fed_s = to_string(fed);
806  string uRos_s = to_string(uRos);
807  ibooker.setCurrentFolder(topFolder(false) + "FED" + fed_s + "/uROS" + uRos_s);
808 
809  if (mode > 1)
810  return;
811 
812  string histoType = "uROSEventLength";
813  string histoName = "FED" + fed_s + "_uROS" + uRos_s + "_" + "EventLength";
814  string histoTitle = "Event Length (Bytes) FED " + fed_s + " uROS" + uRos_s;
815  unsigned int keyHisto = (uROSEventLength)*1000 + (fed - FEDIDmin) * 100 + (uRos - 1);
816  urosHistos[keyHisto] = ibooker.book1D(histoName, histoTitle, 101, 0, 5000);
817 
818  histoType = "uROSAvgEventLengthvsLumi";
819  histoName = "FED" + fed_s + "_ROS" + uRos_s + "AvgEventLengthvsLumi";
820  histoTitle = "Event Length (Bytes) FED " + fed_s + " ROS" + uRos_s;
821  keyHisto = (fed - FEDIDmin) * 100 + (uRos - 1);
822  urosTimeHistos[keyHisto] = new DTTimeEvolutionHisto(ibooker, histoName, histoTitle, 200, 10, true, 0);
823 
824  histoType = "TTSValues";
825  histoName = "FED" + fed_s + "_" + "uROS" + uRos_s + "_" + histoType;
826  keyHisto = TTSValues * 1000 + (fed - FEDIDmin) * 100 + (uRos - 1);
827  urosHistos[keyHisto] = ibooker.book1D(histoName, histoName, 8, 0, 8);
829  histo->setBinLabel(1, "Disconnected", 1);
830  histo->setBinLabel(2, "Overflow Warning ", 1);
831  histo->setBinLabel(3, "Out of synch", 1);
832  histo->setBinLabel(4, "Busy", 1);
833  histo->setBinLabel(5, "Ready", 1);
834  histo->setBinLabel(6, "Error", 1);
835  histo->setBinLabel(7, "Disconnected", 1);
836  histo->setBinLabel(8, "Unknown", 1);
837 }
838 // ******************End uROS******************** //
839 
840 // ******************uROS******************** //
842  neventsuROS++; // FIXME: implement a counter which makes sense
843 
844  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
845  << "[DTDataIntegrityTask]: " << neventsuROS << " events analyzed by processuROS" << endl;
846 
847  if (mode == 3 || mode == 1)
848  return; //Avoid duplication of Info in FEDIntegrity_EvF
849 
850  MonitorElement* uROSSummary = nullptr;
851  uROSSummary = summaryHistos["uROSSummary"][fed];
852 
853  MonitorElement* uROSStatus = nullptr;
854  uROSStatus = fedHistos["uROSStatus"][fed];
855 
856  if (!uROSSummary) {
857  LogError("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
858  << "Trying to access non existing ME at FED " << fed << std::endl;
859  return;
860  }
861 
862  unsigned int slotMap = (data.getboardId()) & 0xF;
863  if (slotMap == 0)
864  return; //prevention for Simulation empty uROS data
865  int ros = theROS(slotMap, 0); //first sector correspondign to link 0
866  int ddu = theDDU(fed, slotMap, 0, false);
867  int wheel = (ddu - 770) % 5 - 2;
868  MonitorElement* ROSSummary = nullptr;
869  ROSSummary = summaryHistos["ROSSummary"][wheel];
870 
871  // Summary of all Link errors
872  MonitorElement* uROSError0 = nullptr;
873  MonitorElement* uROSError1 = nullptr;
874  MonitorElement* uROSError2 = nullptr;
875 
876  int errorX[5][12] = {{0}}; //5th is notOK flag
877 
878  if (mode <= 2) {
879  if (uRos > 2) { //sectors 1-12
880 
881  uROSError0 = urosHistos[(uROSError)*1000 + (wheel + 2) * 100 + (ros - 1)]; //links 0-23
882  uROSError1 = urosHistos[(uROSError)*1000 + (wheel + 2) * 100 + (ros)]; //links 24-47
883  uROSError2 = urosHistos[(uROSError)*1000 + (wheel + 2) * 100 + (ros + 1)]; //links 48-71
884 
885  if ((!uROSError2) || (!uROSError1) || (!uROSError0)) {
886  LogError("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
887  << "Trying to access non existing ME at uROS " << uRos << std::endl;
888  return;
889  }
890 
891  // uROS errors
892  for (unsigned int link = 0; link < 72; ++link) {
893  for (unsigned int flag = 0; flag < 5; ++flag) {
894  if ((data.getokxflag(link) >> flag) & 0x1) { // Undefined Flag 1-4 64bits word for each MTP (12 channels)
895  int value = flag;
896  if (flag == 0)
897  value = 5; //move it to the 5th bin
898 
899  if (value > 0) {
900  if (link < 24) {
901  errorX[value - 1][ros - 1] += 1;
902  uROSError0->Fill(value - 1, link); //bins start at 0 despite labelin
903  } else if (link < 48) {
904  errorX[value - 1][ros] += 1;
905  uROSError1->Fill(value - 1, link - 23);
906  } else if (link < 72) {
907  errorX[value - 1][ros + 1] += 1;
908  uROSError2->Fill(value - 1, link - 47);
909  }
910  } //value>0
911  } //flag value
912  } //loop on flags
913  } //loop on links
914  } //uROS>2
915 
916  else { //uRos<3
917 
918  for (unsigned int link = 0; link < 12; ++link) {
919  for (unsigned int flag = 0; flag < 5; ++flag) {
920  if ((data.getokxflag(link) >> flag) & 0x1) { // Undefined Flag 1-4 64bits word for each MTP (12 channels)
921  int value = flag;
922  int sc = 24;
923  if (flag == 0)
924  value = 5; //move it to the 5th bin
925 
926  if (value > 0) {
927  unsigned int keyHisto = (uROSError)*1000 + (wheel + 2) * 100 + link; //ros -1 = link in this case
928  uROSError0 = urosHistos[keyHisto];
929  if (!uROSError0) {
930  LogError("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
931  << "Trying to access non existing ME at uROS " << uRos << std::endl;
932  return;
933  }
934  errorX[value - 1][link] += 1; // ros-1=link in this case
935  uROSError0->Fill(value - 1, sc); //bins start at 0 despite labeling, this is the old SC
936  }
937  } //flag values
938  } //loop on flags
939  } //loop on links
940  } //else uRos<3
941 
942  } //mode<=2
943 
944  // Fill the ROSSummary (1 per wheel) histo
945  for (unsigned int iros = 0; iros < 12; ++iros) {
946  for (unsigned int bin = 0; bin < 5; ++bin) {
947  if (errorX[bin][iros] != 0)
948  ROSSummary->Fill(bin, iros + 1); //bins start at 1
949  }
950  }
951 
952  // Global Errors for uROS
953  for (unsigned int flag = 4; flag < 16; ++flag) {
954  if ((data.getuserWord() >> flag) & 0x1) {
955  uROSSummary->Fill(flag - 4, uRos);
956  uROSStatus->Fill(flag - 4, uRos); //duplicated info?
957  }
958  }
959 
960  // ROS error
961  for (unsigned int icounter = 0; icounter < data.geterrors().size(); ++icounter) {
962  int link = data.geterrorROBID(icounter);
963  int tdc = data.geterrorTDCID(icounter);
964  int error = data.geterror(icounter);
965  int tdcError_ROSSummary = 0;
966  int tdcError_ROSError = 0;
967  int tdcError_TDCHisto = 0;
968 
969  if (error & 0x4000) {
970  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
971  << " ROS " << uRos << " ROB " << link << " Internal fatal Error 4000 in TDC " << error << endl;
972 
973  tdcError_ROSSummary = 5;
974  tdcError_ROSError = 5;
975  tdcError_TDCHisto = 0;
976 
977  } else if (error & 0x0249) {
978  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
979  << " ROS " << uRos << " ROB " << link << " TDC FIFO overflow in TDC " << error << endl;
980 
981  tdcError_ROSSummary = 6;
982  tdcError_ROSError = 6;
983  tdcError_TDCHisto = 1;
984 
985  } else if (error & 0x0492) {
986  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
987  << " ROS " << uRos << " ROB " << link << " TDC L1 buffer overflow in TDC " << error << endl;
988 
989  tdcError_ROSSummary = 7;
990  tdcError_ROSError = 7;
991  tdcError_TDCHisto = 2;
992 
993  } else if (error & 0x2000) {
994  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
995  << " ROS " << uRos << " ROB " << link << " TDC L1A FIFO overflow in TDC " << error << endl;
996 
997  tdcError_ROSSummary = 8;
998  tdcError_ROSError = 8;
999  tdcError_TDCHisto = 3;
1000 
1001  } else if (error & 0x0924) {
1002  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
1003  << " uROS " << uRos << " ROB " << link << " TDC hit error in TDC " << error << endl;
1004 
1005  tdcError_ROSSummary = 9;
1006  tdcError_ROSError = 9;
1007  tdcError_TDCHisto = 4;
1008 
1009  } else if (error & 0x1000) {
1010  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
1011  << " uROS " << uRos << " ROB " << link << " TDC hit rejected in TDC " << error << endl;
1012 
1013  tdcError_ROSSummary = 10;
1014  tdcError_ROSError = 10;
1015  tdcError_TDCHisto = 5;
1016 
1017  } else {
1018  LogWarning("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
1019  << " TDC error code not known " << error << endl;
1020  }
1021 
1022  if (uRos < 3) {
1023  ROSSummary->Fill(tdcError_ROSSummary, link + 1); //link 0 = ROS 1
1024  int sc = 24;
1025  if (mode <= 2) {
1026  urosHistos[(uROSError)*1000 + (wheel + 2) * 100 + (link)]->Fill(tdcError_ROSError, sc);
1027  if (mode <= 1)
1028  urosHistos[(TDCError)*1000 + (wheel + 2) * 100 + (link)]->Fill(tdcError_TDCHisto + 6 * (tdc - 1),
1029  sc); // ros-1=link in this case
1030  } //mode<=2
1031  } //uRos<3
1032  else { //uRos>2
1033  if (link < 24)
1034  ROSSummary->Fill(tdcError_ROSSummary, ros);
1035  else if (link < 48)
1036  ROSSummary->Fill(tdcError_ROSSummary, ros + 1);
1037  else if (link < 72)
1038  ROSSummary->Fill(tdcError_ROSSummary, ros + 2);
1039 
1040  if (mode <= 2) {
1041  if (link < 24)
1042  uROSError0->Fill(tdcError_ROSError, link);
1043  else if (link < 48)
1044  uROSError1->Fill(tdcError_ROSError, link - 23);
1045  else if (link < 72)
1046  uROSError2->Fill(tdcError_ROSError, link - 47);
1047 
1048  if (mode <= 1) {
1049  if (link < 24)
1050  urosHistos[(TDCError)*1000 + (wheel + 2) * 100 + (ros - 1)]->Fill(tdcError_TDCHisto + 6 * (tdc - 1), link);
1051  else if (link < 48)
1052  urosHistos[(TDCError)*1000 + (wheel + 2) * 100 + (ros)]->Fill(tdcError_TDCHisto + 6 * (tdc - 1), link - 23);
1053  else if (link < 72)
1054  urosHistos[(TDCError)*1000 + (wheel + 2) * 100 + (ros + 1)]->Fill(tdcError_TDCHisto + 6 * (tdc - 1),
1055  link - 47);
1056 
1057  } //mode<=1
1058  } //mode<=2
1059  } //uROS>2
1060  } //loop on errors
1061 
1062  // 1D histograms for TTS values per uROS
1063  int ttsCodeValue = -1;
1064 
1065  int value = (data.getuserWord() & 0xF);
1066  switch (value) {
1067  case 0: { //disconnected
1068  ttsCodeValue = 0;
1069  break;
1070  }
1071  case 1: { //warning overflow
1072  ttsCodeValue = 1;
1073  break;
1074  }
1075  case 2: { //out of sinch
1076  ttsCodeValue = 2;
1077  break;
1078  }
1079  case 4: { //busy
1080  ttsCodeValue = 3;
1081  break;
1082  }
1083  case 8: { //ready
1084  ttsCodeValue = 4;
1085  break;
1086  }
1087  case 12: { //error
1088  ttsCodeValue = 5;
1089  break;
1090  }
1091  case 15: { //disconnected
1092  ttsCodeValue = 6;
1093  break;
1094  }
1095  default: {
1096  LogError("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
1097  << "[DTDataIntegrityTask] FED User control: wrong TTS value " << value << " in FED " << fed << " uROS "
1098  << uRos << endl; //FIXME
1099  ttsCodeValue = 7;
1100  }
1101  }
1102  if (mode < 1) {
1103  urosHistos[TTSValues * 1000 + (fed - FEDIDmin) * 100 + (uRos - 1)]->Fill(ttsCodeValue);
1104 
1105  // Plot the event length //NOHLT
1106  int uRosEventLength = (data.gettrailer() & 0xFFFFF) * 8;
1107  urosTimeHistos[(fed - FEDIDmin) * 100 + (uRos - 1)]->accumulateValueTimeSlot(uRosEventLength);
1108 
1109  if (uRosEventLength > 5000)
1110  uRosEventLength = 5000;
1111  urosHistos[uROSEventLength * 1000 + (fed - FEDIDmin) * 100 + (uRos - 1)]->Fill(uRosEventLength);
1112  }
1113 }
1114 
1115 // *****************End uROS ******************//
1116 
1118  neventsuROS++; // FIXME: implement a counter which makes sense
1119 
1120  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
1121  << "[DTDataIntegrityTask]: " << neventsuROS << " events analyzed by processROS25" << endl;
1122 
1123  // The ID of the RO board (used to map the histos)
1124  DTROChainCoding code;
1125  code.setDDU(ddu);
1126  code.setROS(ros);
1127 
1128  if (mode == 3 || mode == 1)
1129  return; //Avoid duplication of Info in FEDIntegrity_EvF
1130 
1131  MonitorElement* ROSSummary = summaryHistos["ROSSummary"][code.getDDUID()];
1132 
1133  // Summary of all ROB errors
1134  MonitorElement* ROSError = nullptr;
1135  if (mode <= 2)
1136  ROSError = rosHistos["ROSError"][code.getROSID()];
1137 
1138  if ((mode <= 2) && (!ROSError)) {
1139  LogError("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
1140  << "Trying to access non existing ME at ROSID " << code.getROSID() << std::endl;
1141  return;
1142  }
1143 
1144  // L1A ids to be checked against FED one
1145  rosL1AIdsPerFED[ddu].insert(data.getROSHeader().TTCEventCounter());
1146 
1147  // ROS errors
1148 
1149  // check for TPX errors
1150  if (data.getROSTrailer().TPX() != 0) {
1151  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask") << " TXP error en ROS " << code.getROS() << endl;
1152  ROSSummary->Fill(9, code.getROS());
1153  }
1154 
1155  // L1 Buffer almost full (non-critical error!)
1156  if (data.getROSTrailer().l1AFifoOccupancy() > 31) {
1157  ROSSummary->Fill(10, code.getROS());
1158  }
1159 
1160  for (vector<DTROSErrorWord>::const_iterator error_it = data.getROSErrors().begin();
1161  error_it != data.getROSErrors().end();
1162  error_it++) { // Loop over ROS error words
1163 
1164  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
1165  << " Error in ROS " << code.getROS() << " ROB Id " << (*error_it).robID() << " Error type "
1166  << (*error_it).errorType() << endl;
1167 
1168  // Fill the ROSSummary (1 per FED) histo
1169  ROSSummary->Fill((*error_it).errorType(), code.getROS());
1170  if ((*error_it).errorType() <= 11) { // set error flag
1171  eventErrorFlag = true;
1172  }
1173 
1174  if (mode <= 2) {
1175  // Fill the ROB Summary (1 per ROS) histo
1176  if ((*error_it).robID() != 31) {
1177  ROSError->Fill((*error_it).errorType(), (*error_it).robID());
1178  } else if ((*error_it).errorType() == 4) {
1179  vector<int> channelBins;
1180  channelsInROS((*error_it).cerosID(), channelBins);
1181  vector<int>::const_iterator channelIt = channelBins.begin();
1182  vector<int>::const_iterator channelEnd = channelBins.end();
1183  for (; channelIt != channelEnd; ++channelIt) {
1184  ROSError->Fill(4, (*channelIt));
1185  }
1186  }
1187  }
1188  }
1189 
1190  int ROSDebug_BunchNumber = -1;
1191 
1192  for (vector<DTROSDebugWord>::const_iterator debug_it = data.getROSDebugs().begin();
1193  debug_it != data.getROSDebugs().end();
1194  debug_it++) { // Loop over ROS debug words
1195 
1196  int debugROSSummary = 0;
1197  int debugROSError = 0;
1198  vector<int> debugBins;
1199  bool hasEvIdMis = false;
1200  vector<int> evIdMisBins;
1201 
1202  if ((*debug_it).debugType() == 0) {
1203  ROSDebug_BunchNumber = (*debug_it).debugMessage();
1204  } else if ((*debug_it).debugType() == 1) {
1205  // not used
1206  // ROSDebug_BcntResCntLow = (*debug_it).debugMessage();
1207  } else if ((*debug_it).debugType() == 2) {
1208  // not used
1209  // ROSDebug_BcntResCntHigh = (*debug_it).debugMessage();
1210  } else if ((*debug_it).debugType() == 3) {
1211  if ((*debug_it).dontRead()) {
1212  debugROSSummary = 11;
1213  debugROSError = 8;
1214  if (mode <= 2)
1215  channelsInCEROS((*debug_it).cerosIdCerosStatus(), (*debug_it).dontRead(), debugBins);
1216  }
1217  if ((*debug_it).evIdMis()) {
1218  hasEvIdMis = true;
1219  if (mode <= 2)
1220  channelsInCEROS((*debug_it).cerosIdCerosStatus(), (*debug_it).evIdMis(), evIdMisBins);
1221  }
1222  } else if ((*debug_it).debugType() == 4 && (*debug_it).cerosIdRosStatus()) {
1223  debugROSSummary = 13;
1224  debugROSError = 10;
1225  if (mode <= 2)
1226  channelsInROS((*debug_it).cerosIdRosStatus(), debugBins);
1227  }
1228 
1229  if (debugROSSummary) {
1230  ROSSummary->Fill(debugROSSummary, code.getROS());
1231  if (mode <= 2) {
1232  vector<int>::const_iterator channelIt = debugBins.begin();
1233  vector<int>::const_iterator channelEnd = debugBins.end();
1234  for (; channelIt != channelEnd; ++channelIt) {
1235  ROSError->Fill(debugROSError, (*channelIt));
1236  }
1237  }
1238  }
1239 
1240  if (hasEvIdMis) {
1241  ROSSummary->Fill(12, code.getROS());
1242  if (mode <= 2) {
1243  vector<int>::const_iterator channelIt = evIdMisBins.begin();
1244  vector<int>::const_iterator channelEnd = evIdMisBins.end();
1245  for (; channelIt != channelEnd; ++channelIt) {
1246  ROSError->Fill(9, (*channelIt));
1247  }
1248  }
1249  }
1250  }
1251 
1252  // ROB Group Header
1253  // Check the BX of the ROB headers against the BX of the ROS
1254  for (vector<DTROBHeader>::const_iterator rob_it = data.getROBHeaders().begin(); rob_it != data.getROBHeaders().end();
1255  rob_it++) { // loop over ROB headers
1256 
1257  code.setROB((*rob_it).first);
1258  DTROBHeaderWord robheader = (*rob_it).second;
1259 
1260  rosBxIdsPerFED[ddu].insert(ROSDebug_BunchNumber);
1261 
1262  if (robheader.bunchID() != ROSDebug_BunchNumber) {
1263  // fill ROS Summary plot
1264  ROSSummary->Fill(8, code.getROS());
1265  eventErrorFlag = true;
1266 
1267  // fill ROB Summary plot for that particular ROS
1268  if (mode <= 2)
1269  ROSError->Fill(7, robheader.robID());
1270  }
1271  }
1272 
1273  if (mode < 1) { // produce only when not in HLT or SM
1274  // ROB Trailer
1275  for (vector<DTROBTrailerWord>::const_iterator robt_it = data.getROBTrailers().begin();
1276  robt_it != data.getROBTrailers().end();
1277  robt_it++) { // loop over ROB trailers
1278  float wCount = (*robt_it).wordCount() < 100. ? (*robt_it).wordCount() : 99.9;
1279  rosHistos["ROB_mean"][code.getROSID()]->Fill((*robt_it).robID(), wCount);
1280  }
1281 
1282  // Plot the event length //NOHLT
1283  int rosEventLength = data.getROSTrailer().EventWordCount() * 4;
1284  rosTimeHistos["ROSAvgEventLengthvsLumi"][code.getROSID()]->accumulateValueTimeSlot(rosEventLength);
1285 
1286  if (rosEventLength > 1600)
1287  rosEventLength = 1600;
1288  rosHistos["ROSEventLength"][code.getROSID()]->Fill(rosEventLength);
1289  }
1290 
1291  // TDC Data
1292  for (vector<DTTDCData>::const_iterator tdc_it = data.getTDCData().begin(); tdc_it != data.getTDCData().end();
1293  tdc_it++) { // loop over TDC data
1294 
1295  DTTDCMeasurementWord tdcDatum = (*tdc_it).second;
1296 
1297  if (tdcDatum.PC() != 0) {
1298  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
1299  << " PC error in ROS " << code.getROS() << " TDC " << (*tdc_it).first << endl;
1300  // fill ROS Summary plot
1301  ROSSummary->Fill(7, code.getROS());
1302 
1303  eventErrorFlag = true;
1304 
1305  // fill ROB Summary plot for that particular ROS
1306  if (mode <= 2)
1307  ROSError->Fill(6, (*tdc_it).first);
1308  }
1309  }
1310 
1311  // TDC Error
1312  for (vector<DTTDCError>::const_iterator tdc_it = data.getTDCError().begin(); tdc_it != data.getTDCError().end();
1313  tdc_it++) { // loop over TDC errors
1314 
1315  code.setROB((*tdc_it).first);
1316 
1317  int tdcError_ROSSummary = 0;
1318  int tdcError_ROSError = 0;
1319  int tdcError_TDCHisto = 0;
1320 
1321  if (((*tdc_it).second).tdcError() & 0x4000) {
1322  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
1323  << " ROS " << code.getROS() << " ROB " << code.getROB() << " Internal fatal Error 4000 in TDC "
1324  << (*tdc_it).first << endl;
1325 
1326  tdcError_ROSSummary = 14;
1327  tdcError_ROSError = 11;
1328  tdcError_TDCHisto = 0;
1329 
1330  } else if (((*tdc_it).second).tdcError() & 0x0249) {
1331  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
1332  << " ROS " << code.getROS() << " ROB " << code.getROB() << " TDC FIFO overflow in TDC " << (*tdc_it).first
1333  << endl;
1334 
1335  tdcError_ROSSummary = 15;
1336  tdcError_ROSError = 12;
1337  tdcError_TDCHisto = 1;
1338 
1339  } else if (((*tdc_it).second).tdcError() & 0x0492) {
1340  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
1341  << " ROS " << code.getROS() << " ROB " << code.getROB() << " TDC L1 buffer overflow in TDC "
1342  << (*tdc_it).first << endl;
1343 
1344  tdcError_ROSSummary = 16;
1345  tdcError_ROSError = 13;
1346  tdcError_TDCHisto = 2;
1347 
1348  } else if (((*tdc_it).second).tdcError() & 0x2000) {
1349  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
1350  << " ROS " << code.getROS() << " ROB " << code.getROB() << " TDC L1A FIFO overflow in TDC " << (*tdc_it).first
1351  << endl;
1352 
1353  tdcError_ROSSummary = 17;
1354  tdcError_ROSError = 14;
1355  tdcError_TDCHisto = 3;
1356 
1357  } else if (((*tdc_it).second).tdcError() & 0x0924) {
1358  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
1359  << " ROS " << code.getROS() << " ROB " << code.getROB() << " TDC hit error in TDC " << (*tdc_it).first
1360  << endl;
1361 
1362  tdcError_ROSSummary = 18;
1363  tdcError_ROSError = 15;
1364  tdcError_TDCHisto = 4;
1365 
1366  } else if (((*tdc_it).second).tdcError() & 0x1000) {
1367  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
1368  << " ROS " << code.getROS() << " ROB " << code.getROB() << " TDC hit rejected in TDC " << (*tdc_it).first
1369  << endl;
1370 
1371  tdcError_ROSSummary = 19;
1372  tdcError_ROSError = 16;
1373  tdcError_TDCHisto = 5;
1374 
1375  } else {
1376  LogWarning("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
1377  << " TDC error code not known " << ((*tdc_it).second).tdcError() << endl;
1378  }
1379 
1380  ROSSummary->Fill(tdcError_ROSSummary, code.getROS());
1381 
1382  if (tdcError_ROSSummary <= 15) {
1383  eventErrorFlag = true;
1384  }
1385 
1386  if (mode <= 2) {
1387  ROSError->Fill(tdcError_ROSError, (*tdc_it).first);
1388  if (mode <= 1)
1389  rosHistos["TDCError"][code.getROSID()]->Fill(tdcError_TDCHisto + 6 * ((*tdc_it).second).tdcID(),
1390  (*tdc_it).first);
1391  }
1392  }
1393 
1394  // Read SC data
1395  if (mode < 1 && getSCInfo) {
1396  // NumberOf16bitWords counts the # of words + 1 subheader
1397  // the SC includes the SC "private header" and the ROS header and trailer (= NumberOf16bitWords +3)
1398  rosHistos["SCSizeVsROSSize"][code.getSCID()]->Fill(ros, data.getSCTrailer().wordCount());
1399  }
1400 }
1401 
1402 // ******************uROS******************** //
1404  neventsFED++;
1405  if (neventsFED % 1000 == 0)
1406  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
1407  << "[DTDataIntegrityTask]: " << neventsFED << " events analyzed by processFED" << endl;
1408 
1409  if (fed < FEDIDmin || fed > FEDIDmax)
1410  return;
1411 
1412  hFEDEntry->Fill(fed);
1413 
1414  if (mode == 3 || mode == 1)
1415  return; //Avoid duplication of Info in FEDIntegrity_EvF
1416 
1417  //1D HISTOS: EVENT LENGHT from trailer
1418  int fedEvtLength = data.getevtlgth() * 8; //1 word = 8 bytes
1419  // if(fedEvtLength > 16000) fedEvtLength = 16000; // overflow bin
1420  fedHistos["EventLength"][fed]->Fill(fedEvtLength);
1421 
1422  if (mode > 1)
1423  return;
1424 
1425  fedTimeHistos["FEDAvgEvLengthvsLumi"][fed]->accumulateValueTimeSlot(fedEvtLength);
1426 
1427  // fill the distribution of the BX ids
1428  fedHistos["BXID"][fed]->Fill(data.getBXId());
1429 
1430  // size of the list of ROS in the Read-Out
1431  fedHistos["uROSList"][fed]->Fill(data.getnslots());
1432 
1433  // Fill the status summary of the TTS
1434 
1435  //1D HISTO WITH TTS VALUES form trailer (7 bins = 7 values)
1436 
1437  int ttsCodeValue = -1;
1438  int value = data.getTTS();
1439  switch (value) {
1440  case 0: { //disconnected
1441  ttsCodeValue = 0;
1442  break;
1443  }
1444  case 1: { //warning overflow
1445  ttsCodeValue = 1;
1446  break;
1447  }
1448  case 2: { //out of sinch
1449  ttsCodeValue = 2;
1450  break;
1451  }
1452  case 4: { //busy
1453  ttsCodeValue = 3;
1454  break;
1455  }
1456  case 8: { //ready
1457  ttsCodeValue = 4;
1458  break;
1459  }
1460  case 12: { //error
1461  ttsCodeValue = 5;
1462  break;
1463  }
1464  case 15: { //disconnected
1465  ttsCodeValue = 6;
1466  break;
1467  }
1468  default: {
1469  LogError("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
1470  << "[DTDataIntegrityTask] FED TTS control: wrong TTS value " << value << " in FED " << fed << endl;
1471  ttsCodeValue = 7;
1472  }
1473  }
1474  if (mode < 1)
1475  fedHistos["TTSValues"][fed]->Fill(ttsCodeValue);
1476 }
1477 // *****************End uROS ******************//
1478 
1479 void DTDataIntegrityTask::processFED(DTDDUData& data, const std::vector<DTROS25Data>& rosData, int ddu) {
1480  neventsFED++;
1481  if (neventsFED % 1000 == 0)
1482  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
1483  << "[DTDataIntegrityTask]: " << neventsFED << " events analyzed by processFED" << endl;
1484 
1485  DTROChainCoding code;
1486  code.setDDU(ddu);
1487  if (code.getDDUID() < FEDIDmin || code.getDDUID() > FEDIDmax)
1488  return;
1489 
1490  hFEDEntry->Fill(code.getDDUID());
1491 
1492  const FEDTrailer& trailer = data.getDDUTrailer();
1493  const FEDHeader& header = data.getDDUHeader();
1494 
1495  // check consistency of header and trailer
1496  if (!header.check()) {
1497  // error code 7
1498  hFEDFatal->Fill(code.getDDUID());
1499  hCorruptionSummary->Fill(code.getDDUID(), 7);
1500  }
1501 
1502  if (!trailer.check()) {
1503  // error code 8
1504  hFEDFatal->Fill(code.getDDUID());
1505  hCorruptionSummary->Fill(code.getDDUID(), 8);
1506  }
1507 
1508  // check CRC error bit set by DAQ before sending data on SLink
1509  if (data.crcErrorBit()) {
1510  // error code 6
1511  hFEDFatal->Fill(code.getDDUID());
1512  hCorruptionSummary->Fill(code.getDDUID(), 6);
1513  }
1514 
1515  if (mode == 3 || mode == 1)
1516  return; //Avoid duplication of Info in FEDIntegrity_EvF
1517 
1518  const DTDDUSecondStatusWord& secondWord = data.getSecondStatusWord();
1519 
1520  // Fill the status summary of the TTS
1521 
1522  //1D HISTO WITH TTS VALUES form trailer (7 bins = 7 values)
1523  int ttsCodeValue = -1;
1524  int ttsSummaryBin = -1;
1525 
1526  switch (trailer.ttsBits()) {
1527  case 0: { //disconnected
1528  ttsCodeValue = 0;
1529  break;
1530  }
1531  case 1: { //warning overflow
1532  ttsCodeValue = 1;
1533  if (secondWord.warningROSPAF()) { // ROS PAF
1534  ttsSummaryBin = 1;
1535  } else { // DDU PAF
1536  ttsSummaryBin = 2;
1537  }
1538 
1539  break;
1540  }
1541  case 2: { //out of sinch
1542  ttsCodeValue = 2;
1543  bool knownOrigin = false;
1544  if (secondWord.outOfSynchROSError()) { // ROS Error
1545  ttsSummaryBin = 7;
1546  knownOrigin = true;
1547  }
1548  if (secondWord.l1AIDError()) { // L1A Mism.
1549  ttsSummaryBin = 6;
1550  knownOrigin = true;
1551  }
1552  if (secondWord.bxIDError()) { // BX Mism.
1553  ttsSummaryBin = 8;
1554  knownOrigin = true;
1555  }
1556  if (secondWord.outputFifoFull() || secondWord.inputFifoFull() || secondWord.fifoFull()) { // DDU Full
1557  ttsSummaryBin = 5;
1558  knownOrigin = true;
1559  }
1560  if (!knownOrigin)
1561  ttsSummaryBin = 9; // Error in DDU logic
1562 
1563  break;
1564  }
1565  case 4: { //busy
1566  ttsCodeValue = 3;
1567  bool knownOrigin = false;
1568  if (secondWord.busyROSPAF()) { // ROS PAF
1569  ttsSummaryBin = 3;
1570  knownOrigin = true;
1571  }
1572  if (secondWord.outputFifoAlmostFull() || secondWord.inputFifoAlmostFull() ||
1573  secondWord.fifoAlmostFull()) { // DDU PAF
1574  ttsSummaryBin = 4;
1575  knownOrigin = true;
1576  }
1577  if (!knownOrigin)
1578  ttsSummaryBin = 9; // Error in DDU logic
1579  break;
1580  }
1581  case 8: { //ready
1582  ttsCodeValue = 4;
1583  break;
1584  }
1585  case 12: { //error
1586  ttsCodeValue = 5;
1587  break;
1588  }
1589  case 16: { //disconnected
1590  ttsCodeValue = 6;
1591  break;
1592  }
1593  default: {
1594  LogError("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
1595  << "[DTDataIntegrityTask] DDU control: wrong TTS value " << trailer.ttsBits() << endl;
1596  ttsCodeValue = 7;
1597  }
1598  }
1599  if (mode < 1)
1600  fedHistos["TTSValues"][code.getDDUID()]->Fill(ttsCodeValue);
1601  if (ttsSummaryBin != -1) {
1602  hTTSSummary->Fill(ddu, ttsSummaryBin);
1603  }
1604 
1605  //2D HISTO: ROS VS STATUS (8 BIT = 8 BIN) from 1st-2nd status words (9th BIN FROM LIST OF ROS in 2nd status word)
1606  MonitorElement* hROSStatus = fedHistos["ROSStatus"][code.getDDUID()];
1607  //1D HISTO: NUMBER OF ROS IN THE EVENTS from 2nd status word
1608 
1609  int rosList = secondWord.rosList();
1610  set<int> rosPositions;
1611  for (int i = 0; i < 12; i++) {
1612  if (rosList & 0x1) {
1613  rosPositions.insert(i);
1614  //9th BIN FROM LIST OF ROS in 2nd status word
1615  if (mode <= 2)
1616  hROSStatus->Fill(8, i, 1);
1617  }
1618  rosList >>= 1;
1619  }
1620 
1621  int channel = 0;
1622  for (vector<DTDDUFirstStatusWord>::const_iterator fsw_it = data.getFirstStatusWord().begin();
1623  fsw_it != data.getFirstStatusWord().end();
1624  fsw_it++) {
1625  // assuming association one-to-one between DDU channel and ROS
1626  if (mode <= 2) {
1627  hROSStatus->Fill(0, channel, (*fsw_it).channelEnabled());
1628  hROSStatus->Fill(1, channel, (*fsw_it).timeout());
1629  hROSStatus->Fill(2, channel, (*fsw_it).eventTrailerLost());
1630  hROSStatus->Fill(3, channel, (*fsw_it).opticalFiberSignalLost());
1631  hROSStatus->Fill(4, channel, (*fsw_it).tlkPropagationError());
1632  hROSStatus->Fill(5, channel, (*fsw_it).tlkPatternError());
1633  hROSStatus->Fill(6, channel, (*fsw_it).tlkSignalLost());
1634  hROSStatus->Fill(7, channel, (*fsw_it).errorFromROS());
1635  }
1636  // check that the enabled channel was also in the read-out
1637  if ((*fsw_it).channelEnabled() == 1 && rosPositions.find(channel) == rosPositions.end()) {
1638  if (mode <= 2)
1639  hROSStatus->Fill(9, channel, 1);
1640  // error code 1
1641  hFEDFatal->Fill(code.getDDUID());
1642  hCorruptionSummary->Fill(code.getDDUID(), 1);
1643  }
1644  channel++;
1645  }
1646 
1647  // ---------------------------------------------------------------------
1648  // cross checks between FED and ROS data
1649  // check the BX ID against the ROSs
1650  set<int> rosBXIds = rosBxIdsPerFED[ddu];
1651  if ((rosBXIds.size() > 1 || rosBXIds.find(header.bxID()) == rosBXIds.end()) &&
1652  !rosBXIds.empty()) { // in this case look for faulty ROSs
1653  for (vector<DTROS25Data>::const_iterator rosControlData = rosData.begin(); rosControlData != rosData.end();
1654  ++rosControlData) { // loop over the ROS data
1655  for (vector<DTROSDebugWord>::const_iterator debug_it = (*rosControlData).getROSDebugs().begin();
1656  debug_it != (*rosControlData).getROSDebugs().end();
1657  debug_it++) { // Loop over ROS debug words
1658  if ((*debug_it).debugType() == 0 && (*debug_it).debugMessage() != header.bxID()) { // check the BX
1659  int ros = (*rosControlData).getROSID();
1660  // fill the error bin
1661  if (mode <= 2)
1662  hROSStatus->Fill(11, ros - 1);
1663  // error code 2
1664  hFEDFatal->Fill(code.getDDUID());
1665  hCorruptionSummary->Fill(code.getDDUID(), 2);
1666  }
1667  }
1668  }
1669  }
1670 
1671  // check the BX ID against other FEDs
1672  fedBXIds.insert(header.bxID());
1673  if (fedBXIds.size() != 1) {
1674  LogWarning("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
1675  << "ERROR: FED " << ddu << " BX ID different from other feds: " << header.bxID() << endl;
1676  // error code 3
1677  hFEDFatal->Fill(code.getDDUID());
1678  hCorruptionSummary->Fill(code.getDDUID(), 3);
1679  }
1680 
1681  // check the L1A ID against the ROSs
1682  set<int> rosL1AIds = rosL1AIdsPerFED[ddu];
1683  if ((rosL1AIds.size() > 1 || rosL1AIds.find(header.lvl1ID() - 1) == rosL1AIds.end()) &&
1684  !rosL1AIds.empty()) { // in this case look for faulty ROSs
1685  //If L1A_ID error identify which ROS has wrong L1A
1686  for (vector<DTROS25Data>::const_iterator rosControlData = rosData.begin(); rosControlData != rosData.end();
1687  rosControlData++) { // loop over the ROS data
1688  unsigned int ROSHeader_TTCCount =
1689  ((*rosControlData).getROSHeader().TTCEventCounter() + 1) %
1690  0x1000000; // fix comparison in case of last counting bin in ROS /first one in DDU
1691  if (ROSHeader_TTCCount != header.lvl1ID()) {
1692  int ros = (*rosControlData).getROSID();
1693  if (mode <= 2)
1694  hROSStatus->Fill(10, ros - 1);
1695  // error code 4
1696  hFEDFatal->Fill(code.getDDUID());
1697  hCorruptionSummary->Fill(code.getDDUID(), 4);
1698  }
1699  }
1700  }
1701 
1702  //1D HISTOS: EVENT LENGHT from trailer
1703  int fedEvtLength = trailer.fragmentLength() * 8;
1704  // if(fedEvtLength > 16000) fedEvtLength = 16000; // overflow bin
1705  fedHistos["EventLength"][code.getDDUID()]->Fill(fedEvtLength);
1706 
1707  if (mode > 1)
1708  return;
1709 
1710  fedTimeHistos["FEDAvgEvLengthvsLumi"][code.getDDUID()]->accumulateValueTimeSlot(fedEvtLength);
1711 
1712  // size of the list of ROS in the Read-Out
1713  fedHistos["ROSList"][code.getDDUID()]->Fill(rosPositions.size());
1714 
1715  //2D HISTO: FIFO STATUS from 2nd status word
1716  MonitorElement* hFIFOStatus = fedHistos["FIFOStatus"][code.getDDUID()];
1717  int inputFifoFull = secondWord.inputFifoFull();
1718  int inputFifoAlmostFull = secondWord.inputFifoAlmostFull();
1719  int fifoFull = secondWord.fifoFull();
1720  int fifoAlmostFull = secondWord.fifoAlmostFull();
1721  int outputFifoFull = secondWord.outputFifoFull();
1722  int outputFifoAlmostFull = secondWord.outputFifoAlmostFull();
1723  for (int i = 0; i < 3; i++) {
1724  if (inputFifoFull & 0x1) {
1725  hFIFOStatus->Fill(i, 0);
1726  }
1727  if (inputFifoAlmostFull & 0x1) {
1728  hFIFOStatus->Fill(i, 1);
1729  }
1730  if (fifoFull & 0x1) {
1731  hFIFOStatus->Fill(3 + i, 0);
1732  }
1733  if (fifoAlmostFull & 0x1) {
1734  hFIFOStatus->Fill(3 + i, 1);
1735  }
1736  if (!(inputFifoFull & 0x1) && !(inputFifoAlmostFull & 0x1)) {
1737  hFIFOStatus->Fill(i, 2);
1738  }
1739  if (!(fifoFull & 0x1) && !(fifoAlmostFull & 0x1)) {
1740  hFIFOStatus->Fill(3 + i, 2);
1741  }
1742  inputFifoFull >>= 1;
1743  inputFifoAlmostFull >>= 1;
1744  fifoFull >>= 1;
1745  fifoAlmostFull >>= 1;
1746  }
1747 
1748  if (outputFifoFull) {
1749  hFIFOStatus->Fill(6, 0);
1750  }
1751  if (outputFifoAlmostFull) {
1752  hFIFOStatus->Fill(6, 1);
1753  }
1754  if (!outputFifoFull && !outputFifoAlmostFull) {
1755  hFIFOStatus->Fill(6, 2);
1756  }
1757 
1758  //1D HISTO: EVENT TYPE from header
1759  fedHistos["EventType"][code.getDDUID()]->Fill(header.triggerType());
1760 
1761  // fill the distribution of the BX ids
1762  fedHistos["BXID"][code.getDDUID()]->Fill(header.bxID());
1763 }
1764 
1766 
1767 // log number of times the payload of each fed is unpacked
1768 void DTDataIntegrityTask::fedEntry(int dduID) { hFEDEntry->Fill(dduID); }
1769 
1770 // log number of times the payload of each fed is skipped (no ROS inside)
1771 void DTDataIntegrityTask::fedFatal(int dduID) { hFEDFatal->Fill(dduID); }
1772 
1773 // log number of times the payload of each fed is partially skipped (some ROS skipped)
1775 
1776 std::string DTDataIntegrityTask::topFolder(bool isFEDIntegrity) const {
1777  string folder = isFEDIntegrity ? fedIntegrityFolder : "DT/00-DataIntegrity/";
1778 
1779  if (mode == 0 || mode == 2)
1780  folder = "DT/00-DataIntegrity/"; //Move everything from FEDIntegrity except for SM and HLT modes
1781 
1782  return folder;
1783 }
1784 
1785 void DTDataIntegrityTask::channelsInCEROS(int cerosId, int chMask, vector<int>& channels) {
1786  for (int iCh = 0; iCh < 6; ++iCh) {
1787  if ((chMask >> iCh) & 0x1) {
1788  channels.push_back(cerosId * 6 + iCh);
1789  }
1790  }
1791  return;
1792 }
1793 
1794 void DTDataIntegrityTask::channelsInROS(int cerosMask, vector<int>& channels) {
1795  for (int iCeros = 0; iCeros < 5; ++iCeros) {
1796  if ((cerosMask >> iCeros) & 0x1) {
1797  for (int iCh = 0; iCh < 6; ++iCh) {
1798  channels.push_back(iCeros * 6 + iCh);
1799  }
1800  }
1801  }
1802  return;
1803 }
1804 
1806  nEventsLS = 0;
1807 }
1808 
1810  int lumiBlock = ls.luminosityBlock();
1811 
1812  if (checkUros) {
1813  map<string, map<int, DTTimeEvolutionHisto*> >::iterator fedIt = fedTimeHistos.begin();
1814  map<string, map<int, DTTimeEvolutionHisto*> >::iterator fedEnd = fedTimeHistos.end();
1815  for (; fedIt != fedEnd; ++fedIt) {
1816  map<int, DTTimeEvolutionHisto*>::iterator histoIt = fedIt->second.begin();
1817  map<int, DTTimeEvolutionHisto*>::iterator histoEnd = fedIt->second.end();
1818  for (; histoIt != histoEnd; ++histoIt) {
1819  histoIt->second->updateTimeSlot(lumiBlock, nEventsLS);
1820  }
1821  }
1822 
1823  map<unsigned int, DTTimeEvolutionHisto*>::iterator urosIt = urosTimeHistos.begin();
1824  map<unsigned int, DTTimeEvolutionHisto*>::iterator urosEnd = urosTimeHistos.end();
1825  for (; urosIt != urosEnd; ++urosIt) {
1826  urosIt->second->updateTimeSlot(lumiBlock, nEventsLS);
1827  }
1828 
1829  } //uROS starting on 2018
1830  else {
1831  map<string, map<int, DTTimeEvolutionHisto*> >::iterator dduIt = fedTimeHistos.begin();
1832  map<string, map<int, DTTimeEvolutionHisto*> >::iterator dduEnd = fedTimeHistos.end();
1833  for (; dduIt != dduEnd; ++dduIt) {
1834  map<int, DTTimeEvolutionHisto*>::iterator histoIt = dduIt->second.begin();
1835  map<int, DTTimeEvolutionHisto*>::iterator histoEnd = dduIt->second.end();
1836  for (; histoIt != histoEnd; ++histoIt) {
1837  histoIt->second->updateTimeSlot(lumiBlock, nEventsLS);
1838  }
1839  }
1840 
1841  map<string, map<int, DTTimeEvolutionHisto*> >::iterator rosIt = rosTimeHistos.begin();
1842  map<string, map<int, DTTimeEvolutionHisto*> >::iterator rosEnd = rosTimeHistos.end();
1843  for (; rosIt != rosEnd; ++rosIt) {
1844  map<int, DTTimeEvolutionHisto*>::iterator histoIt = rosIt->second.begin();
1845  map<int, DTTimeEvolutionHisto*>::iterator histoEnd = rosIt->second.end();
1846  for (; histoIt != histoEnd; ++histoIt) {
1847  histoIt->second->updateTimeSlot(lumiBlock, nEventsLS);
1848  }
1849  }
1850  } //ROS Legacy
1851 }
1852 
1854  nevents++;
1856 
1857  nEventsLS++;
1858 
1859  LogTrace("DTRawToDigi|TDQM|DTMonitorModule|DTDataIntegrityTask") << "[DTDataIntegrityTask]: preProcessEvent" << endl;
1860 
1861  if (checkUros) { //uROS starting on 2018
1862  // Digi collection
1864  e.getByToken(fedToken, fedCol);
1865  DTuROSFEDData fedData;
1866  DTuROSROSData urosData;
1867 
1868  if (fedCol.isValid()) {
1869  for (unsigned int j = 0; j < fedCol->size(); ++j) {
1870  fedData = fedCol->at(j);
1871  int fed = fedData.getfed(); //argument should be void
1872  if (fed > FEDIDmax || fed < FEDIDmin) {
1873  LogError("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
1874  << "[DTDataIntegrityTask]: analyze, FED ID " << fed << " not expected." << endl;
1875  continue;
1876  }
1877  processFED(fedData, fed);
1878 
1879  if (mode == 3 || mode == 1)
1880  continue; //Not needed for FEDIntegrity_EvF
1881 
1882  for (int slot = 1; slot <= DOCESLOTS; ++slot) {
1883  urosData = fedData.getuROS(slot);
1884  if (fedData.getslotsize(slot) == 0 || urosData.getslot() == -1)
1885  continue;
1886  processuROS(urosData, fed, slot);
1887  }
1888  }
1889  }
1890  } // checkUros
1891  else { //Legacy ROS
1892  // clear the set of BXids from the ROSs
1893  for (map<int, set<int> >::iterator rosBxIds = rosBxIdsPerFED.begin(); rosBxIds != rosBxIdsPerFED.end();
1894  ++rosBxIds) {
1895  (*rosBxIds).second.clear();
1896  }
1897 
1898  fedBXIds.clear();
1899 
1900  for (map<int, set<int> >::iterator rosL1AIds = rosL1AIdsPerFED.begin(); rosL1AIds != rosL1AIdsPerFED.end();
1901  ++rosL1AIds) {
1902  (*rosL1AIds).second.clear();
1903  }
1904 
1905  // reset the error flag
1906  eventErrorFlag = false;
1907 
1908  // Digi collection
1909  edm::Handle<DTDDUCollection> dduProduct;
1910  e.getByToken(dduToken, dduProduct);
1911  edm::Handle<DTROS25Collection> ros25Product;
1912  e.getByToken(ros25Token, ros25Product);
1913 
1914  DTDDUData dduData;
1915  std::vector<DTROS25Data> ros25Data;
1916  if (dduProduct.isValid() && ros25Product.isValid()) {
1917  for (unsigned int i = 0; i < dduProduct->size(); ++i) {
1918  dduData = dduProduct->at(i);
1919  ros25Data = ros25Product->at(i);
1920  // FIXME: passing id variable is not needed anymore - change processFED interface for next release!
1921  FEDHeader header = dduData.getDDUHeader();
1922  int id = header.sourceID();
1923  if (id > FEDIDmax || id < FEDIDmin)
1924  continue; //SIM uses extra FEDs not monitored
1925 
1926  processFED(dduData, ros25Data, id);
1927  for (unsigned int j = 0; j < ros25Data.size(); ++j) {
1928  int rosid = j + 1;
1929  processROS25(ros25Data[j], id, rosid);
1930  }
1931  }
1932  }
1933  }
1934 }
1935 
1936 // Conversions
1937 int DTDataIntegrityTask::theDDU(int crate, int slot, int link, bool tenDDU) {
1938  int ros = theROS(slot, link);
1939 
1940  int ddu = 772;
1941  //if (crate == 1368) { ddu = 775; }
1942  //Needed just in case this FED should be used due to fibers length
1943 
1944  if (crate == FEDNumbering::MINDTUROSFEDID) {
1945  if (slot < 7)
1946  ddu = 770;
1947  else
1948  ddu = 771;
1949  }
1950 
1951  if (crate == (FEDNumbering::MINDTUROSFEDID + 1)) {
1952  ddu = 772;
1953  }
1954 
1955  if (crate == FEDNumbering::MAXDTUROSFEDID) {
1956  if (slot < 7)
1957  ddu = 773;
1958  else
1959  ddu = 774;
1960  }
1961 
1962  if (ros > 6 && tenDDU && ddu < 775)
1963  ddu += 5;
1964 
1965  return ddu;
1966 }
1967 
1968 int DTDataIntegrityTask::theROS(int slot, int link) {
1969  if (slot % 6 == 5)
1970  return link + 1;
1971 
1972  int ros = (link / 24) + 3 * (slot % 6) - 2;
1973  return ros;
1974 }
1975 
1976 // Local Variables:
1977 // show-trailing-whitespace: t
1978 // truncate-lines: t
1979 // End:
std::map< int, std::set< int > > rosBxIdsPerFED
void bookHistosROS(DQMStore::IBooker &, const int wheel, const int ros)
std::multimap< std::string, std::string > names
std::map< int, std::set< int > > rosL1AIdsPerFED
int EventWordCount() const
Definition: DTDDUWords.h:249
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX)
Definition: DQMStore.cc:239
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
const std::vector< DTROBHeader > & getROBHeaders() const
Definition: DTControlData.h:59
std::vector< int > geterrors() const
const std::vector< DTTDCData > & getTDCData() const
Definition: DTControlData.h:62
uint8_t triggerType() const
Event Trigger type identifier.
Definition: FEDHeader.cc:13
MonitorElement * bookFloat(TString const &name)
Definition: DQMStore.cc:233
int outputFifoFull() const
Definition: DTDDUWords.h:688
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
int PC() const
Definition: DTDDUWords.h:487
MonitorElement * hFEDNonFatal
int rosList() const
Definition: DTDDUWords.h:690
void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:418
int getevtlgth() const
int geterrorTDCID(int i) const
void bookHistosuROS(DQMStore::IBooker &, const int fed, const int uRos)
bool check() const
Check that the header is OK.
Definition: FEDHeader.cc:44
int l1AFifoOccupancy() const
Definition: DTDDUWords.h:248
uint16_t sourceID() const
Identifier of the FED.
Definition: FEDHeader.cc:19
void bookHistos(DQMStore::IBooker &, const int fedMin, const int fedMax)
edm::EDGetTokenT< DTuROSFEDDataCollection > fedToken
bool check() const
Check that the trailer is OK.
Definition: FEDTrailer.cc:45
int getROS() const
int busyROSPAF() const
Definition: DTDDUWords.h:692
int l1AIDError() const
Definition: DTDDUWords.h:682
void processuROS(DTuROSROSData &data, int fed, int uRos)
void channelsInROS(int cerosMask, std::vector< int > &channels)
MonitorElement * hFEDFatal
uint32_t fragmentLength() const
The length of the event fragment counted in 64-bit words including header and trailer.
Definition: FEDTrailer.cc:13
static const int DOCESLOTS
LuminosityBlockNumber_t luminosityBlock() const
edm::EDGetTokenT< DTROS25Collection > ros25Token
void Fill(long long x)
const DTLocalTriggerTrailerWord & getSCTrailer() const
Definition: DTControlData.h:67
int warningROSPAF() const
Definition: DTDDUWords.h:691
int getSCID() const
DTDataIntegrityTask(const edm::ParameterSet &ps)
int TTCEventCounter() const
Definition: DTDDUWords.h:213
std::map< std::string, std::map< int, DTTimeEvolutionHisto * > > fedTimeHistos
void processROS25(DTROS25Data &data, int dduID, int ros)
const std::vector< DTROSDebugWord > & getROSDebugs() const
Definition: DTControlData.h:58
const std::vector< DTDDUFirstStatusWord > & getFirstStatusWord() const
std::map< std::string, std::map< int, MonitorElement * > > summaryHistos
int theROS(int slot, int link)
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
const DTROSTrailerWord & getROSTrailer() const
Definition: DTControlData.h:55
const DTROSHeaderWord & getROSHeader() const
Definition: DTControlData.h:56
void beginLuminosityBlock(const edm::LuminosityBlock &ls, const edm::EventSetup &es) override
std::map< unsigned int, MonitorElement * > urosHistos
void analyze(const edm::Event &e, const edm::EventSetup &c) override
int TPX() const
Definition: DTDDUWords.h:247
int getBXId() const
void endLuminosityBlock(const edm::LuminosityBlock &ls, const edm::EventSetup &es) override
DTuROSROSData getuROS(int slot) const
int fifoFull() const
Definition: DTDDUWords.h:684
Definition: value.py:1
int getokxflag(int i) const
bool isValid() const
Definition: HandleBase.h:70
virtual void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
std::map< std::string, std::map< int, MonitorElement * > > fedHistos
#define LogTrace(id)
bool crcErrorBit() const
int getuserWord() const
int getDDUID() const
const FEDTrailer & getDDUTrailer() const
MonitorElement * nEventMonitor
int inputFifoAlmostFull() const
Definition: DTDDUWords.h:687
int robID() const
Definition: DTDDUWords.h:353
def ls(path, rec=False)
Definition: eostools.py:349
int inputFifoFull() const
Definition: DTDDUWords.h:685
std::string topFolder(bool isFEDIntegrity) const
const FEDHeader & getDDUHeader() const
Getters.
uint8_t ttsBits() const
Current value of the Trigger Throttling System bits.
Definition: FEDTrailer.cc:19
MonitorElement * hFEDEntry
void setROB(const int &ID)
std::map< std::string, std::map< int, MonitorElement * > > rosHistos
void setROS(const int &ID)
const std::vector< DTROBTrailerWord > & getROBTrailers() const
Definition: DTControlData.h:60
int getDDU() const
int bxIDError() const
Definition: DTDDUWords.h:683
int getboardId() const
long gettrailer() const
uint16_t bxID() const
The bunch crossing number.
Definition: FEDHeader.cc:17
int geterror(int i) const
int geterrorROBID(int i) const
void processFED(DTuROSFEDData &data, int fed)
void channelsInCEROS(int cerosId, int chMask, std::vector< int > &channels)
int getROB() const
int outputFifoAlmostFull() const
Definition: DTDDUWords.h:689
void setDDU(const int &ID)
need to reset the bits before setting
HLT enums.
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
void bookHistosROS25(DQMStore::IBooker &, DTROChainCoding code)
int getslotsize(int slot) const
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Definition: DQMStore.cc:266
const std::vector< DTROSErrorWord > & getROSErrors() const
Definition: DTControlData.h:57
MonitorElement * hTTSSummary
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
int getslot() const
std::map< std::string, std::map< int, DTTimeEvolutionHisto * > > rosTimeHistos
std::set< int > fedBXIds
int getTTS() const
uint32_t lvl1ID() const
Level-1 event number generated by the TTC system.
Definition: FEDHeader.cc:15
int getnslots() const
int getfed() const
int fifoAlmostFull() const
Definition: DTDDUWords.h:686
const std::vector< DTTDCError > & getTDCError() const
Definition: DTControlData.h:63
const DTDDUSecondStatusWord & getSecondStatusWord() const
int outOfSynchROSError() const
Definition: DTDDUWords.h:693
MonitorElement * hCorruptionSummary
std::map< unsigned int, DTTimeEvolutionHisto * > urosTimeHistos
int bunchID() const
Definition: DTDDUWords.h:355
edm::EDGetTokenT< DTDDUCollection > dduToken
Definition: Run.h:45
int theDDU(int crate, int slot, int link, bool tenDDU)
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
int getROSID() const