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)
 
virtual ~DTDataIntegrityTask ()
 
- Public Member Functions inherited from DQMEDAnalyzer
virtual void beginRun (edm::Run const &, edm::EventSetup const &) final
 
virtual void beginStream (edm::StreamID id) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer (void)
 
virtual void endLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
virtual 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
 
virtual ~EDAnalyzerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 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 & itemsToGetFromEvent () 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::MAXDTFEDID, 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 
44 
45 // If you want info VS time histos
46 // doTimeHisto = ps.getUntrackedParameter<bool>("doTimeHisto", false);
47 // Plot quantities about SC
48  getSCInfo = ps.getUntrackedParameter<bool>("getSCInfo", false);
49 
50  fedIntegrityFolder = ps.getUntrackedParameter<string>("fedIntegrityFolder","DT/FEDIntegrity");
51 
52  string processingMode = ps.getUntrackedParameter<string>("processingMode","Online");
53 
54  // processing mode flag to select plots to be produced and basedirs CB vedi se farlo meglio...
55  if (processingMode == "Online") {
56  mode = 0;
57  } else if(processingMode == "SM") {
58  mode = 1;
59  } else if (processingMode == "Offline") {
60  mode = 2;
61  } else if (processingMode == "HLT") {
62  mode = 3;
63  } else {
64  throw cms::Exception("MissingParameter")
65  << "[DTDataIntegrityTask]: processingMode :" << processingMode
66  << " invalid! Must be Online, SM, Offline or HLT !" << endl;
67  }
68 
69 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< DTROS25Collection > ros25Token
#define LogTrace(id)
edm::EDGetTokenT< DTDDUCollection > dduToken
DTDataIntegrityTask::~DTDataIntegrityTask ( )
virtual

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

1144 {
1145  nevents++;
1147 
1148  nEventsLS++;
1149 
1150  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask") << "[DTDataIntegrityTask]: preProcessEvent" <<endl;
1151  // clear the set of BXids from the ROSs
1152  for(map<int, set<int> >::iterator rosBxIds = rosBxIdsPerFED.begin(); rosBxIds != rosBxIdsPerFED.end(); ++rosBxIds) {
1153  (*rosBxIds).second.clear();
1154  }
1155 
1156  fedBXIds.clear();
1157 
1158  for(map<int, set<int> >::iterator rosL1AIds = rosL1AIdsPerFED.begin(); rosL1AIds != rosL1AIdsPerFED.end(); ++rosL1AIds) {
1159  (*rosL1AIds).second.clear();
1160  }
1161 
1162  // reset the error flag
1163  eventErrorFlag = false;
1164 
1165  // Digi collection
1166  edm::Handle<DTDDUCollection> dduProduct;
1167  e.getByToken(dduToken, dduProduct);
1168  edm::Handle<DTROS25Collection> ros25Product;
1169  e.getByToken(ros25Token, ros25Product);
1170 
1171  DTDDUData dduData;
1172  std::vector<DTROS25Data> ros25Data;
1173 
1174  if(dduProduct.isValid() && ros25Product.isValid()) {
1175  for(unsigned int i=0; i<dduProduct->size(); ++i)
1176  {
1177  dduData = dduProduct->at(i);
1178  ros25Data = ros25Product->at(i);
1179  // FIXME: passing id variable is not needed anymore - change processFED interface for next release!
1180  FEDHeader header = dduData.getDDUHeader();
1181  int id = header.sourceID();
1182  processFED(dduData, ros25Data, id);
1183  for(unsigned int j=0; j < ros25Data.size(); ++j) {
1184  int rosid = j+1;
1185  processROS25(ros25Data[j],id,rosid);
1186  }
1187  }
1188  }
1189 }
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:457
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 1111 of file DTDataIntegrityTask.cc.

References nEventsLS.

1111  {
1112 
1113  nEventsLS = 0;
1114 
1115 }
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, 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  // static booking of the histograms
103  for(int fed = FEDIDmin; fed <= FEDIDMax; ++fed) { // loop over the FEDs in the readout
104  DTROChainCoding code;
105  code.setDDU(fed);
106 
107  bookHistos(ibooker, string("ROS_S"), code);
108 
109  bookHistos(ibooker, string("DDU"), code);
110 
111  for(int ros = 1; ros <= 12; ++ros) {// loop over all ROS
112  code.setROS(ros);
113  bookHistosROS25(ibooker, code);
114  }
115  }
116 }
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 118 of file DTDataIntegrityTask.cc.

References DQMStore::IBooker::book1D(), DQMStore::IBooker::book2D(), DQMStore::IBooker::bookFloat(), dduHistos, dduTimeHistos, PFMuonValidation_cff::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().

118  {
119 
120  ibooker.setCurrentFolder("DT/EventInfo/Counters");
121  nEventMonitor = ibooker.bookFloat("nProcessedEventsDataIntegrity");
122 
123  // Standard FED integrity histos
124  ibooker.setCurrentFolder(topFolder(true));
125 
126  int nFED = (fedMax - fedMin)+1;
127 
128  hFEDEntry = ibooker.book1D("FEDEntries","# entries per DT FED",nFED,fedMin,fedMax+1);
129  hFEDFatal = ibooker.book1D("FEDFatal","# fatal errors DT FED",nFED,fedMin,fedMax+1);
130  hFEDNonFatal = ibooker.book1D("FEDNonFatal","# NON fatal errors DT FED",nFED,fedMin,fedMax+1);
131 
132 
133  ibooker.setCurrentFolder(topFolder(false));
134  hTTSSummary = ibooker.book2D("TTSSummary","Summary Status TTS",nFED,fedMin,fedMax+1,9,1,10);
135  hTTSSummary->setAxisTitle("FED",1);
136  hTTSSummary->setBinLabel(1,"ROS PAF",2);
137  hTTSSummary->setBinLabel(2,"DDU PAF",2);
138  hTTSSummary->setBinLabel(3,"ROS PAF",2);
139  hTTSSummary->setBinLabel(4,"DDU PAF",2);
140  hTTSSummary->setBinLabel(5,"DDU Full",2);
141  hTTSSummary->setBinLabel(6,"L1A Mism.",2);
142  hTTSSummary->setBinLabel(7,"ROS Error",2);
143  hTTSSummary->setBinLabel(8,"BX Mism.",2);
144  hTTSSummary->setBinLabel(9,"DDU Logic Err.",2);
145 
146  // bookkeeping of the
147 
148  hCorruptionSummary = ibooker.book2D("DataCorruptionSummary", "Data Corruption Sources",
149  nFED,fedMin,fedMax+1, 8, 1, 9);
151  hCorruptionSummary->setBinLabel(1,"Miss Ch.",2);
152  hCorruptionSummary->setBinLabel(2,"ROS BX mism",2);
153  hCorruptionSummary->setBinLabel(3,"DDU BX mism",2);
154  hCorruptionSummary->setBinLabel(4,"ROS L1A mism",2);
155  hCorruptionSummary->setBinLabel(5,"Miss Payload",2);
156  hCorruptionSummary->setBinLabel(6,"FCRC bit",2);
157  hCorruptionSummary->setBinLabel(7,"Header check",2);
158  hCorruptionSummary->setBinLabel(8,"Triler Check",2);
159 
160 }
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 480 of file DTDataIntegrityTask.cc.

References bookHistos(), getSCInfo, and mode.

Referenced by bookHistograms().

480  {
481  bookHistos(ibooker, string("ROS"), code);
482 
483  if(mode <= 1)
484  if(getSCInfo)
485  bookHistos(ibooker, string("SC"), code);
486 }
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 1091 of file DTDataIntegrityTask.cc.

Referenced by processROS25().

1091  {
1092  for (int iCh=0; iCh<6;++iCh) {
1093  if ((chMask >> iCh) & 0x1){
1094  channels.push_back(cerosId*6+iCh);
1095  }
1096  }
1097  return;
1098 }
void DTDataIntegrityTask::channelsInROS ( int  cerosMask,
std::vector< int > &  channels 
)
private

Definition at line 1100 of file DTDataIntegrityTask.cc.

Referenced by processROS25().

1100  {
1101  for (int iCeros=0; iCeros<5;++iCeros) {
1102  if ((cerosMask >> iCeros) & 0x1){
1103  for (int iCh=0; iCh<6;++iCh) {
1104  channels.push_back(iCeros*6+iCh);
1105  }
1106  }
1107  }
1108  return;
1109 }
void DTDataIntegrityTask::endLuminosityBlock ( const edm::LuminosityBlock ls,
const edm::EventSetup es 
)
override

Definition at line 1117 of file DTDataIntegrityTask.cc.

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

1117  {
1118 
1119  int lumiBlock = ls.luminosityBlock();
1120 
1121  map<std::string, map<int, DTTimeEvolutionHisto*> >::iterator dduIt = dduTimeHistos.begin();
1122  map<std::string, map<int, DTTimeEvolutionHisto*> >::iterator dduEnd = dduTimeHistos.end();
1123  for(; dduIt!=dduEnd; ++dduIt) {
1124  map<int, DTTimeEvolutionHisto*>::iterator histoIt = dduIt->second.begin();
1125  map<int, DTTimeEvolutionHisto*>::iterator histoEnd = dduIt->second.end();
1126  for(; histoIt!=histoEnd; ++histoIt) {
1127  histoIt->second->updateTimeSlot(lumiBlock,nEventsLS);
1128  }
1129  }
1130 
1131  map<std::string, map<int, DTTimeEvolutionHisto*> >::iterator rosIt = rosTimeHistos.begin();
1132  map<std::string, map<int, DTTimeEvolutionHisto*> >::iterator rosEnd = rosTimeHistos.end();
1133  for(; rosIt!=rosEnd; ++rosIt) {
1134  map<int, DTTimeEvolutionHisto*>::iterator histoIt = rosIt->second.begin();
1135  map<int, DTTimeEvolutionHisto*>::iterator histoEnd = rosIt->second.end();
1136  for(; histoIt!=histoEnd; ++histoIt) {
1137  histoIt->second->updateTimeSlot(lumiBlock,nEventsLS);
1138  }
1139  }
1140 
1141 }
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 1056 of file DTDataIntegrityTask.cc.

References eventErrorFlag.

1056  {
1057  return eventErrorFlag;
1058 }
void DTDataIntegrityTask::fedEntry ( int  dduID)

Definition at line 1062 of file DTDataIntegrityTask.cc.

References MonitorElement::Fill(), and hFEDEntry.

1062  {
1063  hFEDEntry->Fill(dduID);
1064 }
void Fill(long long x)
MonitorElement * hFEDEntry
void DTDataIntegrityTask::fedFatal ( int  dduID)

Definition at line 1069 of file DTDataIntegrityTask.cc.

References MonitorElement::Fill(), and hFEDFatal.

1069  {
1070  hFEDFatal->Fill(dduID);
1071 }
MonitorElement * hFEDFatal
void Fill(long long x)
void DTDataIntegrityTask::fedNonFatal ( int  dduID)

Definition at line 1076 of file DTDataIntegrityTask.cc.

References MonitorElement::Fill(), and hFEDNonFatal.

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

Definition at line 771 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(), and DTDDUSecondStatusWord::warningROSPAF().

Referenced by analyze().

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

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

References fedIntegrityFolder, and PFMuonValidation_cff::folder.

Referenced by bookHistos().

1080  {
1081 
1082  string folder = isFEDIntegrity ? fedIntegrityFolder : "DT/00-DataIntegrity/";
1083 
1084 // if (!isFEDIntegrity)
1085 // folder += (mode==1) ? "_SM/" : (mode==3) ? "_EvF/" : "/";
1086 
1087  return folder;
1088 
1089 }

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

Definition at line 125 of file DTDataIntegrityTask.h.

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

Definition at line 126 of file DTDataIntegrityTask.h.

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

Definition at line 105 of file DTDataIntegrityTask.h.

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

Definition at line 155 of file DTDataIntegrityTask.h.

Referenced by analyze(), and DTDataIntegrityTask().

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

Definition at line 144 of file DTDataIntegrityTask.h.

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

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

Definition at line 103 of file DTDataIntegrityTask.h.

Referenced by 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.