34 LogTrace(
"DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask") <<
"[DTDataIntegrityTask]: Constructor" << endl;
54 <<
" invalid! Must be Online, SM or HLT !" << endl
55 <<
" Offline mode is covered on DTDataIntegrityuROSOffline" << endl;
60 <<
" invalid! Must be Online, SM, Offline or HLT !" << endl;
65 LogTrace(
"DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
66 <<
"[DTDataIntegrityTask]: Destructor. Analyzed " <<
neventsFED <<
" events" << endl;
67 LogTrace(
"DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
68 <<
"[DTDataIntegrityTask]: postEndJob called!" << endl;
83 LogTrace(
"DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask") <<
"[DTDataIntegrityTask]: postBeginJob" << endl;
85 LogTrace(
"DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
86 <<
"[DTDataIntegrityTask] Get DQMStore service" << endl;
90 LogTrace(
"DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
105 for (
int uRos = 1; uRos <=
NuROS; ++uRos) {
111 for (
int ros = 1; ros <=
NuROS; ++ros) {
120 ibooker.setCurrentFolder(
"DT/EventInfo/Counters");
121 nEventMonitor = ibooker.bookFloat(
"nProcessedEventsDataIntegrity");
124 ibooker.setCurrentFolder(
topFolder(
true));
126 int nFED = (fedMax - fedMin) + 1;
128 hFEDEntry = ibooker.book1D(
"FEDEntries",
"# entries per DT FED", nFED, fedMin, fedMax + 1);
130 string histoType =
"ROSSummary";
132 string wheel_s = to_string(
wheel);
133 string histoName =
"ROSSummary_W" + wheel_s;
134 string fed_s = to_string(
FEDIDmin + 1);
139 string histoTitle =
"Summary Wheel" + wheel_s +
" (FED " + fed_s +
")";
143 histo->setBinLabel(1,
"Error 1", 1);
144 histo->setBinLabel(2,
"Error 2", 1);
145 histo->setBinLabel(3,
"Error 3", 1);
146 histo->setBinLabel(4,
"Error 4", 1);
147 histo->setBinLabel(5,
"Not OKflag", 1);
149 histo->setBinLabel(6,
"TDC Fatal", 1);
150 histo->setBinLabel(7,
"TDC RO FIFO ov.", 1);
151 histo->setBinLabel(8,
"TDC L1 buf. ov.", 1);
152 histo->setBinLabel(9,
"TDC L1A FIFO ov.", 1);
153 histo->setBinLabel(10,
"TDC hit err.", 1);
154 histo->setBinLabel(11,
"TDC hit rej.", 1);
156 histo->setBinLabel(1,
"ROS1", 2);
157 histo->setBinLabel(2,
"ROS2", 2);
158 histo->setBinLabel(3,
"ROS3", 2);
159 histo->setBinLabel(4,
"ROS4", 2);
160 histo->setBinLabel(5,
"ROS5", 2);
161 histo->setBinLabel(6,
"ROS6", 2);
162 histo->setBinLabel(7,
"ROS7", 2);
163 histo->setBinLabel(8,
"ROS8", 2);
164 histo->setBinLabel(9,
"ROS9", 2);
165 histo->setBinLabel(10,
"ROS10", 2);
166 histo->setBinLabel(11,
"ROS11", 2);
167 histo->setBinLabel(12,
"ROS12", 2);
172 string wheel =
"ZERO";
177 string fed_s = to_string(fed);
178 LogTrace(
"DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
179 <<
" Booking histos for FED: " << fed_s <<
" folder: " <<
folder << endl;
188 ibooker.setCurrentFolder(
topFolder(
false) +
"FED" + fed_s);
190 histoType =
"EventLength";
191 histoName =
"FED" + fed_s +
"_" + histoType;
192 histoTitle =
"Event Length (Bytes) FED " + fed_s;
198 histoType =
"uROSStatus";
199 histoName =
"FED" + fed_s +
"_" + histoType;
203 histo->setBinLabel(1,
"Error G 1", 1);
204 histo->setBinLabel(2,
"Error G 2", 1);
205 histo->setBinLabel(3,
"Error G 3", 1);
206 histo->setBinLabel(4,
"Error G 4", 1);
207 histo->setBinLabel(5,
"Error G 5", 1);
208 histo->setBinLabel(6,
"Error G 6", 1);
209 histo->setBinLabel(7,
"Error G 7", 1);
210 histo->setBinLabel(8,
"Error G 8", 1);
211 histo->setBinLabel(9,
"Error G 9", 1);
212 histo->setBinLabel(10,
"Error G 10", 1);
213 histo->setBinLabel(11,
"Error G 11", 1);
214 histo->setBinLabel(12,
"Error G 12", 1);
216 histo->setBinLabel(1,
"uROS 1", 2);
217 histo->setBinLabel(2,
"uROS 2", 2);
218 histo->setBinLabel(3,
"uROS 3", 2);
219 histo->setBinLabel(4,
"uROS 4", 2);
220 histo->setBinLabel(5,
"uROS 5", 2);
221 histo->setBinLabel(6,
"uROS 6", 2);
222 histo->setBinLabel(7,
"uROS 7", 2);
223 histo->setBinLabel(8,
"uROS 8", 2);
224 histo->setBinLabel(9,
"uROS 9", 2);
225 histo->setBinLabel(10,
"uROS 10", 2);
226 histo->setBinLabel(11,
"uROS 11", 2);
227 histo->setBinLabel(12,
"uROS 12", 2);
232 histoType =
"FEDAvgEvLengthvsLumi";
233 histoName =
"FED" + fed_s +
"_" + histoType;
234 histoTitle =
"Avg Event Length (Bytes) vs LumiSec FED " + fed_s;
237 histoType =
"TTSValues";
238 histoName =
"FED" + fed_s +
"_" + histoType;
241 histo->setBinLabel(1,
"Disconnected", 1);
242 histo->setBinLabel(2,
"Overflow Warning ", 1);
243 histo->setBinLabel(3,
"Out of synch", 1);
244 histo->setBinLabel(4,
"Busy", 1);
245 histo->setBinLabel(5,
"Ready", 1);
246 histo->setBinLabel(6,
"Error", 1);
247 histo->setBinLabel(7,
"Disconnected", 1);
248 histo->setBinLabel(8,
"Unknown", 1);
250 histoType =
"uROSList";
251 histoName =
"FED" + fed_s +
"_" + histoType;
252 histoTitle =
"# of uROS in the FED payload (FED" + fed_s +
")";
257 histoTitle =
"Distrib. BX ID (FED" + fed_s +
")";
263 ibooker.setCurrentFolder(
topFolder(
false));
268 histoType =
"uROSSummary";
269 histoName =
"FED" + fed_s +
"_uROSSummary";
270 string histoTitle =
"Summary Wheel" +
wheel +
" (FED " + fed_s +
")";
276 histo->setBinLabel(1,
"Error G 1", 1);
277 histo->setBinLabel(2,
"Error G 2", 1);
278 histo->setBinLabel(3,
"Error G 3", 1);
279 histo->setBinLabel(4,
"Error G 4", 1);
280 histo->setBinLabel(5,
"Error G 5", 1);
281 histo->setBinLabel(6,
"Error G 6", 1);
282 histo->setBinLabel(7,
"Error G 7", 1);
283 histo->setBinLabel(8,
"Error G 8", 1);
284 histo->setBinLabel(9,
"Error G 9", 1);
285 histo->setBinLabel(10,
"Error G 10", 1);
286 histo->setBinLabel(11,
"Error G 11", 1);
287 histo->setBinLabel(12,
"Error G 12", 1);
289 histo->setBinLabel(1,
"uROS1", 2);
290 histo->setBinLabel(2,
"uROS2", 2);
291 histo->setBinLabel(3,
"uROS3", 2);
292 histo->setBinLabel(4,
"uROS4", 2);
293 histo->setBinLabel(5,
"uROS5", 2);
294 histo->setBinLabel(6,
"uROS6", 2);
295 histo->setBinLabel(7,
"uROS7", 2);
296 histo->setBinLabel(8,
"uROS8", 2);
297 histo->setBinLabel(9,
"uROS9", 2);
298 histo->setBinLabel(10,
"uROS10", 2);
299 histo->setBinLabel(11,
"uROS11", 2);
300 histo->setBinLabel(12,
"uROS12", 2);
305 string wheel_s = to_string(
wheel);
306 string ros_s = to_string(ros);
307 ibooker.setCurrentFolder(
topFolder(
false) +
"Wheel" + wheel_s +
"/ROS" + ros_s);
309 string histoType =
"ROSError";
311 string linkDown_s = to_string(linkDown);
312 int linkUp = linkDown + 24;
313 string linkUp_s = to_string(linkUp);
314 string histoName =
"W" + wheel_s +
"_" +
"ROS" + ros_s +
"_" + histoType;
315 string histoTitle =
histoName +
" (Link " + linkDown_s +
"-" + linkUp_s +
" error summary)";
325 histo->setBinLabel(1,
"Error 1", 1);
326 histo->setBinLabel(2,
"Error 2", 1);
327 histo->setBinLabel(3,
"Error 3", 1);
328 histo->setBinLabel(4,
"Error 4", 1);
329 histo->setBinLabel(5,
"Not OKFlag", 1);
332 histo->setBinLabel(6,
"TDC Fatal", 1);
333 histo->setBinLabel(7,
"TDC RO FIFO ov.", 1);
334 histo->setBinLabel(8,
"TDC L1 buf. ov.", 1);
335 histo->setBinLabel(9,
"TDC L1A FIFO ov.", 1);
336 histo->setBinLabel(10,
"TDC hit err.", 1);
337 histo->setBinLabel(11,
"TDC hit rej.", 1);
339 for (
int link = linkDown;
link < (linkUp + 1); ++
link) {
340 string link_s = to_string(
link);
341 histo->setBinLabel(
link + 1,
"Link" + link_s, 2);
347 histoType =
"TDCError";
349 linkDown_s = to_string(linkDown);
350 linkUp = linkDown + 24;
351 linkUp_s = to_string(linkUp);
352 histoName =
"W" + wheel_s +
"_" +
"ROS" + ros_s +
"_" + histoType;
353 histoTitle =
histoName +
" (Link " + linkDown_s +
"-" + linkUp_s +
" error summary)";
358 histo->setBinLabel(1,
"Fatal", 1);
359 histo->setBinLabel(2,
"RO FIFO ov.", 1);
360 histo->setBinLabel(3,
"L1 buf. ov.", 1);
361 histo->setBinLabel(4,
"L1A FIFO ov.", 1);
362 histo->setBinLabel(5,
"hit err.", 1);
363 histo->setBinLabel(6,
"hit rej.", 1);
364 histo->setBinLabel(7,
"Fatal", 1);
365 histo->setBinLabel(8,
"RO FIFO ov.", 1);
366 histo->setBinLabel(9,
"L1 buf. ov.", 1);
367 histo->setBinLabel(10,
"L1A FIFO ov.", 1);
368 histo->setBinLabel(11,
"hit err.", 1);
369 histo->setBinLabel(12,
"hit rej.", 1);
370 histo->setBinLabel(13,
"Fatal", 1);
371 histo->setBinLabel(14,
"RO FIFO ov.", 1);
372 histo->setBinLabel(15,
"L1 buf. ov.", 1);
373 histo->setBinLabel(16,
"L1A FIFO ov.", 1);
374 histo->setBinLabel(17,
"hit err.", 1);
375 histo->setBinLabel(18,
"hit rej.", 1);
376 histo->setBinLabel(19,
"Fatal", 1);
377 histo->setBinLabel(20,
"RO FIFO ov.", 1);
378 histo->setBinLabel(21,
"L1 buf. ov.", 1);
379 histo->setBinLabel(22,
"L1A FIFO ov.", 1);
380 histo->setBinLabel(23,
"hit err.", 1);
381 histo->setBinLabel(24,
"hit rej.", 1);
383 for (
int link = linkDown;
link < (linkUp + 1); ++
link) {
384 string link_s = to_string(
link);
385 histo->setBinLabel(
link + 1,
"Link" + link_s, 2);
390 string fed_s = to_string(fed);
391 string uRos_s = to_string(uRos);
392 ibooker.setCurrentFolder(
topFolder(
false) +
"FED" + fed_s +
"/uROS" + uRos_s);
397 string histoType =
"uROSEventLength";
398 string histoName =
"FED" + fed_s +
"_uROS" + uRos_s +
"_" +
"EventLength";
399 string histoTitle =
"Event Length (Bytes) FED " + fed_s +
" uROS" + uRos_s;
403 histoType =
"uROSAvgEventLengthvsLumi";
404 histoName =
"FED" + fed_s +
"_ROS" + uRos_s +
"AvgEventLengthvsLumi";
405 histoTitle =
"Event Length (Bytes) FED " + fed_s +
" ROS" + uRos_s;
409 histoType =
"TTSValues";
410 histoName =
"FED" + fed_s +
"_" +
"uROS" + uRos_s +
"_" + histoType;
414 histo->setBinLabel(1,
"Disconnected", 1);
415 histo->setBinLabel(2,
"Overflow Warning ", 1);
416 histo->setBinLabel(3,
"Out of synch", 1);
417 histo->setBinLabel(4,
"Busy", 1);
418 histo->setBinLabel(5,
"Ready", 1);
419 histo->setBinLabel(6,
"Error", 1);
420 histo->setBinLabel(7,
"Disconnected", 1);
421 histo->setBinLabel(8,
"Unknown", 1);
427 LogTrace(
"DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
428 <<
"[DTDataIntegrityTask]: " <<
neventsuROS <<
" events analyzed by processuROS" << endl;
437 uROSStatus =
fedHistos[
"uROSStatus"][fed];
440 LogError(
"DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
441 <<
"Trying to access non existing ME at FED " << fed << std::endl;
445 unsigned int slotMap = (
data.getboardId()) & 0xF;
448 int ros =
theROS(slotMap, 0);
449 int ddu =
theDDU(fed, slotMap, 0,
false);
450 int wheel = (ddu - 770) % 5 - 2;
459 int errorX[5][12] = {{0}};
468 if ((!uROSError2) || (!uROSError1) || (!uROSError0)) {
469 LogError(
"DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
470 <<
"Trying to access non existing ME at uROS " << uRos << std::endl;
484 errorX[
value - 1][ros - 1] += 1;
486 }
else if (
link < 48) {
487 errorX[
value - 1][ros] += 1;
489 }
else if (
link < 72) {
490 errorX[
value - 1][ros + 1] += 1;
513 LogError(
"DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
514 <<
"Trying to access non existing ME at uROS " << uRos << std::endl;
528 for (
unsigned int iros = 0; iros < 12; ++iros) {
529 for (
unsigned int bin = 0;
bin < 5; ++
bin) {
530 if (errorX[
bin][iros] != 0)
531 ROSSummary->
Fill(
bin, iros + 1);
544 for (
unsigned int icounter = 0; icounter <
data.geterrors().size(); ++icounter) {
545 int link =
data.geterrorROBID(icounter);
546 int tdc =
data.geterrorTDCID(icounter);
548 int tdcError_ROSSummary = 0;
549 int tdcError_ROSError = 0;
550 int tdcError_TDCHisto = 0;
552 if (
error & 0x4000) {
553 LogTrace(
"DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
554 <<
" ROS " << uRos <<
" ROB " <<
link <<
" Internal fatal Error 4000 in TDC " <<
error << endl;
556 tdcError_ROSSummary = 5;
557 tdcError_ROSError = 5;
558 tdcError_TDCHisto = 0;
560 }
else if (
error & 0x0249) {
561 LogTrace(
"DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
562 <<
" ROS " << uRos <<
" ROB " <<
link <<
" TDC FIFO overflow in TDC " <<
error << endl;
564 tdcError_ROSSummary = 6;
565 tdcError_ROSError = 6;
566 tdcError_TDCHisto = 1;
568 }
else if (
error & 0x0492) {
569 LogTrace(
"DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
570 <<
" ROS " << uRos <<
" ROB " <<
link <<
" TDC L1 buffer overflow in TDC " <<
error << endl;
572 tdcError_ROSSummary = 7;
573 tdcError_ROSError = 7;
574 tdcError_TDCHisto = 2;
576 }
else if (
error & 0x2000) {
577 LogTrace(
"DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
578 <<
" ROS " << uRos <<
" ROB " <<
link <<
" TDC L1A FIFO overflow in TDC " <<
error << endl;
580 tdcError_ROSSummary = 8;
581 tdcError_ROSError = 8;
582 tdcError_TDCHisto = 3;
584 }
else if (
error & 0x0924) {
585 LogTrace(
"DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
586 <<
" uROS " << uRos <<
" ROB " <<
link <<
" TDC hit error in TDC " <<
error << endl;
588 tdcError_ROSSummary = 9;
589 tdcError_ROSError = 9;
590 tdcError_TDCHisto = 4;
592 }
else if (
error & 0x1000) {
593 LogTrace(
"DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
594 <<
" uROS " << uRos <<
" ROB " <<
link <<
" TDC hit rejected in TDC " <<
error << endl;
596 tdcError_ROSSummary = 10;
597 tdcError_ROSError = 10;
598 tdcError_TDCHisto = 5;
601 LogWarning(
"DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
602 <<
" TDC error code not known " <<
error << endl;
606 ROSSummary->
Fill(tdcError_ROSSummary,
link + 1);
617 ROSSummary->
Fill(tdcError_ROSSummary, ros);
619 ROSSummary->
Fill(tdcError_ROSSummary, ros + 1);
621 ROSSummary->
Fill(tdcError_ROSSummary, ros + 2);
625 uROSError0->
Fill(tdcError_ROSError,
link);
627 uROSError1->
Fill(tdcError_ROSError,
link - 23);
629 uROSError2->
Fill(tdcError_ROSError,
link - 47);
646 int ttsCodeValue = -1;
679 LogError(
"DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
680 <<
"[DTDataIntegrityTask] FED User control: wrong TTS value " <<
value <<
" in FED " << fed <<
" uROS "
689 int uRosEventLength = (
data.gettrailer() & 0xFFFFF) * 8;
692 if (uRosEventLength > 5000)
693 uRosEventLength = 5000;
701 LogTrace(
"DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
702 <<
"[DTDataIntegrityTask]: " <<
neventsFED <<
" events analyzed by processFED" << endl;
704 if (fed < FEDIDmin || fed >
FEDIDmax)
713 int fedEvtLength =
data.getevtlgth() * 8;
715 fedHistos[
"EventLength"][fed]->Fill(fedEvtLength);
720 fedTimeHistos[
"FEDAvgEvLengthvsLumi"][fed]->accumulateValueTimeSlot(fedEvtLength);
732 int ttsCodeValue = -1;
764 LogError(
"DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
765 <<
"[DTDataIntegrityTask] FED TTS control: wrong TTS value " <<
value <<
" in FED " << fed << endl;
770 fedHistos[
"TTSValues"][fed]->Fill(ttsCodeValue);
777 folder =
"DT/00-DataIntegrity/";
787 int lumiBlock =
ls.luminosityBlock();
789 map<string, map<int, DTTimeEvolutionHisto*> >::iterator fedIt =
fedTimeHistos.begin();
790 map<string, map<int, DTTimeEvolutionHisto*> >::iterator fedEnd =
fedTimeHistos.end();
791 for (; fedIt != fedEnd; ++fedIt) {
792 map<int, DTTimeEvolutionHisto*>::iterator histoIt = fedIt->second.begin();
793 map<int, DTTimeEvolutionHisto*>::iterator histoEnd = fedIt->second.end();
794 for (; histoIt != histoEnd; ++histoIt) {
795 histoIt->second->updateTimeSlot(lumiBlock,
nEventsLS);
799 map<unsigned int, DTTimeEvolutionHisto*>::iterator urosIt =
urosTimeHistos.begin();
800 map<unsigned int, DTTimeEvolutionHisto*>::iterator urosEnd =
urosTimeHistos.end();
801 for (; urosIt != urosEnd; ++urosIt) {
802 urosIt->second->updateTimeSlot(lumiBlock,
nEventsLS);
812 LogTrace(
"DTRawToDigi|TDQM|DTMonitorModule|DTDataIntegrityTask") <<
"[DTDataIntegrityTask]: preProcessEvent" << endl;
821 for (
unsigned int j = 0;
j < fedCol->size(); ++
j) {
822 fedData = fedCol->at(
j);
823 int fed = fedData.
getfed();
825 LogError(
"DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
826 <<
"[DTDataIntegrityTask]: analyze, FED ID " << fed <<
" not expected." << endl;
834 for (
int slot = 1; slot <=
DOCESLOTS; ++slot) {
835 urosData = fedData.
getuROS(slot);
870 if (ros > 6 && tenDDU && ddu < 775)
880 int ros = (
link / 24) + 3 * (slot % 6) - 2;