33 LogTrace(
"DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
34 <<
"[DTDataIntegrityTask]: Constructor" <<endl;
63 if (processingMode ==
"Online") {
65 }
else if(processingMode ==
"SM") {
67 }
else if (processingMode ==
"Offline") {
69 }
else if (processingMode ==
"HLT") {
73 <<
"[DTDataIntegrityTask]: processingMode :" << processingMode
74 <<
" invalid! Must be Online, SM, Offline or HLT !" << endl;
81 LogTrace(
"DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
82 <<
"[DTDataIntegrityTask]: Destructor. Analyzed "<<
neventsFED <<
" events"<<endl;
83 LogTrace(
"DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
84 <<
"[DTDataIntegrityTask]: postEndJob called!" <<endl;
105 LogTrace(
"DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask") <<
"[DTDataIntegrityTask]: postBeginJob" <<endl;
107 LogTrace(
"DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask") <<
"[DTDataIntegrityTask] Get DQMStore service" << endl;
111 LogTrace(
"DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
127 for(
int uRos = 1; uRos <=
NuROS; ++uRos) {
133 for(
int ros = 1; ros <=
NuROS; ++ros) {
153 for(
int ros = 1; ros <=
NuROS; ++ros) {
170 int nFED = (fedMax - fedMin)+1;
172 hFEDEntry = ibooker.
book1D(
"FEDEntries",
"# entries per DT FED",nFED,fedMin,fedMax+1);
178 hFEDFatal = ibooker.
book1D(
"FEDFatal",
"# fatal errors DT FED",nFED,fedMin,fedMax+1);
179 hFEDNonFatal = ibooker.
book1D(
"FEDNonFatal",
"# NON fatal errors DT FED",nFED,fedMin,fedMax+1);
183 string histoType =
"ROSSummary";
185 string wheel_s = to_string(
wheel);
186 string histoName =
"ROSSummary_W"+wheel_s;
187 string fed_s = to_string(
FEDIDmin+1);
190 string histoTitle =
"Summary Wheel" + wheel_s +
" (FED " + fed_s +
")";
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);
229 hTTSSummary = ibooker.
book2D(
"TTSSummary",
"Summary Status TTS",nFED,fedMin,fedMax+1,9,1,10);
243 nFED,fedMin,fedMax+1, 8, 1, 9);
259 string wheel =
"ZERO";
262 string fed_s = to_string(fed);
263 LogTrace(
"DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
264 <<
" Booking histos for FED: " << fed_s
265 <<
" folder: " <<
folder << endl;
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);
284 histoType =
"uROSStatus";
285 histoName =
"FED" + fed_s +
"_" + histoType;
286 (
fedHistos[histoType])[fed] = ibooker.
book2D(histoName,histoName,12,0,12,12,1,13);
317 histoType =
"FEDAvgEvLengthvsLumi";
318 histoName =
"FED" + fed_s +
"_" + histoType;
319 histoTitle =
"Avg Event Length (Bytes) vs LumiSec FED " + fed_s;
322 histoType =
"TTSValues";
323 histoName =
"FED" + fed_s +
"_" + histoType;
324 (
fedHistos[histoType])[fed] = ibooker.
book1D(histoName,histoName,8,0,8);
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);
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);
353 histoType =
"uROSSummary";
354 histoName =
"FED" + fed_s +
"_uROSSummary";
355 string histoTitle =
"Summary Wheel" + wheel +
" (FED " + fed_s +
")";
397 string dduID_s = to_string(code.
getDDU());
398 string rosID_s = to_string(code.
getROS());
399 string robID_s = to_string(code.
getROB());
401 string wheel_s = to_string(wheel);
403 LogTrace(
"DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
404 <<
" Booking histos for FED: " << code.
getDDU() <<
" ROS: " << code.
getROS()
405 <<
" ROB: " << code.
getROB() <<
" folder: " <<
folder << endl;
417 histoType =
"EventLength";
418 histoName =
"FED" + dduID_s +
"_" + histoType;
419 histoTitle =
"Event Length (Bytes) FED " + dduID_s;
424 histoType =
"ROSStatus";
425 histoName =
"FED" + dduID_s +
"_" + histoType;
456 histoType =
"FEDAvgEvLengthvsLumi";
457 histoName =
"FED" + dduID_s +
"_" + histoType;
458 histoTitle =
"Avg Event Length (Bytes) vs LumiSec FED " + dduID_s;
461 histoType =
"TTSValues";
462 histoName =
"FED" + dduID_s +
"_" + histoType;
474 histoType =
"EventType";
475 histoName =
"FED" + dduID_s +
"_" + histoType;
481 histoType =
"ROSList";
482 histoName =
"FED" + dduID_s +
"_" + histoType;
483 histoTitle =
"# of ROS in the FED payload (FED" + dduID_s +
")";
486 histoType =
"FIFOStatus";
487 histoName =
"FED" + dduID_s +
"_" + histoType;
502 histoName =
"FED" + dduID_s +
"_BXID";
503 histoTitle =
"Distrib. BX ID (FED" + dduID_s +
")";
509 if (
folder ==
"ROS_S" ) {
514 histoType =
"ROSSummary";
515 histoName =
"FED" + dduID_s +
"_ROSSummary";
516 string histoTitle =
"Summary Wheel" + wheel_s +
" (FED " + dduID_s +
")";
562 histoType =
"ROSError";
563 histoName =
"FED" + dduID_s +
"_" +
folder + rosID_s +
"_ROSError";
564 histoTitle = histoName +
" (ROBID error summary)";
621 histoType =
"ROSEventLength";
622 histoName =
"FED" + dduID_s +
"_" +
folder + rosID_s +
"_ROSEventLength";
623 histoTitle =
"Event Length (Bytes) FED " + dduID_s +
" ROS " + rosID_s;
626 histoType =
"ROSAvgEventLengthvsLumi";
627 histoName =
"FED" + dduID_s +
"_" +
folder + rosID_s + histoType;
628 histoTitle =
"Event Length (Bytes) FED " + dduID_s +
" ROS " + rosID_s;
631 histoType =
"TDCError";
632 histoName =
"FED" + dduID_s +
"_" +
folder + rosID_s +
"_TDCError";
633 histoTitle = histoName +
" (ROBID error summary)";
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)));
705 histoType =
"SCSizeVsROSSize";
706 histoName =
"FED" + dduID_s +
"_SCSizeVsROSSize";
707 histoTitle =
"SC size vs SC (FED " + dduID_s +
")";
726 string wheel_s = to_string(wheel);
727 string ros_s = to_string(ros);
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)";
758 for (
int link=linkDown; link < (linkUp+1); ++link){
759 string link_s = to_string(link);
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);
801 for (
int link=linkDown; link < (linkUp+1); ++link){
802 string link_s = to_string(link);
808 string fed_s = to_string(fed);
809 string uRos_s = to_string(uRos);
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;
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);
826 histoType =
"TTSValues";
827 histoName =
"FED" + fed_s +
"_" +
"uROS" + uRos_s +
"_" + histoType;
848 LogTrace(
"DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
849 <<
"[DTDataIntegrityTask]: " <<
neventsuROS <<
" events analyzed by processuROS" << endl;
857 uROSStatus =
fedHistos[
"uROSStatus"][fed];
860 LogError(
"DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask") <<
861 "Trying to access non existing ME at FED " << fed <<
866 unsigned int slotMap = ( data.
getboardId() ) & 0xF;
867 if (slotMap==0)
return;
868 int ros =
theROS(slotMap, 0);
869 int ddu =
theDDU(fed, slotMap, 0,
false);
870 int wheel = (ddu - 770)%5 - 2;
879 int errorX[5][12]={{0}};
889 if ((!uROSError2) || (!uROSError1) || (!uROSError0) ) {
890 LogError(
"DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask") <<
891 "Trying to access non existing ME at uROS " << uRos <<
897 for (
unsigned int link = 0; link<72; ++link){
901 if (
flag==0) value=5;
905 errorX[value-1][ros-1]+=1;
906 uROSError0->
Fill(value-1,link);
909 errorX[value-1][ros]+=1;
910 uROSError1->Fill(value-1,link-23);
913 errorX[value-1][ros+1]+=1;
914 uROSError2->Fill(value-1,link-47);
924 for (
unsigned int link = 0; link<12; ++link){
929 if (
flag==0) value=5;
935 LogError(
"DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask") <<
936 "Trying to access non existing ME at uROS " << uRos <<
940 errorX[value-1][link]+=1;
941 uROSError0->
Fill(value-1,sc);
951 for (
unsigned int iros = 0; iros<12;++iros){
953 if(errorX[
bin][iros]!=0) ROSSummary->
Fill(
bin, iros+1);
966 for (
unsigned int icounter = 0; icounter<data.
geterrors().size(); ++icounter){
970 int tdcError_ROSSummary = 0;
971 int tdcError_ROSError = 0;
972 int tdcError_TDCHisto = 0;
974 if(error & 0x4000 ) {
975 LogTrace(
"DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
976 <<
" ROS " << uRos <<
" ROB " << link
977 <<
" Internal fatal Error 4000 in TDC " << error << endl;
979 tdcError_ROSSummary = 5;
980 tdcError_ROSError = 5;
981 tdcError_TDCHisto = 0;
983 }
else if ( error & 0x0249 ) {
984 LogTrace(
"DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
985 <<
" ROS " << uRos <<
" ROB " << link
986 <<
" TDC FIFO overflow in TDC " << error << endl;
988 tdcError_ROSSummary = 6;
989 tdcError_ROSError = 6;
990 tdcError_TDCHisto = 1;
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;
997 tdcError_ROSSummary = 7;
998 tdcError_ROSError = 7;
999 tdcError_TDCHisto = 2;
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;
1006 tdcError_ROSSummary = 8;
1007 tdcError_ROSError = 8;
1008 tdcError_TDCHisto = 3;
1010 }
else if ( error & 0x0924 ) {
1011 LogTrace(
"DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
1012 <<
" uROS " << uRos <<
" ROB " << link
1013 <<
" TDC hit error in TDC " << error << endl;
1015 tdcError_ROSSummary = 9;
1016 tdcError_ROSError = 9;
1017 tdcError_TDCHisto = 4;
1019 }
else if ( error & 0x1000 ) {
1020 LogTrace(
"DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
1021 <<
" uROS " << uRos <<
" ROB " << link
1022 <<
" TDC hit rejected in TDC " << error << endl;
1024 tdcError_ROSSummary = 10;
1025 tdcError_ROSError = 10;
1026 tdcError_TDCHisto = 5;
1029 LogWarning(
"DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
1030 <<
" TDC error code not known " << error << endl;
1034 ROSSummary->
Fill(tdcError_ROSSummary,link+1);
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);
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);
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);
1062 int ttsCodeValue = -1;
1095 LogError(
"DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
1096 <<
"[DTDataIntegrityTask] FED User control: wrong TTS value "<< value <<
" in FED " << fed <<
" uROS "<< uRos<< endl;
1104 int uRosEventLength = (data.
gettrailer() & 0xFFFFF)*8;
1107 if(uRosEventLength > 5000) uRosEventLength = 5000;
1119 LogTrace(
"DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
1120 <<
"[DTDataIntegrityTask]: " <<
neventsuROS <<
" events analyzed by processROS25" << endl;
1135 if ( (
mode<=2) && (!ROSError) ) {
1136 LogError(
"DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask") <<
1137 "Trying to access non existing ME at ROSID " << code.
getROSID() <<
1150 LogTrace(
"DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask") <<
" TXP error en ROS " 1151 << code.
getROS() << endl;
1161 for (vector<DTROSErrorWord>::const_iterator error_it = data.
getROSErrors().begin();
1164 LogTrace(
"DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask") <<
" Error in ROS " << code.
getROS()
1165 <<
" ROB Id " << (*error_it).robID()
1166 <<
" Error type " << (*error_it).errorType() << endl;
1169 ROSSummary->
Fill((*error_it).errorType(), code.
getROS());
1170 if((*error_it).errorType() <= 11) {
1176 if ((*error_it).robID() != 31) {
1177 ROSError->
Fill((*error_it).errorType(),(*error_it).robID());
1179 else if ((*error_it).errorType() == 4) {
1180 vector<int> 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));
1192 int ROSDebug_BunchNumber = -1;
1194 for (vector<DTROSDebugWord>::const_iterator debug_it = data.
getROSDebugs().begin();
1197 int debugROSSummary = 0;
1198 int debugROSError = 0;
1199 vector<int> debugBins;
1200 bool hasEvIdMis =
false;
1201 vector<int> evIdMisBins;
1203 if ((*debug_it).debugType() == 0 ) {
1204 ROSDebug_BunchNumber = (*debug_it).debugMessage();
1205 }
else if ((*debug_it).debugType() == 1 ) {
1208 }
else if ((*debug_it).debugType() == 2 ) {
1211 }
else if ((*debug_it).debugType() == 3) {
1212 if ((*debug_it).dontRead()){
1213 debugROSSummary = 11;
1215 if (
mode <= 2)
channelsInCEROS((*debug_it).cerosIdCerosStatus(),(*debug_it).dontRead(),debugBins);
1216 }
if ((*debug_it).evIdMis()){
1218 if (
mode <= 2)
channelsInCEROS((*debug_it).cerosIdCerosStatus(),(*debug_it).evIdMis(),evIdMisBins);
1220 }
else if ((*debug_it).debugType() == 4 &&
1221 (*debug_it).cerosIdRosStatus()){
1222 debugROSSummary = 13;
1227 if (debugROSSummary) {
1228 ROSSummary->
Fill(debugROSSummary,code.
getROS());
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));
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));
1253 for (vector<DTROBHeader>::const_iterator rob_it = data.
getROBHeaders().begin();
1256 code.
setROB((*rob_it).first);
1261 if (robheader.
bunchID() != ROSDebug_BunchNumber) {
1274 for (vector<DTROBTrailerWord>::const_iterator robt_it = data.
getROBTrailers().begin();
1276 float wCount = (*robt_it).wordCount()<100. ? (*robt_it).wordCount() : 99.9;
1284 if(rosEventLength > 1600) rosEventLength = 1600;
1290 for (vector<DTTDCData>::const_iterator tdc_it = data.
getTDCData().begin();
1291 tdc_it != data.
getTDCData().end(); tdc_it++) {
1295 if ( tdcDatum.
PC() !=0) {
1296 LogTrace(
"DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
1297 <<
" PC error in ROS " << code.
getROS() <<
" TDC " << (*tdc_it).first << endl;
1304 if(
mode <= 2) ROSError->
Fill(6,(*tdc_it).first);
1309 for (vector<DTTDCError>::const_iterator tdc_it = data.
getTDCError().begin();
1312 code.
setROB((*tdc_it).first);
1314 int tdcError_ROSSummary = 0;
1315 int tdcError_ROSError = 0;
1316 int tdcError_TDCHisto = 0;
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;
1323 tdcError_ROSSummary = 14;
1324 tdcError_ROSError = 11;
1325 tdcError_TDCHisto = 0;
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;
1332 tdcError_ROSSummary = 15;
1333 tdcError_ROSError = 12;
1334 tdcError_TDCHisto = 1;
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;
1341 tdcError_ROSSummary = 16;
1342 tdcError_ROSError = 13;
1343 tdcError_TDCHisto = 2;
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;
1350 tdcError_ROSSummary = 17;
1351 tdcError_ROSError = 14;
1352 tdcError_TDCHisto = 3;
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;
1359 tdcError_ROSSummary = 18;
1360 tdcError_ROSError = 15;
1361 tdcError_TDCHisto = 4;
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;
1368 tdcError_ROSSummary = 19;
1369 tdcError_ROSError = 16;
1370 tdcError_TDCHisto = 5;
1373 LogWarning(
"DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
1374 <<
" TDC error code not known " << ((*tdc_it).second).tdcError() << endl;
1377 ROSSummary->
Fill(tdcError_ROSSummary,code.
getROS());
1379 if(tdcError_ROSSummary <= 15) {
1384 ROSError->
Fill(tdcError_ROSError,(*tdc_it).first);
1386 rosHistos[
"TDCError"][code.
getROSID()]->Fill(tdcError_TDCHisto+6*((*tdc_it).second).tdcID(),(*tdc_it).first);
1404 LogTrace(
"DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
1405 <<
"[DTDataIntegrityTask]: " <<
neventsFED <<
" events analyzed by processFED" << endl;
1407 if(fed < FEDIDmin || fed >
FEDIDmax)
return;
1416 fedHistos[
"EventLength"][fed]->Fill(fedEvtLength);
1418 if(
mode > 1)
return;
1420 fedTimeHistos[
"FEDAvgEvLengthvsLumi"][fed]->accumulateValueTimeSlot(fedEvtLength);
1432 int ttsCodeValue = -1;
1464 LogError(
"DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
1465 <<
"[DTDataIntegrityTask] FED TTS control: wrong TTS value "<< value <<
" in FED "<< fed<< endl;
1469 if(
mode < 1)
fedHistos[
"TTSValues"][fed]->Fill(ttsCodeValue);
1479 LogTrace(
"DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
1480 <<
"[DTDataIntegrityTask]: " <<
neventsFED <<
" events analyzed by processFED" << endl;
1493 if(!header.
check()) {
1499 if(!trailer.
check()) {
1519 int ttsCodeValue = -1;
1520 int ttsSummaryBin = -1;
1539 bool knownOrigin =
false;
1556 if(!knownOrigin) ttsSummaryBin = 9;
1562 bool knownOrigin =
false;
1571 if(!knownOrigin) ttsSummaryBin = 9;
1587 LogError(
"DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
1588 <<
"[DTDataIntegrityTask] DDU control: wrong TTS value "<<trailer.
ttsBits()<<endl;
1593 if(ttsSummaryBin != -1) {
1602 int rosList = secondWord.
rosList();
1603 set<int> rosPositions;
1604 for(
int i=0;
i<12;
i++) {
1606 rosPositions.insert(
i);
1614 for (vector<DTDDUFirstStatusWord>::const_iterator fsw_it = data.
getFirstStatusWord().begin();
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());
1628 if((*fsw_it).channelEnabled() == 1 &&
1629 rosPositions.find(channel) == rosPositions.end()) {
1630 if(
mode <= 2) hROSStatus->
Fill(9,channel,1);
1643 if((rosBXIds.size() > 1 || rosBXIds.find(header.
bxID()) == rosBXIds.end()) && !rosBXIds.empty() ) {
1644 for(vector<DTROS25Data>::const_iterator rosControlData = rosData.begin();
1645 rosControlData != rosData.end(); ++rosControlData) {
1646 for (vector<DTROSDebugWord>::const_iterator debug_it = (*rosControlData).getROSDebugs().begin();
1647 debug_it != (*rosControlData).getROSDebugs().end(); debug_it++) {
1648 if ((*debug_it).debugType() == 0 && (*debug_it).debugMessage() != header.
bxID()) {
1649 int ros = (*rosControlData).getROSID();
1651 if(
mode <= 2) hROSStatus->
Fill(11,ros-1);
1663 LogWarning(
"DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
1664 <<
"ERROR: FED " << ddu <<
" BX ID different from other feds: " << header.
bxID() << endl;
1673 if((rosL1AIds.size() > 1 || rosL1AIds.find(header.
lvl1ID()-1) == rosL1AIds.end()) && !rosL1AIds.empty() ){
1675 for (vector<DTROS25Data>::const_iterator rosControlData = rosData.begin();
1676 rosControlData != rosData.end(); rosControlData++) {
1677 unsigned int ROSHeader_TTCCount = ((*rosControlData).getROSHeader().TTCEventCounter() + 1) % 0x1000000;
1678 if( ROSHeader_TTCCount != header.
lvl1ID() ) {
1679 int ros = (*rosControlData).getROSID();
1680 if(
mode <= 2) hROSStatus->
Fill(10,ros-1);
1693 if(
mode > 1)
return;
1705 int fifoFull = secondWord.
fifoFull();
1709 for(
int i=0;
i<3;
i++){
1710 if(inputFifoFull & 0
x1){
1711 hFIFOStatus->
Fill(
i,0);
1713 if(inputFifoAlmostFull & 0x1){
1714 hFIFOStatus->
Fill(
i,1);
1717 hFIFOStatus->
Fill(3+
i,0);
1719 if(fifoAlmostFull & 0x1){
1720 hFIFOStatus->
Fill(3+
i,1);
1722 if(!(inputFifoFull & 0x1) && !(inputFifoAlmostFull & 0x1)){
1723 hFIFOStatus->
Fill(
i,2);
1725 if(!(fifoFull & 0x1) && !(fifoAlmostFull & 0x1)){
1726 hFIFOStatus->
Fill(3+
i,2);
1728 inputFifoFull >>= 1;
1729 inputFifoAlmostFull >>= 1;
1731 fifoAlmostFull >>= 1;
1735 hFIFOStatus->
Fill(6,0);
1737 if(outputFifoAlmostFull){
1738 hFIFOStatus->
Fill(6,1);
1740 if(!outputFifoFull && !outputFifoAlmostFull){
1741 hFIFOStatus->
Fill(6,2);
1781 folder =
"DT/00-DataIntegrity/";
1788 for (
int iCh=0; iCh<6;++iCh) {
1789 if ((chMask >> iCh) & 0
x1){
1790 channels.push_back(cerosId*6+iCh);
1797 for (
int iCeros=0; iCeros<5;++iCeros) {
1798 if ((cerosMask >> iCeros) & 0
x1){
1799 for (
int iCh=0; iCh<6;++iCh) {
1800 channels.push_back(iCeros*6+iCh);
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);
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);
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);
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);
1865 LogTrace(
"DTRawToDigi|TDQM|DTMonitorModule|DTDataIntegrityTask") <<
"[DTDataIntegrityTask]: preProcessEvent" <<endl;
1875 for(
unsigned int j=0; j <fedCol->size();++j){
1876 fedData = fedCol->at(j);
1877 int fed = fedData.
getfed();
1879 LogError(
"DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask") <<
"[DTDataIntegrityTask]: analyze, FED ID " << fed <<
" not expected." << endl;
1884 if(
mode == 3 ||
mode ==1)
continue;
1886 for(
int slot=1; slot<=
DOCESLOTS; ++slot)
1888 urosData = fedData.
getuROS(slot);
1898 (*rosBxIds).second.clear();
1904 (*rosL1AIds).second.clear();
1917 std::vector<DTROS25Data> ros25Data;
1919 for(
unsigned int i=0;
i<dduProduct->size(); ++
i)
1921 dduData = dduProduct->at(
i);
1922 ros25Data = ros25Product->at(
i);
1929 for(
unsigned int j=0; j < ros25Data.size(); ++j) {
1942 int ros =
theROS(slot,link);
1964 if (ros > 6 && tenDDU && ddu < 775)
1972 if (slot%6 == 5)
return link+1;
1974 int ros = (link/24) + 3*(slot%6) - 2;
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
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
const std::vector< DTROBHeader > & getROBHeaders() const
std::vector< int > geterrors() const
const std::vector< DTTDCData > & getTDCData() const
int outputFifoFull() const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::string fedIntegrityFolder
MonitorElement * hFEDNonFatal
int geterrorTDCID(int i) const
void bookHistosuROS(DQMStore::IBooker &, const int fed, const int uRos)
int l1AFifoOccupancy() const
bool eventHasErrors() const
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.
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.
static const int DOCESLOTS
LuminosityBlockNumber_t luminosityBlock() const
edm::EDGetTokenT< DTROS25Collection > ros25Token
const DTLocalTriggerTrailerWord & getSCTrailer() const
int warningROSPAF() const
DTDataIntegrityTask(const edm::ParameterSet &ps)
std::map< std::string, std::map< int, DTTimeEvolutionHisto * > > fedTimeHistos
void processROS25(DTROS25Data &data, int dduID, int ros)
const std::vector< DTROSDebugWord > & getROSDebugs() const
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
const DTROSHeaderWord & getROSHeader() const
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
~DTDataIntegrityTask() override
MonitorElement * book1D(Args &&...args)
void endLuminosityBlock(const edm::LuminosityBlock &ls, const edm::EventSetup &es) override
DTuROSROSData getuROS(int slot) const
int getokxflag(int i) const
std::map< std::string, std::map< int, MonitorElement * > > fedHistos
bin
set the eta bin as selection string.
const FEDTrailer & getDDUTrailer() const
MonitorElement * nEventMonitor
int inputFifoAlmostFull() const
int inputFifoFull() const
std::string topFolder(bool isFEDIntegrity) const
const FEDHeader & getDDUHeader() const
Getters.
void setCurrentFolder(const std::string &fullpath)
uint8_t ttsBits() const
Current value of the Trigger Throttling System bits.
MonitorElement * hFEDEntry
MonitorElement * book2D(Args &&...args)
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
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 outputFifoAlmostFull() const
void setDDU(const int &ID)
need to reset the bits before setting
char data[epos_bytes_allocation]
void bookHistosROS25(DQMStore::IBooker &, DTROChainCoding code)
int getslotsize(int slot) const
const std::vector< DTROSErrorWord > & getROSErrors() const
MonitorElement * hTTSSummary
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
std::map< std::string, std::map< int, DTTimeEvolutionHisto * > > rosTimeHistos
void fedNonFatal(int dduID)
MonitorElement * bookFloat(Args &&...args)
int fifoAlmostFull() const
const std::vector< DTTDCError > & getTDCError() const
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
MonitorElement * hCorruptionSummary
std::map< unsigned int, DTTimeEvolutionHisto * > urosTimeHistos
edm::EDGetTokenT< DTDDUCollection > dduToken
int theDDU(int crate, int slot, int link, bool tenDDU)