CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
DTDataIntegrityTask Class Reference

#include <DTDataIntegrityTask.h>

Inheritance diagram for DTDataIntegrityTask:
DTDataMonitorInterface

Public Member Functions

 DTDataIntegrityTask (const edm::ParameterSet &ps, edm::ActivityRegistry &reg)
 
bool eventHasErrors () const
 
void fedEntry (int dduID)
 
void fedFatal (int dduID)
 
void fedNonFatal (int dduID)
 
void postBeginJob ()
 
void postEndJob ()
 
void preBeginLumi (const edm::LuminosityBlockID &ls, const edm::Timestamp &iTime)
 
void preEndLumi (const edm::LuminosityBlockID &ls, const edm::Timestamp &iTime)
 
void preProcessEvent (const edm::EventID &iEvtid, const edm::Timestamp &iTime)
 
void processFED (DTDDUData &dduData, const std::vector< DTROS25Data > &rosData, int dduID)
 
void processROS25 (DTROS25Data &data, int dduID, int ros)
 
void TimeHistos (std::string histoType)
 
virtual ~DTDataIntegrityTask ()
 
- Public Member Functions inherited from DTDataMonitorInterface
 DTDataMonitorInterface ()
 
virtual ~DTDataMonitorInterface ()
 

Private Member Functions

void bookHistos (const int fedMin, const int fedMax)
 
void bookHistos (std::string folder, DTROChainCoding code)
 
void bookHistosROS25 (DTROChainCoding code)
 
void channelsInCEROS (int cerosId, int chMask, std::vector< int > &channels)
 
void channelsInROS (int cerosMask, std::vector< int > &channels)
 
std::string topFolder (bool isFEDIntegrity) const
 

Private Attributes

DTROChainCoding coding
 
DQMStoredbe
 
std::map< std::string,
std::map< int, MonitorElement * > > 
dduHistos
 
std::map< std::string,
std::map< int,
DTTimeEvolutionHisto * > > 
dduTimeHistos
 
bool doTimeHisto
 
bool eventErrorFlag
 
std::set< int > fedBXIds
 
std::string fedIntegrityFolder
 
bool getSCInfo
 
MonitorElementhCorruptionSummary
 
MonitorElementhFEDEntry
 
MonitorElementhFEDFatal
 
MonitorElementhFEDNonFatal
 
MonitorElementhTTSSummary
 
std::multimap< std::string,
std::string >::iterator 
it
 
int mode
 
int myPrevEv
 
int myPrevFifoVal [7]
 
int myPrevRosVal
 
int myPrevTtsVal
 
std::multimap< std::string,
std::string > 
names
 
MonitorElementnEventMonitor
 
int nevents
 
int neventsDDU
 
int nEventsLS
 
int neventsROS25
 
std::string outputFile
 
edm::ParameterSet parameters
 
double rob_max [25]
 
std::map< std::string,
std::map< int, MonitorElement * > > 
robHistos
 
std::map< int, std::set< int > > rosBxIdsPerFED
 
std::map< std::string,
std::map< int, MonitorElement * > > 
rosHistos
 
std::map< int, std::set< int > > rosL1AIdsPerFED
 
std::map< std::string,
std::map< int, MonitorElement * > > 
rosSHistos
 
std::map< std::string,
std::map< int,
DTTimeEvolutionHisto * > > 
rosTimeHistos
 
float trigger_counter
 

Detailed Description

Class for DT Data Integrity.

Author
Marco Zanetti (INFN Padova), Gianluca Cerminara (INFN Torino)

Definition at line 37 of file DTDataIntegrityTask.h.

Constructor & Destructor Documentation

DTDataIntegrityTask::DTDataIntegrityTask ( const edm::ParameterSet ps,
edm::ActivityRegistry reg 
)
explicit

Definition at line 35 of file DTDataIntegrityTask.cc.

References edm::hlt::Exception, fedIntegrityFolder, getSCInfo, edm::ParameterSet::getUntrackedParameter(), LogTrace, mode, neventsDDU, neventsROS25, postBeginJob(), preBeginLumi(), preEndLumi(), preProcessEvent(), dtDQMClient_cfg::processingMode, edm::ActivityRegistry::watchPostBeginJob(), edm::ActivityRegistry::watchPreBeginLumi(), edm::ActivityRegistry::watchPreEndLumi(), and edm::ActivityRegistry::watchPreProcessEvent().

35  : nevents(0) , dbe(0) {
36 
37  // Register the methods that we want to schedule
38  // reg.watchPostEndJob(this,&DTDataIntegrityTask::postEndJob);
41 
44 
45  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
46  << "[DTDataIntegrityTask]: Constructor" <<endl;
47 
48  neventsDDU = 0;
49  neventsROS25 = 0;
50 
51 // //If you want info VS time histos
52 // doTimeHisto = ps.getUntrackedParameter<bool>("doTimeHisto", false);
53  // Plot quantities about SC
54  getSCInfo = ps.getUntrackedParameter<bool>("getSCInfo", false);
55 
56  fedIntegrityFolder = ps.getUntrackedParameter<string>("fedIntegrityFolder","DT/FEDIntegrity");
57 
58  string processingMode = ps.getUntrackedParameter<string>("processingMode","Online");
59 
60  // processing mode flag to select plots to be produced and basedirs CB vedi se farlo meglio...
61  if (processingMode == "Online") {
62  mode = 0;
63  } else if(processingMode == "SM") {
64  mode = 1;
65  } else if (processingMode == "Offline") {
66  mode = 2;
67  } else if (processingMode == "HLT") {
68  mode = 3;
69  } else {
70  throw cms::Exception("MissingParameter")
71  << "[DTDataIntegrityTask]: processingMode :" << processingMode
72  << " invalid! Must be Online, SM, Offline or HLT !" << endl;
73  }
74 
75 }
T getUntrackedParameter(std::string const &, T const &) const
void preProcessEvent(const edm::EventID &iEvtid, const edm::Timestamp &iTime)
void preBeginLumi(const edm::LuminosityBlockID &ls, const edm::Timestamp &iTime)
void watchPreProcessEvent(PreProcessEvent::slot_type const &iSlot)
void watchPreEndLumi(PreEndLumi::slot_type const &iSlot)
void preEndLumi(const edm::LuminosityBlockID &ls, const edm::Timestamp &iTime)
#define LogTrace(id)
void watchPreBeginLumi(PreBeginLumi::slot_type const &iSlot)
void watchPostBeginJob(PostBeginJob::slot_type const &iSlot)
convenience function for attaching to signal
DTDataIntegrityTask::~DTDataIntegrityTask ( )
virtual

Definition at line 79 of file DTDataIntegrityTask.cc.

References LogTrace, and neventsDDU.

79  {
80  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
81  <<"[DTDataIntegrityTask]: Destructor. Analyzed "<< neventsDDU <<" events"<<endl;
82 }
#define LogTrace(id)

Member Function Documentation

void DTDataIntegrityTask::bookHistos ( const int  fedMin,
const int  fedMax 
)
private

Definition at line 104 of file DTDataIntegrityTask.cc.

References DQMStore::book1D(), DQMStore::book2D(), DQMStore::bookFloat(), dbe, hCorruptionSummary, hFEDEntry, hFEDFatal, hFEDNonFatal, hTTSSummary, nEventMonitor, MonitorElement::setAxisTitle(), MonitorElement::setBinLabel(), DQMStore::setCurrentFolder(), and topFolder().

Referenced by bookHistosROS25(), and postBeginJob().

104  {
105 
106  dbe->setCurrentFolder("DT/EventInfo/Counters");
107  nEventMonitor = dbe->bookFloat("nProcessedEventsDataIntegrity");
108 
109  // Standard FED integrity histos
111 
112  int nFED = (fedMax - fedMin)+1;
113 
114  hFEDEntry = dbe->book1D("FEDEntries","# entries per DT FED",nFED,fedMin,fedMax+1);
115  hFEDFatal = dbe->book1D("FEDFatal","# fatal errors DT FED",nFED,fedMin,fedMax+1);
116  hFEDNonFatal = dbe->book1D("FEDNonFatal","# NON fatal errors DT FED",nFED,fedMin,fedMax+1);
117 
118 
119  dbe->setCurrentFolder(topFolder(false));
120  hTTSSummary = dbe->book2D("TTSSummary","Summary Status TTS",nFED,fedMin,fedMax+1,9,1,10);
121  hTTSSummary->setAxisTitle("FED",1);
122  hTTSSummary->setBinLabel(1,"ROS PAF",2);
123  hTTSSummary->setBinLabel(2,"DDU PAF",2);
124  hTTSSummary->setBinLabel(3,"ROS PAF",2);
125  hTTSSummary->setBinLabel(4,"DDU PAF",2);
126  hTTSSummary->setBinLabel(5,"DDU Full",2);
127  hTTSSummary->setBinLabel(6,"L1A Mism.",2);
128  hTTSSummary->setBinLabel(7,"ROS Error",2);
129  hTTSSummary->setBinLabel(8,"BX Mism.",2);
130  hTTSSummary->setBinLabel(9,"DDU Logic Err.",2);
131 
132  // bookkeeping of the
133 
134  hCorruptionSummary = dbe->book2D("DataCorruptionSummary", "Data Corruption Sources",
135  nFED,fedMin,fedMax+1, 8, 1, 9);
137  hCorruptionSummary->setBinLabel(1,"Miss Ch.",2);
138  hCorruptionSummary->setBinLabel(2,"ROS BX mism",2);
139  hCorruptionSummary->setBinLabel(3,"DDU BX mism",2);
140  hCorruptionSummary->setBinLabel(4,"ROS L1A mism",2);
141  hCorruptionSummary->setBinLabel(5,"Miss Payload",2);
142  hCorruptionSummary->setBinLabel(6,"FCRC bit",2);
143  hCorruptionSummary->setBinLabel(7,"Header check",2);
144  hCorruptionSummary->setBinLabel(8,"Triler Check",2);
145 
146 }
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:872
MonitorElement * hFEDNonFatal
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)
MonitorElement * hFEDFatal
MonitorElement * bookFloat(const char *name)
Book float.
Definition: DQMStore.cc:809
MonitorElement * nEventMonitor
std::string topFolder(bool isFEDIntegrity) const
MonitorElement * hFEDEntry
MonitorElement * hTTSSummary
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
Definition: DQMStore.cc:1000
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
MonitorElement * hCorruptionSummary
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:584
void DTDataIntegrityTask::bookHistos ( std::string  folder,
DTROChainCoding  code 
)
private
void DTDataIntegrityTask::bookHistosROS25 ( DTROChainCoding  code)
private

Definition at line 526 of file DTDataIntegrityTask.cc.

References bookHistos(), getSCInfo, and mode.

Referenced by postBeginJob().

526  {
527  bookHistos( string("ROS"), code);
528 // for(int robId = 0; robId != 25; ++robId) {
529 // code.setROB(robId);
530 // bookHistos( string("TDCError"), code);
531 // }
532  if(mode <= 1)
533  if(getSCInfo)
534  bookHistos( string("SC"), code);
535 }
void bookHistos(const int fedMin, const int fedMax)
void DTDataIntegrityTask::channelsInCEROS ( int  cerosId,
int  chMask,
std::vector< int > &  channels 
)
private

Definition at line 1184 of file DTDataIntegrityTask.cc.

Referenced by processROS25().

1184  {
1185  for (int iCh=0; iCh<6;++iCh) {
1186  if ((chMask >> iCh) & 0x1){
1187  channels.push_back(cerosId*6+iCh);
1188  }
1189  }
1190  return;
1191 }
void DTDataIntegrityTask::channelsInROS ( int  cerosMask,
std::vector< int > &  channels 
)
private

Definition at line 1193 of file DTDataIntegrityTask.cc.

Referenced by processROS25().

1193  {
1194  for (int iCeros=0; iCeros<5;++iCeros) {
1195  if ((cerosMask >> iCeros) & 0x1){
1196  for (int iCh=0; iCh<6;++iCh) {
1197  channels.push_back(iCeros*6+iCh);
1198  }
1199  }
1200  }
1201  return;
1202 }
bool DTDataIntegrityTask::eventHasErrors ( ) const

Definition at line 1148 of file DTDataIntegrityTask.cc.

References eventErrorFlag.

Referenced by DTDataErrorFilter::hltFilter().

1148  {
1149  return eventErrorFlag;
1150 }
void DTDataIntegrityTask::fedEntry ( int  dduID)
virtual

Implements DTDataMonitorInterface.

Definition at line 1155 of file DTDataIntegrityTask.cc.

References MonitorElement::Fill(), and hFEDEntry.

1155  {
1156  hFEDEntry->Fill(dduID);
1157 }
void Fill(long long x)
MonitorElement * hFEDEntry
void DTDataIntegrityTask::fedFatal ( int  dduID)
virtual

Implements DTDataMonitorInterface.

Definition at line 1162 of file DTDataIntegrityTask.cc.

References MonitorElement::Fill(), and hFEDFatal.

1162  {
1163  hFEDFatal->Fill(dduID);
1164 }
MonitorElement * hFEDFatal
void Fill(long long x)
void DTDataIntegrityTask::fedNonFatal ( int  dduID)
virtual

Implements DTDataMonitorInterface.

Definition at line 1169 of file DTDataIntegrityTask.cc.

References MonitorElement::Fill(), and hFEDNonFatal.

1169  {
1170  hFEDNonFatal->Fill(dduID);
1171 }
MonitorElement * hFEDNonFatal
void Fill(long long x)
void DTDataIntegrityTask::postBeginJob ( )

Definition at line 1262 of file DTDataIntegrityTask.cc.

References bookHistos(), bookHistosROS25(), dbe, LogTrace, FEDNumbering::MAXDTFEDID, FEDNumbering::MINDTFEDID, cppFunctionSkipper::operator, DTROChainCoding::setDDU(), and DTROChainCoding::setROS().

Referenced by DTDataIntegrityTask().

1262  {
1263  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask") << "[DTDataIntegrityTask]: postBeginJob" <<endl;
1264  // get the DQMStore service if needed
1266  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask") << "[DTDataIntegrityTask] Get DQMStore service" << endl;
1267 
1268 
1269 
1270  // Loop over the DT FEDs
1271  int FEDIDmin = FEDNumbering::MINDTFEDID;
1272  int FEDIDMax = FEDNumbering::MAXDTFEDID;
1273 
1274  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
1275  << " FEDS: " << FEDIDmin << " to " << FEDIDMax << " in the RO" << endl;
1276 
1277  // book FED integrity histos
1278  bookHistos(FEDIDmin, FEDIDMax);
1279 
1280  // static booking of the histograms
1281  for(int fed = FEDIDmin; fed <= FEDIDMax; ++fed) { // loop over the FEDs in the readout
1282  DTROChainCoding code;
1283  code.setDDU(fed);
1284 
1285  bookHistos( string("ROS_S"), code);
1286 
1287  bookHistos( string("DDU"), code);
1288 
1289  for(int ros = 1; ros <= 12; ++ros) {// loop over all ROS
1290  code.setROS(ros);
1291  bookHistosROS25(code);
1292  }
1293  }
1294 
1295 }
void bookHistosROS25(DTROChainCoding code)
#define LogTrace(id)
void setROS(const int &ID)
void bookHistos(const int fedMin, const int fedMax)
void setDDU(const int &ID)
need to reset the bits before setting
void DTDataIntegrityTask::postEndJob ( )

Definition at line 95 of file DTDataIntegrityTask.cc.

References LogTrace.

95  {
96  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
97  << "[DTDataIntegrityTask]: postEndJob called!" <<endl;
98 
99 // if(doTimeHisto) TimeHistos("Event_word_vs_time");
100 
101 }
#define LogTrace(id)
void DTDataIntegrityTask::preBeginLumi ( const edm::LuminosityBlockID ls,
const edm::Timestamp iTime 
)

Definition at line 1230 of file DTDataIntegrityTask.cc.

References nEventsLS.

Referenced by DTDataIntegrityTask().

1230  {
1231 
1232  nEventsLS = 0;
1233 
1234 }
void DTDataIntegrityTask::preEndLumi ( const edm::LuminosityBlockID ls,
const edm::Timestamp iTime 
)

Definition at line 1236 of file DTDataIntegrityTask.cc.

References dduTimeHistos, edm::LuminosityBlockID::luminosityBlock(), nEventsLS, and rosTimeHistos.

Referenced by DTDataIntegrityTask().

1236  {
1237 
1238  int lumiBlock = ls.luminosityBlock();
1239 
1240  map<std::string, map<int, DTTimeEvolutionHisto*> >::iterator dduIt = dduTimeHistos.begin();
1241  map<std::string, map<int, DTTimeEvolutionHisto*> >::iterator dduEnd = dduTimeHistos.end();
1242  for(; dduIt!=dduEnd; ++dduIt) {
1243  map<int, DTTimeEvolutionHisto*>::iterator histoIt = dduIt->second.begin();
1244  map<int, DTTimeEvolutionHisto*>::iterator histoEnd = dduIt->second.end();
1245  for(; histoIt!=histoEnd; ++histoIt) {
1246  histoIt->second->updateTimeSlot(lumiBlock,nEventsLS);
1247  }
1248  }
1249 
1250  map<std::string, map<int, DTTimeEvolutionHisto*> >::iterator rosIt = rosTimeHistos.begin();
1251  map<std::string, map<int, DTTimeEvolutionHisto*> >::iterator rosEnd = rosTimeHistos.end();
1252  for(; rosIt!=rosEnd; ++rosIt) {
1253  map<int, DTTimeEvolutionHisto*>::iterator histoIt = rosIt->second.begin();
1254  map<int, DTTimeEvolutionHisto*>::iterator histoEnd = rosIt->second.end();
1255  for(; histoIt!=histoEnd; ++histoIt) {
1256  histoIt->second->updateTimeSlot(lumiBlock,nEventsLS);
1257  }
1258  }
1259 
1260 }
std::map< std::string, std::map< int, DTTimeEvolutionHisto * > > dduTimeHistos
LuminosityBlockNumber_t luminosityBlock() const
std::map< std::string, std::map< int, DTTimeEvolutionHisto * > > rosTimeHistos
void DTDataIntegrityTask::preProcessEvent ( const edm::EventID iEvtid,
const edm::Timestamp iTime 
)

Definition at line 1204 of file DTDataIntegrityTask.cc.

References eventErrorFlag, fedBXIds, MonitorElement::Fill(), LogTrace, python.multivaluedict::map(), nEventMonitor, nevents, nEventsLS, rosBxIdsPerFED, and rosL1AIdsPerFED.

Referenced by DTDataIntegrityTask().

1204  {
1205 
1206  nevents++;
1208 
1209  nEventsLS++;
1210 
1211  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask") << "[DTDataIntegrityTask]: preProcessEvent" <<endl;
1212  // clear the set of BXids from the ROSs
1213  for(map<int, set<int> >::iterator rosBxIds = rosBxIdsPerFED.begin();
1214  rosBxIds != rosBxIdsPerFED.end(); ++rosBxIds) {
1215  (*rosBxIds).second.clear();
1216  }
1217 
1218  fedBXIds.clear();
1219 
1220  for(map<int, set<int> >::iterator rosL1AIds = rosL1AIdsPerFED.begin();
1221  rosL1AIds != rosL1AIdsPerFED.end(); ++rosL1AIds) {
1222  (*rosL1AIds).second.clear();
1223  }
1224 
1225  // reset the error flag
1226  eventErrorFlag = false;
1227 
1228 }
std::map< int, std::set< int > > rosBxIdsPerFED
std::map< int, std::set< int > > rosL1AIdsPerFED
void Fill(long long x)
#define LogTrace(id)
MonitorElement * nEventMonitor
std::set< int > fedBXIds
void DTDataIntegrityTask::processFED ( DTDDUData dduData,
const std::vector< DTROS25Data > &  rosData,
int  dduID 
)
virtual

Implements DTDataMonitorInterface.

Definition at line 861 of file DTDataIntegrityTask.cc.

References DTDDUSecondStatusWord::busyROSPAF(), FEDHeader::bxID(), DTDDUSecondStatusWord::bxIDError(), FEDTrailer::check(), FEDHeader::check(), DTDDUData::crcErrorBit(), dduHistos, dduTimeHistos, fedBXIds, DTDDUSecondStatusWord::fifoAlmostFull(), DTDDUSecondStatusWord::fifoFull(), MonitorElement::Fill(), DTDDUData::getDDUHeader(), DTROChainCoding::getDDUID(), DTDDUData::getDDUTrailer(), DTDDUData::getFirstStatusWord(), DTDDUData::getSecondStatusWord(), hCorruptionSummary, hFEDEntry, hFEDFatal, hTTSSummary, i, DTDDUSecondStatusWord::inputFifoAlmostFull(), DTDDUSecondStatusWord::inputFifoFull(), DTDDUSecondStatusWord::l1AIDError(), FEDTrailer::lenght(), LogTrace, FEDHeader::lvl1ID(), mode, neventsDDU, DTDDUSecondStatusWord::outOfSynchROSError(), DTDDUSecondStatusWord::outputFifoAlmostFull(), DTDDUSecondStatusWord::outputFifoFull(), rosBxIdsPerFED, rosL1AIdsPerFED, DTDDUSecondStatusWord::rosList(), DTROChainCoding::setDDU(), FEDHeader::triggerType(), FEDTrailer::ttsBits(), and DTDDUSecondStatusWord::warningROSPAF().

861  {
862 
863  neventsDDU++;
864  if (neventsDDU%1000 == 0)
865  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
866  << "[DTDataIntegrityTask]: " << neventsDDU << " events analyzed by processFED" << endl;
867 
868 
869  DTROChainCoding code;
870  code.setDDU(ddu);
871 
872  hFEDEntry->Fill(code.getDDUID());
873 
874  FEDTrailer trailer = data.getDDUTrailer();
875  FEDHeader header = data.getDDUHeader();
876 
877  // check consistency of header and trailer
878  if(!header.check()) {
879  // error code 7
880  hFEDFatal->Fill(code.getDDUID());
881  hCorruptionSummary->Fill(code.getDDUID(), 7);
882  }
883 
884  if(!trailer.check()) {
885  // error code 8
886  hFEDFatal->Fill(code.getDDUID());
887  hCorruptionSummary->Fill(code.getDDUID(), 8);
888  }
889 
890  // check CRC error bit set by DAQ before sending data on SLink
891  if(data.crcErrorBit()) {
892  // error code 6
893  hFEDFatal->Fill(code.getDDUID());
894  hCorruptionSummary->Fill(code.getDDUID(), 6);
895  }
896 
897  DTDDUSecondStatusWord secondWord = data.getSecondStatusWord();
898 
899  // Fill the status summary of the TTS
900 
901 
902  //1D HISTO WITH TTS VALUES form trailer (7 bins = 7 values)
903  int ttsCodeValue = -1;
904  int ttsSummaryBin = -1;
905 
906  switch(trailer.ttsBits()) {
907  case 0:{ //disconnected
908  ttsCodeValue = 0;
909  break;
910  }
911  case 1:{ //warning overflow
912  ttsCodeValue = 1;
913  if(secondWord.warningROSPAF()) { // ROS PAF
914  ttsSummaryBin = 1;
915  } else { // DDU PAF
916  ttsSummaryBin = 2;
917  }
918 
919  break;
920  }
921  case 2:{ //out of sinch
922  ttsCodeValue = 2;
923  bool knownOrigin = false;
924  if(secondWord.outOfSynchROSError()) {// ROS Error
925  ttsSummaryBin = 7;
926  knownOrigin = true;
927  }
928  if(secondWord.l1AIDError()) {// L1A Mism.
929  ttsSummaryBin = 6;
930  knownOrigin = true;
931  }
932  if(secondWord.bxIDError()) {// BX Mism.
933  ttsSummaryBin = 8;
934  knownOrigin = true;
935  }
936  if(secondWord.outputFifoFull() || secondWord.inputFifoFull() || secondWord.fifoFull()) { // DDU Full
937  ttsSummaryBin = 5;
938  knownOrigin = true;
939  }
940  if(!knownOrigin) ttsSummaryBin = 9; // Error in DDU logic
941 
942  break;
943  }
944  case 4:{ //busy
945  ttsCodeValue = 3;
946  bool knownOrigin = false;
947  if(secondWord.busyROSPAF()) { // ROS PAF
948  ttsSummaryBin = 3;
949  knownOrigin = true;
950  }
951  if(secondWord.outputFifoAlmostFull() || secondWord.inputFifoAlmostFull() || secondWord.fifoAlmostFull() ){ // DDU PAF
952  ttsSummaryBin = 4;
953  knownOrigin = true;
954  }
955  if(!knownOrigin) ttsSummaryBin = 9; // Error in DDU logic
956  break;
957  }
958  case 8:{ //ready
959  ttsCodeValue = 4;
960  break;
961  }
962  case 12:{ //error
963  ttsCodeValue = 5;
964  break;
965  }
966  case 16:{ //disconnected
967  ttsCodeValue = 6;
968  break;
969  }
970  default:{
971  LogError("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
972  <<"[DTDataIntegrityTask] DDU control: wrong TTS value "<<trailer.ttsBits()<<endl;
973  ttsCodeValue = 7;
974  }
975  }
976  if(mode <= 1) dduHistos["TTSValues"][code.getDDUID()]->Fill(ttsCodeValue);
977  if(ttsSummaryBin != -1) {
978  hTTSSummary->Fill(ddu, ttsSummaryBin);
979  }
980 
981 
982 
983 
984 
985 
986  //2D HISTO: ROS VS STATUS (8 BIT = 8 BIN) from 1st-2nd status words (9th BIN FROM LIST OF ROS in 2nd status word)
987  MonitorElement* hROSStatus = dduHistos["ROSStatus"][code.getDDUID()];
988  //1D HISTO: NUMBER OF ROS IN THE EVENTS from 2nd status word
989 
990  int rosList = secondWord.rosList();
991  set<int> rosPositions;
992  for(int i=0;i<12;i++) {
993  if(rosList & 0x1) {
994  rosPositions.insert(i);
995  //9th BIN FROM LIST OF ROS in 2nd status word
996  if(mode <= 2) hROSStatus->Fill(8,i,1);
997  }
998  rosList >>= 1;
999  }
1000 
1001  int channel=0;
1002  for (vector<DTDDUFirstStatusWord>::const_iterator fsw_it = data.getFirstStatusWord().begin();
1003  fsw_it != data.getFirstStatusWord().end(); fsw_it++) {
1004  // assuming association one-to-one between DDU channel and ROS
1005  if(mode <= 2) {
1006  hROSStatus->Fill(0,channel,(*fsw_it).channelEnabled());
1007  hROSStatus->Fill(1,channel,(*fsw_it).timeout());
1008  hROSStatus->Fill(2,channel,(*fsw_it).eventTrailerLost());
1009  hROSStatus->Fill(3,channel,(*fsw_it).opticalFiberSignalLost());
1010  hROSStatus->Fill(4,channel,(*fsw_it).tlkPropagationError());
1011  hROSStatus->Fill(5,channel,(*fsw_it).tlkPatternError());
1012  hROSStatus->Fill(6,channel,(*fsw_it).tlkSignalLost());
1013  hROSStatus->Fill(7,channel,(*fsw_it).errorFromROS());
1014  }
1015  // check that the enabled channel was also in the read-out
1016  if((*fsw_it).channelEnabled() == 1 &&
1017  rosPositions.find(channel) == rosPositions.end()) {
1018  if(mode <= 2) hROSStatus->Fill(9,channel,1);
1019  // error code 1
1020  hFEDFatal->Fill(code.getDDUID());
1021  hCorruptionSummary->Fill(code.getDDUID(), 1);
1022  }
1023  channel++;
1024  }
1025 
1026 
1027  // ---------------------------------------------------------------------
1028  // cross checks between FED and ROS data
1029  // check the BX ID against the ROSs
1030  set<int> rosBXIds = rosBxIdsPerFED[ddu];
1031  if((rosBXIds.size() > 1 || rosBXIds.find(header.bxID()) == rosBXIds.end()) && rosBXIds.size() != 0) { // in this case look for faulty ROSs
1032  for(vector<DTROS25Data>::const_iterator rosControlData = rosData.begin();
1033  rosControlData != rosData.end(); ++rosControlData) { // loop over the ROS data
1034  for (vector<DTROSDebugWord>::const_iterator debug_it = (*rosControlData).getROSDebugs().begin();
1035  debug_it != (*rosControlData).getROSDebugs().end(); debug_it++) { // Loop over ROS debug words
1036  if ((*debug_it).debugType() == 0 && (*debug_it).debugMessage() != header.bxID()) { // check the BX
1037  int ros = (*rosControlData).getROSID();
1038  // fill the error bin
1039  if(mode <= 2) hROSStatus->Fill(11,ros-1);
1040  // error code 2
1041  hFEDFatal->Fill(code.getDDUID());
1042  hCorruptionSummary->Fill(code.getDDUID(), 2);
1043  }
1044  }
1045  }
1046  }
1047 
1048  // check the BX ID against other FEDs
1049  fedBXIds.insert(header.bxID());
1050  if(fedBXIds.size() != 1) {
1051  LogWarning("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
1052  << "ERROR: FED " << ddu << " BX ID different from other feds: " << header.bxID() << endl;
1053  // error code 3
1054  hFEDFatal->Fill(code.getDDUID());
1055  hCorruptionSummary->Fill(code.getDDUID(), 3);
1056  }
1057 
1058 
1059  // check the L1A ID against the ROSs
1060  set<int> rosL1AIds = rosL1AIdsPerFED[ddu];
1061  if((rosL1AIds.size() > 1 || rosL1AIds.find(header.lvl1ID()-1) == rosL1AIds.end()) && rosL1AIds.size() != 0) { // in this case look for faulty ROSs
1062  //If L1A_ID error identify which ROS has wrong L1A
1063  for (vector<DTROS25Data>::const_iterator rosControlData = rosData.begin();
1064  rosControlData != rosData.end(); rosControlData++) { // loop over the ROS data
1065  int ROSHeader_TTCCount = ((*rosControlData).getROSHeader().TTCEventCounter() + 1) % 0x1000000; // fix comparison in case of last counting bin in ROS /first one in DDU
1066  if( ROSHeader_TTCCount != header.lvl1ID() ) {
1067  int ros = (*rosControlData).getROSID();
1068  if(mode <= 2) hROSStatus->Fill(10,ros-1);
1069  // error code 4
1070  hFEDFatal->Fill(code.getDDUID());
1071  hCorruptionSummary->Fill(code.getDDUID(), 4);
1072  }
1073  }
1074  }
1075 
1076  //1D HISTOS: EVENT LENGHT from trailer
1077  int fedEvtLenght = trailer.lenght()*8;
1078  // if(fedEvtLenght > 16000) fedEvtLenght = 16000; // overflow bin
1079  dduHistos["EventLenght"][code.getDDUID()]->Fill(fedEvtLenght);
1080 
1081  if(mode > 1) return;
1082 
1083  dduTimeHistos["FEDAvgEvLenghtvsLumi"][code.getDDUID()]->accumulateValueTimeSlot(fedEvtLenght);
1084 
1085  // size of the list of ROS in the Read-Out
1086  dduHistos["ROSList"][code.getDDUID()]->Fill(rosPositions.size());
1087 
1088 
1089  //2D HISTO: FIFO STATUS from 2nd status word
1090  MonitorElement *hFIFOStatus = dduHistos["FIFOStatus"][code.getDDUID()];
1091  int inputFifoFull = secondWord.inputFifoFull();
1092  int inputFifoAlmostFull = secondWord.inputFifoAlmostFull();
1093  int fifoFull = secondWord.fifoFull();
1094  int fifoAlmostFull = secondWord.fifoAlmostFull();
1095  int outputFifoFull = secondWord.outputFifoFull();
1096  int outputFifoAlmostFull = secondWord.outputFifoAlmostFull();
1097  for(int i=0;i<3;i++){
1098  if(inputFifoFull & 0x1){
1099  hFIFOStatus->Fill(i,0);
1100  }
1101  if(inputFifoAlmostFull & 0x1){
1102  hFIFOStatus->Fill(i,1);
1103  }
1104  if(fifoFull & 0x1){
1105  hFIFOStatus->Fill(3+i,0);
1106  }
1107  if(fifoAlmostFull & 0x1){
1108  hFIFOStatus->Fill(3+i,1);
1109  }
1110  if(!(inputFifoFull & 0x1) && !(inputFifoAlmostFull & 0x1)){
1111  hFIFOStatus->Fill(i,2);
1112  }
1113  if(!(fifoFull & 0x1) && !(fifoAlmostFull & 0x1)){
1114  hFIFOStatus->Fill(3+i,2);
1115  }
1116  inputFifoFull >>= 1;
1117  inputFifoAlmostFull >>= 1;
1118  fifoFull >>= 1;
1119  fifoAlmostFull >>= 1;
1120  }
1121 
1122  if(outputFifoFull){
1123  hFIFOStatus->Fill(6,0);
1124  }
1125  if(outputFifoAlmostFull){
1126  hFIFOStatus->Fill(6,1);
1127  }
1128  if(!outputFifoFull && !outputFifoAlmostFull){
1129  hFIFOStatus->Fill(6,2);
1130  }
1131 
1132 
1133 
1134 
1135 
1136 
1137 
1138  //1D HISTO: EVENT TYPE from header
1139  dduHistos["EventType"][code.getDDUID()]->Fill(header.triggerType());
1140 
1141  // fill the distribution of the BX ids
1142  dduHistos["BXID"][code.getDDUID()]->Fill(header.bxID());
1143 
1144 
1145 }
std::map< int, std::set< int > > rosBxIdsPerFED
std::map< int, std::set< int > > rosL1AIdsPerFED
int i
Definition: DBlmapReader.cc:9
std::map< std::string, std::map< int, MonitorElement * > > dduHistos
bool check()
Definition: FEDTrailer.cc:64
int outputFifoFull() const
Definition: DTDDUWords.h:899
int rosList() const
Definition: DTDDUWords.h:901
int busyROSPAF() const
Definition: DTDDUWords.h:903
int l1AIDError() const
Definition: DTDDUWords.h:893
std::map< std::string, std::map< int, DTTimeEvolutionHisto * > > dduTimeHistos
MonitorElement * hFEDFatal
void Fill(long long x)
int warningROSPAF() const
Definition: DTDDUWords.h:902
int fifoFull() const
Definition: DTDDUWords.h:895
#define LogTrace(id)
int getDDUID() const
int inputFifoAlmostFull() const
Definition: DTDDUWords.h:898
int ttsBits()
Current value of the Trigger Throttling System bitsAQ).
Definition: FEDTrailer.cc:32
int inputFifoFull() const
Definition: DTDDUWords.h:896
bool check()
Check that the header is OK.
Definition: FEDHeader.cc:64
MonitorElement * hFEDEntry
int lenght()
The length of the event fragment counted in 64-bit words including header and trailer.
Definition: FEDTrailer.cc:17
int bxID()
The bunch crossing number.
Definition: FEDHeader.cc:24
int bxIDError() const
Definition: DTDDUWords.h:894
int outputFifoAlmostFull() const
Definition: DTDDUWords.h:900
void setDDU(const int &ID)
need to reset the bits before setting
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
MonitorElement * hTTSSummary
std::set< int > fedBXIds
int lvl1ID()
Level-1 event number generated by the TTC system.
Definition: FEDHeader.cc:20
int fifoAlmostFull() const
Definition: DTDDUWords.h:897
int triggerType()
Event Trigger type identifier.
Definition: FEDHeader.cc:16
int outOfSynchROSError() const
Definition: DTDDUWords.h:904
MonitorElement * hCorruptionSummary
void DTDataIntegrityTask::processROS25 ( DTROS25Data data,
int  dduID,
int  ros 
)
virtual

Implements DTDataMonitorInterface.

Definition at line 538 of file DTDataIntegrityTask.cc.

References DTROBHeaderWord::bunchID(), channelsInCEROS(), channelsInROS(), eventErrorFlag, DTROSTrailerWord::EventWordCount(), MonitorElement::Fill(), FirstRos, DTROChainCoding::getDDUID(), DTROChainCoding::getROB(), DTROS25Data::getROBHeaders(), DTROS25Data::getROBTrailers(), DTROChainCoding::getROS(), DTROS25Data::getROSDebugs(), DTROS25Data::getROSErrors(), DTROS25Data::getROSHeader(), DTROChainCoding::getROSID(), DTROS25Data::getROSTrailer(), DTROChainCoding::getSCID(), getSCInfo, DTROS25Data::getSCPrivHeader(), DTROS25Data::getSCTrailer(), DTROS25Data::getTDCData(), DTROS25Data::getTDCError(), DTROSTrailerWord::l1AFifoOccupancy(), LogTrace, mode, nevents, neventsROS25, DTLocalTriggerSectorCollectorHeaderWord::NumberOf16bitWords(), DTTDCMeasurementWord::PC(), ResetCount_unfolded, DTROBHeaderWord::robID(), rosBxIdsPerFED, rosHistos, rosL1AIdsPerFED, rosSHistos, rosTimeHistos, ROSWords_t(), DTROChainCoding::setDDU(), DTROChainCoding::setROB(), DTROChainCoding::setROS(), DTROSTrailerWord::TPX(), DTROSHeaderWord::TTCEventCounter(), and DTLocalTriggerTrailerWord::wordCount().

538  {
539  neventsROS25++; // FIXME: implement a counter which makes sense
540 
541 // if (neventsROS25%1000 == 0)
542  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
543  << "[DTDataIntegrityTask]: " << neventsROS25 << " events analyzed by processROS25" << endl;
544 
545  // The ID of the RO board (used to map the histos)
546  DTROChainCoding code;
547  code.setDDU(ddu);
548  code.setROS(ros);
549 
550  MonitorElement* ROSSummary = rosSHistos["ROSSummary"][code.getDDUID()];
551 
552  // Summary of all ROB errors
553  MonitorElement* ROSError = 0;
554  if(mode <= 2) ROSError = rosHistos["ROSError"][code.getROSID()];
555 
556  if ( (mode<=2) && (!ROSError) ) {
557  LogError("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask") <<
558  "Trying to access non existing ME at ROSID " << code.getROSID() <<
559  std::endl;
560  return;
561  }
562 
563  // L1A ids to be checked against FED one
564  rosL1AIdsPerFED[ddu].insert(data.getROSHeader().TTCEventCounter());
565 
566  // ROS errors
567 
568 
569  // check for TPX errors
570  if (data.getROSTrailer().TPX() != 0) {
571  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask") << " TXP error en ROS "
572  << code.getROS() << endl;
573  ROSSummary->Fill(9,code.getROS());
574  }
575 
576  // L1 Buffer almost full (non-critical error!)
577  if(data.getROSTrailer().l1AFifoOccupancy() > 31) {
578  ROSSummary->Fill(10,code.getROS());
579  }
580 
581  // FIXME: what is this about???
582  if (neventsROS25 == 1) FirstRos = code.getROSID();
583  if (code.getROSID() == FirstRos) nevents++ ;
584 
585 
586  for (vector<DTROSErrorWord>::const_iterator error_it = data.getROSErrors().begin();
587  error_it != data.getROSErrors().end(); error_it++) { // Loop over ROS error words
588 
589  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask") << " Error in ROS " << code.getROS()
590  << " ROB Id " << (*error_it).robID()
591  << " Error type " << (*error_it).errorType() << endl;
592 
593  // Fill the ROSSummary (1 per FED) histo
594  ROSSummary->Fill((*error_it).errorType(), code.getROS());
595  if((*error_it).errorType() <= 11) { // set error flag
596  eventErrorFlag = true;
597  }
598 
599  if(mode <= 2) {
600  // Fill the ROB Summary (1 per ROS) histo
601  if ((*error_it).robID() != 31) {
602  ROSError->Fill((*error_it).errorType(),(*error_it).robID());
603  }
604  else if ((*error_it).errorType() == 4) {
605  vector<int> channelBins;
606  channelsInROS((*error_it).cerosID(),channelBins);
607  vector<int>::const_iterator channelIt = channelBins.begin();
608  vector<int>::const_iterator channelEnd = channelBins.end();
609  for(;channelIt!=channelEnd;++channelIt) {
610  ROSError->Fill(4,(*channelIt));
611  }
612  }
613  }
614  }
615 
616 
617  int ROSDebug_BunchNumber = -1;
618  int ROSDebug_BcntResCntLow = 0;
619  int ROSDebug_BcntResCntHigh = 0;
620  int ROSDebug_BcntResCnt = 0;
621 
622  for (vector<DTROSDebugWord>::const_iterator debug_it = data.getROSDebugs().begin();
623  debug_it != data.getROSDebugs().end(); debug_it++) { // Loop over ROS debug words
624 
625  int debugROSSummary = 0;
626  int debugROSError = 0;
627  vector<int> debugBins;
628  bool hasEvIdMis = false;
629  vector<int> evIdMisBins;
630 
631  if ((*debug_it).debugType() == 0 ) {
632  ROSDebug_BunchNumber = (*debug_it).debugMessage();
633  } else if ((*debug_it).debugType() == 1 ) {
634  ROSDebug_BcntResCntLow = (*debug_it).debugMessage();
635  } else if ((*debug_it).debugType() == 2 ) {
636  ROSDebug_BcntResCntHigh = (*debug_it).debugMessage();
637  } else if ((*debug_it).debugType() == 3) {
638  if ((*debug_it).dontRead()){
639  debugROSSummary = 11;
640  debugROSError = 8;
641  if (mode <= 2) channelsInCEROS((*debug_it).cerosIdCerosStatus(),(*debug_it).dontRead(),debugBins);
642  } if ((*debug_it).evIdMis()){
643  hasEvIdMis = true;
644  if (mode <= 2) channelsInCEROS((*debug_it).cerosIdCerosStatus(),(*debug_it).evIdMis(),evIdMisBins);
645  }
646  } else if ((*debug_it).debugType() == 4 &&
647  (*debug_it).cerosIdRosStatus()){
648  debugROSSummary = 13;
649  debugROSError = 10;
650  if (mode <= 2) channelsInROS((*debug_it).cerosIdRosStatus(),debugBins);
651  }
652 
653  if (debugROSSummary) {
654  ROSSummary->Fill(debugROSSummary,code.getROS());
655  if (mode <= 2) {
656  vector<int>::const_iterator channelIt = debugBins.begin();
657  vector<int>::const_iterator channelEnd = debugBins.end();
658  for (;channelIt!=channelEnd;++channelIt) {
659  ROSError->Fill(debugROSError,(*channelIt));
660  }
661  }
662  }
663 
664  if (hasEvIdMis) {
665  ROSSummary->Fill(12,code.getROS());
666  if (mode <= 2) {
667  vector<int>::const_iterator channelIt = evIdMisBins.begin();
668  vector<int>::const_iterator channelEnd = evIdMisBins.end();
669  for (;channelIt!=channelEnd;++channelIt) {
670  ROSError->Fill(9,(*channelIt));
671  }
672  }
673  }
674 
675  }
676 
677  ROSDebug_BcntResCnt = (ROSDebug_BcntResCntHigh << 15) + ROSDebug_BcntResCntLow;
678  // LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
679  // << " ROS: " << code.getROS() << " ROSDebug_BunchNumber " << ROSDebug_BunchNumber
680  // << " ROSDebug_BcntResCnt " << ROSDebug_BcntResCnt << endl;
681 
682 
683  // Event words vs time
684  // FIXME: what is this doing???
685  ROSWords_t(ResetCount_unfolded,code.getROS(),ROSDebug_BcntResCnt,nevents);
686 
687  // fill hists it here
688  // histoType = "Event_word_vs_time";
689  // if (rosHistos[histoType].find(code.getROSID()) != rosHistos[histoType].end()){
690  // (rosHistos.find(histoType)->second).find(code.getROSID())->second->
691  // Fill((ResetCount_unfolded),data.getROSTrailer().EventWordCount());
692  // (rosHistos.find(histoType)->second).find(code.getROSID())->second->setAxisTitle("Time(s)",1);
693  // }
694  // else {
695  // (rosHistos.find(histoType)->second).find(code.getROSID())->second->
696  // Fill((ResetCount_unfolded),data.getROSTrailer().EventWordCount());}
697 
698 
699 
700 
701  // ROB Group Header
702  // Check the BX of the ROB headers against the BX of the ROS
703  for (vector<DTROBHeader>::const_iterator rob_it = data.getROBHeaders().begin();
704  rob_it != data.getROBHeaders().end(); rob_it++) { // loop over ROB headers
705 
706  code.setROB((*rob_it).first);
707  DTROBHeaderWord robheader = (*rob_it).second;
708 
709  rosBxIdsPerFED[ddu].insert(ROSDebug_BunchNumber);
710 
711  if (robheader.bunchID() != ROSDebug_BunchNumber) {
712  // fill ROS Summary plot
713  ROSSummary->Fill(8,code.getROS());
714  eventErrorFlag = true;
715 
716  // fill ROB Summary plot for that particular ROS
717  if(mode <= 2) ROSError->Fill(7,robheader.robID());
718  }
719  }
720 
721 
722  if(mode <= 1) { // produce only when not in HLT
723  // ROB Trailer
724  for (vector<DTROBTrailerWord>::const_iterator robt_it = data.getROBTrailers().begin();
725  robt_it != data.getROBTrailers().end(); robt_it++) { // loop over ROB trailers
726  float wCount = (*robt_it).wordCount()<100. ? (*robt_it).wordCount() : 99.9;
727  rosHistos["ROB_mean"][code.getROSID()]->Fill((*robt_it).robID(),wCount);
728  }
729 
730 // // Trigger frequency
731 // double frequency = 0;
732 // // FIXME: how is the frequency computed
733 // ROS_L1A_Frequency(code.getROS(),ROSDebug_BcntResCnt,neventsROS25,frequency,trigger_counter);
734 // rosHistos["Trigger_frequency"][code.getROSID()]->Fill(frequency);
735 
736  // Plot the event lenght //NOHLT
737  int rosEventLenght = data.getROSTrailer().EventWordCount()*4;
738  rosTimeHistos["ROSAvgEventLenghtvsLumi"][code.getROSID()]->accumulateValueTimeSlot(rosEventLenght);
739 
740  if(rosEventLenght > 1600) rosEventLenght = 1600;
741  rosHistos["ROSEventLenght"][code.getROSID()]->Fill(rosEventLenght);
742  }
743 
744 
745  // TDC Data
746  for (vector<DTTDCData>::const_iterator tdc_it = data.getTDCData().begin();
747  tdc_it != data.getTDCData().end(); tdc_it++) { // loop over TDC data
748 
749  DTTDCMeasurementWord tdcDatum = (*tdc_it).second;
750 
751  if ( tdcDatum.PC() !=0) {
752  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
753  << " PC error in ROS " << code.getROS() << " TDC " << (*tdc_it).first << endl;
754  // fill ROS Summary plot
755  ROSSummary->Fill(7,code.getROS());
756 
757  eventErrorFlag = true;
758 
759  // fill ROB Summary plot for that particular ROS
760  if(mode <= 2) ROSError->Fill(6,(*tdc_it).first);
761  }
762  }
763 
764  // TDC Error
765  for (vector<DTTDCError>::const_iterator tdc_it = data.getTDCError().begin();
766  tdc_it != data.getTDCError().end(); tdc_it++) { // loop over TDC errors
767 
768  code.setROB((*tdc_it).first);
769 
770  int tdcError_ROSSummary = 0;
771  int tdcError_ROSError = 0;
772  int tdcError_TDCHisto = 0;
773 
774  if(((*tdc_it).second).tdcError() & 0x4000 ) {
775  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
776  << " ROS " << code.getROS() << " ROB " << code.getROB()
777  << " Internal fatal Error 4000 in TDC " << (*tdc_it).first << endl;
778 
779  tdcError_ROSSummary = 14;
780  tdcError_ROSError = 11;
781  tdcError_TDCHisto = 0;
782 
783  } else if ( ((*tdc_it).second).tdcError() & 0x0249 ) {
784  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
785  << " ROS " << code.getROS() << " ROB " << code.getROB()
786  << " TDC FIFO overflow in TDC " << (*tdc_it).first << endl;
787 
788  tdcError_ROSSummary = 15;
789  tdcError_ROSError = 12;
790  tdcError_TDCHisto = 1;
791 
792  } else if ( ((*tdc_it).second).tdcError() & 0x0492 ) {
793  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
794  << " ROS " << code.getROS() << " ROB " << code.getROB()
795  << " TDC L1 buffer overflow in TDC " << (*tdc_it).first << endl;
796 
797  tdcError_ROSSummary = 16;
798  tdcError_ROSError = 13;
799  tdcError_TDCHisto = 2;
800 
801  } else if ( ((*tdc_it).second).tdcError() & 0x2000 ) {
802  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
803  << " ROS " << code.getROS() << " ROB " << code.getROB()
804  << " TDC L1A FIFO overflow in TDC " << (*tdc_it).first << endl;
805 
806  tdcError_ROSSummary = 17;
807  tdcError_ROSError = 14;
808  tdcError_TDCHisto = 3;
809 
810  } else if ( ((*tdc_it).second).tdcError() & 0x0924 ) {
811  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
812  << " ROS " << code.getROS() << " ROB " << code.getROB()
813  << " TDC hit error in TDC " << (*tdc_it).first << endl;
814 
815  tdcError_ROSSummary = 18;
816  tdcError_ROSError = 15;
817  tdcError_TDCHisto = 4;
818 
819  } else if ( ((*tdc_it).second).tdcError() & 0x1000 ) {
820  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
821  << " ROS " << code.getROS() << " ROB " << code.getROB()
822  << " TDC hit rejected in TDC " << (*tdc_it).first << endl;
823 
824  tdcError_ROSSummary = 19;
825  tdcError_ROSError = 16;
826  tdcError_TDCHisto = 5;
827 
828  } else {
829  LogWarning("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
830  << " TDC error code not known " << ((*tdc_it).second).tdcError() << endl;
831  }
832 
833  ROSSummary->Fill(tdcError_ROSSummary,code.getROS());
834 
835  if(tdcError_ROSSummary <= 15) {
836  eventErrorFlag = true;
837  }
838 
839  if(mode <= 2) {
840  ROSError->Fill(tdcError_ROSError,(*tdc_it).first);
841  if(mode <= 1)
842  rosHistos["TDCError"][code.getROSID()]->Fill(tdcError_TDCHisto+6*((*tdc_it).second).tdcID(),(*tdc_it).first);
843  }
844  }
845 
846  // Read SC data
847  if (mode <= 1 && getSCInfo) {
848  // SC Data
849 
850  // NumberOf16bitWords counts the # of words + 1 subheader
851  // the SC includes the SC "private header" and the ROS header and trailer (= NumberOf16bitWords +3)
852  rosHistos["SCSizeVsROSSize"][code.getSCID()]->Fill(ros,data.getSCPrivHeader().NumberOf16bitWords()+3-data.getSCTrailer().wordCount());
853 
854  }
855 
856 
857 
858 
859 }
std::map< int, std::set< int > > rosBxIdsPerFED
std::map< int, std::set< int > > rosL1AIdsPerFED
int EventWordCount() const
Definition: DTDDUWords.h:270
const std::vector< DTROBHeader > & getROBHeaders() const
Definition: DTControlData.h:59
int FirstRos
const std::vector< DTTDCData > & getTDCData() const
Definition: DTControlData.h:62
int PC() const
Definition: DTDDUWords.h:620
const DTLocalTriggerSectorCollectorHeaderWord & getSCPrivHeader() const
Definition: DTControlData.h:66
void ROSWords_t(double &ResetCount_unfolded, int ROS_number, int ROSDebug_BcntResCnt, int nevents)
int l1AFifoOccupancy() const
Definition: DTDDUWords.h:269
int getROS() const
double ResetCount_unfolded
void channelsInROS(int cerosMask, std::vector< int > &channels)
void Fill(long long x)
const DTLocalTriggerTrailerWord & getSCTrailer() const
Definition: DTControlData.h:67
int getSCID() const
int TTCEventCounter() const
Definition: DTDDUWords.h:223
const std::vector< DTROSDebugWord > & getROSDebugs() const
Definition: DTControlData.h:58
const DTROSTrailerWord & getROSTrailer() const
Definition: DTControlData.h:55
const DTROSHeaderWord & getROSHeader() const
Definition: DTControlData.h:56
int TPX() const
Definition: DTDDUWords.h:268
#define LogTrace(id)
std::map< std::string, std::map< int, MonitorElement * > > rosSHistos
int getDDUID() const
int robID() const
Definition: DTDDUWords.h:419
void setROB(const int &ID)
std::map< std::string, std::map< int, MonitorElement * > > rosHistos
void setROS(const int &ID)
const std::vector< DTROBTrailerWord > & getROBTrailers() const
Definition: DTControlData.h:60
void channelsInCEROS(int cerosId, int chMask, std::vector< int > &channels)
int getROB() const
void setDDU(const int &ID)
need to reset the bits before setting
const std::vector< DTROSErrorWord > & getROSErrors() const
Definition: DTControlData.h:57
std::map< std::string, std::map< int, DTTimeEvolutionHisto * > > rosTimeHistos
const std::vector< DTTDCError > & getTDCError() const
Definition: DTControlData.h:63
int bunchID() const
Definition: DTDDUWords.h:421
int getROSID() const
void DTDataIntegrityTask::TimeHistos ( std::string  histoType)

Definition at line 490 of file DTDataIntegrityTask.cc.

References newFWLiteAna::bin, dbe, DQMStore::get(), MonitorElement::getBinContent(), MonitorElement::getNbinsX(), MonitorElement::getNbinsY(), it, j, names, and MonitorElement::setAxisRange().

490  {
491 
492  if(histoType == "Event_word_vs_time"){
493 
494  for (it = names.begin(); it != names.end(); it++) {
495 
496  if ((*it).first==histoType){
497 
498  MonitorElement * h1 =dbe->get((*it).second);
499 
500  int first_bin = -1, last_bin=-1;
501  for( int bin=1; bin < h1->getNbinsX()+1; bin++ ){
502  for( int j=1; j < h1->getNbinsY(); j++ ){
503  if( h1->getBinContent(bin,j) > 0 ) {
504  if( first_bin == -1 ) { first_bin = bin; }
505  last_bin = bin;
506  }
507  }
508  }
509 
510  if( first_bin > 1 ) { first_bin -= 1; }
511  if( last_bin < h1-> getNbinsX() ){ last_bin += 1; }
512  h1->setAxisRange(0,last_bin,1);
513  }
514  }
515  }
516 }
std::multimap< std::string, std::string > names
std::multimap< std::string, std::string >::iterator it
void setAxisRange(double xmin, double xmax, int axis=1)
set x-, y- or z-axis range (axis=1, 2, 3 respectively)
int getNbinsY(void) const
get # of bins in Y-axis
int j
Definition: DBlmapReader.cc:9
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1623
double getBinContent(int binx) const
get content of bin (1-D)
int getNbinsX(void) const
get # of bins in X-axis
std::string DTDataIntegrityTask::topFolder ( bool  isFEDIntegrity) const
private

Definition at line 1173 of file DTDataIntegrityTask.cc.

References fedIntegrityFolder, and mode.

Referenced by bookHistos().

1173  {
1174 
1175  string folder = isFEDIntegrity ? fedIntegrityFolder : "DT/00-DataIntegrity";
1176 
1177  if (!isFEDIntegrity)
1178  folder += (mode==1) ? "_SM/" : (mode==3) ? "_EvF/" : "/";
1179 
1180  return folder;
1181 
1182 }

Member Data Documentation

DTROChainCoding DTDataIntegrityTask::coding
private

Definition at line 91 of file DTDataIntegrityTask.h.

DQMStore* DTDataIntegrityTask::dbe
private

Definition at line 89 of file DTDataIntegrityTask.h.

Referenced by bookHistos(), postBeginJob(), and TimeHistos().

std::map<std::string, std::map<int, MonitorElement*> > DTDataIntegrityTask::dduHistos
private

Definition at line 96 of file DTDataIntegrityTask.h.

Referenced by processFED().

std::map<std::string, std::map<int, DTTimeEvolutionHisto*> > DTDataIntegrityTask::dduTimeHistos
private

Definition at line 114 of file DTDataIntegrityTask.h.

Referenced by preEndLumi(), and processFED().

bool DTDataIntegrityTask::doTimeHisto
private

Definition at line 82 of file DTDataIntegrityTask.h.

bool DTDataIntegrityTask::eventErrorFlag
private

Definition at line 135 of file DTDataIntegrityTask.h.

Referenced by eventHasErrors(), preProcessEvent(), and processROS25().

std::set<int> DTDataIntegrityTask::fedBXIds
private

Definition at line 138 of file DTDataIntegrityTask.h.

Referenced by preProcessEvent(), and processFED().

std::string DTDataIntegrityTask::fedIntegrityFolder
private

Definition at line 143 of file DTDataIntegrityTask.h.

Referenced by DTDataIntegrityTask(), and topFolder().

bool DTDataIntegrityTask::getSCInfo
private

Definition at line 84 of file DTDataIntegrityTask.h.

Referenced by bookHistosROS25(), DTDataIntegrityTask(), and processROS25().

MonitorElement* DTDataIntegrityTask::hCorruptionSummary
private

Definition at line 108 of file DTDataIntegrityTask.h.

Referenced by bookHistos(), and processFED().

MonitorElement* DTDataIntegrityTask::hFEDEntry
private

Definition at line 105 of file DTDataIntegrityTask.h.

Referenced by bookHistos(), fedEntry(), and processFED().

MonitorElement* DTDataIntegrityTask::hFEDFatal
private

Definition at line 106 of file DTDataIntegrityTask.h.

Referenced by bookHistos(), fedFatal(), and processFED().

MonitorElement* DTDataIntegrityTask::hFEDNonFatal
private

Definition at line 107 of file DTDataIntegrityTask.h.

Referenced by bookHistos(), and fedNonFatal().

MonitorElement* DTDataIntegrityTask::hTTSSummary
private

Definition at line 111 of file DTDataIntegrityTask.h.

Referenced by bookHistos(), and processFED().

std::multimap<std::string, std::string>::iterator DTDataIntegrityTask::it
private

Definition at line 77 of file DTDataIntegrityTask.h.

Referenced by TimeHistos().

int DTDataIntegrityTask::mode
private
int DTDataIntegrityTask::myPrevEv
private

Definition at line 126 of file DTDataIntegrityTask.h.

int DTDataIntegrityTask::myPrevFifoVal[7]
private

Definition at line 131 of file DTDataIntegrityTask.h.

int DTDataIntegrityTask::myPrevRosVal
private

Definition at line 130 of file DTDataIntegrityTask.h.

int DTDataIntegrityTask::myPrevTtsVal
private

Definition at line 129 of file DTDataIntegrityTask.h.

std::multimap<std::string, std::string> DTDataIntegrityTask::names
private

Definition at line 76 of file DTDataIntegrityTask.h.

Referenced by TimeHistos().

MonitorElement* DTDataIntegrityTask::nEventMonitor
private

Definition at line 94 of file DTDataIntegrityTask.h.

Referenced by bookHistos(), and preProcessEvent().

int DTDataIntegrityTask::nevents
private

Definition at line 86 of file DTDataIntegrityTask.h.

Referenced by preProcessEvent(), and processROS25().

int DTDataIntegrityTask::neventsDDU
private

Definition at line 119 of file DTDataIntegrityTask.h.

Referenced by DTDataIntegrityTask(), processFED(), and ~DTDataIntegrityTask().

int DTDataIntegrityTask::nEventsLS
private

Definition at line 117 of file DTDataIntegrityTask.h.

Referenced by preBeginLumi(), preEndLumi(), and preProcessEvent().

int DTDataIntegrityTask::neventsROS25
private

Definition at line 120 of file DTDataIntegrityTask.h.

Referenced by DTDataIntegrityTask(), and processROS25().

std::string DTDataIntegrityTask::outputFile
private

Definition at line 122 of file DTDataIntegrityTask.h.

edm::ParameterSet DTDataIntegrityTask::parameters
private
double DTDataIntegrityTask::rob_max[25]
private

Definition at line 123 of file DTDataIntegrityTask.h.

std::map<std::string, std::map<int, MonitorElement*> > DTDataIntegrityTask::robHistos
private

Definition at line 102 of file DTDataIntegrityTask.h.

std::map<int, std::set<int> > DTDataIntegrityTask::rosBxIdsPerFED
private

Definition at line 137 of file DTDataIntegrityTask.h.

Referenced by preProcessEvent(), processFED(), and processROS25().

std::map<std::string, std::map<int, MonitorElement*> > DTDataIntegrityTask::rosHistos
private

Definition at line 100 of file DTDataIntegrityTask.h.

Referenced by processROS25().

std::map<int, std::set<int> > DTDataIntegrityTask::rosL1AIdsPerFED
private

Definition at line 139 of file DTDataIntegrityTask.h.

Referenced by preProcessEvent(), processFED(), and processROS25().

std::map<std::string, std::map<int, MonitorElement*> > DTDataIntegrityTask::rosSHistos
private

Definition at line 98 of file DTDataIntegrityTask.h.

Referenced by processROS25().

std::map<std::string, std::map<int, DTTimeEvolutionHisto*> > DTDataIntegrityTask::rosTimeHistos
private

Definition at line 115 of file DTDataIntegrityTask.h.

Referenced by preEndLumi(), and processROS25().

float DTDataIntegrityTask::trigger_counter
private

Definition at line 121 of file DTDataIntegrityTask.h.