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 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
 
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
 
int neventsDDU
 
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
 
float trigger_counter
 

Detailed Description

Class for DT Data Integrity.

Date:
2010/04/14 18:21:20
Revision:
1.28
Author
Marco Zanetti (INFN Padova), Gianluca Cerminara (INFN Torino)

Definition at line 38 of file DTDataIntegrityTask.h.

Constructor & Destructor Documentation

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

Definition at line 36 of file DTDataIntegrityTask.cc.

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

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

Definition at line 77 of file DTDataIntegrityTask.cc.

References LogTrace, and neventsDDU.

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

Member Function Documentation

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

Definition at line 102 of file DTDataIntegrityTask.cc.

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

Referenced by bookHistosROS25(), and postBeginJob().

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

Definition at line 516 of file DTDataIntegrityTask.cc.

References bookHistos(), getSCInfo, and mode.

Referenced by postBeginJob().

516  {
517  bookHistos( string("ROS"), code);
518 // for(int robId = 0; robId != 25; ++robId) {
519 // code.setROB(robId);
520 // bookHistos( string("TDCError"), code);
521 // }
522  if(mode <= 1)
523  if(getSCInfo)
524  bookHistos( string("SC"), code);
525 }
void bookHistos(const int fedMin, const int fedMax)
void DTDataIntegrityTask::channelsInCEROS ( int  cerosId,
int  chMask,
std::vector< int > &  channels 
)
private

Definition at line 1164 of file DTDataIntegrityTask.cc.

Referenced by processROS25().

1164  {
1165  for (int iCh=0; iCh<6;++iCh) {
1166  if ((chMask >> iCh) & 0x1){
1167  channels.push_back(cerosId*6+iCh);
1168  }
1169  }
1170  return;
1171 }
void DTDataIntegrityTask::channelsInROS ( int  cerosMask,
std::vector< int > &  channels 
)
private

Definition at line 1173 of file DTDataIntegrityTask.cc.

Referenced by processROS25().

1173  {
1174  for (int iCeros=0; iCeros<5;++iCeros) {
1175  if ((cerosMask >> iCeros) & 0x1){
1176  for (int iCh=0; iCh<6;++iCh) {
1177  channels.push_back(iCeros*6+iCh);
1178  }
1179  }
1180  }
1181  return;
1182 }
bool DTDataIntegrityTask::eventHasErrors ( ) const

Definition at line 1128 of file DTDataIntegrityTask.cc.

References eventErrorFlag.

Referenced by DTDataErrorFilter::filter().

1128  {
1129  return eventErrorFlag;
1130 }
void DTDataIntegrityTask::fedEntry ( int  dduID)
virtual

Implements DTDataMonitorInterface.

Definition at line 1135 of file DTDataIntegrityTask.cc.

References MonitorElement::Fill(), and hFEDEntry.

1135  {
1136  hFEDEntry->Fill(dduID);
1137 }
void Fill(long long x)
MonitorElement * hFEDEntry
void DTDataIntegrityTask::fedFatal ( int  dduID)
virtual

Implements DTDataMonitorInterface.

Definition at line 1142 of file DTDataIntegrityTask.cc.

References MonitorElement::Fill(), and hFEDFatal.

1142  {
1143  hFEDFatal->Fill(dduID);
1144 }
MonitorElement * hFEDFatal
void Fill(long long x)
void DTDataIntegrityTask::fedNonFatal ( int  dduID)
virtual

Implements DTDataMonitorInterface.

Definition at line 1149 of file DTDataIntegrityTask.cc.

References MonitorElement::Fill(), and hFEDNonFatal.

1149  {
1150  hFEDNonFatal->Fill(dduID);
1151 }
MonitorElement * hFEDNonFatal
void Fill(long long x)
void DTDataIntegrityTask::postBeginJob ( )

Definition at line 1207 of file DTDataIntegrityTask.cc.

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

Referenced by DTDataIntegrityTask().

1207  {
1208  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask") << "[DTDataIntegrityTask]: postBeginJob" <<endl;
1209  // get the DQMStore service if needed
1211  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask") << "[DTDataIntegrityTask] Get DQMStore service" << endl;
1212 
1213 
1214 
1215  // Loop over the DT FEDs
1216  int FEDIDmin = FEDNumbering::MINDTFEDID;
1217  int FEDIDMax = FEDNumbering::MAXDTFEDID;
1218 
1219  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
1220  << " FEDS: " << FEDIDmin << " to " << FEDIDMax << " in the RO" << endl;
1221 
1222  // book FED integrity histos
1223  bookHistos(FEDIDmin, FEDIDMax);
1224 
1225  // static booking of the histograms
1226  for(int fed = FEDIDmin; fed <= FEDIDMax; ++fed) { // loop over the FEDs in the readout
1227  DTROChainCoding code;
1228  code.setDDU(fed);
1229 
1230  bookHistos( string("ROS_S"), code);
1231 
1232  bookHistos( string("DDU"), code);
1233 
1234  for(int ros = 1; ros <= 12; ++ros) {// loop over all ROS
1235  code.setROS(ros);
1236  bookHistosROS25(code);
1237  }
1238  }
1239 
1240 }
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 93 of file DTDataIntegrityTask.cc.

References LogTrace.

93  {
94  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
95  << "[DTDataIntegrityTask]: postEndJob called!" <<endl;
96 
97 // if(doTimeHisto) TimeHistos("Event_word_vs_time");
98 
99 }
#define LogTrace(id)
void DTDataIntegrityTask::preProcessEvent ( const edm::EventID iEvtid,
const edm::Timestamp iTime 
)

Definition at line 1184 of file DTDataIntegrityTask.cc.

References eventErrorFlag, fedBXIds, LogTrace, python.multivaluedict::map(), rosBxIdsPerFED, and rosL1AIdsPerFED.

Referenced by DTDataIntegrityTask().

1184  {
1185  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask") << "[DTDataIntegrityTask]: preProcessEvent" <<endl;
1186  // clear the set of BXids from the ROSs
1187  for(map<int, set<int> >::iterator rosBxIds = rosBxIdsPerFED.begin();
1188  rosBxIds != rosBxIdsPerFED.end(); ++rosBxIds) {
1189  (*rosBxIds).second.clear();
1190  }
1191 
1192  fedBXIds.clear();
1193 
1194  for(map<int, set<int> >::iterator rosL1AIds = rosL1AIdsPerFED.begin();
1195  rosL1AIds != rosL1AIdsPerFED.end(); ++rosL1AIds) {
1196  (*rosL1AIds).second.clear();
1197  }
1198 
1199 
1200 
1201  // reset the error flag
1202  eventErrorFlag = false;
1203 }
std::map< int, std::set< int > > rosBxIdsPerFED
std::map< int, std::set< int > > rosL1AIdsPerFED
#define LogTrace(id)
std::set< int > fedBXIds
void DTDataIntegrityTask::processFED ( DTDDUData dduData,
const std::vector< DTROS25Data > &  rosData,
int  dduID 
)
virtual

Implements DTDataMonitorInterface.

Definition at line 842 of file DTDataIntegrityTask.cc.

References DTDDUSecondStatusWord::busyROSPAF(), FEDHeader::bxID(), DTDDUSecondStatusWord::bxIDError(), FEDTrailer::check(), FEDHeader::check(), DTDDUData::crcErrorBit(), dduHistos, 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().

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

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

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

480  {
481 
482  if(histoType == "Event_word_vs_time"){
483 
484  for (it = names.begin(); it != names.end(); it++) {
485 
486  if ((*it).first==histoType){
487 
488  MonitorElement * h1 =dbe->get((*it).second);
489 
490  int first_bin = -1, last_bin=-1;
491  for( int bin=1; bin < h1->getNbinsX()+1; bin++ ){
492  for( int j=1; j < h1->getNbinsY(); j++ ){
493  if( h1->getBinContent(bin,j) > 0 ) {
494  if( first_bin == -1 ) { first_bin = bin; }
495  last_bin = bin;
496  }
497  }
498  }
499 
500  if( first_bin > 1 ) { first_bin -= 1; }
501  if( last_bin < h1-> getNbinsX() ){ last_bin += 1; }
502  h1->setAxisRange(0,last_bin,1);
503  }
504  }
505  }
506 }
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:1265
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 1153 of file DTDataIntegrityTask.cc.

References fedIntegrityFolder, and mode.

Referenced by bookHistos().

1153  {
1154 
1155  string folder = isFEDIntegrity ? fedIntegrityFolder : "DT/00-DataIntegrity";
1156 
1157  if (!isFEDIntegrity)
1158  folder += (mode==1) ? "_SM/" : (mode==3) ? "_EvF/" : "/";
1159 
1160  return folder;
1161 
1162 }

Member Data Documentation

DTROChainCoding DTDataIntegrityTask::coding
private

Definition at line 87 of file DTDataIntegrityTask.h.

DQMStore* DTDataIntegrityTask::dbe
private

Definition at line 85 of file DTDataIntegrityTask.h.

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

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

Definition at line 91 of file DTDataIntegrityTask.h.

Referenced by processFED().

bool DTDataIntegrityTask::doTimeHisto
private

Definition at line 80 of file DTDataIntegrityTask.h.

bool DTDataIntegrityTask::eventErrorFlag
private

Definition at line 124 of file DTDataIntegrityTask.h.

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

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

Definition at line 127 of file DTDataIntegrityTask.h.

Referenced by preProcessEvent(), and processFED().

std::string DTDataIntegrityTask::fedIntegrityFolder
private

Definition at line 132 of file DTDataIntegrityTask.h.

Referenced by DTDataIntegrityTask(), and topFolder().

bool DTDataIntegrityTask::getSCInfo
private

Definition at line 82 of file DTDataIntegrityTask.h.

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

MonitorElement* DTDataIntegrityTask::hCorruptionSummary
private

Definition at line 103 of file DTDataIntegrityTask.h.

Referenced by bookHistos(), and processFED().

MonitorElement* DTDataIntegrityTask::hFEDEntry
private

Definition at line 100 of file DTDataIntegrityTask.h.

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

MonitorElement* DTDataIntegrityTask::hFEDFatal
private

Definition at line 101 of file DTDataIntegrityTask.h.

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

MonitorElement* DTDataIntegrityTask::hFEDNonFatal
private

Definition at line 102 of file DTDataIntegrityTask.h.

Referenced by bookHistos(), and fedNonFatal().

MonitorElement* DTDataIntegrityTask::hTTSSummary
private

Definition at line 106 of file DTDataIntegrityTask.h.

Referenced by bookHistos(), and processFED().

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

Definition at line 75 of file DTDataIntegrityTask.h.

Referenced by TimeHistos().

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

Definition at line 115 of file DTDataIntegrityTask.h.

int DTDataIntegrityTask::myPrevFifoVal[7]
private

Definition at line 120 of file DTDataIntegrityTask.h.

int DTDataIntegrityTask::myPrevRosVal
private

Definition at line 119 of file DTDataIntegrityTask.h.

int DTDataIntegrityTask::myPrevTtsVal
private

Definition at line 118 of file DTDataIntegrityTask.h.

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

Definition at line 74 of file DTDataIntegrityTask.h.

Referenced by TimeHistos().

int DTDataIntegrityTask::neventsDDU
private

Definition at line 108 of file DTDataIntegrityTask.h.

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

int DTDataIntegrityTask::neventsROS25
private

Definition at line 109 of file DTDataIntegrityTask.h.

Referenced by DTDataIntegrityTask(), and processROS25().

std::string DTDataIntegrityTask::outputFile
private

Definition at line 111 of file DTDataIntegrityTask.h.

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

Definition at line 112 of file DTDataIntegrityTask.h.

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

Definition at line 97 of file DTDataIntegrityTask.h.

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

Definition at line 126 of file DTDataIntegrityTask.h.

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

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

Definition at line 95 of file DTDataIntegrityTask.h.

Referenced by processROS25().

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

Definition at line 128 of file DTDataIntegrityTask.h.

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

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

Definition at line 93 of file DTDataIntegrityTask.h.

Referenced by processROS25().

float DTDataIntegrityTask::trigger_counter
private

Definition at line 110 of file DTDataIntegrityTask.h.