28 LogTrace(
"DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityUrosOffline")
29 <<
"[DTDataIntegrityUrosOffline]: Constructor" << endl;
42 LogTrace(
"DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityUrosOffline")
43 <<
"[DTDataIntegrityUrosOffline]: Destructor. Analyzed " <<
neventsFED <<
" events" << endl;
44 LogTrace(
"DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityUrosOffline")
45 <<
"[DTDataIntegrityUrosOffline]: postEndJob called!" << endl;
60 LogTrace(
"DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityUrosOffline")
61 <<
"[DTDataIntegrityUrosOffline]: postBeginJob" << endl;
63 LogTrace(
"DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityUrosOffline")
64 <<
"[DTDataIntegrityUrosOffline] Get DQMStore service" << endl;
68 LogTrace(
"DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityUrosOffline")
82 for (
int uRos = 1; uRos <=
NuROS; ++uRos) {
88 for (
int ros = 1; ros <=
NuROS; ++ros) {
101 int nFED = (fedMax - fedMin) + 1;
103 hFEDEntry = ibooker.
book1D(
"FEDEntries",
"# entries per DT FED", nFED, fedMin, fedMax + 1);
105 string histoType =
"ROSSummary";
107 string wheel_s = to_string(
wheel);
108 string histoName =
"ROSSummary_W" + wheel_s;
109 string fed_s = to_string(
FEDIDmin + 1);
114 string histoTitle =
"Summary Wheel" + wheel_s +
" (FED " + fed_s +
")";
118 histo->setBinLabel(1,
"Error 1", 1);
119 histo->setBinLabel(2,
"Error 2", 1);
120 histo->setBinLabel(3,
"Error 3", 1);
121 histo->setBinLabel(4,
"Error 4", 1);
122 histo->setBinLabel(5,
"Not OKflag", 1);
124 histo->setBinLabel(6,
"TDC Fatal", 1);
125 histo->setBinLabel(7,
"TDC RO FIFO ov.", 1);
126 histo->setBinLabel(8,
"TDC L1 buf. ov.", 1);
127 histo->setBinLabel(9,
"TDC L1A FIFO ov.", 1);
128 histo->setBinLabel(10,
"TDC hit err.", 1);
129 histo->setBinLabel(11,
"TDC hit rej.", 1);
131 histo->setBinLabel(1,
"ROS1", 2);
132 histo->setBinLabel(2,
"ROS2", 2);
133 histo->setBinLabel(3,
"ROS3", 2);
134 histo->setBinLabel(4,
"ROS4", 2);
135 histo->setBinLabel(5,
"ROS5", 2);
136 histo->setBinLabel(6,
"ROS6", 2);
137 histo->setBinLabel(7,
"ROS7", 2);
138 histo->setBinLabel(8,
"ROS8", 2);
139 histo->setBinLabel(9,
"ROS9", 2);
140 histo->setBinLabel(10,
"ROS10", 2);
141 histo->setBinLabel(11,
"ROS11", 2);
142 histo->setBinLabel(12,
"ROS12", 2);
147 string wheel =
"ZERO";
152 string fed_s = to_string(fed);
153 LogTrace(
"DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityUrosOffline")
154 <<
" Booking histos for FED: " << fed_s <<
" folder: " <<
folder << endl;
163 ibooker.setCurrentFolder(
topFolder(
false) +
"FED" + fed_s);
165 histoType =
"EventLength";
166 histoName =
"FED" + fed_s +
"_" + histoType;
167 histoTitle =
"Event Length (Bytes) FED " + fed_s;
170 histoType =
"uROSStatus";
171 histoName =
"FED" + fed_s +
"_" + histoType;
175 histo->setBinLabel(1,
"Error G 1", 1);
176 histo->setBinLabel(2,
"Error G 2", 1);
177 histo->setBinLabel(3,
"Error G 3", 1);
178 histo->setBinLabel(4,
"Error G 4", 1);
179 histo->setBinLabel(5,
"Error G 5", 1);
180 histo->setBinLabel(6,
"Error G 6", 1);
181 histo->setBinLabel(7,
"Error G 7", 1);
182 histo->setBinLabel(8,
"Error G 8", 1);
183 histo->setBinLabel(9,
"Error G 9", 1);
184 histo->setBinLabel(10,
"Error G 10", 1);
185 histo->setBinLabel(11,
"Error G 11", 1);
186 histo->setBinLabel(12,
"Error G 12", 1);
188 histo->setBinLabel(1,
"uROS 1", 2);
189 histo->setBinLabel(2,
"uROS 2", 2);
190 histo->setBinLabel(3,
"uROS 3", 2);
191 histo->setBinLabel(4,
"uROS 4", 2);
192 histo->setBinLabel(5,
"uROS 5", 2);
193 histo->setBinLabel(6,
"uROS 6", 2);
194 histo->setBinLabel(7,
"uROS 7", 2);
195 histo->setBinLabel(8,
"uROS 8", 2);
196 histo->setBinLabel(9,
"uROS 9", 2);
197 histo->setBinLabel(10,
"uROS 10", 2);
198 histo->setBinLabel(11,
"uROS 11", 2);
199 histo->setBinLabel(12,
"uROS 12", 2);
204 ibooker.setCurrentFolder(
topFolder(
false));
206 histoType =
"uROSSummary";
207 histoName =
"FED" + fed_s +
"_uROSSummary";
208 string histoTitle =
"Summary Wheel" +
wheel +
" (FED " + fed_s +
")";
214 histo->setBinLabel(1,
"Error G 1", 1);
215 histo->setBinLabel(2,
"Error G 2", 1);
216 histo->setBinLabel(3,
"Error G 3", 1);
217 histo->setBinLabel(4,
"Error G 4", 1);
218 histo->setBinLabel(5,
"Error G 5", 1);
219 histo->setBinLabel(6,
"Error G 6", 1);
220 histo->setBinLabel(7,
"Error G 7", 1);
221 histo->setBinLabel(8,
"Error G 8", 1);
222 histo->setBinLabel(9,
"Error G 9", 1);
223 histo->setBinLabel(10,
"Error G 10", 1);
224 histo->setBinLabel(11,
"Error G 11", 1);
225 histo->setBinLabel(12,
"Error G 12", 1);
227 histo->setBinLabel(1,
"uROS1", 2);
228 histo->setBinLabel(2,
"uROS2", 2);
229 histo->setBinLabel(3,
"uROS3", 2);
230 histo->setBinLabel(4,
"uROS4", 2);
231 histo->setBinLabel(5,
"uROS5", 2);
232 histo->setBinLabel(6,
"uROS6", 2);
233 histo->setBinLabel(7,
"uROS7", 2);
234 histo->setBinLabel(8,
"uROS8", 2);
235 histo->setBinLabel(9,
"uROS9", 2);
236 histo->setBinLabel(10,
"uROS10", 2);
237 histo->setBinLabel(11,
"uROS11", 2);
238 histo->setBinLabel(12,
"uROS12", 2);
243 string wheel_s = to_string(
wheel);
244 string ros_s = to_string(ros);
247 string histoType =
"ROSError";
249 string linkDown_s = to_string(linkDown);
250 int linkUp = linkDown + 24;
251 string linkUp_s = to_string(linkUp);
252 string histoName =
"W" + wheel_s +
"_" +
"ROS" + ros_s +
"_" + histoType;
253 string histoTitle =
histoName +
" (Link " + linkDown_s +
"-" + linkUp_s +
" error summary)";
260 histo->setBinLabel(1,
"Error 1", 1);
261 histo->setBinLabel(2,
"Error 2", 1);
262 histo->setBinLabel(3,
"Error 3", 1);
263 histo->setBinLabel(4,
"Error 4", 1);
264 histo->setBinLabel(5,
"Not OKFlag", 1);
265 for (
int link = linkDown;
link < (linkUp + 1); ++
link) {
266 string link_s = to_string(
link);
267 histo->setBinLabel(
link + 1,
"Link" + link_s, 2);
273 string fed_s = to_string(fed);
274 string uRos_s = to_string(uRos);
281 LogTrace(
"DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityUrosOffline")
282 <<
"[DTDataIntegrityUrosOffline]: " <<
neventsuROS <<
" events analyzed by processuROS" << endl;
288 uROSStatus =
fedHistos[
"uROSStatus"][fed];
291 LogError(
"DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityUrosOffline")
292 <<
"Trying to access non existing ME at FED " << fed << std::endl;
296 unsigned int slotMap = (
data.getboardId()) & 0xF;
299 int ros =
theROS(slotMap, 0);
300 int ddu =
theDDU(fed, slotMap, 0,
false);
301 int wheel = (ddu - 770) % 5 - 2;
310 int errorX[5][12] = {{0}};
318 if ((!uROSError2) || (!uROSError1) || (!uROSError0)) {
319 LogError(
"DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityUrosOffline")
320 <<
"Trying to access non existing ME at uROS " << uRos << std::endl;
334 errorX[
value - 1][ros - 1] += 1;
336 }
else if (
link < 48) {
337 errorX[
value - 1][ros] += 1;
339 }
else if (
link < 72) {
340 errorX[
value - 1][ros + 1] += 1;
363 LogError(
"DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityUrosOffline")
364 <<
"Trying to access non existing ME at uROS " << uRos << std::endl;
376 for (
unsigned int iros = 0; iros < 12; ++iros) {
377 for (
unsigned int bin = 0;
bin < 5; ++
bin) {
378 if (errorX[
bin][iros] != 0)
379 ROSSummary->
Fill(
bin, iros + 1);
392 for (
unsigned int icounter = 0; icounter <
data.geterrors().size(); ++icounter) {
393 int link =
data.geterrorROBID(icounter);
395 int tdcError_ROSSummary = 0;
396 int tdcError_ROSError = 0;
398 if (
error & 0x4000) {
399 LogTrace(
"DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityUrosOffline")
400 <<
" ROS " << uRos <<
" ROB " <<
link <<
" Internal fatal Error 4000 in TDC " <<
error << endl;
402 tdcError_ROSSummary = 5;
403 tdcError_ROSError = 5;
405 }
else if (
error & 0x0249) {
406 LogTrace(
"DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityUrosOffline")
407 <<
" ROS " << uRos <<
" ROB " <<
link <<
" TDC FIFO overflow in TDC " <<
error << endl;
409 tdcError_ROSSummary = 6;
410 tdcError_ROSError = 6;
412 }
else if (
error & 0x0492) {
413 LogTrace(
"DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityUrosOffline")
414 <<
" ROS " << uRos <<
" ROB " <<
link <<
" TDC L1 buffer overflow in TDC " <<
error << endl;
416 tdcError_ROSSummary = 7;
417 tdcError_ROSError = 7;
419 }
else if (
error & 0x2000) {
420 LogTrace(
"DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityUrosOffline")
421 <<
" ROS " << uRos <<
" ROB " <<
link <<
" TDC L1A FIFO overflow in TDC " <<
error << endl;
423 tdcError_ROSSummary = 8;
424 tdcError_ROSError = 8;
426 }
else if (
error & 0x0924) {
427 LogTrace(
"DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityUrosOffline")
428 <<
" uROS " << uRos <<
" ROB " <<
link <<
" TDC hit error in TDC " <<
error << endl;
430 tdcError_ROSSummary = 9;
431 tdcError_ROSError = 9;
433 }
else if (
error & 0x1000) {
434 LogTrace(
"DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityUrosOffline")
435 <<
" uROS " << uRos <<
" ROB " <<
link <<
" TDC hit rejected in TDC " <<
error << endl;
437 tdcError_ROSSummary = 10;
438 tdcError_ROSError = 10;
441 LogWarning(
"DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityUrosOffline")
442 <<
" TDC error code not known " <<
error << endl;
446 ROSSummary->
Fill(tdcError_ROSSummary,
link + 1);
452 ROSSummary->
Fill(tdcError_ROSSummary, ros);
453 uROSError0->
Fill(tdcError_ROSError,
link);
454 }
else if (
link < 48) {
455 ROSSummary->
Fill(tdcError_ROSSummary, ros + 1);
456 uROSError1->
Fill(tdcError_ROSError,
link - 23);
457 }
else if (
link < 72) {
458 ROSSummary->
Fill(tdcError_ROSSummary, ros + 2);
459 uROSError2->
Fill(tdcError_ROSError,
link - 47);
468 LogTrace(
"DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityUrosOffline")
469 <<
"[DTDataIntegrityUrosOffline]: " <<
neventsFED <<
" events analyzed by processFED" << endl;
471 if (fed < FEDIDmin || fed >
FEDIDmax)
477 int fedEvtLength =
data.getevtlgth() * 8;
479 fedHistos[
"EventLength"][fed]->Fill(fedEvtLength);
483 string folder =
"DT/00-DataIntegrity/";
492 LogTrace(
"DTRawToDigi|TDQM|DTMonitorModule|DTDataIntegrityUrosOffline")
493 <<
"[DTDataIntegrityUrosOffline]: preProcessEvent" << endl;
502 for (
unsigned int j = 0;
j < fedCol->size(); ++
j) {
503 fedData = fedCol->at(
j);
504 int fed = fedData.
getfed();
506 LogError(
"DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityUrosOffline")
507 <<
"[DTDataIntegrityUrosOffline]: analyze, FED ID " << fed <<
" not expected." << endl;
512 for (
int slot = 1; slot <=
DOCESLOTS; ++slot) {
513 urosData = fedData.
getuROS(slot);
548 if (ros > 6 && tenDDU && ddu < 775)
558 int ros = (
link / 24) + 3 * (slot % 6) - 2;