CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DTDataIntegrityTask.cc
Go to the documentation of this file.
1 /*
2  * \file DTDataIntegrityTask.cc
3  *
4  * Class for DT Data Integrity
5  * at Online DQM (Single Thread)
6  * expected to monitor uROS
7  * Class with MEs vs Time/LS
8  *
9  * \author Javier Fernandez (Uni. Oviedo)
10  *
11  */
12 
23 
24 #include <cmath>
25 #include <fstream>
26 #include <map>
27 #include <string>
28 #include <vector>
29 
30 using namespace std;
31 using namespace edm;
32 
34  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask") << "[DTDataIntegrityTask]: Constructor" << endl;
35 
36  fedToken = consumes<DTuROSFEDDataCollection>(ps.getParameter<InputTag>("dtFEDlabel"));
39 
40  neventsFED = 0;
41  neventsuROS = 0;
42 
43  fedIntegrityFolder = ps.getUntrackedParameter<string>("fedIntegrityFolder", "DT/FEDIntegrity");
44  nLinksForFatal = ps.getUntrackedParameter<int>("nLinksForFatal", 15); //per wheel
45 
46  string processingMode = ps.getUntrackedParameter<string>("processingMode", "Online");
47 
48  // processing mode flag to select plots to be produced and basedirs CB vedi se farlo meglio...
49  if (processingMode == "Online") {
50  mode = 0;
51  } else if (processingMode == "SM") {
52  mode = 1;
53  } else if (processingMode == "Offline") {
54  mode = 2;
55  } else if (processingMode == "HLT") {
56  mode = 3;
57  } else {
58  throw cms::Exception("MissingParameter") << "[DTDataIntegrityTask]: processingMode :" << processingMode
59  << " invalid! Must be Online, SM, Offline or HLT !" << endl;
60  }
61 }
62 
64  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
65  << "[DTDataIntegrityTask]: Destructor. Analyzed " << neventsFED << " events" << endl;
66  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
67  << "[DTDataIntegrityTask]: postEndJob called!" << endl;
68 }
69 
70 /*
71  Folder Structure uROS:
72  - 3 uROS Summary plots: Wheel-1/-2 (FED1369), Wheel0 (FED1370), Wheel+1/+2 (FED1371)
73  - One folder for each FED
74  - Inside each FED folder the uROSStatus histos, FED histos
75  - One folder for each wheel and the corresponding ROSn folders
76  - Inside each ROS folder the TDC and ROS errors histos, 24 Links/plot
77 */
78 
80  edm::Run const& iRun,
81  edm::EventSetup const& iSetup) {
82  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask") << "[DTDataIntegrityTask]: postBeginJob" << endl;
83 
84  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
85  << "[DTDataIntegrityTask] Get DQMStore service" << endl;
86 
87  // Loop over the DT FEDs
88 
89  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
90  << " FEDS: " << FEDIDmin << " to " << FEDIDmax << " in the RO" << endl;
91 
92  // book FED integrity histos
93  bookHistos(ibooker, FEDIDmin, FEDIDmax);
94 
95  // static booking of the histograms
96 
97  if (mode == 0 || mode == 2) {
98  for (int fed = FEDIDmin; fed <= FEDIDmax; ++fed) { // loop over the FEDs in the readout
99 
100  bookHistos(ibooker, string("FED"), fed);
101 
102  bookHistos(ibooker, string("CRATE"), fed);
103 
104  for (int uRos = 1; uRos <= NuROS; ++uRos) { // loop over all ROS
105  bookHistosuROS(ibooker, fed, uRos);
106  }
107  }
108 
109  for (int wheel = -2; wheel < 3; ++wheel) {
110  for (int ros = 1; ros <= NuROS; ++ros) { // loop over all ROS
111  bookHistosROS(ibooker, wheel, ros);
112  }
113  }
114 
115  } //Not in HLT or SM mode
116 }
117 
118 void DTDataIntegrityTask::bookHistos(DQMStore::IBooker& ibooker, const int fedMin, const int fedMax) {
119  ibooker.setCurrentFolder("DT/EventInfo/Counters");
120  nEventMonitor = ibooker.bookFloat("nProcessedEventsDataIntegrity");
121 
122  // Standard FED integrity histos
123  ibooker.setCurrentFolder(topFolder(true));
124 
125  int nFED = (fedMax - fedMin) + 1;
126 
127  hFEDEntry = ibooker.book1D("FEDEntries", "# entries per DT FED", nFED, fedMin, fedMax + 1);
128  hFEDFatal = ibooker.book1D("FEDFatal", "# fatal errors DT FED", nFED, fedMin, fedMax + 1);
129 
130  if (mode == 1)
131  return; // to avoid duplication in FEDIntegrity_EvF folder
132 
133  string histoType = "ROSSummary";
134  for (int wheel = -2; wheel < 3; ++wheel) {
135  string wheel_s = to_string(wheel);
136  string histoName = "ROSSummary_W" + wheel_s;
137  string fed_s = to_string(FEDIDmin + 1); //3 FEDs from 2018 onwards
138  if (wheel < 0)
139  fed_s = to_string(FEDIDmin);
140  else if (wheel > 0)
141  fed_s = to_string(FEDIDmax);
142  string histoTitle = "Summary Wheel" + wheel_s + " (FED " + fed_s + ")";
143 
144  ((summaryHistos[histoType])[wheel]) = ibooker.book2D(histoName, histoTitle, 11, 0, 11, 12, 1, 13);
145  MonitorElement* histo = ((summaryHistos[histoType])[wheel]);
146  histo->setBinLabel(1, "Error 1", 1);
147  histo->setBinLabel(2, "Error 2", 1);
148  histo->setBinLabel(3, "Error 3", 1);
149  histo->setBinLabel(4, "Error 4", 1);
150  histo->setBinLabel(5, "Not OKflag", 1);
151  // TDC error bins
152  histo->setBinLabel(6, "TDC Fatal", 1);
153  histo->setBinLabel(7, "TDC RO FIFO ov.", 1);
154  histo->setBinLabel(8, "TDC L1 buf. ov.", 1);
155  histo->setBinLabel(9, "TDC L1A FIFO ov.", 1);
156  histo->setBinLabel(10, "TDC hit err.", 1);
157  histo->setBinLabel(11, "TDC hit rej.", 1);
158 
159  histo->setBinLabel(1, "Sector1", 2);
160  histo->setBinLabel(2, "Sector2", 2);
161  histo->setBinLabel(3, "Sector3", 2);
162  histo->setBinLabel(4, "Sector4", 2);
163  histo->setBinLabel(5, "Sector5", 2);
164  histo->setBinLabel(6, "Sector6", 2);
165  histo->setBinLabel(7, "Sector7", 2);
166  histo->setBinLabel(8, "Sector8", 2);
167  histo->setBinLabel(9, "Sector9", 2);
168  histo->setBinLabel(10, "Sector10", 2);
169  histo->setBinLabel(11, "Sector11", 2);
170  histo->setBinLabel(12, "Sector12", 2);
171  }
172 }
173 
174 void DTDataIntegrityTask::bookHistos(DQMStore::IBooker& ibooker, string folder, const int fed) {
175  string wheel = "ZERO";
176  if (fed == FEDIDmin)
177  wheel = "NEG";
178  else if (fed == FEDIDmax)
179  wheel = "POS";
180  string fed_s = to_string(fed);
181  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
182  << " Booking histos for FED: " << fed_s << " folder: " << folder << endl;
183 
184  string histoType;
185  string histoName;
186  string histoTitle;
187  MonitorElement* histo = nullptr;
188 
189  // Crate (old DDU) Histograms
190  if (folder == "CRATE") {
191  ibooker.setCurrentFolder(topFolder(false) + "FED" + fed_s);
192 
193  histoType = "EventLength";
194  histoName = "FED" + fed_s + "_" + histoType;
195  histoTitle = "Event Length (Bytes) FED " + fed_s;
196  (fedHistos[histoType])[fed] = ibooker.book1D(histoName, histoTitle, 501, 0, 30000);
197 
198  if (mode == 3 || mode == 1)
199  return; //Avoid duplication of Info in FEDIntegrity_EvF
200 
201  histoType = "uROSStatus";
202  histoName = "FED" + fed_s + "_" + histoType;
203  (fedHistos[histoType])[fed] = ibooker.book2D(histoName, histoName, 12, 0, 12, 12, 1, 13);
204  histo = (fedHistos[histoType])[fed];
205  // only placeholders for the moment
206  histo->setBinLabel(1, "Error G 1", 1);
207  histo->setBinLabel(2, "Error G 2", 1);
208  histo->setBinLabel(3, "Error G 3", 1);
209  histo->setBinLabel(4, "Error G 4", 1);
210  histo->setBinLabel(5, "Error G 5", 1);
211  histo->setBinLabel(6, "Error G 6", 1);
212  histo->setBinLabel(7, "Error G 7", 1);
213  histo->setBinLabel(8, "Error G 8", 1);
214  histo->setBinLabel(9, "Error G 9", 1);
215  histo->setBinLabel(10, "Error G 10", 1);
216  histo->setBinLabel(11, "Error G 11", 1);
217  histo->setBinLabel(12, "Error G 12", 1);
218 
219  histo->setBinLabel(1, "uROS 1", 2);
220  histo->setBinLabel(2, "uROS 2", 2);
221  histo->setBinLabel(3, "uROS 3", 2);
222  histo->setBinLabel(4, "uROS 4", 2);
223  histo->setBinLabel(5, "uROS 5", 2);
224  histo->setBinLabel(6, "uROS 6", 2);
225  histo->setBinLabel(7, "uROS 7", 2);
226  histo->setBinLabel(8, "uROS 8", 2);
227  histo->setBinLabel(9, "uROS 9", 2);
228  histo->setBinLabel(10, "uROS 10", 2);
229  histo->setBinLabel(11, "uROS 11", 2);
230  histo->setBinLabel(12, "uROS 12", 2);
231 
232  if (mode == 0) { //Info for Online only
233 
234  histoType = "FEDAvgEvLengthvsLumi";
235  histoName = "FED" + fed_s + "_" + histoType;
236  histoTitle = "Avg Event Length (Bytes) vs LumiSec FED " + fed_s;
237  (fedTimeHistos[histoType])[fed] = new DTTimeEvolutionHisto(ibooker, histoName, histoTitle, 200, 10, true, 0);
238 
239  //Not used for the moment due to wrong coding from AMC13
240  /*
241  histoType = "TTSValues";
242  histoName = "FED" + fed_s + "_" + histoType;
243  (fedHistos[histoType])[fed] = ibooker.book1D(histoName, histoName, 6, 0, 6);
244  histo = (fedHistos[histoType])[fed];
245  histo->setBinLabel(1, "Ready", 1);
246  histo->setBinLabel(2, "Overflow Warning ", 1);
247  histo->setBinLabel(3, "Busy", 1);
248  histo->setBinLabel(4, "Sync lost", 1);
249  histo->setBinLabel(5, "Error", 1);
250  histo->setBinLabel(6, "Unknown", 1);
251  */
252  histoType = "uROSList";
253  histoName = "FED" + fed_s + "_" + histoType;
254  histoTitle = "# of uROS in the FED payload (FED" + fed_s + ")";
255  (fedHistos[histoType])[fed] = ibooker.book1D(histoName, histoTitle, 13, 0, 13);
256 
257  histoType = "BXID";
258  histoName = "FED" + fed_s + "_BXID";
259  histoTitle = "Distrib. BX ID (FED" + fed_s + ")";
260  (fedHistos[histoType])[fed] = ibooker.book1D(histoName, histoTitle, 3600, 0, 3600);
261  } // mode == 0 for Online only
262  }
263 
264  // uROS Histograms
265  if (folder == "FED") { // The summary of the error of the ROS on the same FED
266  ibooker.setCurrentFolder(topFolder(false));
267 
268  if (mode == 3 || mode == 1)
269  return; //Avoid duplication of Info in FEDIntegrity_EvF
270 
271  histoType = "uROSSummary";
272  histoName = "FED" + fed_s + "_uROSSummary";
273  string histoTitle = "Summary Wheel" + wheel + " (FED " + fed_s + ")";
274 
275  ((summaryHistos[histoType])[fed]) = ibooker.book2D(histoName, histoTitle, 12, 0, 12, 12, 1, 13);
276  MonitorElement* histo = ((summaryHistos[histoType])[fed]);
277  // ROS error bins
278  // Placeholders for Global Errors for the moment
279  histo->setBinLabel(1, "Error G 1", 1);
280  histo->setBinLabel(2, "Error G 2", 1);
281  histo->setBinLabel(3, "Error G 3", 1);
282  histo->setBinLabel(4, "Error G 4", 1);
283  histo->setBinLabel(5, "Error G 5", 1);
284  histo->setBinLabel(6, "Error G 6", 1);
285  histo->setBinLabel(7, "Error G 7", 1);
286  histo->setBinLabel(8, "Error G 8", 1);
287  histo->setBinLabel(9, "Error G 9", 1);
288  histo->setBinLabel(10, "Error G 10", 1);
289  histo->setBinLabel(11, "Error G 11", 1);
290  histo->setBinLabel(12, "Error G 12", 1);
291 
292  histo->setBinLabel(1, "uROS1", 2);
293  histo->setBinLabel(2, "uROS2", 2);
294  histo->setBinLabel(3, "uROS3", 2);
295  histo->setBinLabel(4, "uROS4", 2);
296  histo->setBinLabel(5, "uROS5", 2);
297  histo->setBinLabel(6, "uROS6", 2);
298  histo->setBinLabel(7, "uROS7", 2);
299  histo->setBinLabel(8, "uROS8", 2);
300  histo->setBinLabel(9, "uROS9", 2);
301  histo->setBinLabel(10, "uROS10", 2);
302  histo->setBinLabel(11, "uROS11", 2);
303  histo->setBinLabel(12, "uROS12", 2);
304  }
305 }
306 
307 void DTDataIntegrityTask::bookHistosROS(DQMStore::IBooker& ibooker, const int wheel, const int ros) {
308  string wheel_s = to_string(wheel);
309  string ros_s = to_string(ros);
310  ibooker.setCurrentFolder(topFolder(false) + "Wheel" + wheel_s + "/Sector" + ros_s);
311 
312  string histoType = "ROSError";
313  int linkDown = 0;
314  string linkDown_s = to_string(linkDown);
315  int linkUp = linkDown + 24;
316  string linkUp_s = to_string(linkUp);
317  string histoName = "W" + wheel_s + "_" + "Sector" + ros_s + "_" + histoType;
318  string histoTitle = histoName + " (Channel " + linkDown_s + "-" + linkUp_s + " error summary)";
319  unsigned int keyHisto = (uROSError)*1000 + (wheel + 2) * 100 + (ros - 1);
320  if (mode < 1) // Online only
321  urosHistos[keyHisto] = ibooker.book2D(histoName, histoTitle, 11, 0, 11, 25, 0, 25);
322  else if (mode > 1)
323  urosHistos[keyHisto] = ibooker.book2D(histoName, histoTitle, 5, 0, 5, 25, 0, 25);
324 
326  // uROS error bins
327  // Placeholders for the moment
328  histo->setBinLabel(1, "Error 1", 1);
329  histo->setBinLabel(2, "Error 2", 1);
330  histo->setBinLabel(3, "Error 3", 1);
331  histo->setBinLabel(4, "Error 4", 1);
332  histo->setBinLabel(5, "Not OKFlag", 1);
333  if (mode < 1) { //Online only
334  // TDC error bins
335  histo->setBinLabel(6, "TDC Fatal", 1);
336  histo->setBinLabel(7, "TDC RO FIFO ov.", 1);
337  histo->setBinLabel(8, "TDC L1 buf. ov.", 1);
338  histo->setBinLabel(9, "TDC L1A FIFO ov.", 1);
339  histo->setBinLabel(10, "TDC hit err.", 1);
340  histo->setBinLabel(11, "TDC hit rej.", 1);
341  }
342  for (int link = linkDown; link < linkUp; ++link) {
343  int sector = ros;
344 
345  int station = int(link / 6) + 1;
346  if (link == 18)
347  station = 3;
348 
349  int rob = link % 6;
350  if (link == 18)
351  rob = 6;
352  else if (link > 18)
353  rob = rob - 1;
354 
355  //Sector 4 exceptions
356  if (ros == 4) {
357  if (link > 18 && link < 22)
358  rob = rob + 2;
359  else if (link == 22 || link == 23) {
360  sector = 13;
361  rob = rob - 1;
362  }
363  }
364 
365  //Sector 9 exceptions
366  if (ros == 9 && (link == 22 || link == 23)) {
367  sector = 13;
368  rob = rob - 3;
369  }
370 
371  //Sector 10 exceptions
372  if (ros == 10) {
373  if (link > 18 && link < 22)
374  sector = 14;
375  else if (link == 22 || link == 23)
376  rob = rob - 3;
377  }
378 
379  //Sector 11 exceptions
380  if (ros == 11 && (link == 22 || link == 23)) {
381  sector = 4;
382  rob = rob - 3;
383  }
384 
385  string sector_s = to_string(sector);
386  string st_s = to_string(station);
387  string rob_s = to_string(rob);
388  histo->setBinLabel(link + 1, "S" + sector_s + " MB" + st_s + " ROB" + rob_s, 2);
389  }
390 
391  int link25 = linkUp;
392  string label25[12] = {"S1 MB4 ROB5",
393  "S2 MB4 ROB5",
394  "S3 MB4 ROB5",
395  "S13 MB4 ROB4",
396  "S5 MB4 ROB5",
397  "S6 MB4 ROB5",
398  "S7 MB4 ROB5",
399  "S8 MB4 ROB5",
400  "S10 MB4 ROB3",
401  "S10 MB4 ROB2",
402  "S14 MB4 ROB3",
403  "S12 MB4 ROB5"};
404  histo->setBinLabel(link25 + 1, label25[ros - 1], 2);
405 
406  if (mode > 1)
407  return;
408 
409  histoType = "TDCError";
410  linkDown = 0;
411  linkDown_s = to_string(linkDown);
412  linkUp = linkDown + 24;
413  linkUp_s = to_string(linkUp);
414  histoName = "W" + wheel_s + "_" + "Sector" + ros_s + "_" + histoType;
415  histoTitle = histoName + " (Channel " + linkDown_s + "-" + linkUp_s + " error summary)";
416  keyHisto = (TDCError)*1000 + (wheel + 2) * 100 + (ros - 1);
417  urosHistos[keyHisto] = ibooker.book2D(histoName, histoTitle, 24, 0, 24, 25, 0, 25);
418  histo = urosHistos[keyHisto];
419  // TDC error bins
420  histo->setBinLabel(1, "Fatal", 1);
421  histo->setBinLabel(2, "RO FIFO ov.", 1);
422  histo->setBinLabel(3, "L1 buf. ov.", 1);
423  histo->setBinLabel(4, "L1A FIFO ov.", 1);
424  histo->setBinLabel(5, "hit err.", 1);
425  histo->setBinLabel(6, "hit rej.", 1);
426  histo->setBinLabel(7, "Fatal", 1);
427  histo->setBinLabel(8, "RO FIFO ov.", 1);
428  histo->setBinLabel(9, "L1 buf. ov.", 1);
429  histo->setBinLabel(10, "L1A FIFO ov.", 1);
430  histo->setBinLabel(11, "hit err.", 1);
431  histo->setBinLabel(12, "hit rej.", 1);
432  histo->setBinLabel(13, "Fatal", 1);
433  histo->setBinLabel(14, "RO FIFO ov.", 1);
434  histo->setBinLabel(15, "L1 buf. ov.", 1);
435  histo->setBinLabel(16, "L1A FIFO ov.", 1);
436  histo->setBinLabel(17, "hit err.", 1);
437  histo->setBinLabel(18, "hit rej.", 1);
438  histo->setBinLabel(19, "Fatal", 1);
439  histo->setBinLabel(20, "RO FIFO ov.", 1);
440  histo->setBinLabel(21, "L1 buf. ov.", 1);
441  histo->setBinLabel(22, "L1A FIFO ov.", 1);
442  histo->setBinLabel(23, "hit err.", 1);
443  histo->setBinLabel(24, "hit rej.", 1);
444 
445  for (int link = linkDown; link < linkUp; ++link) {
446  int sector = ros;
447 
448  int station = int(link / 6) + 1;
449  if (link == 18)
450  station = 3;
451 
452  int rob = link % 6;
453  if (link == 18)
454  rob = 6;
455  else if (link > 18)
456  rob = rob - 1;
457 
458  //Sector 4 exceptions
459  if (ros == 4) {
460  if (link > 18 && link < 22)
461  rob = rob + 2;
462  else if (link == 22 || link == 23) {
463  sector = 13;
464  rob = rob - 1;
465  }
466  }
467 
468  //Sector 9 exceptions
469  if (ros == 9 && (link == 22 || link == 23))
470  rob = rob - 3;
471 
472  //Sector 10 exceptions
473  if (ros == 10) {
474  if (link > 18 && link < 22)
475  sector = 14;
476  else if (link == 22 || link == 23)
477  rob = rob - 3;
478  }
479 
480  //Sector 11 exceptions
481  if (ros == 11 && (link == 22 || link == 23)) {
482  sector = 4;
483  rob = rob - 3;
484  }
485 
486  string sector_s = to_string(sector);
487  string st_s = to_string(station);
488  string rob_s = to_string(rob);
489  histo->setBinLabel(link + 1, "S" + sector_s + " MB" + st_s + " ROB" + rob_s, 2);
490  }
491 
492  link25 = linkUp;
493  histo->setBinLabel(link25 + 1, label25[ros - 1], 2);
494 
495 } //bookHistosROS
496 
497 void DTDataIntegrityTask::bookHistosuROS(DQMStore::IBooker& ibooker, const int fed, const int uRos) {
498  string fed_s = to_string(fed);
499  string uRos_s = to_string(uRos);
500  ibooker.setCurrentFolder(topFolder(false) + "FED" + fed_s + "/uROS" + uRos_s);
501 
502  if (mode >= 1)
503  return;
504 
505  string histoType = "uROSEventLength";
506  string histoName = "FED" + fed_s + "_uROS" + uRos_s + "_" + "EventLength";
507  string histoTitle = "Event Length (Bytes) FED " + fed_s + " uROS" + uRos_s;
508  unsigned int keyHisto = (uROSEventLength)*1000 + (fed - FEDIDmin) * 100 + (uRos - 1);
509  urosHistos[keyHisto] = ibooker.book1D(histoName, histoTitle, 101, 0, 5000);
510 
511  histoType = "uROSAvgEventLengthvsLumi";
512  histoName = "FED" + fed_s + "_ROS" + uRos_s + "AvgEventLengthvsLumi";
513  histoTitle = "Event Length (Bytes) FED " + fed_s + " ROS" + uRos_s;
514  keyHisto = (fed - FEDIDmin) * 100 + (uRos - 1);
515  urosTimeHistos[keyHisto] = new DTTimeEvolutionHisto(ibooker, histoName, histoTitle, 200, 10, true, 0);
516 
517  histoType = "TTSValues";
518  histoName = "FED" + fed_s + "_" + "uROS" + uRos_s + "_" + histoType;
519  keyHisto = TTSValues * 1000 + (fed - FEDIDmin) * 100 + (uRos - 1);
520  urosHistos[keyHisto] = ibooker.book1D(histoName, histoName, 4, 1, 5);
522  histo->setBinLabel(1, "Overflow Warning ", 1);
523  histo->setBinLabel(2, "Busy", 1);
524  histo->setBinLabel(3, "Ready", 1);
525  histo->setBinLabel(4, "Unknown", 1);
526 }
527 
529  neventsuROS++;
530 
531  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
532  << "[DTDataIntegrityTask]: " << neventsuROS << " events analyzed by processuROS" << endl;
533 
534  if (mode == 3) // || mode == 1)
535  return; //Avoid duplication of Info in FEDIntegrity_EvF
536 
537  MonitorElement* uROSSummary = nullptr;
538  MonitorElement* uROSStatus = nullptr;
539 
540  unsigned int slotMap = (data.getboardId()) & 0xF;
541  if (slotMap == 0)
542  return; //prevention for Simulation empty uROS data
543  unsigned int ros = theROS(slotMap, 0); //first sector correspondign to link 0
544  int ddu = theDDU(fed, slotMap, 0, false);
545  int wheel = (ddu - 770) % 5 - 2;
546  int sector4 = 3; //Asymmetry in mapping
547 
548  MonitorElement* ROSSummary = nullptr;
549  ROSSummary = summaryHistos["ROSSummary"][wheel];
550 
551  // Summary of all Link errors
552  MonitorElement* uROSError0 = nullptr;
553  MonitorElement* uROSError1 = nullptr;
554  MonitorElement* uROSError2 = nullptr;
555  MonitorElement* uROSErrorS4 = nullptr;
556 
557  if (mode <= 2) {
558  if (uRos > 2) { //sectors 1-12
559  if (mode != 1) {
560  uROSSummary = summaryHistos["uROSSummary"][fed];
561  uROSStatus = fedHistos["uROSStatus"][fed];
562  if (!uROSSummary) {
563  LogError("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
564  << "Trying to access non existing ME at FED " << fed << std::endl;
565  return;
566  }
567 
568  uROSError0 = urosHistos[(uROSError)*1000 + (wheel + 2) * 100 + (ros - 1)]; //links 0-23
569  uROSError1 = urosHistos[(uROSError)*1000 + (wheel + 2) * 100 + (ros)]; //links 24-47
570  uROSError2 = urosHistos[(uROSError)*1000 + (wheel + 2) * 100 + (ros + 1)]; //links 48-71
571  uROSErrorS4 = urosHistos[(uROSError)*1000 + (wheel + 2) * 100 + 3];
572 
573  if ((!uROSError2) || (!uROSError1) || (!uROSError0)) {
574  LogError("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
575  << "Trying to access non existing ME at uROS " << uRos << std::endl;
576  return;
577  }
578  }
579 
580  // uROS errors
581  for (unsigned int link = 0; link < 72; ++link) {
582  for (unsigned int flag = 0; flag < 5; ++flag) {
583  if ((data.getokxflag(link) >> flag) & 0x1) { // Undefined Flag 1-4 64bits word for each MTP (12 channels)
584  int value = flag;
585 
586  if (flag == 0)
587  value = 5; //move it to the 5th bin
588 
589  if (value > 0) {
590  if (link < 24) {
591  errorX[value - 1][ros - 1][wheel + 2] += 1;
592  if (mode != 1)
593  uROSError0->Fill(value - 1, link); //bins start at 0 despite labeling
594  } else if (link < 48) {
595  if ((link == 46 || link == 57) && ros == 10)
596  errorX[value - 1][sector4][wheel + 2] += 1;
597  else
598  errorX[value - 1][ros][wheel + 2] += 1;
599  if (mode != 1) {
600  if ((link == 46 || link == 57) && ros == 10)
601  uROSErrorS4->Fill(value - 1, link - 24);
602  else
603  uROSError1->Fill(value - 1, link - 24);
604  }
605  } else if (link < 72) {
606  errorX[value - 1][ros + 1][wheel + 2] += 1;
607  if (mode != 1)
608  uROSError2->Fill(value - 1, link - 48);
609  }
610  } //value>0
611  } //flag value
612  } //loop on flags
613  } //loop on links
614  } //uROS>2
615 
616  else { //uRos<3 25th Channel slot
617 
618  for (unsigned int link = 0; link < 12; ++link) {
619  for (unsigned int flag = 0; flag < 5; ++flag) {
620  if ((data.getokxflag(link) >> flag) & 0x1) { // Undefined Flag 1-4 64bits word for each MTP (12 channels)
621  int value = flag;
622  int ch25 = 24;
623  int sector = link + 1;
624  if (flag == 0)
625  value = 5; //move it to the 5th bin
626 
627  if (value > 0) {
628  if (mode != 1) {
629  if (sector == 9)
630  sector = 10;
631  unsigned int keyHisto =
632  (uROSError)*1000 + (wheel + 2) * 100 + abs(sector - 1); //ros -1 = link in this case
633  uROSError0 = urosHistos[keyHisto];
634  if (!uROSError0) {
635  LogError("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
636  << "Trying to access non existing ME at uROS " << uRos << std::endl;
637  return;
638  }
639  }
640  errorX[value - 1][sector - 1][wheel + 2] += 1; // ros-1=link in this case
641  if (mode != 1)
642  uROSError0->Fill(value - 1, ch25); //bins start at 0 despite labeling, this is the old SC
643  }
644  } //flag values
645  } //loop on flags
646  } //loop on links
647  } //else uRos<3
648 
649  } //mode<=2
650 
651  if (mode != 1) {
652  // Fill the ROSSummary (1 per wheel) histo
653  for (unsigned int iros = ros - 1; iros < (ros + 2); ++iros) {
654  for (unsigned int bin = 0; bin < 5; ++bin) {
655  if (errorX[bin][iros][wheel + 2] != 0) {
656  ROSSummary->Fill(bin, iros + 1, errorX[bin][iros][wheel + 2]); //bins start at 1
657  }
658  }
659  }
660 
661  // Global Errors for uROS
662  for (unsigned int flag = 4; flag < 16; ++flag) {
663  if ((data.getuserWord() >> flag) & 0x1) {
664  uROSSummary->Fill(flag - 4, uRos);
665  uROSStatus->Fill(flag - 4, uRos); //duplicated info?
666  }
667  }
668  }
669 
670  // ROS error
671  for (unsigned int icounter = 0; icounter < data.geterrors().size(); ++icounter) {
672  int link = data.geterrorROBID(icounter);
673  int tdc = data.geterrorTDCID(icounter);
674  int error = data.geterror(icounter);
675  int tdcError_ROSSummary = 0;
676  int tdcError_ROSError = 0;
677  int tdcError_TDCHisto = 0;
678 
679  if (error & 0x4000) {
680  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
681  << " ROS " << uRos << " ROB " << link << " Internal fatal Error 4000 in TDC " << error << endl;
682 
683  tdcError_ROSSummary = 5;
684  tdcError_ROSError = 5;
685  tdcError_TDCHisto = 0;
686 
687  } else if (error & 0x0249) {
688  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
689  << " ROS " << uRos << " ROB " << link << " TDC FIFO overflow in TDC " << error << endl;
690 
691  tdcError_ROSSummary = 6;
692  tdcError_ROSError = 6;
693  tdcError_TDCHisto = 1;
694 
695  } else if (error & 0x0492) {
696  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
697  << " ROS " << uRos << " ROB " << link << " TDC L1 buffer overflow in TDC " << error << endl;
698 
699  tdcError_ROSSummary = 7;
700  tdcError_ROSError = 7;
701  tdcError_TDCHisto = 2;
702 
703  } else if (error & 0x2000) {
704  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
705  << " ROS " << uRos << " ROB " << link << " TDC L1A FIFO overflow in TDC " << error << endl;
706 
707  tdcError_ROSSummary = 8;
708  tdcError_ROSError = 8;
709  tdcError_TDCHisto = 3;
710 
711  } else if (error & 0x0924) {
712  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
713  << " uROS " << uRos << " ROB " << link << " TDC hit error in TDC " << error << endl;
714 
715  tdcError_ROSSummary = 9;
716  tdcError_ROSError = 9;
717  tdcError_TDCHisto = 4;
718 
719  } else if (error & 0x1000) {
720  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
721  << " uROS " << uRos << " ROB " << link << " TDC hit rejected in TDC " << error << endl;
722 
723  tdcError_ROSSummary = 10;
724  tdcError_ROSError = 10;
725  tdcError_TDCHisto = 5;
726 
727  } else {
728  LogWarning("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
729  << " TDC error code not known " << error << endl;
730  }
731 
732  if (uRos < 3) {
733  int sector = link + 1;
734  errorX[5][link][wheel + 2] += 1;
735  if (mode != 1) {
736  if (sector == 9)
737  sector = 10;
738  ROSSummary->Fill(tdcError_ROSSummary, sector - 1); //link 0 = ROS 1
739  int ch25 = 24;
740  if (mode <= 2) {
741  urosHistos[(uROSError)*1000 + (wheel + 2) * 100 + (sector - 1)]->Fill(tdcError_ROSError, ch25);
742  if (mode < 1)
743  urosHistos[(TDCError)*1000 + (wheel + 2) * 100 + (sector - 1)]->Fill(tdcError_TDCHisto + 6 * tdc,
744  ch25); // ros-1=link in this case
745  } //mode <= 2
746  } //mode!=1
747  } //uRos<3
748  else { //uRos>2
749  if (link < 24) {
750  errorX[5][ros - 1][wheel + 2] += 1;
751  if (mode != 1)
752  ROSSummary->Fill(tdcError_ROSSummary, ros);
753  } else if (link < 48) {
754  if ((link == 46 || link == 57) && ros == 10)
755  errorX[5][sector4][wheel + 2] += 1;
756  else
757  errorX[5][ros][wheel + 2] += 1;
758  if (mode != 1) {
759  if ((link == 46 || link == 57) && ros == 10)
760  ROSSummary->Fill(tdcError_ROSSummary, sector4);
761  else
762  ROSSummary->Fill(tdcError_ROSSummary, ros + 1);
763  }
764  } else if (link < 72) {
765  errorX[5][ros + 1][wheel + 2] += 1;
766  if (mode != 1)
767  ROSSummary->Fill(tdcError_ROSSummary, ros + 2);
768  }
769 
770  if (mode <= 2 && mode != 1) {
771  if (link < 24)
772  uROSError0->Fill(tdcError_ROSError, link);
773  else if (link < 48)
774  if ((link == 46 || link == 57) && ros == 10)
775  uROSError1->Fill(tdcError_ROSError, sector4);
776  else
777  uROSError1->Fill(tdcError_ROSError, link - 24);
778  else if (link < 72)
779  uROSError2->Fill(tdcError_ROSError, link - 48);
780 
781  if (mode < 1) {
782  if (link < 24)
783  urosHistos[(TDCError)*1000 + (wheel + 2) * 100 + (ros - 1)]->Fill(tdcError_TDCHisto + 6 * tdc, link);
784  else if (link < 48)
785  urosHistos[(TDCError)*1000 + (wheel + 2) * 100 + (ros)]->Fill(tdcError_TDCHisto + 6 * tdc, link - 24);
786  else if (link < 72)
787  urosHistos[(TDCError)*1000 + (wheel + 2) * 100 + (ros + 1)]->Fill(tdcError_TDCHisto + 6 * tdc, link - 48);
788 
789  } //mode<1
790  } //mode<=2 && mode != 1
791  } //uROS>2
792  } //loop on errors
793 
794  // 1D histograms for TTS values per uROS
795  if (mode < 1) {
796  int ttsCodeValue = -1;
797  int value = (data.getuserWord() & 0xF);
798  switch (value) {
799  case 1: { //warning overflow
800  ttsCodeValue = 1;
801  break;
802  }
803  case 4: { //busy
804  ttsCodeValue = 2;
805  break;
806  }
807  case 8: { //ready
808  ttsCodeValue = 3;
809  break;
810  }
811  default: {
812  LogError("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
813  << "[DTDataIntegrityTask] FED User control: wrong TTS value " << value << " in FED " << fed << " uROS "
814  << uRos << endl;
815  ttsCodeValue = 4;
816  }
817  }
818 
819  urosHistos[TTSValues * 1000 + (fed - FEDIDmin) * 100 + (uRos - 1)]->Fill(ttsCodeValue);
820 
821  // Plot the event length //NOHLT
822  int uRosEventLength = (data.gettrailer() & 0xFFFFF) * 8;
823  urosTimeHistos[(fed - FEDIDmin) * 100 + (uRos - 1)]->accumulateValueTimeSlot(uRosEventLength);
824 
825  if (uRosEventLength > 5000)
826  uRosEventLength = 5000;
827  urosHistos[uROSEventLength * 1000 + (fed - FEDIDmin) * 100 + (uRos - 1)]->Fill(uRosEventLength);
828  }
829 }
830 
832  neventsFED++;
833  if (neventsFED % 1000 == 0)
834  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
835  << "[DTDataIntegrityTask]: " << neventsFED << " events analyzed by processFED" << endl;
836 
837  if (fed < FEDIDmin || fed > FEDIDmax)
838  return;
839 
840  hFEDEntry->Fill(fed);
841 
842  if (mode == 3)
843  return; //Avoid duplication of Info in FEDIntegrity_EvF
844 
845  if (mode != 1) {
846  //1D HISTOS: EVENT LENGHT from trailer
847  int fedEvtLength = data.getevtlgth() * 8; //1 word = 8 bytes
848  // if(fedEvtLength > 16000) fedEvtLength = 16000; // overflow bin
849  fedHistos["EventLength"][fed]->Fill(fedEvtLength);
850 
851  if (mode == 0) {
852  fedTimeHistos["FEDAvgEvLengthvsLumi"][fed]->accumulateValueTimeSlot(fedEvtLength);
853 
854  // fill the distribution of the BX ids
855  fedHistos["BXID"][fed]->Fill(data.getBXId());
856 
857  // size of the list of ROS in the Read-Out
858  fedHistos["uROSList"][fed]->Fill(data.getnslots());
859  }
860 
861  } //mode != 1
862 
863  // Fill the status summary of the TTS
864 
865  //1D HISTO WITH TTS VALUES form trailer
866  //Not used for the moment due to wrong coding from AMC13
867  /*
868  int ttsCodeValue = -1;
869  int value = data.getTTS();
870  switch (value) {
871  case 0: { //ready
872  ttsCodeValue = 0;
873  break;
874  }
875  case 1: { //warning overflow
876  ttsCodeValue = 1;
877  break;
878  }
879  case 2: { //busy
880  ttsCodeValue = 2;
881  break;
882  }
883  case 4: { //synch lost
884  ttsCodeValue = 3;
885  break;
886  }
887  case 8: { //error
888  ttsCodeValue = 4;
889  break;
890  }
891  default: {
892  LogError("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
893  << "[DTDataIntegrityTask] FED TTS control: wrong TTS value " << value << " in FED " << fed << endl;
894  ttsCodeValue = 5;
895  }
896  }
897  if (mode < 1)
898  fedHistos["TTSValues"][fed]->Fill(ttsCodeValue);
899  */
900 
901  //FEDFatal definition per wheel: 5*TDCFatal/6000 + 5*NotOKFlag/1500
902  int wheel = 0;
903  if (fed == FEDIDmin)
904  wheel = -2;
905  else if (fed == FEDIDmax)
906  wheel = 1;
907 
908  float sumTDC = 0., sumNotOKFlag = 0.;
909  for (int ros = 0; ros < 12; ros++) {
910  sumNotOKFlag += errorX[4][ros][wheel + 2];
911  sumTDC += errorX[5][ros][wheel + 2];
912  }
913 
914  if (wheel != 0) { // consider both wheels for FEDs 1369 & 1371
915  wheel += 1;
916  for (int ros = 0; ros < 12; ros++) {
917  sumNotOKFlag += errorX[4][ros][wheel + 2];
918  sumTDC += errorX[5][ros][wheel + 2];
919  }
920  }
921 
922  //Divide by 2 for egde FEDs to normalize per wheel
923  sumNotOKFlag = sumNotOKFlag / ((wheel != 0) ? 2. : 1.);
924  sumTDC = sumTDC / ((wheel != 0) ? 2. : 1.);
925 
926  if (sumNotOKFlag > nLinksForFatal || sumTDC > nLinksForFatal)
927  hFEDFatal->Fill(fed);
928 }
929 
930 std::string DTDataIntegrityTask::topFolder(bool isFEDIntegrity) const {
931  string folder = isFEDIntegrity ? fedIntegrityFolder : "DT/00-DataIntegrity/";
932 
933  if (mode == 0)
934  folder = "DT/00-DataIntegrity/"; //Move everything from FEDIntegrity except for SM and HLT modes
935 
936  return folder;
937 }
938 
940  const edm::EventSetup& es) const {
941  nEventsLS = 0;
942  return std::shared_ptr<dtdi::Void>();
943 }
944 
946  int lumiBlock = ls.id().luminosityBlock();
947 
948  map<string, map<int, DTTimeEvolutionHisto*> >::iterator fedIt = fedTimeHistos.begin();
949  map<string, map<int, DTTimeEvolutionHisto*> >::iterator fedEnd = fedTimeHistos.end();
950  for (; fedIt != fedEnd; ++fedIt) {
951  map<int, DTTimeEvolutionHisto*>::iterator histoIt = fedIt->second.begin();
952  map<int, DTTimeEvolutionHisto*>::iterator histoEnd = fedIt->second.end();
953  for (; histoIt != histoEnd; ++histoIt) {
954  histoIt->second->updateTimeSlot(lumiBlock, nEventsLS);
955  }
956  }
957 
958  map<unsigned int, DTTimeEvolutionHisto*>::iterator urosIt = urosTimeHistos.begin();
959  map<unsigned int, DTTimeEvolutionHisto*>::iterator urosEnd = urosTimeHistos.end();
960  for (; urosIt != urosEnd; ++urosIt) {
961  urosIt->second->updateTimeSlot(lumiBlock, nEventsLS);
962  }
963 }
964 
966  nevents++;
968  nEventsLS++;
969 
970  //errorX[6][12][5] = {0}; //5th is notOK flag and 6th is TDC Fatal; ros; wheel
971  fill(&errorX[0][0][0], &errorX[0][0][0] + 360, 0);
972 
973  LogTrace("DTRawToDigi|TDQM|DTMonitorModule|DTDataIntegrityTask") << "[DTDataIntegrityTask]: preProcessEvent" << endl;
974 
975  // Digi collection
977  e.getByToken(fedToken, fedCol);
978  DTuROSFEDData fedData;
979  DTuROSROSData urosData;
980 
981  if (fedCol.isValid()) {
982  for (unsigned int j = 0; j < fedCol->size(); ++j) {
983  fedData = fedCol->at(j);
984  int fed = fedData.getfed(); //argument should be void
985  if (fed > FEDIDmax || fed < FEDIDmin) {
986  LogError("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
987  << "[DTDataIntegrityTask]: analyze, FED ID " << fed << " not expected." << endl;
988  continue;
989  }
990 
991  if (mode == 3)
992  continue; //Not needed for FEDIntegrity_EvF
993 
994  for (int slot = 1; slot <= DOCESLOTS; ++slot) {
995  urosData = fedData.getuROS(slot);
996  if (fedData.getslotsize(slot) == 0 || urosData.getslot() == -1)
997  continue;
998  processuROS(urosData, fed, slot);
999  }
1000  processFED(fedData, fed);
1001  }
1002  }
1003 }
1004 
1005 // Conversions
1006 int DTDataIntegrityTask::theDDU(int crate, int slot, int link, bool tenDDU) {
1007  int ros = theROS(slot, link);
1008 
1009  int ddu = 772;
1010  //if (crate == 1368) { ddu = 775; }
1011  //Needed just in case this FED should be used due to fibers length
1012 
1013  if (crate == FEDNumbering::MINDTUROSFEDID) {
1014  if (slot < 7)
1015  ddu = 770;
1016  else
1017  ddu = 771;
1018  }
1019 
1020  if (crate == (FEDNumbering::MINDTUROSFEDID + 1)) {
1021  ddu = 772;
1022  }
1023 
1024  if (crate == FEDNumbering::MAXDTUROSFEDID) {
1025  if (slot < 7)
1026  ddu = 773;
1027  else
1028  ddu = 774;
1029  }
1030 
1031  if (ros > 6 && tenDDU && ddu < 775)
1032  ddu += 5;
1033 
1034  return ddu;
1035 }
1036 
1037 int DTDataIntegrityTask::theROS(int slot, int link) {
1038  if (slot % 6 == 5)
1039  return link + 1;
1040 
1041  int ros = (link / 24) + 3 * (slot % 6) - 2;
1042  return ros;
1043 }
1044 
1045 // Local Variables:
1046 // show-trailing-whitespace: t
1047 // truncate-lines: t
1048 // End:
void bookHistosROS(DQMStore::IBooker &, const int wheel, const int ros)
LuminosityBlockID id() const
T getUntrackedParameter(std::string const &, T const &) const
std::vector< int > geterrors() const
MonitorElement * bookFloat(TString const &name, FUNC onbooking=NOOP())
Definition: DQMStore.h:80
const edm::EventSetup & c
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
string keyHisto
Definition: plotFactory.py:80
int getevtlgth() const
int geterrorTDCID(int i) const
void bookHistosuROS(DQMStore::IBooker &, const int fed, const int uRos)
def ls
Definition: eostools.py:349
void bookHistos(DQMStore::IBooker &, const int fedMin, const int fedMax)
edm::EDGetTokenT< DTuROSFEDDataCollection > fedToken
void globalEndLuminosityBlock(const edm::LuminosityBlock &ls, const edm::EventSetup &es) override
Log< level::Error, false > LogError
void processuROS(DTuROSROSData &data, int fed, int uRos)
MonitorElement * hFEDFatal
#define LogTrace(id)
static const int DOCESLOTS
std::shared_ptr< dtdi::Void > globalBeginLuminosityBlock(const edm::LuminosityBlock &ls, const edm::EventSetup &es) const override
void Fill(long long x)
DTDataIntegrityTask(const edm::ParameterSet &ps)
std::map< std::string, std::map< int, DTTimeEvolutionHisto * > > fedTimeHistos
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)
std::map< unsigned int, MonitorElement * > urosHistos
void analyze(const edm::Event &e, const edm::EventSetup &c) override
int getBXId() const
DTuROSROSData getuROS(int slot) const
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int getokxflag(int i) const
bool isValid() const
Definition: HandleBase.h:70
virtual void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
std::map< std::string, std::map< int, MonitorElement * > > fedHistos
int getuserWord() const
MonitorElement * nEventMonitor
std::string topFolder(bool isFEDIntegrity) const
void fill(std::map< std::string, TH1 * > &h, const std::string &s, double x)
MonitorElement * hFEDEntry
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:177
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
LuminosityBlockNumber_t luminosityBlock() const
int getboardId() const
long gettrailer() const
int geterror(int i) const
int geterrorROBID(int i) const
void processFED(DTuROSFEDData &data, int fed)
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
int getslotsize(int slot) const
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
int getslot() const
int getnslots() const
Log< level::Warning, false > LogWarning
int getfed() const
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
std::map< unsigned int, DTTimeEvolutionHisto * > urosTimeHistos
Definition: Run.h:45
int theDDU(int crate, int slot, int link, bool tenDDU)