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