CMS 3D CMS Logo

List of all members | Public Member Functions | Protected Member Functions | Private Types | 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 (DTuROSFEDData &data, int fed)
 
void processFED (DTDDUData &dduData, const std::vector< DTROS25Data > &rosData, int dduID)
 
void processROS25 (DTROS25Data &data, int dduID, int ros)
 
void processuROS (DTuROSROSData &data, int fed, int uRos)
 
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 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
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) 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 Types

enum  histoTypes { uROSEventLenght =0, uROSError =1, TDCError =4, TTSValues =7 }
 

Private Member Functions

void bookHistos (DQMStore::IBooker &, const int fedMin, const int fedMax)
 
void bookHistos (DQMStore::IBooker &, std::string folder, DTROChainCoding code)
 
void bookHistos (DQMStore::IBooker &, std::string folder, const int fed)
 
void bookHistosROS25 (DQMStore::IBooker &, DTROChainCoding code)
 
void bookHistosuROS (DQMStore::IBooker &, const int fed, const int uRos)
 
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

bool checkUros
 
DTROChainCoding coding
 
edm::EDGetTokenT< DTDDUCollectiondduToken
 
bool doTimeHisto
 
bool eventErrorFlag
 
std::set< int > fedBXIds
 
std::map< std::string, std::map< int, MonitorElement * > > fedHistos
 
int FEDIDmax
 
int FEDIDmin
 
std::string fedIntegrityFolder
 
std::map< std::string, std::map< int, DTTimeEvolutionHisto * > > fedTimeHistos
 
edm::EDGetTokenT< DTuROSFEDDataCollectionfedToken
 
bool getSCInfo
 
MonitorElementhCorruptionSummary
 
MonitorElementhFEDEntry
 
MonitorElementhFEDFatal
 
MonitorElementhFEDNonFatal
 
MonitorElementhTTSSummary
 
std::multimap< std::string, std::string >::iterator it
 
double link_max [72]
 
int mode
 
int myPrevEv
 
int myPrevFifoVal [7]
 
int myPrevRosVal
 
int myPrevTtsVal
 
std::multimap< std::string, std::string > names
 
MonitorElementnEventMonitor
 
int nevents
 
int neventsFED
 
int nEventsLS
 
int neventsuROS
 
const int NuROS = 12
 
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, DTTimeEvolutionHisto * > > rosTimeHistos
 
std::map< std::string, std::map< int, MonitorElement * > > summaryHistos
 
float trigger_counter
 
std::map< unsigned int, MonitorElement * > urosHistos
 
std::map< unsigned int, DTTimeEvolutionHisto * > urosTimeHistos
 

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

Member Enumeration Documentation

Constructor & Destructor Documentation

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

Definition at line 31 of file DTDataIntegrityTask.cc.

References checkUros, dduToken, Exception, FEDIDmax, FEDIDmin, fedIntegrityFolder, fedToken, edm::ParameterSet::getParameter(), getSCInfo, edm::ParameterSet::getUntrackedParameter(), LogTrace, FEDNumbering::MAXDTFEDID, FEDNumbering::MAXDTUROSFEDID, FEDNumbering::MINDTFEDID, FEDNumbering::MINDTUROSFEDID, mode, neventsFED, neventsuROS, and ros25Token.

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

Definition at line 80 of file DTDataIntegrityTask.cc.

References LogTrace, and neventsFED.

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

Member Function Documentation

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

Definition at line 1738 of file DTDataIntegrityTask.cc.

References checkUros, dduToken, DOCESLOTS, eventErrorFlag, fedBXIds, FEDIDmax, FEDIDmin, fedToken, MonitorElement::Fill(), edm::Event::getByToken(), DTDDUData::getDDUHeader(), DTuROSFEDData::getfed(), DTuROSROSData::getslot(), DTuROSFEDData::getslotsize(), DTuROSFEDData::getuROS(), RecoTauValidation_cfi::header, mps_fire::i, edm::HandleBase::isValid(), LogTrace, genParticles_cff::map, nEventMonitor, nevents, nEventsLS, processFED(), processROS25(), processuROS(), ros25Token, rosBxIdsPerFED, rosL1AIdsPerFED, and FEDHeader::sourceID().

1739 {
1740  nevents++;
1742 
1743  nEventsLS++;
1744 
1745  LogTrace("DTRawToDigi|TDQM|DTMonitorModule|DTDataIntegrityTask") << "[DTDataIntegrityTask]: preProcessEvent" <<endl;
1746 
1747  if (checkUros){ //uROS starting on 2018
1748  // Digi collection
1750  e.getByToken(fedToken, fedCol);
1751  DTuROSFEDData fedData;
1752  DTuROSROSData urosData;
1753 
1754  if(fedCol.isValid()){
1755  for(unsigned int j=0; j <fedCol->size();++j){
1756  fedData = fedCol->at(j);
1757  int fed = fedData.getfed(); //argument should be void
1758  if (fed>FEDIDmax || fed<FEDIDmin) {
1759  LogError("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask") << "[DTDataIntegrityTask]: analyze, FED ID " << fed <<" not expected." << endl;
1760  continue;
1761  }
1762  processFED(fedData, fed);
1763 
1764  for(int slot=1; slot<=DOCESLOTS; ++slot)
1765  {
1766  urosData = fedData.getuROS(slot);
1767  if(fedData.getslotsize(slot)==0 || urosData.getslot()==-1) continue;
1768  processuROS(urosData,fed,slot);
1769  }
1770  }
1771  }
1772  } // checkUros
1773  else{ //Legacy ROS
1774  // clear the set of BXids from the ROSs
1775  for(map<int, set<int> >::iterator rosBxIds = rosBxIdsPerFED.begin(); rosBxIds != rosBxIdsPerFED.end(); ++rosBxIds) {
1776  (*rosBxIds).second.clear();
1777  }
1778 
1779  fedBXIds.clear();
1780 
1781  for(map<int, set<int> >::iterator rosL1AIds = rosL1AIdsPerFED.begin(); rosL1AIds != rosL1AIdsPerFED.end(); ++rosL1AIds) {
1782  (*rosL1AIds).second.clear();
1783  }
1784 
1785  // reset the error flag
1786  eventErrorFlag = false;
1787 
1788  // Digi collection
1789  edm::Handle<DTDDUCollection> dduProduct;
1790  e.getByToken(dduToken, dduProduct);
1791  edm::Handle<DTROS25Collection> ros25Product;
1792  e.getByToken(ros25Token, ros25Product);
1793 
1794  DTDDUData dduData;
1795  std::vector<DTROS25Data> ros25Data;
1796  if(dduProduct.isValid() && ros25Product.isValid()) {
1797  for(unsigned int i=0; i<dduProduct->size(); ++i)
1798  {
1799  dduData = dduProduct->at(i);
1800  ros25Data = ros25Product->at(i);
1801  // FIXME: passing id variable is not needed anymore - change processFED interface for next release!
1802  FEDHeader header = dduData.getDDUHeader();
1803  int id = header.sourceID();
1804  if (id>FEDIDmax || id<FEDIDmin) continue; //SIM uses extra FEDs not monitored
1805 
1806  processFED(dduData, ros25Data, id);
1807  for(unsigned int j=0; j < ros25Data.size(); ++j) {
1808  int rosid = j+1;
1809  processROS25(ros25Data[j],id,rosid);
1810  }
1811  }
1812  }
1813  }
1814 
1815 }
std::map< int, std::set< int > > rosBxIdsPerFED
std::map< int, std::set< int > > rosL1AIdsPerFED
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:519
uint16_t sourceID() const
Identifier of the FED.
Definition: FEDHeader.cc:32
edm::EDGetTokenT< DTuROSFEDDataCollection > fedToken
void processuROS(DTuROSROSData &data, int fed, int uRos)
static const int DOCESLOTS
void Fill(long long x)
edm::EDGetTokenT< DTROS25Collection > ros25Token
void processROS25(DTROS25Data &data, int dduID, int ros)
DTuROSROSData getuROS(int slot) const
bool isValid() const
Definition: HandleBase.h:74
#define LogTrace(id)
MonitorElement * nEventMonitor
const FEDHeader & getDDUHeader() const
Getters.
void processFED(DTuROSFEDData &data, int fed)
int getslotsize(int slot) const
int getslot() const
std::set< int > fedBXIds
int getfed() const
edm::EDGetTokenT< DTDDUCollection > dduToken
void DTDataIntegrityTask::beginLuminosityBlock ( const edm::LuminosityBlock ls,
const edm::EventSetup es 
)
override

Definition at line 1687 of file DTDataIntegrityTask.cc.

References nEventsLS.

1687  {
1688 
1689  nEventsLS = 0;
1690 
1691 }
void DTDataIntegrityTask::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  iRun,
edm::EventSetup const &  iSetup 
)
overrideprotectedvirtual

Implements DQMEDAnalyzer.

Definition at line 102 of file DTDataIntegrityTask.cc.

References bookHistos(), bookHistosROS25(), bookHistosuROS(), checkUros, FEDIDmax, FEDIDmin, LogTrace, mode, NuROS, DTROChainCoding::setDDU(), and DTROChainCoding::setROS().

102  {
103 
104  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask") << "[DTDataIntegrityTask]: postBeginJob" <<endl;
105 
106  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask") << "[DTDataIntegrityTask] Get DQMStore service" << endl;
107 
108  // Loop over the DT FEDs
109 
110  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
111  << " FEDS: " << FEDIDmin << " to " << FEDIDmax << " in the RO" << endl;
112 
113  // book FED integrity histos
114  bookHistos(ibooker, FEDIDmin, FEDIDmax);
115 
116  if (checkUros){ //uROS starting on 2018
117  // static booking of the histograms
118 
119  if(mode == 0 || mode ==2){
120  for(int fed = FEDIDmin; fed <= FEDIDmax; ++fed) { // loop over the FEDs in the readout
121 
122  bookHistos(ibooker, string("FED"), fed);
123 
124  bookHistos(ibooker, string("CRATE"), fed);
125 
126  for(int uRos = 1; uRos <= NuROS; ++uRos) {// loop over all ROS
127  bookHistosuROS(ibooker,fed,uRos);
128  }
129  }
130  } //Not in HLT or SM mode
131  } //uROS
132 
133  else{ //Legacy ROS
134 
135  if(mode == 0 || mode ==2){
136  // static booking of the histograms
137 
138  for(int fed = FEDIDmin; fed <= FEDIDmax; ++fed) { // loop over the FEDs in the readout
139  DTROChainCoding code;
140  code.setDDU(fed);
141  bookHistos(ibooker, string("ROS_S"), code);
142 
143  bookHistos(ibooker, string("DDU"), code);
144 
145  for(int ros = 1; ros <= NuROS; ++ros) {// loop over all ROS
146  code.setROS(ros);
147  bookHistosROS25(ibooker, code);
148  }
149  }
150  } //Not in HLT or SM mode
151  } //Legacy ROS
152 }
void bookHistosuROS(DQMStore::IBooker &, const int fed, const int uRos)
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 154 of file DTDataIntegrityTask.cc.

References DQMStore::IBooker::book1D(), DQMStore::IBooker::book2D(), DQMStore::IBooker::bookFloat(), checkUros, fedHistos, FEDIDmax, FEDIDmin, fedTimeHistos, 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, rosTimeHistos, MonitorElement::setAxisTitle(), MonitorElement::setBinLabel(), DQMStore::IBooker::setCurrentFolder(), summaryHistos, topFolder(), and makeMuonMisalignmentScenario::wheel.

Referenced by bookHistograms(), and bookHistosROS25().

154  {
155 
156  ibooker.setCurrentFolder("DT/EventInfo/Counters");
157  nEventMonitor = ibooker.bookFloat("nProcessedEventsDataIntegrity");
158 
159  // Standard FED integrity histos
160  ibooker.setCurrentFolder(topFolder(true));
161 
162  int nFED = (fedMax - fedMin)+1;
163 
164  hFEDEntry = ibooker.book1D("FEDEntries","# entries per DT FED",nFED,fedMin,fedMax+1);
165 
166  if(!checkUros){
167  hFEDFatal = ibooker.book1D("FEDFatal","# fatal errors DT FED",nFED,fedMin,fedMax+1);
168  hFEDNonFatal = ibooker.book1D("FEDNonFatal","# NON fatal errors DT FED",nFED,fedMin,fedMax+1);
169 
170  if(mode == 3 || mode ==1) return; //Avoid duplication of Info in FEDIntegrity_EvF
171 
172  ibooker.setCurrentFolder(topFolder(false));
173  hTTSSummary = ibooker.book2D("TTSSummary","Summary Status TTS",nFED,fedMin,fedMax+1,9,1,10);
174  hTTSSummary->setAxisTitle("FED",1);
175  hTTSSummary->setBinLabel(1,"ROS PAF",2);
176  hTTSSummary->setBinLabel(2,"DDU PAF",2);
177  hTTSSummary->setBinLabel(3,"ROS PAF",2);
178  hTTSSummary->setBinLabel(4,"DDU PAF",2);
179  hTTSSummary->setBinLabel(5,"DDU Full",2);
180  hTTSSummary->setBinLabel(6,"L1A Mism.",2);
181  hTTSSummary->setBinLabel(7,"ROS Error",2);
182  hTTSSummary->setBinLabel(8,"BX Mism.",2);
183  hTTSSummary->setBinLabel(9,"DDU Logic Err.",2);
184 
185  // bookkeeping of the
186  hCorruptionSummary = ibooker.book2D("DataCorruptionSummary", "Data Corruption Sources",
187  nFED,fedMin,fedMax+1, 8, 1, 9);
189  hCorruptionSummary->setBinLabel(1,"Miss Ch.",2);
190  hCorruptionSummary->setBinLabel(2,"ROS BX mism",2);
191  hCorruptionSummary->setBinLabel(3,"DDU BX mism",2);
192  hCorruptionSummary->setBinLabel(4,"ROS L1A mism",2);
193  hCorruptionSummary->setBinLabel(5,"Miss Payload",2);
194  hCorruptionSummary->setBinLabel(6,"FCRC bit",2);
195  hCorruptionSummary->setBinLabel(7,"Header check",2);
196  hCorruptionSummary->setBinLabel(8,"Trailer Check",2);
197  } //checkUros
198 }
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:118
MonitorElement * nEventMonitor
std::string topFolder(bool isFEDIntegrity) const
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:279
MonitorElement * hFEDEntry
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:136
MonitorElement * hTTSSummary
MonitorElement * bookFloat(Args &&...args)
Definition: DQMStore.h:112
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::bookHistos ( DQMStore::IBooker ,
std::string  folder,
const int  fed 
)
private
void DTDataIntegrityTask::bookHistosROS25 ( DQMStore::IBooker ibooker,
DTROChainCoding  code 
)
private

Definition at line 664 of file DTDataIntegrityTask.cc.

References bookHistos(), getSCInfo, and mode.

Referenced by bookHistograms().

664  {
665 
666  bookHistos(ibooker, string("ROS"), code);
667 
668  if(mode < 1)
669  if(getSCInfo)
670  bookHistos(ibooker, string("SC"), code);
671 }
void bookHistos(DQMStore::IBooker &, const int fedMin, const int fedMax)
void DTDataIntegrityTask::bookHistosuROS ( DQMStore::IBooker ibooker,
const int  fed,
const int  uRos 
)
private

Definition at line 674 of file DTDataIntegrityTask.cc.

References DQMStore::IBooker::book1D(), DQMStore::IBooker::book2D(), counter, FEDIDmin, trackerHits::histo, plotFactory::keyHisto, mode, MonitorElement::setBinLabel(), DQMStore::IBooker::setCurrentFolder(), TDCError, topFolder(), TTSValues, uROSError, uROSEventLenght, urosHistos, and urosTimeHistos.

Referenced by bookHistograms().

674  {
675  string fed_s = to_string(fed);
676  string uRos_s = to_string(uRos);
677  ibooker.setCurrentFolder(topFolder(false) + "FED" + fed_s + "/uROS" + uRos_s);
678 
679  for (int counter=0; counter<3; counter++){
680  string counter_s = to_string(counter);
681  string histoType = "uROSError"+counter_s;
682  int linkDown = counter*24; string linkDown_s = to_string(linkDown);
683  int linkUp = linkDown+23; string linkUp_s = to_string(linkUp);
684  string histoName = "FED" + fed_s + "_" + "uROS" + uRos_s + "_"+histoType;
685  string histoTitle = histoName + " (Link " + linkDown_s +"-"+ linkUp_s + " error summary)";
686  unsigned int keyHisto = (uROSError + counter)*1000 + (fed-FEDIDmin)*100 + (uRos-1);
687  if(mode < 1) // Online only
688  urosHistos[keyHisto] = ibooker.book2D(histoName,histoTitle,11,0,11,24,0,24);
689  else
690  urosHistos[keyHisto] = ibooker.book2D(histoName,histoTitle,5,0,5,24,0,24);
691 
693  // uROS error bins
694  // Placeholders for the moment
695  histo->setBinLabel(1,"Error 1",1);
696  histo->setBinLabel(2,"Error 2",1);
697  histo->setBinLabel(3,"Error 3",1);
698  histo->setBinLabel(4,"Error 4",1);
699  histo->setBinLabel(5,"Not OKFlag",1);
700  if(mode < 1) { //Online only
701  // TDC error bins
702  histo->setBinLabel(6,"TDC Fatal",1);
703  histo->setBinLabel(7,"TDC RO FIFO ov.",1);
704  histo->setBinLabel(8,"TDC L1 buf. ov.",1);
705  histo->setBinLabel(9,"TDC L1A FIFO ov.",1);
706  histo->setBinLabel(10,"TDC hit err.",1);
707  histo->setBinLabel(11,"TDC hit rej.",1);
708  }
709  for (int link=linkDown; link < (linkUp+1); ++link){
710  string link_s = to_string(link);
711  histo->setBinLabel(link-linkDown+1,"Link"+link_s,2);
712  }
713  }
714 
715 
716  if(mode > 1) return;
717 
718  string histoType = "uROSEventLenght";
719  string histoName = "FED" + fed_s + "_uROS" + uRos_s + "_" + "EventLenght";
720  string histoTitle = "Event Lenght (Bytes) FED " + fed_s + " uROS" + uRos_s;
721  unsigned int keyHisto = (uROSEventLenght)*1000 + (fed-FEDIDmin)*100 + (uRos-1);
722  urosHistos[keyHisto] = ibooker.book1D(histoName,histoTitle,101,0,5000);
723 
724  histoType = "uROSAvgEventLenghtvsLumi";
725  histoName = "FED" + fed_s + "_uROS" + uRos_s + "AvgEventLenghtvsLumi";
726  histoTitle = "Event Lenght (Bytes) FED " + fed_s + " uROS" + uRos_s;
727  keyHisto = (fed-FEDIDmin)*100 + (uRos-1);
728  urosTimeHistos[keyHisto] = new DTTimeEvolutionHisto(ibooker,histoName,histoTitle,200,10,true,0);
729 
730  for (int counter=0; counter<3; counter++){
731  string counter_s = to_string(counter);
732  string histoType = "TDCError"+counter_s;
733  int linkDown = counter*24; string linkDown_s = to_string(linkDown);
734  int linkUp = linkDown+23; string linkUp_s = to_string(linkUp);
735  string histoName = "FED" + fed_s + "_" + "uROS" + uRos_s + "_"+histoType;
736  string histoTitle = histoName + " (Link " + linkDown_s +"-"+ linkUp_s + " error summary)";
737  keyHisto = (TDCError+counter)*1000 + (fed-FEDIDmin)*100 + (uRos-1);
738  urosHistos[keyHisto] = ibooker.book2D(histoName,histoTitle,24,0,24,24,0,24);
740  // TDC error bins
741  histo->setBinLabel(1,"Fatal",1);
742  histo->setBinLabel(2,"RO FIFO ov.",1);
743  histo->setBinLabel(3,"L1 buf. ov.",1);
744  histo->setBinLabel(4,"L1A FIFO ov.",1);
745  histo->setBinLabel(5,"hit err.",1);
746  histo->setBinLabel(6,"hit rej.",1);
747  histo->setBinLabel(7,"Fatal",1);
748  histo->setBinLabel(8,"RO FIFO ov.",1);
749  histo->setBinLabel(9,"L1 buf. ov.",1);
750  histo->setBinLabel(10,"L1A FIFO ov.",1);
751  histo->setBinLabel(11,"hit err.",1);
752  histo->setBinLabel(12,"hit rej.",1);
753  histo->setBinLabel(13,"Fatal",1);
754  histo->setBinLabel(14,"RO FIFO ov.",1);
755  histo->setBinLabel(15,"L1 buf. ov.",1);
756  histo->setBinLabel(16,"L1A FIFO ov.",1);
757  histo->setBinLabel(17,"hit err.",1);
758  histo->setBinLabel(18,"hit rej.",1);
759  histo->setBinLabel(19,"Fatal",1);
760  histo->setBinLabel(20,"RO FIFO ov.",1);
761  histo->setBinLabel(21,"L1 buf. ov.",1);
762  histo->setBinLabel(22,"L1A FIFO ov.",1);
763  histo->setBinLabel(23,"hit err.",1);
764  histo->setBinLabel(24,"hit rej.",1);
765 
766  for (int link=linkDown; link < (linkUp+1); ++link){
767  string link_s = to_string(link);
768  histo->setBinLabel(link-linkDown+1,"Link"+link_s,2);
769  }
770  }
771 
772  histoType = "TTSValues";
773  histoName = "FED" + fed_s + "_" + "uROS" + uRos_s + "_" + histoType;
774  keyHisto = TTSValues*1000 + (fed-FEDIDmin)*100 + (uRos-1);
775  urosHistos[keyHisto] = ibooker.book1D(histoName,histoName,8,0,8);
777  histo->setBinLabel(1,"Disconnected",1);
778  histo->setBinLabel(2,"Overflow Warning ",1);
779  histo->setBinLabel(3,"Out of synch",1);
780  histo->setBinLabel(4,"Busy",1);
781  histo->setBinLabel(5,"Ready",1);
782  histo->setBinLabel(6,"Error",1);
783  histo->setBinLabel(7,"Disconnected",1);
784  histo->setBinLabel(8,"Unknown",1);
785 
786 }
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)
std::map< unsigned int, MonitorElement * > urosHistos
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:118
std::string topFolder(bool isFEDIntegrity) const
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:279
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:136
static std::atomic< unsigned int > counter
std::map< unsigned int, DTTimeEvolutionHisto * > urosTimeHistos
void DTDataIntegrityTask::channelsInCEROS ( int  cerosId,
int  chMask,
std::vector< int > &  channels 
)
private

Definition at line 1667 of file DTDataIntegrityTask.cc.

References globals_cff::x1.

Referenced by processROS25().

1667  {
1668  for (int iCh=0; iCh<6;++iCh) {
1669  if ((chMask >> iCh) & 0x1){
1670  channels.push_back(cerosId*6+iCh);
1671  }
1672  }
1673  return;
1674 }
void DTDataIntegrityTask::channelsInROS ( int  cerosMask,
std::vector< int > &  channels 
)
private

Definition at line 1676 of file DTDataIntegrityTask.cc.

References globals_cff::x1.

Referenced by processROS25().

1676  {
1677  for (int iCeros=0; iCeros<5;++iCeros) {
1678  if ((cerosMask >> iCeros) & 0x1){
1679  for (int iCh=0; iCh<6;++iCh) {
1680  channels.push_back(iCeros*6+iCh);
1681  }
1682  }
1683  }
1684  return;
1685 }
void DTDataIntegrityTask::endLuminosityBlock ( const edm::LuminosityBlock ls,
const edm::EventSetup es 
)
override

Definition at line 1693 of file DTDataIntegrityTask.cc.

References checkUros, fedTimeHistos, edm::LuminosityBlockBase::luminosityBlock(), nEventsLS, rosTimeHistos, and urosTimeHistos.

1693  {
1694 
1695  int lumiBlock = ls.luminosityBlock();
1696 
1697  if (checkUros){
1698  map<string, map<int, DTTimeEvolutionHisto*> >::iterator fedIt = fedTimeHistos.begin();
1699  map<string, map<int, DTTimeEvolutionHisto*> >::iterator fedEnd = fedTimeHistos.end();
1700  for(; fedIt!=fedEnd; ++fedIt) {
1701  map<int, DTTimeEvolutionHisto*>::iterator histoIt = fedIt->second.begin();
1702  map<int, DTTimeEvolutionHisto*>::iterator histoEnd = fedIt->second.end();
1703  for(; histoIt!=histoEnd; ++histoIt) {
1704  histoIt->second->updateTimeSlot(lumiBlock,nEventsLS);
1705  }
1706  }
1707 
1708  map<unsigned int, DTTimeEvolutionHisto*>::iterator urosIt = urosTimeHistos.begin();
1709  map<unsigned int, DTTimeEvolutionHisto*>::iterator urosEnd = urosTimeHistos.end();
1710  for(; urosIt!=urosEnd; ++urosIt) {
1711  urosIt->second->updateTimeSlot(lumiBlock,nEventsLS);
1712  }
1713 
1714  }//uROS starting on 2018
1715  else{
1716  map<string, map<int, DTTimeEvolutionHisto*> >::iterator dduIt = fedTimeHistos.begin();
1717  map<string, map<int, DTTimeEvolutionHisto*> >::iterator dduEnd = fedTimeHistos.end();
1718  for(; dduIt!=dduEnd; ++dduIt) {
1719  map<int, DTTimeEvolutionHisto*>::iterator histoIt = dduIt->second.begin();
1720  map<int, DTTimeEvolutionHisto*>::iterator histoEnd = dduIt->second.end();
1721  for(; histoIt!=histoEnd; ++histoIt) {
1722  histoIt->second->updateTimeSlot(lumiBlock,nEventsLS);
1723  }
1724  }
1725 
1726  map<string, map<int, DTTimeEvolutionHisto*> >::iterator rosIt = rosTimeHistos.begin();
1727  map<string, map<int, DTTimeEvolutionHisto*> >::iterator rosEnd = rosTimeHistos.end();
1728  for(; rosIt!=rosEnd; ++rosIt) {
1729  map<int, DTTimeEvolutionHisto*>::iterator histoIt = rosIt->second.begin();
1730  map<int, DTTimeEvolutionHisto*>::iterator histoEnd = rosIt->second.end();
1731  for(; histoIt!=histoEnd; ++histoIt) {
1732  histoIt->second->updateTimeSlot(lumiBlock,nEventsLS);
1733  }
1734  }
1735  }//ROS Legacy
1736 }
LuminosityBlockNumber_t luminosityBlock() const
std::map< std::string, std::map< int, DTTimeEvolutionHisto * > > fedTimeHistos
std::map< std::string, std::map< int, DTTimeEvolutionHisto * > > rosTimeHistos
std::map< unsigned int, DTTimeEvolutionHisto * > urosTimeHistos
bool DTDataIntegrityTask::eventHasErrors ( ) const

Definition at line 1632 of file DTDataIntegrityTask.cc.

References eventErrorFlag.

1632  {
1633  return eventErrorFlag;
1634 }
void DTDataIntegrityTask::fedEntry ( int  dduID)

Definition at line 1638 of file DTDataIntegrityTask.cc.

References MonitorElement::Fill(), and hFEDEntry.

1638  {
1639  hFEDEntry->Fill(dduID);
1640 }
void Fill(long long x)
MonitorElement * hFEDEntry
void DTDataIntegrityTask::fedFatal ( int  dduID)

Definition at line 1645 of file DTDataIntegrityTask.cc.

References MonitorElement::Fill(), and hFEDFatal.

1645  {
1646  hFEDFatal->Fill(dduID);
1647 }
MonitorElement * hFEDFatal
void Fill(long long x)
void DTDataIntegrityTask::fedNonFatal ( int  dduID)

Definition at line 1652 of file DTDataIntegrityTask.cc.

References MonitorElement::Fill(), and hFEDNonFatal.

1652  {
1653  hFEDNonFatal->Fill(dduID);
1654 }
MonitorElement * hFEDNonFatal
void Fill(long long x)
void DTDataIntegrityTask::processFED ( DTuROSFEDData data,
int  fed 
)

Definition at line 1280 of file DTDataIntegrityTask.cc.

References fedHistos, FEDIDmax, fedTimeHistos, MonitorElement::Fill(), DTuROSFEDData::getBXId(), DTuROSFEDData::getevtlgth(), DTuROSFEDData::getnslots(), DTuROSFEDData::getTTS(), hFEDEntry, LogTrace, mode, and neventsFED.

Referenced by analyze().

1280  {
1281 
1282  neventsFED++;
1283  if (neventsFED%1000 == 0)
1284  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
1285  << "[DTDataIntegrityTask]: " << neventsFED << " events analyzed by processFED" << endl;
1286 
1287  if(fed < FEDIDmin || fed > FEDIDmax) return;
1288 
1289  hFEDEntry->Fill(fed);
1290 
1291  if(mode == 3 || mode ==1) return; //Avoid duplication of Info in FEDIntegrity_EvF
1292 
1293  //1D HISTOS: EVENT LENGHT from trailer
1294  int fedEvtLenght = data.getevtlgth()*8; //1 word = 8 bytes
1295  // if(fedEvtLenght > 16000) fedEvtLenght = 16000; // overflow bin
1296  fedHistos["EventLenght"][fed]->Fill(fedEvtLenght);
1297 
1298  if(mode > 1) return;
1299 
1300  fedTimeHistos["FEDAvgEvLenghtvsLumi"][fed]->accumulateValueTimeSlot(fedEvtLenght);
1301 
1302  // fill the distribution of the BX ids
1303  fedHistos["BXID"][fed]->Fill(data.getBXId());
1304 
1305  // size of the list of ROS in the Read-Out
1306  fedHistos["uROSList"][fed]->Fill(data.getnslots());
1307 
1308  // Fill the status summary of the TTS
1309 
1310  //1D HISTO WITH TTS VALUES form trailer (7 bins = 7 values)
1311 
1312  int ttsCodeValue = -1;
1313  int value = data.getTTS();
1314  switch(value) {
1315  case 0:{ //disconnected
1316  ttsCodeValue = 0;
1317  break;
1318  }
1319  case 1:{ //warning overflow
1320  ttsCodeValue = 1;
1321  break;
1322  }
1323  case 2:{ //out of sinch
1324  ttsCodeValue = 2;
1325  break;
1326  }
1327  case 4:{ //busy
1328  ttsCodeValue = 3;
1329  break;
1330  }
1331  case 8:{ //ready
1332  ttsCodeValue = 4;
1333  break;
1334  }
1335  case 12:{ //error
1336  ttsCodeValue = 5;
1337  break;
1338  }
1339  case 15:{ //disconnected
1340  ttsCodeValue = 6;
1341  break;
1342  }
1343  default:{
1344  LogError("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
1345  <<"[DTDataIntegrityTask] FED TTS control: wrong TTS value "<< value << " in FED "<< fed<< endl;
1346  ttsCodeValue = 7;
1347  }
1348  }
1349  if(mode < 1) fedHistos["TTSValues"][fed]->Fill(ttsCodeValue);
1350 
1351 }
int getevtlgth() const
void Fill(long long x)
std::map< std::string, std::map< int, DTTimeEvolutionHisto * > > fedTimeHistos
int getBXId() const
Definition: value.py:1
std::map< std::string, std::map< int, MonitorElement * > > fedHistos
#define LogTrace(id)
MonitorElement * hFEDEntry
int getTTS() const
int getnslots() const
void DTDataIntegrityTask::processFED ( DTDDUData dduData,
const std::vector< DTROS25Data > &  rosData,
int  dduID 
)

Definition at line 1355 of file DTDataIntegrityTask.cc.

References DTDDUSecondStatusWord::busyROSPAF(), FEDHeader::bxID(), DTDDUSecondStatusWord::bxIDError(), FEDHeader::check(), FEDTrailer::check(), DTDDUData::crcErrorBit(), fedBXIds, fedHistos, FEDIDmax, FEDIDmin, fedTimeHistos, DTDDUSecondStatusWord::fifoAlmostFull(), DTDDUSecondStatusWord::fifoFull(), MonitorElement::Fill(), FEDTrailer::fragmentLength(), 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(), LogTrace, FEDHeader::lvl1ID(), mode, neventsFED, DTDDUSecondStatusWord::outOfSynchROSError(), DTDDUSecondStatusWord::outputFifoAlmostFull(), DTDDUSecondStatusWord::outputFifoFull(), rosBxIdsPerFED, rosL1AIdsPerFED, DTDDUSecondStatusWord::rosList(), DTROChainCoding::setDDU(), FEDHeader::triggerType(), FEDTrailer::ttsBits(), DTDDUSecondStatusWord::warningROSPAF(), and globals_cff::x1.

1355  {
1356 
1357  neventsFED++;
1358  if (neventsFED%1000 == 0)
1359  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
1360  << "[DTDataIntegrityTask]: " << neventsFED << " events analyzed by processFED" << endl;
1361 
1362 
1363  DTROChainCoding code;
1364  code.setDDU(ddu);
1365  if(code.getDDUID() < FEDIDmin || code.getDDUID() > FEDIDmax) return;
1366 
1367  hFEDEntry->Fill(code.getDDUID());
1368 
1369  FEDTrailer trailer = data.getDDUTrailer();
1370  FEDHeader header = data.getDDUHeader();
1371 
1372  // check consistency of header and trailer
1373  if(!header.check()) {
1374  // error code 7
1375  hFEDFatal->Fill(code.getDDUID());
1376  hCorruptionSummary->Fill(code.getDDUID(), 7);
1377  }
1378 
1379  if(!trailer.check()) {
1380  // error code 8
1381  hFEDFatal->Fill(code.getDDUID());
1382  hCorruptionSummary->Fill(code.getDDUID(), 8);
1383  }
1384 
1385  // check CRC error bit set by DAQ before sending data on SLink
1386  if(data.crcErrorBit()) {
1387  // error code 6
1388  hFEDFatal->Fill(code.getDDUID());
1389  hCorruptionSummary->Fill(code.getDDUID(), 6);
1390  }
1391 
1392  if(mode == 3 || mode ==1) return; //Avoid duplication of Info in FEDIntegrity_EvF
1393 
1394  const DTDDUSecondStatusWord& secondWord = data.getSecondStatusWord();
1395 
1396  // Fill the status summary of the TTS
1397 
1398  //1D HISTO WITH TTS VALUES form trailer (7 bins = 7 values)
1399  int ttsCodeValue = -1;
1400  int ttsSummaryBin = -1;
1401 
1402  switch(trailer.ttsBits()) {
1403  case 0:{ //disconnected
1404  ttsCodeValue = 0;
1405  break;
1406  }
1407  case 1:{ //warning overflow
1408  ttsCodeValue = 1;
1409  if(secondWord.warningROSPAF()) { // ROS PAF
1410  ttsSummaryBin = 1;
1411  } else { // DDU PAF
1412  ttsSummaryBin = 2;
1413  }
1414 
1415  break;
1416  }
1417  case 2:{ //out of sinch
1418  ttsCodeValue = 2;
1419  bool knownOrigin = false;
1420  if(secondWord.outOfSynchROSError()) {// ROS Error
1421  ttsSummaryBin = 7;
1422  knownOrigin = true;
1423  }
1424  if(secondWord.l1AIDError()) {// L1A Mism.
1425  ttsSummaryBin = 6;
1426  knownOrigin = true;
1427  }
1428  if(secondWord.bxIDError()) {// BX Mism.
1429  ttsSummaryBin = 8;
1430  knownOrigin = true;
1431  }
1432  if(secondWord.outputFifoFull() || secondWord.inputFifoFull() || secondWord.fifoFull()) { // DDU Full
1433  ttsSummaryBin = 5;
1434  knownOrigin = true;
1435  }
1436  if(!knownOrigin) ttsSummaryBin = 9; // Error in DDU logic
1437 
1438  break;
1439  }
1440  case 4:{ //busy
1441  ttsCodeValue = 3;
1442  bool knownOrigin = false;
1443  if(secondWord.busyROSPAF()) { // ROS PAF
1444  ttsSummaryBin = 3;
1445  knownOrigin = true;
1446  }
1447  if(secondWord.outputFifoAlmostFull() || secondWord.inputFifoAlmostFull() || secondWord.fifoAlmostFull() ){ // DDU PAF
1448  ttsSummaryBin = 4;
1449  knownOrigin = true;
1450  }
1451  if(!knownOrigin) ttsSummaryBin = 9; // Error in DDU logic
1452  break;
1453  }
1454  case 8:{ //ready
1455  ttsCodeValue = 4;
1456  break;
1457  }
1458  case 12:{ //error
1459  ttsCodeValue = 5;
1460  break;
1461  }
1462  case 16:{ //disconnected
1463  ttsCodeValue = 6;
1464  break;
1465  }
1466  default:{
1467  LogError("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
1468  <<"[DTDataIntegrityTask] DDU control: wrong TTS value "<<trailer.ttsBits()<<endl;
1469  ttsCodeValue = 7;
1470  }
1471  }
1472  if(mode < 1) fedHistos["TTSValues"][code.getDDUID()]->Fill(ttsCodeValue);
1473  if(ttsSummaryBin != -1) {
1474  hTTSSummary->Fill(ddu, ttsSummaryBin);
1475  }
1476 
1477 
1478  //2D HISTO: ROS VS STATUS (8 BIT = 8 BIN) from 1st-2nd status words (9th BIN FROM LIST OF ROS in 2nd status word)
1479  MonitorElement* hROSStatus = fedHistos["ROSStatus"][code.getDDUID()];
1480  //1D HISTO: NUMBER OF ROS IN THE EVENTS from 2nd status word
1481 
1482  int rosList = secondWord.rosList();
1483  set<int> rosPositions;
1484  for(int i=0;i<12;i++) {
1485  if(rosList & 0x1) {
1486  rosPositions.insert(i);
1487  //9th BIN FROM LIST OF ROS in 2nd status word
1488  if(mode <= 2) hROSStatus->Fill(8,i,1);
1489  }
1490  rosList >>= 1;
1491  }
1492 
1493  int channel=0;
1494  for (vector<DTDDUFirstStatusWord>::const_iterator fsw_it = data.getFirstStatusWord().begin();
1495  fsw_it != data.getFirstStatusWord().end(); fsw_it++) {
1496  // assuming association one-to-one between DDU channel and ROS
1497  if(mode <= 2) {
1498  hROSStatus->Fill(0,channel,(*fsw_it).channelEnabled());
1499  hROSStatus->Fill(1,channel,(*fsw_it).timeout());
1500  hROSStatus->Fill(2,channel,(*fsw_it).eventTrailerLost());
1501  hROSStatus->Fill(3,channel,(*fsw_it).opticalFiberSignalLost());
1502  hROSStatus->Fill(4,channel,(*fsw_it).tlkPropagationError());
1503  hROSStatus->Fill(5,channel,(*fsw_it).tlkPatternError());
1504  hROSStatus->Fill(6,channel,(*fsw_it).tlkSignalLost());
1505  hROSStatus->Fill(7,channel,(*fsw_it).errorFromROS());
1506  }
1507  // check that the enabled channel was also in the read-out
1508  if((*fsw_it).channelEnabled() == 1 &&
1509  rosPositions.find(channel) == rosPositions.end()) {
1510  if(mode <= 2) hROSStatus->Fill(9,channel,1);
1511  // error code 1
1512  hFEDFatal->Fill(code.getDDUID());
1513  hCorruptionSummary->Fill(code.getDDUID(), 1);
1514  }
1515  channel++;
1516  }
1517 
1518 
1519  // ---------------------------------------------------------------------
1520  // cross checks between FED and ROS data
1521  // check the BX ID against the ROSs
1522  set<int> rosBXIds = rosBxIdsPerFED[ddu];
1523  if((rosBXIds.size() > 1 || rosBXIds.find(header.bxID()) == rosBXIds.end()) && !rosBXIds.empty() ) { // in this case look for faulty ROSs
1524  for(vector<DTROS25Data>::const_iterator rosControlData = rosData.begin();
1525  rosControlData != rosData.end(); ++rosControlData) { // loop over the ROS data
1526  for (vector<DTROSDebugWord>::const_iterator debug_it = (*rosControlData).getROSDebugs().begin();
1527  debug_it != (*rosControlData).getROSDebugs().end(); debug_it++) { // Loop over ROS debug words
1528  if ((*debug_it).debugType() == 0 && (*debug_it).debugMessage() != header.bxID()) { // check the BX
1529  int ros = (*rosControlData).getROSID();
1530  // fill the error bin
1531  if(mode <= 2) hROSStatus->Fill(11,ros-1);
1532  // error code 2
1533  hFEDFatal->Fill(code.getDDUID());
1534  hCorruptionSummary->Fill(code.getDDUID(), 2);
1535  }
1536  }
1537  }
1538  }
1539 
1540  // check the BX ID against other FEDs
1541  fedBXIds.insert(header.bxID());
1542  if(fedBXIds.size() != 1) {
1543  LogWarning("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
1544  << "ERROR: FED " << ddu << " BX ID different from other feds: " << header.bxID() << endl;
1545  // error code 3
1546  hFEDFatal->Fill(code.getDDUID());
1547  hCorruptionSummary->Fill(code.getDDUID(), 3);
1548  }
1549 
1550 
1551  // check the L1A ID against the ROSs
1552  set<int> rosL1AIds = rosL1AIdsPerFED[ddu];
1553  if((rosL1AIds.size() > 1 || rosL1AIds.find(header.lvl1ID()-1) == rosL1AIds.end()) && !rosL1AIds.empty() ){ // in this case look for faulty ROSs
1554  //If L1A_ID error identify which ROS has wrong L1A
1555  for (vector<DTROS25Data>::const_iterator rosControlData = rosData.begin();
1556  rosControlData != rosData.end(); rosControlData++) { // loop over the ROS data
1557  unsigned int ROSHeader_TTCCount = ((*rosControlData).getROSHeader().TTCEventCounter() + 1) % 0x1000000; // fix comparison in case of last counting bin in ROS /first one in DDU
1558  if( ROSHeader_TTCCount != header.lvl1ID() ) {
1559  int ros = (*rosControlData).getROSID();
1560  if(mode <= 2) hROSStatus->Fill(10,ros-1);
1561  // error code 4
1562  hFEDFatal->Fill(code.getDDUID());
1563  hCorruptionSummary->Fill(code.getDDUID(), 4);
1564  }
1565  }
1566  }
1567 
1568  //1D HISTOS: EVENT LENGHT from trailer
1569  int fedEvtLenght = trailer.fragmentLength()*8;
1570  // if(fedEvtLenght > 16000) fedEvtLenght = 16000; // overflow bin
1571  fedHistos["EventLenght"][code.getDDUID()]->Fill(fedEvtLenght);
1572 
1573  if(mode > 1) return;
1574 
1575  fedTimeHistos["FEDAvgEvLenghtvsLumi"][code.getDDUID()]->accumulateValueTimeSlot(fedEvtLenght);
1576 
1577  // size of the list of ROS in the Read-Out
1578  fedHistos["ROSList"][code.getDDUID()]->Fill(rosPositions.size());
1579 
1580 
1581  //2D HISTO: FIFO STATUS from 2nd status word
1582  MonitorElement *hFIFOStatus = fedHistos["FIFOStatus"][code.getDDUID()];
1583  int inputFifoFull = secondWord.inputFifoFull();
1584  int inputFifoAlmostFull = secondWord.inputFifoAlmostFull();
1585  int fifoFull = secondWord.fifoFull();
1586  int fifoAlmostFull = secondWord.fifoAlmostFull();
1587  int outputFifoFull = secondWord.outputFifoFull();
1588  int outputFifoAlmostFull = secondWord.outputFifoAlmostFull();
1589  for(int i=0;i<3;i++){
1590  if(inputFifoFull & 0x1){
1591  hFIFOStatus->Fill(i,0);
1592  }
1593  if(inputFifoAlmostFull & 0x1){
1594  hFIFOStatus->Fill(i,1);
1595  }
1596  if(fifoFull & 0x1){
1597  hFIFOStatus->Fill(3+i,0);
1598  }
1599  if(fifoAlmostFull & 0x1){
1600  hFIFOStatus->Fill(3+i,1);
1601  }
1602  if(!(inputFifoFull & 0x1) && !(inputFifoAlmostFull & 0x1)){
1603  hFIFOStatus->Fill(i,2);
1604  }
1605  if(!(fifoFull & 0x1) && !(fifoAlmostFull & 0x1)){
1606  hFIFOStatus->Fill(3+i,2);
1607  }
1608  inputFifoFull >>= 1;
1609  inputFifoAlmostFull >>= 1;
1610  fifoFull >>= 1;
1611  fifoAlmostFull >>= 1;
1612  }
1613 
1614  if(outputFifoFull){
1615  hFIFOStatus->Fill(6,0);
1616  }
1617  if(outputFifoAlmostFull){
1618  hFIFOStatus->Fill(6,1);
1619  }
1620  if(!outputFifoFull && !outputFifoAlmostFull){
1621  hFIFOStatus->Fill(6,2);
1622  }
1623 
1624  //1D HISTO: EVENT TYPE from header
1625  fedHistos["EventType"][code.getDDUID()]->Fill(header.triggerType());
1626 
1627  // fill the distribution of the BX ids
1628  fedHistos["BXID"][code.getDDUID()]->Fill(header.bxID());
1629 
1630 }
std::map< int, std::set< int > > rosBxIdsPerFED
std::map< int, std::set< int > > rosL1AIdsPerFED
uint8_t triggerType() const
Event Trigger type identifier.
Definition: FEDHeader.cc:17
int outputFifoFull() const
Definition: DTDDUWords.h:901
int rosList() const
Definition: DTDDUWords.h:903
bool check() const
Check that the header is OK.
Definition: FEDHeader.cc:72
bool check() const
Check that the trailer is OK.
Definition: FEDTrailer.cc:83
int busyROSPAF() const
Definition: DTDDUWords.h:905
int l1AIDError() const
Definition: DTDDUWords.h:895
MonitorElement * hFEDFatal
uint32_t fragmentLength() const
The length of the event fragment counted in 64-bit words including header and trailer.
Definition: FEDTrailer.cc:17
void Fill(long long x)
int warningROSPAF() const
Definition: DTDDUWords.h:904
std::map< std::string, std::map< int, DTTimeEvolutionHisto * > > fedTimeHistos
int fifoFull() const
Definition: DTDDUWords.h:897
std::map< std::string, std::map< int, MonitorElement * > > fedHistos
#define LogTrace(id)
int getDDUID() const
int inputFifoAlmostFull() const
Definition: DTDDUWords.h:900
int inputFifoFull() const
Definition: DTDDUWords.h:898
uint8_t ttsBits() const
Current value of the Trigger Throttling System bits.
Definition: FEDTrailer.cc:32
MonitorElement * hFEDEntry
int bxIDError() const
Definition: DTDDUWords.h:896
uint16_t bxID() const
The bunch crossing number.
Definition: FEDHeader.cc:27
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
uint32_t lvl1ID() const
Level-1 event number generated by the TTC system.
Definition: FEDHeader.cc:22
int fifoAlmostFull() const
Definition: DTDDUWords.h:899
int outOfSynchROSError() const
Definition: DTDDUWords.h:906
MonitorElement * hCorruptionSummary
void DTDataIntegrityTask::processROS25 ( DTROS25Data data,
int  dduID,
int  ros 
)

Definition at line 995 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, neventsuROS, DTTDCMeasurementWord::PC(), DTROBHeaderWord::robID(), rosBxIdsPerFED, rosHistos, rosL1AIdsPerFED, rosTimeHistos, DTROChainCoding::setDDU(), DTROChainCoding::setROB(), DTROChainCoding::setROS(), summaryHistos, DTROSTrailerWord::TPX(), DTROSHeaderWord::TTCEventCounter(), and DTLocalTriggerTrailerWord::wordCount().

Referenced by analyze().

995  {
996 
997  neventsuROS++; // FIXME: implement a counter which makes sense
998 
999  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
1000  << "[DTDataIntegrityTask]: " << neventsuROS << " events analyzed by processROS25" << endl;
1001 
1002  // The ID of the RO board (used to map the histos)
1003  DTROChainCoding code;
1004  code.setDDU(ddu);
1005  code.setROS(ros);
1006 
1007  if(mode == 3 || mode ==1) return; //Avoid duplication of Info in FEDIntegrity_EvF
1008 
1009  MonitorElement* ROSSummary = summaryHistos["ROSSummary"][code.getDDUID()];
1010 
1011  // Summary of all ROB errors
1012  MonitorElement* ROSError = nullptr;
1013  if(mode <= 2) ROSError = rosHistos["ROSError"][code.getROSID()];
1014 
1015  if ( (mode<=2) && (!ROSError) ) {
1016  LogError("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask") <<
1017  "Trying to access non existing ME at ROSID " << code.getROSID() <<
1018  std::endl;
1019  return;
1020  }
1021 
1022  // L1A ids to be checked against FED one
1023  rosL1AIdsPerFED[ddu].insert(data.getROSHeader().TTCEventCounter());
1024 
1025  // ROS errors
1026 
1027 
1028  // check for TPX errors
1029  if (data.getROSTrailer().TPX() != 0) {
1030  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask") << " TXP error en ROS "
1031  << code.getROS() << endl;
1032  ROSSummary->Fill(9,code.getROS());
1033  }
1034 
1035  // L1 Buffer almost full (non-critical error!)
1036  if(data.getROSTrailer().l1AFifoOccupancy() > 31) {
1037  ROSSummary->Fill(10,code.getROS());
1038  }
1039 
1040 
1041  for (vector<DTROSErrorWord>::const_iterator error_it = data.getROSErrors().begin();
1042  error_it != data.getROSErrors().end(); error_it++) { // Loop over ROS error words
1043 
1044  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask") << " Error in ROS " << code.getROS()
1045  << " ROB Id " << (*error_it).robID()
1046  << " Error type " << (*error_it).errorType() << endl;
1047 
1048  // Fill the ROSSummary (1 per FED) histo
1049  ROSSummary->Fill((*error_it).errorType(), code.getROS());
1050  if((*error_it).errorType() <= 11) { // set error flag
1051  eventErrorFlag = true;
1052  }
1053 
1054  if(mode <= 2) {
1055  // Fill the ROB Summary (1 per ROS) histo
1056  if ((*error_it).robID() != 31) {
1057  ROSError->Fill((*error_it).errorType(),(*error_it).robID());
1058  }
1059  else if ((*error_it).errorType() == 4) {
1060  vector<int> channelBins;
1061  channelsInROS((*error_it).cerosID(),channelBins);
1062  vector<int>::const_iterator channelIt = channelBins.begin();
1063  vector<int>::const_iterator channelEnd = channelBins.end();
1064  for(;channelIt!=channelEnd;++channelIt) {
1065  ROSError->Fill(4,(*channelIt));
1066  }
1067  }
1068  }
1069  }
1070 
1071 
1072  int ROSDebug_BunchNumber = -1;
1073 
1074  for (vector<DTROSDebugWord>::const_iterator debug_it = data.getROSDebugs().begin();
1075  debug_it != data.getROSDebugs().end(); debug_it++) { // Loop over ROS debug words
1076 
1077  int debugROSSummary = 0;
1078  int debugROSError = 0;
1079  vector<int> debugBins;
1080  bool hasEvIdMis = false;
1081  vector<int> evIdMisBins;
1082 
1083  if ((*debug_it).debugType() == 0 ) {
1084  ROSDebug_BunchNumber = (*debug_it).debugMessage();
1085  } else if ((*debug_it).debugType() == 1 ) {
1086  // not used
1087  // ROSDebug_BcntResCntLow = (*debug_it).debugMessage();
1088  } else if ((*debug_it).debugType() == 2 ) {
1089  // not used
1090  // ROSDebug_BcntResCntHigh = (*debug_it).debugMessage();
1091  } else if ((*debug_it).debugType() == 3) {
1092  if ((*debug_it).dontRead()){
1093  debugROSSummary = 11;
1094  debugROSError = 8;
1095  if (mode <= 2) channelsInCEROS((*debug_it).cerosIdCerosStatus(),(*debug_it).dontRead(),debugBins);
1096  } if ((*debug_it).evIdMis()){
1097  hasEvIdMis = true;
1098  if (mode <= 2) channelsInCEROS((*debug_it).cerosIdCerosStatus(),(*debug_it).evIdMis(),evIdMisBins);
1099  }
1100  } else if ((*debug_it).debugType() == 4 &&
1101  (*debug_it).cerosIdRosStatus()){
1102  debugROSSummary = 13;
1103  debugROSError = 10;
1104  if (mode <= 2) channelsInROS((*debug_it).cerosIdRosStatus(),debugBins);
1105  }
1106 
1107  if (debugROSSummary) {
1108  ROSSummary->Fill(debugROSSummary,code.getROS());
1109  if (mode <= 2) {
1110  vector<int>::const_iterator channelIt = debugBins.begin();
1111  vector<int>::const_iterator channelEnd = debugBins.end();
1112  for (;channelIt!=channelEnd;++channelIt) {
1113  ROSError->Fill(debugROSError,(*channelIt));
1114  }
1115  }
1116  }
1117 
1118  if (hasEvIdMis) {
1119  ROSSummary->Fill(12,code.getROS());
1120  if (mode <= 2) {
1121  vector<int>::const_iterator channelIt = evIdMisBins.begin();
1122  vector<int>::const_iterator channelEnd = evIdMisBins.end();
1123  for (;channelIt!=channelEnd;++channelIt) {
1124  ROSError->Fill(9,(*channelIt));
1125  }
1126  }
1127  }
1128 
1129  }
1130 
1131  // ROB Group Header
1132  // Check the BX of the ROB headers against the BX of the ROS
1133  for (vector<DTROBHeader>::const_iterator rob_it = data.getROBHeaders().begin();
1134  rob_it != data.getROBHeaders().end(); rob_it++) { // loop over ROB headers
1135 
1136  code.setROB((*rob_it).first);
1137  DTROBHeaderWord robheader = (*rob_it).second;
1138 
1139  rosBxIdsPerFED[ddu].insert(ROSDebug_BunchNumber);
1140 
1141  if (robheader.bunchID() != ROSDebug_BunchNumber) {
1142  // fill ROS Summary plot
1143  ROSSummary->Fill(8,code.getROS());
1144  eventErrorFlag = true;
1145 
1146  // fill ROB Summary plot for that particular ROS
1147  if(mode <= 2) ROSError->Fill(7,robheader.robID());
1148  }
1149  }
1150 
1151 
1152  if(mode < 1) { // produce only when not in HLT or SM
1153  // ROB Trailer
1154  for (vector<DTROBTrailerWord>::const_iterator robt_it = data.getROBTrailers().begin();
1155  robt_it != data.getROBTrailers().end(); robt_it++) { // loop over ROB trailers
1156  float wCount = (*robt_it).wordCount()<100. ? (*robt_it).wordCount() : 99.9;
1157  rosHistos["ROB_mean"][code.getROSID()]->Fill((*robt_it).robID(),wCount);
1158  }
1159 
1160  // Plot the event lenght //NOHLT
1161  int rosEventLenght = data.getROSTrailer().EventWordCount()*4;
1162  rosTimeHistos["ROSAvgEventLenghtvsLumi"][code.getROSID()]->accumulateValueTimeSlot(rosEventLenght);
1163 
1164  if(rosEventLenght > 1600) rosEventLenght = 1600;
1165  rosHistos["ROSEventLenght"][code.getROSID()]->Fill(rosEventLenght);
1166  }
1167 
1168 
1169  // TDC Data
1170  for (vector<DTTDCData>::const_iterator tdc_it = data.getTDCData().begin();
1171  tdc_it != data.getTDCData().end(); tdc_it++) { // loop over TDC data
1172 
1173  DTTDCMeasurementWord tdcDatum = (*tdc_it).second;
1174 
1175  if ( tdcDatum.PC() !=0) {
1176  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
1177  << " PC error in ROS " << code.getROS() << " TDC " << (*tdc_it).first << endl;
1178  // fill ROS Summary plot
1179  ROSSummary->Fill(7,code.getROS());
1180 
1181  eventErrorFlag = true;
1182 
1183  // fill ROB Summary plot for that particular ROS
1184  if(mode <= 2) ROSError->Fill(6,(*tdc_it).first);
1185  }
1186  }
1187 
1188  // TDC Error
1189  for (vector<DTTDCError>::const_iterator tdc_it = data.getTDCError().begin();
1190  tdc_it != data.getTDCError().end(); tdc_it++) { // loop over TDC errors
1191 
1192  code.setROB((*tdc_it).first);
1193 
1194  int tdcError_ROSSummary = 0;
1195  int tdcError_ROSError = 0;
1196  int tdcError_TDCHisto = 0;
1197 
1198  if(((*tdc_it).second).tdcError() & 0x4000 ) {
1199  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
1200  << " ROS " << code.getROS() << " ROB " << code.getROB()
1201  << " Internal fatal Error 4000 in TDC " << (*tdc_it).first << endl;
1202 
1203  tdcError_ROSSummary = 14;
1204  tdcError_ROSError = 11;
1205  tdcError_TDCHisto = 0;
1206 
1207  } else if ( ((*tdc_it).second).tdcError() & 0x0249 ) {
1208  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
1209  << " ROS " << code.getROS() << " ROB " << code.getROB()
1210  << " TDC FIFO overflow in TDC " << (*tdc_it).first << endl;
1211 
1212  tdcError_ROSSummary = 15;
1213  tdcError_ROSError = 12;
1214  tdcError_TDCHisto = 1;
1215 
1216  } else if ( ((*tdc_it).second).tdcError() & 0x0492 ) {
1217  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
1218  << " ROS " << code.getROS() << " ROB " << code.getROB()
1219  << " TDC L1 buffer overflow in TDC " << (*tdc_it).first << endl;
1220 
1221  tdcError_ROSSummary = 16;
1222  tdcError_ROSError = 13;
1223  tdcError_TDCHisto = 2;
1224 
1225  } else if ( ((*tdc_it).second).tdcError() & 0x2000 ) {
1226  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
1227  << " ROS " << code.getROS() << " ROB " << code.getROB()
1228  << " TDC L1A FIFO overflow in TDC " << (*tdc_it).first << endl;
1229 
1230  tdcError_ROSSummary = 17;
1231  tdcError_ROSError = 14;
1232  tdcError_TDCHisto = 3;
1233 
1234  } else if ( ((*tdc_it).second).tdcError() & 0x0924 ) {
1235  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
1236  << " ROS " << code.getROS() << " ROB " << code.getROB()
1237  << " TDC hit error in TDC " << (*tdc_it).first << endl;
1238 
1239  tdcError_ROSSummary = 18;
1240  tdcError_ROSError = 15;
1241  tdcError_TDCHisto = 4;
1242 
1243  } else if ( ((*tdc_it).second).tdcError() & 0x1000 ) {
1244  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
1245  << " ROS " << code.getROS() << " ROB " << code.getROB()
1246  << " TDC hit rejected in TDC " << (*tdc_it).first << endl;
1247 
1248  tdcError_ROSSummary = 19;
1249  tdcError_ROSError = 16;
1250  tdcError_TDCHisto = 5;
1251 
1252  } else {
1253  LogWarning("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
1254  << " TDC error code not known " << ((*tdc_it).second).tdcError() << endl;
1255  }
1256 
1257  ROSSummary->Fill(tdcError_ROSSummary,code.getROS());
1258 
1259  if(tdcError_ROSSummary <= 15) {
1260  eventErrorFlag = true;
1261  }
1262 
1263  if(mode <= 2) {
1264  ROSError->Fill(tdcError_ROSError,(*tdc_it).first);
1265  if(mode <= 1)
1266  rosHistos["TDCError"][code.getROSID()]->Fill(tdcError_TDCHisto+6*((*tdc_it).second).tdcID(),(*tdc_it).first);
1267  }
1268  }
1269 
1270  // Read SC data
1271  if (mode < 1 && getSCInfo) {
1272  // NumberOf16bitWords counts the # of words + 1 subheader
1273  // the SC includes the SC "private header" and the ROS header and trailer (= NumberOf16bitWords +3)
1274  rosHistos["SCSizeVsROSSize"][code.getSCID()]->Fill(ros,data.getSCTrailer().wordCount());
1275 
1276  }
1277 }
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:57
const std::vector< DTTDCData > & getTDCData() const
Definition: DTControlData.h:60
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:65
int getSCID() const
int TTCEventCounter() const
Definition: DTDDUWords.h:225
const std::vector< DTROSDebugWord > & getROSDebugs() const
Definition: DTControlData.h:56
std::map< std::string, std::map< int, MonitorElement * > > summaryHistos
const DTROSTrailerWord & getROSTrailer() const
Definition: DTControlData.h:53
const DTROSHeaderWord & getROSHeader() const
Definition: DTControlData.h:54
int TPX() const
Definition: DTDDUWords.h:270
#define LogTrace(id)
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:58
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:55
std::map< std::string, std::map< int, DTTimeEvolutionHisto * > > rosTimeHistos
const std::vector< DTTDCError > & getTDCError() const
Definition: DTControlData.h:61
int bunchID() const
Definition: DTDDUWords.h:423
int getROSID() const
void DTDataIntegrityTask::processuROS ( DTuROSROSData data,
int  fed,
int  uRos 
)

Definition at line 790 of file DTDataIntegrityTask.cc.

References relativeConstraints::error, fedHistos, FEDIDmin, MonitorElement::Fill(), HcalObjRepresent::Fill(), RemoveAddSevLevel::flag, DTuROSROSData::geterror(), DTuROSROSData::geterrorROBID(), DTuROSROSData::geterrors(), DTuROSROSData::geterrorTDCID(), DTuROSROSData::getokxflag(), DTuROSROSData::gettrailer(), DTuROSROSData::getuserWord(), LogTrace, mode, neventsuROS, summaryHistos, TDCError, TTSValues, uROSError, uROSEventLenght, urosHistos, urosTimeHistos, and globals_cff::x1.

Referenced by analyze().

790  {
791 
792  neventsuROS++; // FIXME: implement a counter which makes sense
793 
794  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
795  << "[DTDataIntegrityTask]: " << neventsuROS << " events analyzed by processuROS" << endl;
796 
797  if(mode == 3 || mode ==1) return; //Avoid duplication of Info in FEDIntegrity_EvF
798 
799  MonitorElement* uROSSummary = nullptr;
800  uROSSummary = summaryHistos["uROSSummary"][fed];
801 
802  MonitorElement* uROSStatus = nullptr;
803  uROSStatus = fedHistos["uROSStatus"][fed];
804 
805  if(!uROSSummary) {
806  LogError("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask") <<
807  "Trying to access non existing ME at FED " << fed <<
808  std::endl;
809  return;
810  }
811 
812  // Summary of all Link errors
813  MonitorElement* uROSError0 = nullptr;
814  MonitorElement* uROSError1 = nullptr;
815  MonitorElement* uROSError2 = nullptr;
816  if(mode <= 2){
817  uROSError0 = urosHistos[(uROSError+0)*1000 + (fed-FEDIDmin)*100 + (uRos-1)];
818  uROSError1 = urosHistos[(uROSError+1)*1000 + (fed-FEDIDmin)*100 + (uRos-1)];
819  uROSError2 = urosHistos[(uROSError+2)*1000 + (fed-FEDIDmin)*100 + (uRos-1)];
820 
821  if ((!uROSError2) || (!uROSError1) || (!uROSError0) ) {
822  LogError("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask") <<
823  "Trying to access non existing ME at uROS " << uRos <<
824  std::endl;
825  return;
826  }
827  }
828 
829  // uROS errors
830  int sumOKs =0 ;
831  for (unsigned int link = 0; link<72; ++link){
832  for (unsigned int flag = 0; flag<5; ++flag){
833  if((data.getokxflag(link)>>flag) & 0x1) { // Undefined Flag 1-4 64bits word for each MTP (12 channels)i
834  if (flag==0) {sumOKs+=1; // Not OK flag
835  flag=5; //move it to the 5th bin
836  }
837  if (link<24) uROSError0->Fill(flag-1,link); //bins start at 1 despite labeling
838  else if (link<48) uROSError1->Fill(flag-1,link-23);
839  else if (link<72) uROSError2->Fill(flag-1,link-47);
840  }
841  }
842  }
843 
844 
845 // Fill the ROSSummary (1 per FED) histo
846  if(sumOKs!=0) uROSSummary->Fill(12, uRos); //bins start at 1 despite labeling
847 // Need to fill bin 13 Ev ID Mismatch?
848 
849 // Global Errors for uROS
850  for (unsigned int flag = 4; flag<16; ++flag){
851  if((data.getuserWord()>>flag) & 0x1 ) {
852  uROSSummary->Fill(flag-4, uRos);
853  uROSStatus->Fill(flag-4, uRos); //duplicated info?
854  }
855  }
856 
857  // ROS error
858  for (unsigned int icounter = 0; icounter<data.geterrors().size(); ++icounter){
859  int link = data.geterrorROBID(icounter);
860  int tdc = data.geterrorTDCID(icounter);
861  int error = data.geterror(icounter);
862  int tdcError_ROSSummary = 0;
863  int tdcError_ROSError = 0;
864  int tdcError_TDCHisto = 0;
865 
866  if(error & 0x4000 ) {
867  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
868  << " ROS " << uRos << " ROB " << link
869  << " Internal fatal Error 4000 in TDC " << error << endl;
870 
871  tdcError_ROSSummary = 13;
872  tdcError_ROSError = 5;
873  tdcError_TDCHisto = 0;
874 
875  } else if ( error & 0x0249 ) {
876  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
877  << " ROS " << uRos << " ROB " << link
878  << " TDC FIFO overflow in TDC " << error << endl;
879 
880  tdcError_ROSSummary = 14;
881  tdcError_ROSError = 6;
882  tdcError_TDCHisto = 1;
883 
884  } else if ( error & 0x0492 ) {
885  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
886  << " ROS " << uRos << " ROB " << link
887  << " TDC L1 buffer overflow in TDC " << error << endl;
888 
889  tdcError_ROSSummary = 15;
890  tdcError_ROSError = 7;
891  tdcError_TDCHisto = 2;
892 
893  } else if ( error & 0x2000 ) {
894  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
895  << " ROS " << uRos << " ROB " << link
896  << " TDC L1A FIFO overflow in TDC " << error << endl;
897 
898  tdcError_ROSSummary = 16;
899  tdcError_ROSError = 8;
900  tdcError_TDCHisto = 3;
901 
902  } else if ( error & 0x0924 ) {
903  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
904  << " uROS " << uRos << " ROB " << link
905  << " TDC hit error in TDC " << error << endl;
906 
907  tdcError_ROSSummary = 17;
908  tdcError_ROSError = 9;
909  tdcError_TDCHisto = 4;
910 
911  } else if ( error & 0x1000 ) {
912  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
913  << " uROS " << uRos << " ROB " << link
914  << " TDC hit rejected in TDC " << error << endl;
915 
916  tdcError_ROSSummary = 18;
917  tdcError_ROSError = 10;
918  tdcError_TDCHisto = 5;
919 
920  } else {
921  LogWarning("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
922  << " TDC error code not known " << error << endl;
923  }
924 
925  uROSSummary->Fill(tdcError_ROSSummary,uRos);
926 
927  if(mode<=2){
928  if (link<24) uROSError0->Fill(tdcError_ROSError,link);
929  else if (link<48) uROSError1->Fill(tdcError_ROSError,link-23);
930  else if (link<72) uROSError2->Fill(tdcError_ROSError,link-47);
931 
932  if(mode<=1){
933  if (link<24) urosHistos[(TDCError+0)*1000 + (fed-FEDIDmin)*100 + (uRos-1)]->Fill(tdcError_TDCHisto+6*(tdc-1),link);
934  else if (link<48) urosHistos[(TDCError+1)*1000 + (fed-FEDIDmin)*100 + (uRos-1)]->Fill(tdcError_TDCHisto+6*(tdc-1),link-23);
935  else if (link<72) urosHistos[(TDCError+2)*1000 + (fed-FEDIDmin)*100 + (uRos-1)]->Fill(tdcError_TDCHisto+6*(tdc-1),link-47);
936  }
937  }
938  } //loop on errors
939 
940 
941  // 1D histograms for TTS values per uROS
942  int ttsCodeValue = -1;
943 
944  int value = (data.getuserWord() & 0xF);
945  switch(value) {
946  case 0:{ //disconnected
947  ttsCodeValue = 0;
948  break;
949  }
950  case 1:{ //warning overflow
951  ttsCodeValue = 1;
952  break;
953  }
954  case 2:{ //out of sinch
955  ttsCodeValue = 2;
956  break;
957  }
958  case 4:{ //busy
959  ttsCodeValue = 3;
960  break;
961  }
962  case 8:{ //ready
963  ttsCodeValue = 4;
964  break;
965  }
966  case 12:{ //error
967  ttsCodeValue = 5;
968  break;
969  }
970  case 15:{ //disconnected
971  ttsCodeValue = 6;
972  break;
973  }
974  default:{
975  LogError("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
976  <<"[DTDataIntegrityTask] FED User control: wrong TTS value "<< value << " in FED " << fed << " uROS "<< uRos<< endl; //FIXME
977  ttsCodeValue = 7;
978  }
979  }
980  if(mode < 1) {
981  urosHistos[TTSValues*1000 + (fed-FEDIDmin)*100 + (uRos-1)]->Fill(ttsCodeValue);
982 
983  // Plot the event lenght //NOHLT
984  int uRosEventLenght = (data.gettrailer() & 0xFFFFF)*8;
985  urosTimeHistos[(fed-FEDIDmin)*100 + (uRos-1)]->accumulateValueTimeSlot(uRosEventLenght);
986 
987  if(uRosEventLenght > 5000) uRosEventLenght = 5000;
988  urosHistos[uROSEventLenght*1000 + (fed-FEDIDmin)*100 + (uRos-1)]->Fill(uRosEventLenght);
989  }
990 
991 }
std::vector< int > geterrors() const
int geterrorTDCID(int i) const
void Fill(long long x)
std::map< std::string, std::map< int, MonitorElement * > > summaryHistos
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
std::map< unsigned int, MonitorElement * > urosHistos
Definition: value.py:1
int getokxflag(int i) const
std::map< std::string, std::map< int, MonitorElement * > > fedHistos
#define LogTrace(id)
int getuserWord() const
long gettrailer() const
int geterror(int i) const
int geterrorROBID(int i) const
std::map< unsigned int, DTTimeEvolutionHisto * > urosTimeHistos
void DTDataIntegrityTask::TimeHistos ( DQMStore::IBooker ,
std::string  histoType 
)
std::string DTDataIntegrityTask::topFolder ( bool  isFEDIntegrity) const
private

Definition at line 1656 of file DTDataIntegrityTask.cc.

References fedIntegrityFolder, printsummarytable::folder, and mode.

Referenced by bookHistos(), and bookHistosuROS().

1656  {
1657 
1658  string folder = isFEDIntegrity ? fedIntegrityFolder : "DT/00-DataIntegrity/";
1659 
1660  if (mode == 0 || mode == 2)
1661  folder = "DT/00-DataIntegrity/"; //Move everything from FEDIntegrity except for SM and HLT modes
1662 
1663  return folder;
1664 
1665 }

Member Data Documentation

bool DTDataIntegrityTask::checkUros
private
DTROChainCoding DTDataIntegrityTask::coding
private

Definition at line 103 of file DTDataIntegrityTask.h.

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

Definition at line 175 of file DTDataIntegrityTask.h.

Referenced by analyze(), and DTDataIntegrityTask().

bool DTDataIntegrityTask::doTimeHisto
private

Definition at line 95 of file DTDataIntegrityTask.h.

bool DTDataIntegrityTask::eventErrorFlag
private

Definition at line 164 of file DTDataIntegrityTask.h.

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

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

Definition at line 167 of file DTDataIntegrityTask.h.

Referenced by analyze(), and processFED().

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

Definition at line 108 of file DTDataIntegrityTask.h.

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

int DTDataIntegrityTask::FEDIDmax
private
int DTDataIntegrityTask::FEDIDmin
private
std::string DTDataIntegrityTask::fedIntegrityFolder
private

Definition at line 172 of file DTDataIntegrityTask.h.

Referenced by DTDataIntegrityTask(), and topFolder().

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

Definition at line 132 of file DTDataIntegrityTask.h.

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

edm::EDGetTokenT<DTuROSFEDDataCollection> DTDataIntegrityTask::fedToken
private

Definition at line 179 of file DTDataIntegrityTask.h.

Referenced by analyze(), and DTDataIntegrityTask().

bool DTDataIntegrityTask::getSCInfo
private

Definition at line 97 of file DTDataIntegrityTask.h.

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

MonitorElement* DTDataIntegrityTask::hCorruptionSummary
private

Definition at line 126 of file DTDataIntegrityTask.h.

Referenced by bookHistos(), and processFED().

MonitorElement* DTDataIntegrityTask::hFEDEntry
private

Definition at line 123 of file DTDataIntegrityTask.h.

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

MonitorElement* DTDataIntegrityTask::hFEDFatal
private

Definition at line 124 of file DTDataIntegrityTask.h.

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

MonitorElement* DTDataIntegrityTask::hFEDNonFatal
private

Definition at line 125 of file DTDataIntegrityTask.h.

Referenced by bookHistos(), and fedNonFatal().

MonitorElement* DTDataIntegrityTask::hTTSSummary
private

Definition at line 129 of file DTDataIntegrityTask.h.

Referenced by bookHistos(), and processFED().

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

Definition at line 90 of file DTDataIntegrityTask.h.

double DTDataIntegrityTask::link_max[72]
private

Definition at line 146 of file DTDataIntegrityTask.h.

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

Definition at line 155 of file DTDataIntegrityTask.h.

int DTDataIntegrityTask::myPrevFifoVal[7]
private

Definition at line 160 of file DTDataIntegrityTask.h.

int DTDataIntegrityTask::myPrevRosVal
private

Definition at line 159 of file DTDataIntegrityTask.h.

int DTDataIntegrityTask::myPrevTtsVal
private

Definition at line 158 of file DTDataIntegrityTask.h.

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

Definition at line 89 of file DTDataIntegrityTask.h.

Referenced by bookHistos().

MonitorElement* DTDataIntegrityTask::nEventMonitor
private

Definition at line 106 of file DTDataIntegrityTask.h.

Referenced by analyze(), and bookHistos().

int DTDataIntegrityTask::nevents
private

Definition at line 101 of file DTDataIntegrityTask.h.

Referenced by analyze().

int DTDataIntegrityTask::neventsFED
private

Definition at line 140 of file DTDataIntegrityTask.h.

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

int DTDataIntegrityTask::nEventsLS
private

Definition at line 138 of file DTDataIntegrityTask.h.

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

int DTDataIntegrityTask::neventsuROS
private

Definition at line 141 of file DTDataIntegrityTask.h.

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

const int DTDataIntegrityTask::NuROS = 12
private

Definition at line 152 of file DTDataIntegrityTask.h.

Referenced by bookHistograms().

std::string DTDataIntegrityTask::outputFile
private
edm::ParameterSet DTDataIntegrityTask::parameters
private
double DTDataIntegrityTask::rob_max[25]
private

Definition at line 145 of file DTDataIntegrityTask.h.

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

Definition at line 116 of file DTDataIntegrityTask.h.

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

Definition at line 177 of file DTDataIntegrityTask.h.

Referenced by analyze(), and DTDataIntegrityTask().

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

Definition at line 166 of file DTDataIntegrityTask.h.

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

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

Definition at line 112 of file DTDataIntegrityTask.h.

Referenced by bookHistos(), and processROS25().

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

Definition at line 168 of file DTDataIntegrityTask.h.

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

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

Definition at line 133 of file DTDataIntegrityTask.h.

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

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

Definition at line 110 of file DTDataIntegrityTask.h.

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

float DTDataIntegrityTask::trigger_counter
private

Definition at line 143 of file DTDataIntegrityTask.h.

std::map<unsigned int, MonitorElement*> DTDataIntegrityTask::urosHistos
private

Definition at line 114 of file DTDataIntegrityTask.h.

Referenced by bookHistosuROS(), and processuROS().

std::map<unsigned int, DTTimeEvolutionHisto*> DTDataIntegrityTask::urosTimeHistos
private

Definition at line 135 of file DTDataIntegrityTask.h.

Referenced by bookHistosuROS(), endLuminosityBlock(), and processuROS().