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
 
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 1266 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().

1267 {
1268  nevents++;
1270 
1271  nEventsLS++;
1272 
1273  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask") << "[DTDataIntegrityTask]: preProcessEvent" <<endl;
1274  // clear the set of BXids from the ROSs
1275  for(map<int, set<int> >::iterator rosBxIds = rosBxIdsPerFED.begin(); rosBxIds != rosBxIdsPerFED.end(); ++rosBxIds) {
1276  (*rosBxIds).second.clear();
1277  }
1278 
1279  fedBXIds.clear();
1280 
1281  for(map<int, set<int> >::iterator rosL1AIds = rosL1AIdsPerFED.begin(); rosL1AIds != rosL1AIdsPerFED.end(); ++rosL1AIds) {
1282  (*rosL1AIds).second.clear();
1283  }
1284 
1285  // reset the error flag
1286  eventErrorFlag = false;
1287 
1288  // Digi collection
1289  edm::Handle<DTDDUCollection> dduProduct;
1290  e.getByToken(dduToken, dduProduct);
1291  edm::Handle<DTROS25Collection> ros25Product;
1292  e.getByToken(ros25Token, ros25Product);
1293 
1294  DTDDUData dduData;
1295  std::vector<DTROS25Data> ros25Data;
1296 
1297  if(dduProduct.isValid() && ros25Product.isValid()) {
1298  for(unsigned int i=0; i<dduProduct->size(); ++i)
1299  {
1300  dduData = dduProduct->at(i);
1301  ros25Data = ros25Product->at(i);
1302  // FIXME: passing id variable is not needed anymore - change processFED interface for next release!
1303  FEDHeader header = dduData.getDDUHeader();
1304  int id = header.sourceID();
1305  processFED(dduData, ros25Data, id);
1306  for(unsigned int j=0; j < ros25Data.size(); ++j) {
1307  int rosid = j+1;
1308  processROS25(ros25Data[j],id,rosid);
1309  }
1310  }
1311  }
1312 }
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:434
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 1230 of file DTDataIntegrityTask.cc.

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

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

References nEventsLS.

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

Definition at line 98 of file DTDataIntegrityTask.cc.

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

Referenced by beginJob(), and bookHistosROS25().

98  {
99 
100  dbe->setCurrentFolder("DT/EventInfo/Counters");
101  nEventMonitor = dbe->bookFloat("nProcessedEventsDataIntegrity");
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 }
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:954
MonitorElement * hFEDNonFatal
void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
MonitorElement * hFEDFatal
MonitorElement * bookFloat(const char *name)
Book float.
Definition: DQMStore.cc:891
MonitorElement * nEventMonitor
std::string topFolder(bool isFEDIntegrity) const
MonitorElement * hFEDEntry
MonitorElement * hTTSSummary
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
Definition: DQMStore.cc:1082
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:667
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 1178 of file DTDataIntegrityTask.cc.

Referenced by processROS25().

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

Definition at line 1187 of file DTDataIntegrityTask.cc.

Referenced by processROS25().

1187  {
1188  for (int iCeros=0; iCeros<5;++iCeros) {
1189  if ((cerosMask >> iCeros) & 0x1){
1190  for (int iCh=0; iCh<6;++iCh) {
1191  channels.push_back(iCeros*6+iCh);
1192  }
1193  }
1194  }
1195  return;
1196 }
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 1204 of file DTDataIntegrityTask.cc.

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

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

References eventErrorFlag.

Referenced by DTDataErrorFilter::hltFilter().

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

Definition at line 1149 of file DTDataIntegrityTask.cc.

References MonitorElement::Fill(), and hFEDEntry.

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

Definition at line 1156 of file DTDataIntegrityTask.cc.

References MonitorElement::Fill(), and hFEDFatal.

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

Definition at line 1163 of file DTDataIntegrityTask.cc.

References MonitorElement::Fill(), and hFEDNonFatal.

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

References fedIntegrityFolder, and mode.

Referenced by bookHistos().

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

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 149 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 138 of file DTDataIntegrityTask.h.

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

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

Definition at line 141 of file DTDataIntegrityTask.h.

Referenced by analyze(), and processFED().

std::string DTDataIntegrityTask::fedIntegrityFolder
private

Definition at line 146 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 129 of file DTDataIntegrityTask.h.

int DTDataIntegrityTask::myPrevFifoVal[7]
private

Definition at line 134 of file DTDataIntegrityTask.h.

int DTDataIntegrityTask::myPrevRosVal
private

Definition at line 133 of file DTDataIntegrityTask.h.

int DTDataIntegrityTask::myPrevTtsVal
private

Definition at line 132 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 151 of file DTDataIntegrityTask.h.

Referenced by analyze(), and DTDataIntegrityTask().

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

Definition at line 140 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 142 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.