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:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c) override
 
void beginJob () override
 
void beginLuminosityBlock (const edm::LuminosityBlock &ls, const edm::EventSetup &es) override
 
 DTDataIntegrityTask (const edm::ParameterSet &ps)
 
void endJob () override
 
void endLuminosityBlock (const edm::LuminosityBlock &ls, const edm::EventSetup &es) override
 
bool eventHasErrors () const
 
void fedEntry (int dduID)
 
void fedFatal (int dduID)
 
void fedNonFatal (int dduID)
 
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 edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

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
 
edm::EDGetTokenT< DTDDUCollectiondduToken
 
bool doTimeHisto
 
bool eventErrorFlag
 
std::set< int > fedBXIds
 
int FEDIDMax
 
int FEDIDmin
 
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
 
edm::EDGetTokenT
< DTROS25Collection
ros25Token
 
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
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Class for DT Data Integrity.

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)

Definition at line 34 of file DTDataIntegrityTask.cc.

References dduToken, edm::hlt::Exception, fedIntegrityFolder, edm::ParameterSet::getParameter(), getSCInfo, edm::ParameterSet::getUntrackedParameter(), LogTrace, mode, neventsDDU, neventsROS25, dtDQMClient_cfg::processingMode, and ros25Token.

34  : nevents(0) , dbe(0) {
35 
36  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
37  << "[DTDataIntegrityTask]: Constructor" <<endl;
38 
39  dduToken = consumes<DTDDUCollection>(ps.getParameter<InputTag>("dtDDULabel"));
40  ros25Token = consumes<DTROS25Collection>(ps.getParameter<InputTag>("dtROS25Label"));
41 
42  neventsDDU = 0;
43  neventsROS25 = 0;
44 
45 // //If you want info VS time histos
46 // doTimeHisto = ps.getUntrackedParameter<bool>("doTimeHisto", false);
47  // Plot quantities about SC
48  getSCInfo = ps.getUntrackedParameter<bool>("getSCInfo", false);
49 
50  fedIntegrityFolder = ps.getUntrackedParameter<string>("fedIntegrityFolder","DT/FEDIntegrity");
51 
52  string processingMode = ps.getUntrackedParameter<string>("processingMode","Online");
53 
54  // processing mode flag to select plots to be produced and basedirs CB vedi se farlo meglio...
55  if (processingMode == "Online") {
56  mode = 0;
57  } else if(processingMode == "SM") {
58  mode = 1;
59  } else if (processingMode == "Offline") {
60  mode = 2;
61  } else if (processingMode == "HLT") {
62  mode = 3;
63  } else {
64  throw cms::Exception("MissingParameter")
65  << "[DTDataIntegrityTask]: processingMode :" << processingMode
66  << " invalid! Must be Online, SM, Offline or HLT !" << endl;
67  }
68 
69 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< DTROS25Collection > ros25Token
#define LogTrace(id)
edm::EDGetTokenT< DTDDUCollection > dduToken
DTDataIntegrityTask::~DTDataIntegrityTask ( )
virtual

Definition at line 73 of file DTDataIntegrityTask.cc.

References LogTrace, and neventsDDU.

73  {
74  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
75  <<"[DTDataIntegrityTask]: Destructor. Analyzed "<< neventsDDU <<" events"<<endl;
76 }
#define LogTrace(id)

Member Function Documentation

void DTDataIntegrityTask::analyze ( const edm::Event e,
const edm::EventSetup c 
)
overridevirtual

Implements edm::EDAnalyzer.

Definition at line 1265 of file DTDataIntegrityTask.cc.

References dduToken, eventErrorFlag, fedBXIds, MonitorElement::Fill(), edm::Event::getByToken(), DTDDUData::getDDUHeader(), i, edm::HandleBase::isValid(), j, LogTrace, python.multivaluedict::map(), nEventMonitor, nevents, nEventsLS, processFED(), processROS25(), ros25Token, rosBxIdsPerFED, rosL1AIdsPerFED, and FEDHeader::sourceID().

1266 {
1267  nevents++;
1269 
1270  nEventsLS++;
1271 
1272  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask") << "[DTDataIntegrityTask]: preProcessEvent" <<endl;
1273  // clear the set of BXids from the ROSs
1274  for(map<int, set<int> >::iterator rosBxIds = rosBxIdsPerFED.begin(); rosBxIds != rosBxIdsPerFED.end(); ++rosBxIds) {
1275  (*rosBxIds).second.clear();
1276  }
1277 
1278  fedBXIds.clear();
1279 
1280  for(map<int, set<int> >::iterator rosL1AIds = rosL1AIdsPerFED.begin(); rosL1AIds != rosL1AIdsPerFED.end(); ++rosL1AIds) {
1281  (*rosL1AIds).second.clear();
1282  }
1283 
1284  // reset the error flag
1285  eventErrorFlag = false;
1286 
1287  // Digi collection
1288  edm::Handle<DTDDUCollection> dduProduct;
1289  e.getByToken(dduToken, dduProduct);
1290  edm::Handle<DTROS25Collection> ros25Product;
1291  e.getByToken(ros25Token, ros25Product);
1292 
1293  DTDDUData dduData;
1294  std::vector<DTROS25Data> ros25Data;
1295 
1296  if(dduProduct.isValid() && ros25Product.isValid()) {
1297  for(unsigned int i=0; i<dduProduct->size(); ++i)
1298  {
1299  dduData = dduProduct->at(i);
1300  ros25Data = ros25Product->at(i);
1301  // FIXME: passing id variable is not needed anymore - change processFED interface for next release!
1302  FEDHeader header = dduData.getDDUHeader();
1303  int id = header.sourceID();
1304  processFED(dduData, ros25Data, id);
1305  for(unsigned int j=0; j < ros25Data.size(); ++j) {
1306  int rosid = j+1;
1307  processROS25(ros25Data[j],id,rosid);
1308  }
1309  }
1310  }
1311 }
std::map< int, std::set< int > > rosBxIdsPerFED
std::map< int, std::set< int > > rosL1AIdsPerFED
int i
Definition: DBlmapReader.cc:9
void processFED(DTDDUData &dduData, const std::vector< DTROS25Data > &rosData, int dduID)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:446
void Fill(long long x)
edm::EDGetTokenT< DTROS25Collection > ros25Token
int sourceID()
Identifier of the FED.
Definition: FEDHeader.cc:28
void processROS25(DTROS25Data &data, int dduID, int ros)
int j
Definition: DBlmapReader.cc:9
bool isValid() const
Definition: HandleBase.h:76
#define LogTrace(id)
MonitorElement * nEventMonitor
const FEDHeader & getDDUHeader() const
Getters.
std::set< int > fedBXIds
edm::EDGetTokenT< DTDDUCollection > dduToken
void DTDataIntegrityTask::beginJob ( void  )
overridevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 1229 of file DTDataIntegrityTask.cc.

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

1229  {
1230  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask") << "[DTDataIntegrityTask]: postBeginJob" <<endl;
1231  // get the DQMStore service if needed
1233  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask") << "[DTDataIntegrityTask] Get DQMStore service" << endl;
1234 
1235 
1236 
1237  // Loop over the DT FEDs
1240 
1241  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
1242  << " FEDS: " << FEDIDmin << " to " << FEDIDMax << " in the RO" << endl;
1243 
1244  // book FED integrity histos
1246 
1247  // static booking of the histograms
1248  for(int fed = FEDIDmin; fed <= FEDIDMax; ++fed) { // loop over the FEDs in the readout
1249  DTROChainCoding code;
1250  code.setDDU(fed);
1251 
1252  bookHistos( string("ROS_S"), code);
1253 
1254  bookHistos( string("DDU"), code);
1255 
1256  for(int ros = 1; ros <= 12; ++ros) {// loop over all ROS
1257  code.setROS(ros);
1258  bookHistosROS25(code);
1259  }
1260  }
1261 
1262 }
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::beginLuminosityBlock ( const edm::LuminosityBlock ls,
const edm::EventSetup es 
)
overridevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 1197 of file DTDataIntegrityTask.cc.

References nEventsLS.

1197  {
1198 
1199  nEventsLS = 0;
1200 
1201 }
void DTDataIntegrityTask::bookHistos ( const int  fedMin,
const int  fedMax 
)
private

Definition at line 98 of file DTDataIntegrityTask.cc.

References dbe, hCorruptionSummary, hFEDEntry, hFEDFatal, hFEDNonFatal, hTTSSummary, nEventMonitor, MonitorElement::setAxisTitle(), MonitorElement::setBinLabel(), and topFolder().

Referenced by beginJob(), and bookHistosROS25().

98  {
99 
100  dbe->setCurrentFolder("DT/EventInfo/Counters");
101  nEventMonitor = dbe->bookFloat("nProcessedEventsDataIntegrity");
102 
103  // Standard FED integrity histos
104  dbe->setCurrentFolder(topFolder(true));
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 }
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 * nEventMonitor
std::string topFolder(bool isFEDIntegrity) const
MonitorElement * hFEDEntry
MonitorElement * hTTSSummary
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
MonitorElement * hCorruptionSummary
void DTDataIntegrityTask::bookHistos ( std::string  folder,
DTROChainCoding  code 
)
private
void DTDataIntegrityTask::bookHistosROS25 ( DTROChainCoding  code)
private

Definition at line 520 of file DTDataIntegrityTask.cc.

References bookHistos(), getSCInfo, and mode.

Referenced by beginJob().

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

Definition at line 1177 of file DTDataIntegrityTask.cc.

Referenced by processROS25().

1177  {
1178  for (int iCh=0; iCh<6;++iCh) {
1179  if ((chMask >> iCh) & 0x1){
1180  channels.push_back(cerosId*6+iCh);
1181  }
1182  }
1183  return;
1184 }
void DTDataIntegrityTask::channelsInROS ( int  cerosMask,
std::vector< int > &  channels 
)
private

Definition at line 1186 of file DTDataIntegrityTask.cc.

Referenced by processROS25().

1186  {
1187  for (int iCeros=0; iCeros<5;++iCeros) {
1188  if ((cerosMask >> iCeros) & 0x1){
1189  for (int iCh=0; iCh<6;++iCh) {
1190  channels.push_back(iCeros*6+iCh);
1191  }
1192  }
1193  }
1194  return;
1195 }
void DTDataIntegrityTask::endJob ( void  )
overridevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 89 of file DTDataIntegrityTask.cc.

References LogTrace.

89  {
90  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
91  << "[DTDataIntegrityTask]: postEndJob called!" <<endl;
92 
93 // if(doTimeHisto) TimeHistos("Event_word_vs_time");
94 
95 }
#define LogTrace(id)
void DTDataIntegrityTask::endLuminosityBlock ( const edm::LuminosityBlock ls,
const edm::EventSetup es 
)
overridevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 1203 of file DTDataIntegrityTask.cc.

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

1203  {
1204 
1205  int lumiBlock = ls.luminosityBlock();
1206 
1207  map<std::string, map<int, DTTimeEvolutionHisto*> >::iterator dduIt = dduTimeHistos.begin();
1208  map<std::string, map<int, DTTimeEvolutionHisto*> >::iterator dduEnd = dduTimeHistos.end();
1209  for(; dduIt!=dduEnd; ++dduIt) {
1210  map<int, DTTimeEvolutionHisto*>::iterator histoIt = dduIt->second.begin();
1211  map<int, DTTimeEvolutionHisto*>::iterator histoEnd = dduIt->second.end();
1212  for(; histoIt!=histoEnd; ++histoIt) {
1213  histoIt->second->updateTimeSlot(lumiBlock,nEventsLS);
1214  }
1215  }
1216 
1217  map<std::string, map<int, DTTimeEvolutionHisto*> >::iterator rosIt = rosTimeHistos.begin();
1218  map<std::string, map<int, DTTimeEvolutionHisto*> >::iterator rosEnd = rosTimeHistos.end();
1219  for(; rosIt!=rosEnd; ++rosIt) {
1220  map<int, DTTimeEvolutionHisto*>::iterator histoIt = rosIt->second.begin();
1221  map<int, DTTimeEvolutionHisto*>::iterator histoEnd = rosIt->second.end();
1222  for(; histoIt!=histoEnd; ++histoIt) {
1223  histoIt->second->updateTimeSlot(lumiBlock,nEventsLS);
1224  }
1225  }
1226 
1227 }
std::map< std::string, std::map< int, DTTimeEvolutionHisto * > > dduTimeHistos
LuminosityBlockNumber_t luminosityBlock() const
std::map< std::string, std::map< int, DTTimeEvolutionHisto * > > rosTimeHistos
bool DTDataIntegrityTask::eventHasErrors ( ) const

Definition at line 1141 of file DTDataIntegrityTask.cc.

References eventErrorFlag.

Referenced by DTDataErrorFilter::hltFilter().

1141  {
1142  return eventErrorFlag;
1143 }
void DTDataIntegrityTask::fedEntry ( int  dduID)

Definition at line 1148 of file DTDataIntegrityTask.cc.

References MonitorElement::Fill(), and hFEDEntry.

1148  {
1149  hFEDEntry->Fill(dduID);
1150 }
void Fill(long long x)
MonitorElement * hFEDEntry
void DTDataIntegrityTask::fedFatal ( int  dduID)

Definition at line 1155 of file DTDataIntegrityTask.cc.

References MonitorElement::Fill(), and hFEDFatal.

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

Definition at line 1162 of file DTDataIntegrityTask.cc.

References MonitorElement::Fill(), and hFEDNonFatal.

1162  {
1163  hFEDNonFatal->Fill(dduID);
1164 }
MonitorElement * hFEDNonFatal
void Fill(long long x)
void DTDataIntegrityTask::processFED ( DTDDUData dduData,
const std::vector< DTROS25Data > &  rosData,
int  dduID 
)

Definition at line 854 of file DTDataIntegrityTask.cc.

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

Referenced by analyze().

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

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

Referenced by analyze().

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

Definition at line 484 of file DTDataIntegrityTask.cc.

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

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

References fedIntegrityFolder, and mode.

Referenced by bookHistos().

1166  {
1167 
1168  string folder = isFEDIntegrity ? fedIntegrityFolder : "DT/00-DataIntegrity";
1169 
1170  if (!isFEDIntegrity)
1171  folder += (mode==1) ? "_SM/" : (mode==3) ? "_EvF/" : "/";
1172 
1173  return folder;
1174 
1175 }

Member Data Documentation

DTROChainCoding DTDataIntegrityTask::coding
private

Definition at line 94 of file DTDataIntegrityTask.h.

DQMStore* DTDataIntegrityTask::dbe
private

Definition at line 92 of file DTDataIntegrityTask.h.

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

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

Definition at line 99 of file DTDataIntegrityTask.h.

Referenced by processFED().

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

Definition at line 117 of file DTDataIntegrityTask.h.

Referenced by endLuminosityBlock(), and processFED().

edm::EDGetTokenT<DTDDUCollection> DTDataIntegrityTask::dduToken
private

Definition at line 153 of file DTDataIntegrityTask.h.

Referenced by analyze(), and DTDataIntegrityTask().

bool DTDataIntegrityTask::doTimeHisto
private

Definition at line 85 of file DTDataIntegrityTask.h.

bool DTDataIntegrityTask::eventErrorFlag
private

Definition at line 142 of file DTDataIntegrityTask.h.

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

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

Definition at line 145 of file DTDataIntegrityTask.h.

Referenced by analyze(), and processFED().

int DTDataIntegrityTask::FEDIDMax
private

Definition at line 129 of file DTDataIntegrityTask.h.

Referenced by beginJob(), and processFED().

int DTDataIntegrityTask::FEDIDmin
private

Definition at line 128 of file DTDataIntegrityTask.h.

Referenced by beginJob(), and processFED().

std::string DTDataIntegrityTask::fedIntegrityFolder
private

Definition at line 150 of file DTDataIntegrityTask.h.

Referenced by DTDataIntegrityTask(), and topFolder().

bool DTDataIntegrityTask::getSCInfo
private

Definition at line 87 of file DTDataIntegrityTask.h.

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

MonitorElement* DTDataIntegrityTask::hCorruptionSummary
private

Definition at line 111 of file DTDataIntegrityTask.h.

Referenced by bookHistos(), and processFED().

MonitorElement* DTDataIntegrityTask::hFEDEntry
private

Definition at line 108 of file DTDataIntegrityTask.h.

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

MonitorElement* DTDataIntegrityTask::hFEDFatal
private

Definition at line 109 of file DTDataIntegrityTask.h.

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

MonitorElement* DTDataIntegrityTask::hFEDNonFatal
private

Definition at line 110 of file DTDataIntegrityTask.h.

Referenced by bookHistos(), and fedNonFatal().

MonitorElement* DTDataIntegrityTask::hTTSSummary
private

Definition at line 114 of file DTDataIntegrityTask.h.

Referenced by bookHistos(), and processFED().

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

Definition at line 80 of file DTDataIntegrityTask.h.

Referenced by TimeHistos().

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

Definition at line 133 of file DTDataIntegrityTask.h.

int DTDataIntegrityTask::myPrevFifoVal[7]
private

Definition at line 138 of file DTDataIntegrityTask.h.

int DTDataIntegrityTask::myPrevRosVal
private

Definition at line 137 of file DTDataIntegrityTask.h.

int DTDataIntegrityTask::myPrevTtsVal
private

Definition at line 136 of file DTDataIntegrityTask.h.

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

Definition at line 79 of file DTDataIntegrityTask.h.

Referenced by TimeHistos().

MonitorElement* DTDataIntegrityTask::nEventMonitor
private

Definition at line 97 of file DTDataIntegrityTask.h.

Referenced by analyze(), and bookHistos().

int DTDataIntegrityTask::nevents
private

Definition at line 89 of file DTDataIntegrityTask.h.

Referenced by analyze(), and processROS25().

int DTDataIntegrityTask::neventsDDU
private

Definition at line 122 of file DTDataIntegrityTask.h.

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

int DTDataIntegrityTask::nEventsLS
private

Definition at line 120 of file DTDataIntegrityTask.h.

Referenced by analyze(), beginLuminosityBlock(), and endLuminosityBlock().

int DTDataIntegrityTask::neventsROS25
private

Definition at line 123 of file DTDataIntegrityTask.h.

Referenced by DTDataIntegrityTask(), and processROS25().

std::string DTDataIntegrityTask::outputFile
private

Definition at line 125 of file DTDataIntegrityTask.h.

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

Definition at line 126 of file DTDataIntegrityTask.h.

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

Definition at line 105 of file DTDataIntegrityTask.h.

edm::EDGetTokenT<DTROS25Collection> DTDataIntegrityTask::ros25Token
private

Definition at line 155 of file DTDataIntegrityTask.h.

Referenced by analyze(), and DTDataIntegrityTask().

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

Definition at line 144 of file DTDataIntegrityTask.h.

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

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

Definition at line 103 of file DTDataIntegrityTask.h.

Referenced by processROS25().

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

Definition at line 146 of file DTDataIntegrityTask.h.

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

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

Definition at line 101 of file DTDataIntegrityTask.h.

Referenced by processROS25().

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

Definition at line 118 of file DTDataIntegrityTask.h.

Referenced by endLuminosityBlock(), and processROS25().

float DTDataIntegrityTask::trigger_counter
private

Definition at line 124 of file DTDataIntegrityTask.h.