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