CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
DTDataIntegrityTask Class Reference

#include <DTDataIntegrityTask.h>

Inheritance diagram for DTDataIntegrityTask:
DQMEDAnalyzer edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > > edm::stream::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c) override
 
void beginLuminosityBlock (const edm::LuminosityBlock &ls, const edm::EventSetup &es) override
 
 DTDataIntegrityTask (const edm::ParameterSet &ps)
 
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 (DQMStore::IBooker &, std::string histoType)
 
 ~DTDataIntegrityTask () override
 
- Public Member Functions inherited from DQMEDAnalyzer
void beginRun (edm::Run const &, edm::EventSetup const &) final
 
void beginStream (edm::StreamID id) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer (void)
 
void endLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
void endRunSummary (edm::Run const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
uint32_t streamId () const
 
- Public Member Functions inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::stream::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDAnalyzerBase () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Protected Member Functions

void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
- 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)
 

Private Member Functions

void bookHistos (DQMStore::IBooker &, const int fedMin, const int fedMax)
 
void bookHistos (DQMStore::IBooker &, std::string folder, DTROChainCoding code)
 
void bookHistosROS25 (DQMStore::IBooker &, 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
 
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< DTROS25Collectionros25Token
 
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::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDAnalyzerBase
typedef EDAnalyzerAdaptorBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static std::shared_ptr< dqmDetails::NoCacheglobalBeginLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *)
 
static std::shared_ptr< dqmDetails::NoCacheglobalBeginRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *)
 
static void globalEndLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *, dqmDetails::NoCache *)
 
static void globalEndRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *, dqmDetails::NoCache *)
 
- Static Public Member Functions inherited from edm::stream::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Detailed Description

Class for DT Data Integrity.

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

Definition at line 40 of file DTDataIntegrityTask.h.

Constructor & Destructor Documentation

DTDataIntegrityTask::DTDataIntegrityTask ( const edm::ParameterSet ps)

Definition at line 31 of file DTDataIntegrityTask.cc.

References dduToken, Exception, FEDIDMax, FEDIDmin, fedIntegrityFolder, edm::ParameterSet::getParameter(), getSCInfo, edm::ParameterSet::getUntrackedParameter(), LogTrace, FEDNumbering::MINDTFEDID, mode, neventsDDU, neventsROS25, and ros25Token.

31  : nevents(0) {
32 
33  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
34  << "[DTDataIntegrityTask]: Constructor" <<endl;
35 
36  dduToken = consumes<DTDDUCollection>(ps.getParameter<InputTag>("dtDDULabel"));
37  ros25Token = consumes<DTROS25Collection>(ps.getParameter<InputTag>("dtROS25Label"));
38 
39  neventsDDU = 0;
40  neventsROS25 = 0;
41 
43  FEDIDMax = 774; // FEDNumbering::MAXDTFEDID; Monitoring only real used FEDs
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 ( )
override

Definition at line 72 of file DTDataIntegrityTask.cc.

References LogTrace, and neventsDDU.

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

Member Function Documentation

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

Definition at line 1153 of file DTDataIntegrityTask.cc.

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

1154 {
1155  nevents++;
1157 
1158  nEventsLS++;
1159 
1160  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask") << "[DTDataIntegrityTask]: preProcessEvent" <<endl;
1161  // clear the set of BXids from the ROSs
1162  for(map<int, set<int> >::iterator rosBxIds = rosBxIdsPerFED.begin(); rosBxIds != rosBxIdsPerFED.end(); ++rosBxIds) {
1163  (*rosBxIds).second.clear();
1164  }
1165 
1166  fedBXIds.clear();
1167 
1168  for(map<int, set<int> >::iterator rosL1AIds = rosL1AIdsPerFED.begin(); rosL1AIds != rosL1AIdsPerFED.end(); ++rosL1AIds) {
1169  (*rosL1AIds).second.clear();
1170  }
1171 
1172  // reset the error flag
1173  eventErrorFlag = false;
1174 
1175  // Digi collection
1176  edm::Handle<DTDDUCollection> dduProduct;
1177  e.getByToken(dduToken, dduProduct);
1178  edm::Handle<DTROS25Collection> ros25Product;
1179  e.getByToken(ros25Token, ros25Product);
1180 
1181  DTDDUData dduData;
1182  std::vector<DTROS25Data> ros25Data;
1183 
1184  if(dduProduct.isValid() && ros25Product.isValid()) {
1185  for(unsigned int i=0; i<dduProduct->size(); ++i)
1186  {
1187  dduData = dduProduct->at(i);
1188  ros25Data = ros25Product->at(i);
1189  // FIXME: passing id variable is not needed anymore - change processFED interface for next release!
1190  FEDHeader header = dduData.getDDUHeader();
1191  int id = header.sourceID();
1192  processFED(dduData, ros25Data, id);
1193  for(unsigned int j=0; j < ros25Data.size(); ++j) {
1194  int rosid = j+1;
1195  processROS25(ros25Data[j],id,rosid);
1196  }
1197  }
1198  }
1199 }
std::map< int, std::set< int > > rosBxIdsPerFED
std::map< int, std::set< int > > rosL1AIdsPerFED
void processFED(DTDDUData &dduData, const std::vector< DTROS25Data > &rosData, int dduID)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:508
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)
bool isValid() const
Definition: HandleBase.h:74
#define LogTrace(id)
MonitorElement * nEventMonitor
const FEDHeader & getDDUHeader() const
Getters.
std::set< int > fedBXIds
edm::EDGetTokenT< DTDDUCollection > dduToken
void DTDataIntegrityTask::beginLuminosityBlock ( const edm::LuminosityBlock ls,
const edm::EventSetup es 
)
override

Definition at line 1121 of file DTDataIntegrityTask.cc.

References nEventsLS.

1121  {
1122 
1123  nEventsLS = 0;
1124 
1125 }
void DTDataIntegrityTask::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  iRun,
edm::EventSetup const &  iSetup 
)
overrideprotectedvirtual

Implements DQMEDAnalyzer.

Definition at line 88 of file DTDataIntegrityTask.cc.

References bookHistos(), bookHistosROS25(), FEDIDMax, FEDIDmin, LogTrace, mode, DTROChainCoding::setDDU(), and DTROChainCoding::setROS().

88  {
89 
90  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask") << "[DTDataIntegrityTask]: postBeginJob" <<endl;
91 
92  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask") << "[DTDataIntegrityTask] Get DQMStore service" << endl;
93 
94  // Loop over the DT FEDs
95 
96  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
97  << " FEDS: " << FEDIDmin << " to " << FEDIDMax << " in the RO" << endl;
98 
99  // book FED integrity histos
100  bookHistos(ibooker, FEDIDmin, FEDIDMax);
101 
102  if(mode == 0 || mode ==2){
103  // static booking of the histograms
104  for(int fed = FEDIDmin; fed <= FEDIDMax; ++fed) { // loop over the FEDs in the readout
105  DTROChainCoding code;
106  code.setDDU(fed);
107 
108  bookHistos(ibooker, string("ROS_S"), code);
109 
110  bookHistos(ibooker, string("DDU"), code);
111 
112  for(int ros = 1; ros <= 12; ++ros) {// loop over all ROS
113  code.setROS(ros);
114  bookHistosROS25(ibooker, code);
115  }
116  }
117  } //Not in HLT or SM mode
118 }
void bookHistos(DQMStore::IBooker &, const int fedMin, const int fedMax)
#define LogTrace(id)
void setROS(const int &ID)
void setDDU(const int &ID)
need to reset the bits before setting
void bookHistosROS25(DQMStore::IBooker &, DTROChainCoding code)
void DTDataIntegrityTask::bookHistos ( DQMStore::IBooker ibooker,
const int  fedMin,
const int  fedMax 
)
private

Definition at line 120 of file DTDataIntegrityTask.cc.

References DQMStore::IBooker::book1D(), DQMStore::IBooker::book2D(), DQMStore::IBooker::bookFloat(), dduHistos, dduTimeHistos, printsummarytable::folder, DTROChainCoding::getDDU(), DTROChainCoding::getDDUID(), DTROChainCoding::getROB(), DTROChainCoding::getROS(), DTROChainCoding::getROSID(), DTROChainCoding::getSCID(), hCorruptionSummary, hFEDEntry, hFEDFatal, hFEDNonFatal, trackerHits::histo, hTTSSummary, LogTrace, mode, names, nEventMonitor, rosHistos, rosSHistos, rosTimeHistos, MonitorElement::setAxisTitle(), MonitorElement::setBinLabel(), DQMStore::IBooker::setCurrentFolder(), topFolder(), and makeMuonMisalignmentScenario::wheel.

Referenced by bookHistograms(), and bookHistosROS25().

120  {
121 
122  ibooker.setCurrentFolder("DT/EventInfo/Counters");
123  nEventMonitor = ibooker.bookFloat("nProcessedEventsDataIntegrity");
124 
125  // Standard FED integrity histos
126  ibooker.setCurrentFolder(topFolder(true));
127 
128  int nFED = (fedMax - fedMin)+1;
129 
130  hFEDEntry = ibooker.book1D("FEDEntries","# entries per DT FED",nFED,fedMin,fedMax+1);
131  hFEDFatal = ibooker.book1D("FEDFatal","# fatal errors DT FED",nFED,fedMin,fedMax+1);
132  hFEDNonFatal = ibooker.book1D("FEDNonFatal","# NON fatal errors DT FED",nFED,fedMin,fedMax+1);
133 
134  if(mode == 3 || mode ==1) return; //Avoid duplication of Info in FEDIntegrity_EvF
135 
136  ibooker.setCurrentFolder(topFolder(false));
137  hTTSSummary = ibooker.book2D("TTSSummary","Summary Status TTS",nFED,fedMin,fedMax+1,9,1,10);
138  hTTSSummary->setAxisTitle("FED",1);
139  hTTSSummary->setBinLabel(1,"ROS PAF",2);
140  hTTSSummary->setBinLabel(2,"DDU PAF",2);
141  hTTSSummary->setBinLabel(3,"ROS PAF",2);
142  hTTSSummary->setBinLabel(4,"DDU PAF",2);
143  hTTSSummary->setBinLabel(5,"DDU Full",2);
144  hTTSSummary->setBinLabel(6,"L1A Mism.",2);
145  hTTSSummary->setBinLabel(7,"ROS Error",2);
146  hTTSSummary->setBinLabel(8,"BX Mism.",2);
147  hTTSSummary->setBinLabel(9,"DDU Logic Err.",2);
148 
149  // bookkeeping of the
150 
151  hCorruptionSummary = ibooker.book2D("DataCorruptionSummary", "Data Corruption Sources",
152  nFED,fedMin,fedMax+1, 8, 1, 9);
154  hCorruptionSummary->setBinLabel(1,"Miss Ch.",2);
155  hCorruptionSummary->setBinLabel(2,"ROS BX mism",2);
156  hCorruptionSummary->setBinLabel(3,"DDU BX mism",2);
157  hCorruptionSummary->setBinLabel(4,"ROS L1A mism",2);
158  hCorruptionSummary->setBinLabel(5,"Miss Payload",2);
159  hCorruptionSummary->setBinLabel(6,"FCRC bit",2);
160  hCorruptionSummary->setBinLabel(7,"Header check",2);
161  hCorruptionSummary->setBinLabel(8,"Triler Check",2);
162 
163 }
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 * book1D(Args &&...args)
Definition: DQMStore.h:115
MonitorElement * nEventMonitor
std::string topFolder(bool isFEDIntegrity) const
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:277
MonitorElement * hFEDEntry
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
MonitorElement * hTTSSummary
MonitorElement * bookFloat(Args &&...args)
Definition: DQMStore.h:109
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 ( DQMStore::IBooker ,
std::string  folder,
DTROChainCoding  code 
)
private
void DTDataIntegrityTask::bookHistosROS25 ( DQMStore::IBooker ibooker,
DTROChainCoding  code 
)
private

Definition at line 486 of file DTDataIntegrityTask.cc.

References bookHistos(), getSCInfo, and mode.

Referenced by bookHistograms().

486  {
487  bookHistos(ibooker, string("ROS"), code);
488 
489  if(mode < 1)
490  if(getSCInfo)
491  bookHistos(ibooker, string("SC"), code);
492 }
void bookHistos(DQMStore::IBooker &, const int fedMin, const int fedMax)
void DTDataIntegrityTask::channelsInCEROS ( int  cerosId,
int  chMask,
std::vector< int > &  channels 
)
private

Definition at line 1101 of file DTDataIntegrityTask.cc.

References globals_cff::x1.

Referenced by processROS25().

1101  {
1102  for (int iCh=0; iCh<6;++iCh) {
1103  if ((chMask >> iCh) & 0x1){
1104  channels.push_back(cerosId*6+iCh);
1105  }
1106  }
1107  return;
1108 }
void DTDataIntegrityTask::channelsInROS ( int  cerosMask,
std::vector< int > &  channels 
)
private

Definition at line 1110 of file DTDataIntegrityTask.cc.

References globals_cff::x1.

Referenced by processROS25().

1110  {
1111  for (int iCeros=0; iCeros<5;++iCeros) {
1112  if ((cerosMask >> iCeros) & 0x1){
1113  for (int iCh=0; iCh<6;++iCh) {
1114  channels.push_back(iCeros*6+iCh);
1115  }
1116  }
1117  }
1118  return;
1119 }
void DTDataIntegrityTask::endLuminosityBlock ( const edm::LuminosityBlock ls,
const edm::EventSetup es 
)
override

Definition at line 1127 of file DTDataIntegrityTask.cc.

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

1127  {
1128 
1129  int lumiBlock = ls.luminosityBlock();
1130 
1131  map<std::string, map<int, DTTimeEvolutionHisto*> >::iterator dduIt = dduTimeHistos.begin();
1132  map<std::string, map<int, DTTimeEvolutionHisto*> >::iterator dduEnd = dduTimeHistos.end();
1133  for(; dduIt!=dduEnd; ++dduIt) {
1134  map<int, DTTimeEvolutionHisto*>::iterator histoIt = dduIt->second.begin();
1135  map<int, DTTimeEvolutionHisto*>::iterator histoEnd = dduIt->second.end();
1136  for(; histoIt!=histoEnd; ++histoIt) {
1137  histoIt->second->updateTimeSlot(lumiBlock,nEventsLS);
1138  }
1139  }
1140 
1141  map<std::string, map<int, DTTimeEvolutionHisto*> >::iterator rosIt = rosTimeHistos.begin();
1142  map<std::string, map<int, DTTimeEvolutionHisto*> >::iterator rosEnd = rosTimeHistos.end();
1143  for(; rosIt!=rosEnd; ++rosIt) {
1144  map<int, DTTimeEvolutionHisto*>::iterator histoIt = rosIt->second.begin();
1145  map<int, DTTimeEvolutionHisto*>::iterator histoEnd = rosIt->second.end();
1146  for(; histoIt!=histoEnd; ++histoIt) {
1147  histoIt->second->updateTimeSlot(lumiBlock,nEventsLS);
1148  }
1149  }
1150 
1151 }
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 1066 of file DTDataIntegrityTask.cc.

References eventErrorFlag.

1066  {
1067  return eventErrorFlag;
1068 }
void DTDataIntegrityTask::fedEntry ( int  dduID)

Definition at line 1072 of file DTDataIntegrityTask.cc.

References MonitorElement::Fill(), and hFEDEntry.

1072  {
1073  hFEDEntry->Fill(dduID);
1074 }
void Fill(long long x)
MonitorElement * hFEDEntry
void DTDataIntegrityTask::fedFatal ( int  dduID)

Definition at line 1079 of file DTDataIntegrityTask.cc.

References MonitorElement::Fill(), and hFEDFatal.

1079  {
1080  hFEDFatal->Fill(dduID);
1081 }
MonitorElement * hFEDFatal
void Fill(long long x)
void DTDataIntegrityTask::fedNonFatal ( int  dduID)

Definition at line 1086 of file DTDataIntegrityTask.cc.

References MonitorElement::Fill(), and hFEDNonFatal.

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

Definition at line 779 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, RecoTauValidation_cfi::header, hFEDEntry, hFEDFatal, hTTSSummary, mps_fire::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(), DTDDUSecondStatusWord::warningROSPAF(), and globals_cff::x1.

Referenced by analyze().

779  {
780 
781  neventsDDU++;
782  if (neventsDDU%1000 == 0)
783  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
784  << "[DTDataIntegrityTask]: " << neventsDDU << " events analyzed by processFED" << endl;
785 
786 
787  DTROChainCoding code;
788  code.setDDU(ddu);
789  if(code.getDDUID() < FEDIDmin || code.getDDUID() > FEDIDMax) return;
790 
791  hFEDEntry->Fill(code.getDDUID());
792 
793  FEDTrailer trailer = data.getDDUTrailer();
794  FEDHeader header = data.getDDUHeader();
795 
796  // check consistency of header and trailer
797  if(!header.check()) {
798  // error code 7
799  hFEDFatal->Fill(code.getDDUID());
800  hCorruptionSummary->Fill(code.getDDUID(), 7);
801  }
802 
803  if(!trailer.check()) {
804  // error code 8
805  hFEDFatal->Fill(code.getDDUID());
806  hCorruptionSummary->Fill(code.getDDUID(), 8);
807  }
808 
809  // check CRC error bit set by DAQ before sending data on SLink
810  if(data.crcErrorBit()) {
811  // error code 6
812  hFEDFatal->Fill(code.getDDUID());
813  hCorruptionSummary->Fill(code.getDDUID(), 6);
814  }
815 
816  if(mode == 3 || mode ==1) return; //Avoid duplication of Info in FEDIntegrity_EvF
817 
818  const DTDDUSecondStatusWord& secondWord = data.getSecondStatusWord();
819 
820  // Fill the status summary of the TTS
821 
822  //1D HISTO WITH TTS VALUES form trailer (7 bins = 7 values)
823  int ttsCodeValue = -1;
824  int ttsSummaryBin = -1;
825 
826  switch(trailer.ttsBits()) {
827  case 0:{ //disconnected
828  ttsCodeValue = 0;
829  break;
830  }
831  case 1:{ //warning overflow
832  ttsCodeValue = 1;
833  if(secondWord.warningROSPAF()) { // ROS PAF
834  ttsSummaryBin = 1;
835  } else { // DDU PAF
836  ttsSummaryBin = 2;
837  }
838 
839  break;
840  }
841  case 2:{ //out of sinch
842  ttsCodeValue = 2;
843  bool knownOrigin = false;
844  if(secondWord.outOfSynchROSError()) {// ROS Error
845  ttsSummaryBin = 7;
846  knownOrigin = true;
847  }
848  if(secondWord.l1AIDError()) {// L1A Mism.
849  ttsSummaryBin = 6;
850  knownOrigin = true;
851  }
852  if(secondWord.bxIDError()) {// BX Mism.
853  ttsSummaryBin = 8;
854  knownOrigin = true;
855  }
856  if(secondWord.outputFifoFull() || secondWord.inputFifoFull() || secondWord.fifoFull()) { // DDU Full
857  ttsSummaryBin = 5;
858  knownOrigin = true;
859  }
860  if(!knownOrigin) ttsSummaryBin = 9; // Error in DDU logic
861 
862  break;
863  }
864  case 4:{ //busy
865  ttsCodeValue = 3;
866  bool knownOrigin = false;
867  if(secondWord.busyROSPAF()) { // ROS PAF
868  ttsSummaryBin = 3;
869  knownOrigin = true;
870  }
871  if(secondWord.outputFifoAlmostFull() || secondWord.inputFifoAlmostFull() || secondWord.fifoAlmostFull() ){ // DDU PAF
872  ttsSummaryBin = 4;
873  knownOrigin = true;
874  }
875  if(!knownOrigin) ttsSummaryBin = 9; // Error in DDU logic
876  break;
877  }
878  case 8:{ //ready
879  ttsCodeValue = 4;
880  break;
881  }
882  case 12:{ //error
883  ttsCodeValue = 5;
884  break;
885  }
886  case 16:{ //disconnected
887  ttsCodeValue = 6;
888  break;
889  }
890  default:{
891  LogError("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
892  <<"[DTDataIntegrityTask] DDU control: wrong TTS value "<<trailer.ttsBits()<<endl;
893  ttsCodeValue = 7;
894  }
895  }
896  if(mode < 1) dduHistos["TTSValues"][code.getDDUID()]->Fill(ttsCodeValue);
897  if(ttsSummaryBin != -1) {
898  hTTSSummary->Fill(ddu, ttsSummaryBin);
899  }
900 
901 
902 
903 
904 
905 
906  //2D HISTO: ROS VS STATUS (8 BIT = 8 BIN) from 1st-2nd status words (9th BIN FROM LIST OF ROS in 2nd status word)
907  MonitorElement* hROSStatus = dduHistos["ROSStatus"][code.getDDUID()];
908  //1D HISTO: NUMBER OF ROS IN THE EVENTS from 2nd status word
909 
910  int rosList = secondWord.rosList();
911  set<int> rosPositions;
912  for(int i=0;i<12;i++) {
913  if(rosList & 0x1) {
914  rosPositions.insert(i);
915  //9th BIN FROM LIST OF ROS in 2nd status word
916  if(mode <= 2) hROSStatus->Fill(8,i,1);
917  }
918  rosList >>= 1;
919  }
920 
921  int channel=0;
922  for (vector<DTDDUFirstStatusWord>::const_iterator fsw_it = data.getFirstStatusWord().begin();
923  fsw_it != data.getFirstStatusWord().end(); fsw_it++) {
924  // assuming association one-to-one between DDU channel and ROS
925  if(mode <= 2) {
926  hROSStatus->Fill(0,channel,(*fsw_it).channelEnabled());
927  hROSStatus->Fill(1,channel,(*fsw_it).timeout());
928  hROSStatus->Fill(2,channel,(*fsw_it).eventTrailerLost());
929  hROSStatus->Fill(3,channel,(*fsw_it).opticalFiberSignalLost());
930  hROSStatus->Fill(4,channel,(*fsw_it).tlkPropagationError());
931  hROSStatus->Fill(5,channel,(*fsw_it).tlkPatternError());
932  hROSStatus->Fill(6,channel,(*fsw_it).tlkSignalLost());
933  hROSStatus->Fill(7,channel,(*fsw_it).errorFromROS());
934  }
935  // check that the enabled channel was also in the read-out
936  if((*fsw_it).channelEnabled() == 1 &&
937  rosPositions.find(channel) == rosPositions.end()) {
938  if(mode <= 2) hROSStatus->Fill(9,channel,1);
939  // error code 1
940  hFEDFatal->Fill(code.getDDUID());
941  hCorruptionSummary->Fill(code.getDDUID(), 1);
942  }
943  channel++;
944  }
945 
946 
947  // ---------------------------------------------------------------------
948  // cross checks between FED and ROS data
949  // check the BX ID against the ROSs
950  set<int> rosBXIds = rosBxIdsPerFED[ddu];
951  if((rosBXIds.size() > 1 || rosBXIds.find(header.bxID()) == rosBXIds.end()) && !rosBXIds.empty()) { // in this case look for faulty ROSs
952  for(vector<DTROS25Data>::const_iterator rosControlData = rosData.begin();
953  rosControlData != rosData.end(); ++rosControlData) { // loop over the ROS data
954  for (vector<DTROSDebugWord>::const_iterator debug_it = (*rosControlData).getROSDebugs().begin();
955  debug_it != (*rosControlData).getROSDebugs().end(); debug_it++) { // Loop over ROS debug words
956  if ((*debug_it).debugType() == 0 && (*debug_it).debugMessage() != header.bxID()) { // check the BX
957  int ros = (*rosControlData).getROSID();
958  // fill the error bin
959  if(mode <= 2) hROSStatus->Fill(11,ros-1);
960  // error code 2
961  hFEDFatal->Fill(code.getDDUID());
962  hCorruptionSummary->Fill(code.getDDUID(), 2);
963  }
964  }
965  }
966  }
967 
968  // check the BX ID against other FEDs
969  fedBXIds.insert(header.bxID());
970  if(fedBXIds.size() != 1) {
971  LogWarning("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
972  << "ERROR: FED " << ddu << " BX ID different from other feds: " << header.bxID() << endl;
973  // error code 3
974  hFEDFatal->Fill(code.getDDUID());
975  hCorruptionSummary->Fill(code.getDDUID(), 3);
976  }
977 
978 
979  // check the L1A ID against the ROSs
980  set<int> rosL1AIds = rosL1AIdsPerFED[ddu];
981  if((rosL1AIds.size() > 1 || rosL1AIds.find(header.lvl1ID()-1) == rosL1AIds.end()) && !rosL1AIds.empty()) { // in this case look for faulty ROSs
982  //If L1A_ID error identify which ROS has wrong L1A
983  for (vector<DTROS25Data>::const_iterator rosControlData = rosData.begin();
984  rosControlData != rosData.end(); rosControlData++) { // loop over the ROS data
985  int ROSHeader_TTCCount = ((*rosControlData).getROSHeader().TTCEventCounter() + 1) % 0x1000000; // fix comparison in case of last counting bin in ROS /first one in DDU
986  if( ROSHeader_TTCCount != header.lvl1ID() ) {
987  int ros = (*rosControlData).getROSID();
988  if(mode <= 2) hROSStatus->Fill(10,ros-1);
989  // error code 4
990  hFEDFatal->Fill(code.getDDUID());
991  hCorruptionSummary->Fill(code.getDDUID(), 4);
992  }
993  }
994  }
995 
996  //1D HISTOS: EVENT LENGHT from trailer
997  int fedEvtLenght = trailer.lenght()*8;
998  // if(fedEvtLenght > 16000) fedEvtLenght = 16000; // overflow bin
999  dduHistos["EventLenght"][code.getDDUID()]->Fill(fedEvtLenght);
1000 
1001  if(mode > 1) return;
1002 
1003  dduTimeHistos["FEDAvgEvLenghtvsLumi"][code.getDDUID()]->accumulateValueTimeSlot(fedEvtLenght);
1004 
1005  // size of the list of ROS in the Read-Out
1006  dduHistos["ROSList"][code.getDDUID()]->Fill(rosPositions.size());
1007 
1008 
1009  //2D HISTO: FIFO STATUS from 2nd status word
1010  MonitorElement *hFIFOStatus = dduHistos["FIFOStatus"][code.getDDUID()];
1011  int inputFifoFull = secondWord.inputFifoFull();
1012  int inputFifoAlmostFull = secondWord.inputFifoAlmostFull();
1013  int fifoFull = secondWord.fifoFull();
1014  int fifoAlmostFull = secondWord.fifoAlmostFull();
1015  int outputFifoFull = secondWord.outputFifoFull();
1016  int outputFifoAlmostFull = secondWord.outputFifoAlmostFull();
1017  for(int i=0;i<3;i++){
1018  if(inputFifoFull & 0x1){
1019  hFIFOStatus->Fill(i,0);
1020  }
1021  if(inputFifoAlmostFull & 0x1){
1022  hFIFOStatus->Fill(i,1);
1023  }
1024  if(fifoFull & 0x1){
1025  hFIFOStatus->Fill(3+i,0);
1026  }
1027  if(fifoAlmostFull & 0x1){
1028  hFIFOStatus->Fill(3+i,1);
1029  }
1030  if(!(inputFifoFull & 0x1) && !(inputFifoAlmostFull & 0x1)){
1031  hFIFOStatus->Fill(i,2);
1032  }
1033  if(!(fifoFull & 0x1) && !(fifoAlmostFull & 0x1)){
1034  hFIFOStatus->Fill(3+i,2);
1035  }
1036  inputFifoFull >>= 1;
1037  inputFifoAlmostFull >>= 1;
1038  fifoFull >>= 1;
1039  fifoAlmostFull >>= 1;
1040  }
1041 
1042  if(outputFifoFull){
1043  hFIFOStatus->Fill(6,0);
1044  }
1045  if(outputFifoAlmostFull){
1046  hFIFOStatus->Fill(6,1);
1047  }
1048  if(!outputFifoFull && !outputFifoAlmostFull){
1049  hFIFOStatus->Fill(6,2);
1050  }
1051 
1052 
1053 
1054 
1055 
1056 
1057 
1058  //1D HISTO: EVENT TYPE from header
1059  dduHistos["EventType"][code.getDDUID()]->Fill(header.triggerType());
1060 
1061  // fill the distribution of the BX ids
1062  dduHistos["BXID"][code.getDDUID()]->Fill(header.bxID());
1063 
1064 }
std::map< int, std::set< int > > rosBxIdsPerFED
std::map< int, std::set< int > > rosL1AIdsPerFED
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 495 of file DTDataIntegrityTask.cc.

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

Referenced by analyze().

495  {
496 
497  neventsROS25++; // FIXME: implement a counter which makes sense
498 
499  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
500  << "[DTDataIntegrityTask]: " << neventsROS25 << " events analyzed by processROS25" << endl;
501 
502  // The ID of the RO board (used to map the histos)
503  DTROChainCoding code;
504  code.setDDU(ddu);
505  code.setROS(ros);
506 
507  if(mode == 3 || mode ==1) return; //Avoid duplication of Info in FEDIntegrity_EvF
508 
509  MonitorElement* ROSSummary = rosSHistos["ROSSummary"][code.getDDUID()];
510 
511  // Summary of all ROB errors
512  MonitorElement* ROSError = nullptr;
513  if(mode <= 2) ROSError = rosHistos["ROSError"][code.getROSID()];
514 
515  if ( (mode<=2) && (!ROSError) ) {
516  LogError("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask") <<
517  "Trying to access non existing ME at ROSID " << code.getROSID() <<
518  std::endl;
519  return;
520  }
521 
522  // L1A ids to be checked against FED one
523  rosL1AIdsPerFED[ddu].insert(data.getROSHeader().TTCEventCounter());
524 
525  // ROS errors
526 
527 
528  // check for TPX errors
529  if (data.getROSTrailer().TPX() != 0) {
530  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask") << " TXP error en ROS "
531  << code.getROS() << endl;
532  ROSSummary->Fill(9,code.getROS());
533  }
534 
535  // L1 Buffer almost full (non-critical error!)
536  if(data.getROSTrailer().l1AFifoOccupancy() > 31) {
537  ROSSummary->Fill(10,code.getROS());
538  }
539 
540 
541  for (vector<DTROSErrorWord>::const_iterator error_it = data.getROSErrors().begin();
542  error_it != data.getROSErrors().end(); error_it++) { // Loop over ROS error words
543 
544  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask") << " Error in ROS " << code.getROS()
545  << " ROB Id " << (*error_it).robID()
546  << " Error type " << (*error_it).errorType() << endl;
547 
548  // Fill the ROSSummary (1 per FED) histo
549  ROSSummary->Fill((*error_it).errorType(), code.getROS());
550  if((*error_it).errorType() <= 11) { // set error flag
551  eventErrorFlag = true;
552  }
553 
554  if(mode <= 2) {
555  // Fill the ROB Summary (1 per ROS) histo
556  if ((*error_it).robID() != 31) {
557  ROSError->Fill((*error_it).errorType(),(*error_it).robID());
558  }
559  else if ((*error_it).errorType() == 4) {
560  vector<int> channelBins;
561  channelsInROS((*error_it).cerosID(),channelBins);
562  vector<int>::const_iterator channelIt = channelBins.begin();
563  vector<int>::const_iterator channelEnd = channelBins.end();
564  for(;channelIt!=channelEnd;++channelIt) {
565  ROSError->Fill(4,(*channelIt));
566  }
567  }
568  }
569  }
570 
571 
572  int ROSDebug_BunchNumber = -1;
573 
574  for (vector<DTROSDebugWord>::const_iterator debug_it = data.getROSDebugs().begin();
575  debug_it != data.getROSDebugs().end(); debug_it++) { // Loop over ROS debug words
576 
577  int debugROSSummary = 0;
578  int debugROSError = 0;
579  vector<int> debugBins;
580  bool hasEvIdMis = false;
581  vector<int> evIdMisBins;
582 
583  if ((*debug_it).debugType() == 0 ) {
584  ROSDebug_BunchNumber = (*debug_it).debugMessage();
585  } else if ((*debug_it).debugType() == 1 ) {
586  // not used
587  // ROSDebug_BcntResCntLow = (*debug_it).debugMessage();
588  } else if ((*debug_it).debugType() == 2 ) {
589  // not used
590  // ROSDebug_BcntResCntHigh = (*debug_it).debugMessage();
591  } else if ((*debug_it).debugType() == 3) {
592  if ((*debug_it).dontRead()){
593  debugROSSummary = 11;
594  debugROSError = 8;
595  if (mode <= 2) channelsInCEROS((*debug_it).cerosIdCerosStatus(),(*debug_it).dontRead(),debugBins);
596  } if ((*debug_it).evIdMis()){
597  hasEvIdMis = true;
598  if (mode <= 2) channelsInCEROS((*debug_it).cerosIdCerosStatus(),(*debug_it).evIdMis(),evIdMisBins);
599  }
600  } else if ((*debug_it).debugType() == 4 &&
601  (*debug_it).cerosIdRosStatus()){
602  debugROSSummary = 13;
603  debugROSError = 10;
604  if (mode <= 2) channelsInROS((*debug_it).cerosIdRosStatus(),debugBins);
605  }
606 
607  if (debugROSSummary) {
608  ROSSummary->Fill(debugROSSummary,code.getROS());
609  if (mode <= 2) {
610  vector<int>::const_iterator channelIt = debugBins.begin();
611  vector<int>::const_iterator channelEnd = debugBins.end();
612  for (;channelIt!=channelEnd;++channelIt) {
613  ROSError->Fill(debugROSError,(*channelIt));
614  }
615  }
616  }
617 
618  if (hasEvIdMis) {
619  ROSSummary->Fill(12,code.getROS());
620  if (mode <= 2) {
621  vector<int>::const_iterator channelIt = evIdMisBins.begin();
622  vector<int>::const_iterator channelEnd = evIdMisBins.end();
623  for (;channelIt!=channelEnd;++channelIt) {
624  ROSError->Fill(9,(*channelIt));
625  }
626  }
627  }
628 
629  }
630 
631  // ROB Group Header
632  // Check the BX of the ROB headers against the BX of the ROS
633  for (vector<DTROBHeader>::const_iterator rob_it = data.getROBHeaders().begin();
634  rob_it != data.getROBHeaders().end(); rob_it++) { // loop over ROB headers
635 
636  code.setROB((*rob_it).first);
637  DTROBHeaderWord robheader = (*rob_it).second;
638 
639  rosBxIdsPerFED[ddu].insert(ROSDebug_BunchNumber);
640 
641  if (robheader.bunchID() != ROSDebug_BunchNumber) {
642  // fill ROS Summary plot
643  ROSSummary->Fill(8,code.getROS());
644  eventErrorFlag = true;
645 
646  // fill ROB Summary plot for that particular ROS
647  if(mode <= 2) ROSError->Fill(7,robheader.robID());
648  }
649  }
650 
651 
652  if(mode < 1) { // produce only when not in HLT or SM
653  // ROB Trailer
654  for (vector<DTROBTrailerWord>::const_iterator robt_it = data.getROBTrailers().begin();
655  robt_it != data.getROBTrailers().end(); robt_it++) { // loop over ROB trailers
656  float wCount = (*robt_it).wordCount()<100. ? (*robt_it).wordCount() : 99.9;
657  rosHistos["ROB_mean"][code.getROSID()]->Fill((*robt_it).robID(),wCount);
658  }
659 
660  // Plot the event lenght //NOHLT
661  int rosEventLenght = data.getROSTrailer().EventWordCount()*4;
662  rosTimeHistos["ROSAvgEventLenghtvsLumi"][code.getROSID()]->accumulateValueTimeSlot(rosEventLenght);
663 
664  if(rosEventLenght > 1600) rosEventLenght = 1600;
665  rosHistos["ROSEventLenght"][code.getROSID()]->Fill(rosEventLenght);
666  }
667 
668 
669  // TDC Data
670  for (vector<DTTDCData>::const_iterator tdc_it = data.getTDCData().begin();
671  tdc_it != data.getTDCData().end(); tdc_it++) { // loop over TDC data
672 
673  DTTDCMeasurementWord tdcDatum = (*tdc_it).second;
674 
675  if ( tdcDatum.PC() !=0) {
676  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
677  << " PC error in ROS " << code.getROS() << " TDC " << (*tdc_it).first << endl;
678  // fill ROS Summary plot
679  ROSSummary->Fill(7,code.getROS());
680 
681  eventErrorFlag = true;
682 
683  // fill ROB Summary plot for that particular ROS
684  if(mode <= 2) ROSError->Fill(6,(*tdc_it).first);
685  }
686  }
687 
688  // TDC Error
689  for (vector<DTTDCError>::const_iterator tdc_it = data.getTDCError().begin();
690  tdc_it != data.getTDCError().end(); tdc_it++) { // loop over TDC errors
691 
692  code.setROB((*tdc_it).first);
693 
694  int tdcError_ROSSummary = 0;
695  int tdcError_ROSError = 0;
696  int tdcError_TDCHisto = 0;
697 
698  if(((*tdc_it).second).tdcError() & 0x4000 ) {
699  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
700  << " ROS " << code.getROS() << " ROB " << code.getROB()
701  << " Internal fatal Error 4000 in TDC " << (*tdc_it).first << endl;
702 
703  tdcError_ROSSummary = 14;
704  tdcError_ROSError = 11;
705  tdcError_TDCHisto = 0;
706 
707  } else if ( ((*tdc_it).second).tdcError() & 0x0249 ) {
708  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
709  << " ROS " << code.getROS() << " ROB " << code.getROB()
710  << " TDC FIFO overflow in TDC " << (*tdc_it).first << endl;
711 
712  tdcError_ROSSummary = 15;
713  tdcError_ROSError = 12;
714  tdcError_TDCHisto = 1;
715 
716  } else if ( ((*tdc_it).second).tdcError() & 0x0492 ) {
717  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
718  << " ROS " << code.getROS() << " ROB " << code.getROB()
719  << " TDC L1 buffer overflow in TDC " << (*tdc_it).first << endl;
720 
721  tdcError_ROSSummary = 16;
722  tdcError_ROSError = 13;
723  tdcError_TDCHisto = 2;
724 
725  } else if ( ((*tdc_it).second).tdcError() & 0x2000 ) {
726  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
727  << " ROS " << code.getROS() << " ROB " << code.getROB()
728  << " TDC L1A FIFO overflow in TDC " << (*tdc_it).first << endl;
729 
730  tdcError_ROSSummary = 17;
731  tdcError_ROSError = 14;
732  tdcError_TDCHisto = 3;
733 
734  } else if ( ((*tdc_it).second).tdcError() & 0x0924 ) {
735  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
736  << " ROS " << code.getROS() << " ROB " << code.getROB()
737  << " TDC hit error in TDC " << (*tdc_it).first << endl;
738 
739  tdcError_ROSSummary = 18;
740  tdcError_ROSError = 15;
741  tdcError_TDCHisto = 4;
742 
743  } else if ( ((*tdc_it).second).tdcError() & 0x1000 ) {
744  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
745  << " ROS " << code.getROS() << " ROB " << code.getROB()
746  << " TDC hit rejected in TDC " << (*tdc_it).first << endl;
747 
748  tdcError_ROSSummary = 19;
749  tdcError_ROSError = 16;
750  tdcError_TDCHisto = 5;
751 
752  } else {
753  LogWarning("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
754  << " TDC error code not known " << ((*tdc_it).second).tdcError() << endl;
755  }
756 
757  ROSSummary->Fill(tdcError_ROSSummary,code.getROS());
758 
759  if(tdcError_ROSSummary <= 15) {
760  eventErrorFlag = true;
761  }
762 
763  if(mode <= 2) {
764  ROSError->Fill(tdcError_ROSError,(*tdc_it).first);
765  if(mode <= 1)
766  rosHistos["TDCError"][code.getROSID()]->Fill(tdcError_TDCHisto+6*((*tdc_it).second).tdcID(),(*tdc_it).first);
767  }
768  }
769 
770  // Read SC data
771  if (mode < 1 && getSCInfo) {
772  // NumberOf16bitWords counts the # of words + 1 subheader
773  // the SC includes the SC "private header" and the ROS header and trailer (= NumberOf16bitWords +3)
774  rosHistos["SCSizeVsROSSize"][code.getSCID()]->Fill(ros,data.getSCTrailer().wordCount());
775 
776  }
777 }
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
const std::vector< DTTDCData > & getTDCData() const
Definition: DTControlData.h:61
int PC() const
Definition: DTDDUWords.h:622
int l1AFifoOccupancy() const
Definition: DTDDUWords.h:271
int getROS() const
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 ( DQMStore::IBooker ,
std::string  histoType 
)
std::string DTDataIntegrityTask::topFolder ( bool  isFEDIntegrity) const
private

Definition at line 1090 of file DTDataIntegrityTask.cc.

References fedIntegrityFolder, printsummarytable::folder, and mode.

Referenced by bookHistos().

1090  {
1091 
1092  string folder = isFEDIntegrity ? fedIntegrityFolder : "DT/00-DataIntegrity/";
1093 
1094  if (mode == 0 || mode == 2)
1095  folder = "DT/00-DataIntegrity/"; //Move everything from FEDIntegrity except for SM and HLT modes
1096 
1097  return folder;
1098 
1099 }

Member Data Documentation

DTROChainCoding DTDataIntegrityTask::coding
private

Definition at line 94 of file DTDataIntegrityTask.h.

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

Definition at line 99 of file DTDataIntegrityTask.h.

Referenced by bookHistos(), and processFED().

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

Definition at line 117 of file DTDataIntegrityTask.h.

Referenced by bookHistos(), 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 88 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 bookHistograms(), DTDataIntegrityTask(), and processFED().

int DTDataIntegrityTask::FEDIDmin
private

Definition at line 128 of file DTDataIntegrityTask.h.

Referenced by bookHistograms(), DTDataIntegrityTask(), 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 90 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 83 of file DTDataIntegrityTask.h.

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

Referenced by bookHistos().

MonitorElement* DTDataIntegrityTask::nEventMonitor
private

Definition at line 97 of file DTDataIntegrityTask.h.

Referenced by analyze(), and bookHistos().

int DTDataIntegrityTask::nevents
private

Definition at line 92 of file DTDataIntegrityTask.h.

Referenced by analyze().

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
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 bookHistos(), and 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 bookHistos(), and processROS25().

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

Definition at line 118 of file DTDataIntegrityTask.h.

Referenced by bookHistos(), endLuminosityBlock(), and processROS25().

float DTDataIntegrityTask::trigger_counter
private

Definition at line 124 of file DTDataIntegrityTask.h.