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.

Date:
2011/10/19 10:05:54
Revision:
1.31
Author
Marco Zanetti (INFN Padova), Gianluca Cerminara (INFN Torino)

Definition at line 39 of file DTDataIntegrityTask.h.

Constructor & Destructor Documentation

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

Definition at line 37 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().

37  : nevents(0) , dbe(0) {
38 
39  // Register the methods that we want to schedule
40  // reg.watchPostEndJob(this,&DTDataIntegrityTask::postEndJob);
43 
46 
47  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
48  << "[DTDataIntegrityTask]: Constructor" <<endl;
49 
50  neventsDDU = 0;
51  neventsROS25 = 0;
52 
53 // //If you want info VS time histos
54 // doTimeHisto = ps.getUntrackedParameter<bool>("doTimeHisto", false);
55  // Plot quantities about SC
56  getSCInfo = ps.getUntrackedParameter<bool>("getSCInfo", false);
57 
58  fedIntegrityFolder = ps.getUntrackedParameter<string>("fedIntegrityFolder","DT/FEDIntegrity");
59 
60  string processingMode = ps.getUntrackedParameter<string>("processingMode","Online");
61 
62  // processing mode flag to select plots to be produced and basedirs CB vedi se farlo meglio...
63  if (processingMode == "Online") {
64  mode = 0;
65  } else if(processingMode == "SM") {
66  mode = 1;
67  } else if (processingMode == "Offline") {
68  mode = 2;
69  } else if (processingMode == "HLT") {
70  mode = 3;
71  } else {
72  throw cms::Exception("MissingParameter")
73  << "[DTDataIntegrityTask]: processingMode :" << processingMode
74  << " invalid! Must be Online, SM, Offline or HLT !" << endl;
75  }
76 
77 }
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 81 of file DTDataIntegrityTask.cc.

References LogTrace, and neventsDDU.

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

Member Function Documentation

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

Definition at line 106 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().

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

Definition at line 528 of file DTDataIntegrityTask.cc.

References bookHistos(), getSCInfo, and mode.

Referenced by postBeginJob().

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

Definition at line 1186 of file DTDataIntegrityTask.cc.

Referenced by processROS25().

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

Definition at line 1195 of file DTDataIntegrityTask.cc.

Referenced by processROS25().

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

Definition at line 1150 of file DTDataIntegrityTask.cc.

References eventErrorFlag.

Referenced by DTDataErrorFilter::hltFilter().

1150  {
1151  return eventErrorFlag;
1152 }
void DTDataIntegrityTask::fedEntry ( int  dduID)
virtual

Implements DTDataMonitorInterface.

Definition at line 1157 of file DTDataIntegrityTask.cc.

References MonitorElement::Fill(), and hFEDEntry.

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

Implements DTDataMonitorInterface.

Definition at line 1164 of file DTDataIntegrityTask.cc.

References MonitorElement::Fill(), and hFEDFatal.

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

Implements DTDataMonitorInterface.

Definition at line 1171 of file DTDataIntegrityTask.cc.

References MonitorElement::Fill(), and hFEDNonFatal.

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

Definition at line 1264 of file DTDataIntegrityTask.cc.

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

Referenced by DTDataIntegrityTask().

1264  {
1265  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask") << "[DTDataIntegrityTask]: postBeginJob" <<endl;
1266  // get the DQMStore service if needed
1268  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask") << "[DTDataIntegrityTask] Get DQMStore service" << endl;
1269 
1270 
1271 
1272  // Loop over the DT FEDs
1273  int FEDIDmin = FEDNumbering::MINDTFEDID;
1274  int FEDIDMax = FEDNumbering::MAXDTFEDID;
1275 
1276  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
1277  << " FEDS: " << FEDIDmin << " to " << FEDIDMax << " in the RO" << endl;
1278 
1279  // book FED integrity histos
1280  bookHistos(FEDIDmin, FEDIDMax);
1281 
1282  // static booking of the histograms
1283  for(int fed = FEDIDmin; fed <= FEDIDMax; ++fed) { // loop over the FEDs in the readout
1284  DTROChainCoding code;
1285  code.setDDU(fed);
1286 
1287  bookHistos( string("ROS_S"), code);
1288 
1289  bookHistos( string("DDU"), code);
1290 
1291  for(int ros = 1; ros <= 12; ++ros) {// loop over all ROS
1292  code.setROS(ros);
1293  bookHistosROS25(code);
1294  }
1295  }
1296 
1297 }
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 97 of file DTDataIntegrityTask.cc.

References LogTrace.

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

Definition at line 1232 of file DTDataIntegrityTask.cc.

References nEventsLS.

Referenced by DTDataIntegrityTask().

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

Definition at line 1238 of file DTDataIntegrityTask.cc.

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

Referenced by DTDataIntegrityTask().

1238  {
1239 
1240  int lumiBlock = ls.luminosityBlock();
1241 
1242  map<std::string, map<int, DTTimeEvolutionHisto*> >::iterator dduIt = dduTimeHistos.begin();
1243  map<std::string, map<int, DTTimeEvolutionHisto*> >::iterator dduEnd = dduTimeHistos.end();
1244  for(; dduIt!=dduEnd; ++dduIt) {
1245  map<int, DTTimeEvolutionHisto*>::iterator histoIt = dduIt->second.begin();
1246  map<int, DTTimeEvolutionHisto*>::iterator histoEnd = dduIt->second.end();
1247  for(; histoIt!=histoEnd; ++histoIt) {
1248  histoIt->second->updateTimeSlot(lumiBlock,nEventsLS);
1249  }
1250  }
1251 
1252  map<std::string, map<int, DTTimeEvolutionHisto*> >::iterator rosIt = rosTimeHistos.begin();
1253  map<std::string, map<int, DTTimeEvolutionHisto*> >::iterator rosEnd = rosTimeHistos.end();
1254  for(; rosIt!=rosEnd; ++rosIt) {
1255  map<int, DTTimeEvolutionHisto*>::iterator histoIt = rosIt->second.begin();
1256  map<int, DTTimeEvolutionHisto*>::iterator histoEnd = rosIt->second.end();
1257  for(; histoIt!=histoEnd; ++histoIt) {
1258  histoIt->second->updateTimeSlot(lumiBlock,nEventsLS);
1259  }
1260  }
1261 
1262 }
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 1206 of file DTDataIntegrityTask.cc.

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

Referenced by DTDataIntegrityTask().

1206  {
1207 
1208  nevents++;
1210 
1211  nEventsLS++;
1212 
1213  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask") << "[DTDataIntegrityTask]: preProcessEvent" <<endl;
1214  // clear the set of BXids from the ROSs
1215  for(map<int, set<int> >::iterator rosBxIds = rosBxIdsPerFED.begin();
1216  rosBxIds != rosBxIdsPerFED.end(); ++rosBxIds) {
1217  (*rosBxIds).second.clear();
1218  }
1219 
1220  fedBXIds.clear();
1221 
1222  for(map<int, set<int> >::iterator rosL1AIds = rosL1AIdsPerFED.begin();
1223  rosL1AIds != rosL1AIdsPerFED.end(); ++rosL1AIds) {
1224  (*rosL1AIds).second.clear();
1225  }
1226 
1227  // reset the error flag
1228  eventErrorFlag = false;
1229 
1230 }
std::map< int, std::set< int > > rosBxIdsPerFED
std::map< int, std::set< int > > rosL1AIdsPerFED
dictionary map
Definition: Association.py:205
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 863 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().

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

Implements DTDataMonitorInterface.

Definition at line 540 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().

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

Definition at line 492 of file DTDataIntegrityTask.cc.

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

492  {
493 
494  if(histoType == "Event_word_vs_time"){
495 
496  for (it = names.begin(); it != names.end(); it++) {
497 
498  if ((*it).first==histoType){
499 
500  MonitorElement * h1 =dbe->get((*it).second);
501 
502  int first_bin = -1, last_bin=-1;
503  for( int bin=1; bin < h1->getNbinsX()+1; bin++ ){
504  for( int j=1; j < h1->getNbinsY(); j++ ){
505  if( h1->getBinContent(bin,j) > 0 ) {
506  if( first_bin == -1 ) { first_bin = bin; }
507  last_bin = bin;
508  }
509  }
510  }
511 
512  if( first_bin > 1 ) { first_bin -= 1; }
513  if( last_bin < h1-> getNbinsX() ){ last_bin += 1; }
514  h1->setAxisRange(0,last_bin,1);
515  }
516  }
517  }
518 }
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:1473
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 1175 of file DTDataIntegrityTask.cc.

References fedIntegrityFolder, and mode.

Referenced by bookHistos().

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

Member Data Documentation

DTROChainCoding DTDataIntegrityTask::coding
private

Definition at line 93 of file DTDataIntegrityTask.h.

DQMStore* DTDataIntegrityTask::dbe
private

Definition at line 91 of file DTDataIntegrityTask.h.

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

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

Definition at line 98 of file DTDataIntegrityTask.h.

Referenced by processFED().

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

Definition at line 116 of file DTDataIntegrityTask.h.

Referenced by preEndLumi(), and processFED().

bool DTDataIntegrityTask::doTimeHisto
private

Definition at line 84 of file DTDataIntegrityTask.h.

bool DTDataIntegrityTask::eventErrorFlag
private

Definition at line 137 of file DTDataIntegrityTask.h.

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

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

Definition at line 140 of file DTDataIntegrityTask.h.

Referenced by preProcessEvent(), and processFED().

std::string DTDataIntegrityTask::fedIntegrityFolder
private

Definition at line 145 of file DTDataIntegrityTask.h.

Referenced by DTDataIntegrityTask(), and topFolder().

bool DTDataIntegrityTask::getSCInfo
private

Definition at line 86 of file DTDataIntegrityTask.h.

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

MonitorElement* DTDataIntegrityTask::hCorruptionSummary
private

Definition at line 110 of file DTDataIntegrityTask.h.

Referenced by bookHistos(), and processFED().

MonitorElement* DTDataIntegrityTask::hFEDEntry
private

Definition at line 107 of file DTDataIntegrityTask.h.

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

MonitorElement* DTDataIntegrityTask::hFEDFatal
private

Definition at line 108 of file DTDataIntegrityTask.h.

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

MonitorElement* DTDataIntegrityTask::hFEDNonFatal
private

Definition at line 109 of file DTDataIntegrityTask.h.

Referenced by bookHistos(), and fedNonFatal().

MonitorElement* DTDataIntegrityTask::hTTSSummary
private

Definition at line 113 of file DTDataIntegrityTask.h.

Referenced by bookHistos(), and processFED().

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

Definition at line 79 of file DTDataIntegrityTask.h.

Referenced by TimeHistos().

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

Definition at line 128 of file DTDataIntegrityTask.h.

int DTDataIntegrityTask::myPrevFifoVal[7]
private

Definition at line 133 of file DTDataIntegrityTask.h.

int DTDataIntegrityTask::myPrevRosVal
private

Definition at line 132 of file DTDataIntegrityTask.h.

int DTDataIntegrityTask::myPrevTtsVal
private

Definition at line 131 of file DTDataIntegrityTask.h.

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

Definition at line 78 of file DTDataIntegrityTask.h.

Referenced by TimeHistos().

MonitorElement* DTDataIntegrityTask::nEventMonitor
private

Definition at line 96 of file DTDataIntegrityTask.h.

Referenced by bookHistos(), and preProcessEvent().

int DTDataIntegrityTask::nevents
private

Definition at line 88 of file DTDataIntegrityTask.h.

Referenced by preProcessEvent(), and processROS25().

int DTDataIntegrityTask::neventsDDU
private

Definition at line 121 of file DTDataIntegrityTask.h.

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

int DTDataIntegrityTask::nEventsLS
private

Definition at line 119 of file DTDataIntegrityTask.h.

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

int DTDataIntegrityTask::neventsROS25
private

Definition at line 122 of file DTDataIntegrityTask.h.

Referenced by DTDataIntegrityTask(), and processROS25().

std::string DTDataIntegrityTask::outputFile
private

Definition at line 124 of file DTDataIntegrityTask.h.

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

Definition at line 125 of file DTDataIntegrityTask.h.

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

Definition at line 104 of file DTDataIntegrityTask.h.

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

Definition at line 139 of file DTDataIntegrityTask.h.

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

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

Definition at line 102 of file DTDataIntegrityTask.h.

Referenced by processROS25().

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

Definition at line 141 of file DTDataIntegrityTask.h.

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

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

Definition at line 100 of file DTDataIntegrityTask.h.

Referenced by processROS25().

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

Definition at line 117 of file DTDataIntegrityTask.h.

Referenced by preEndLumi(), and processROS25().

float DTDataIntegrityTask::trigger_counter
private

Definition at line 123 of file DTDataIntegrityTask.h.