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:
DQMOneEDAnalyzer< edm::LuminosityBlockCache< dtdi::LumiCache > > edm::one::EDProducer< edm::EndRunProducer, edm::one::WatchRuns, edm::Accumulator, Args... > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c) override
 
 DTDataIntegrityTask (const edm::ParameterSet &ps)
 
std::shared_ptr< dtdi::LumiCacheglobalBeginLuminosityBlock (const edm::LuminosityBlock &ls, const edm::EventSetup &es) const override
 
void globalEndLuminosityBlock (const edm::LuminosityBlock &ls, const edm::EventSetup &es) override
 
void processFED (DTuROSFEDData &data, int fed)
 
void processuROS (DTuROSROSData &data, int fed, int uRos)
 
void TimeHistos (DQMStore::IBooker &, std::string histoType)
 
 ~DTDataIntegrityTask () override
 
- Public Member Functions inherited from DQMOneEDAnalyzer< edm::LuminosityBlockCache< dtdi::LumiCache > >
void accumulate (edm::Event const &event, edm::EventSetup const &setup) override
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
 DQMOneEDAnalyzer ()
 
void endRun (edm::Run const &, edm::EventSetup const &) final
 
void endRunProduce (edm::Run &run, edm::EventSetup const &setup) final
 
virtual bool getCanSaveByLumi ()
 
- Public Member Functions inherited from edm::one::EDProducer< edm::EndRunProducer, edm::one::WatchRuns, edm::Accumulator, Args... >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
std::vector< bool > const & recordProvenanceList () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~ProducerBase () noexcept(false) 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
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
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::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, 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
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Protected Member Functions

void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
- Protected Member Functions inherited from DQMOneEDAnalyzer< edm::LuminosityBlockCache< dtdi::LumiCache > >
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
virtual void dqmEndRun (edm::Run const &, edm::EventSetup const &)
 
- Protected Member Functions inherited from edm::ProducerBase
template<Transition Tr = Transition::Event>
auto produces (std::string instanceName) noexcept
 declare what type of product will make and with which optional label More...
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
template<Transition Tr = Transition::Event>
auto produces () noexcept
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
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)
 
void resetItemsToGetFrom (BranchType iType)
 

Private Types

enum  histoTypes { uROSEventLength = 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, const int fed)
 
void bookHistosROS (DQMStore::IBooker &, const int wheel, const int ros)
 
void bookHistosuROS (DQMStore::IBooker &, const int fed, const int uRos)
 
int theDDU (int crate, int slot, int link, bool tenDDU)
 
int theROS (int slot, int link)
 
std::string topFolder (bool isFEDIntegrity) const
 

Private Attributes

bool doTimeHisto
 
int errorX [6][12][5] = {{{0}}}
 
std::map< std::string, std::map< int, MonitorElement * > > fedHistos
 
const int FEDIDmax
 
const int FEDIDmin
 
std::string fedIntegrityFolder
 
std::map< std::string, std::map< int, DTTimeEvolutionHisto * > > fedTimeHistos
 
edm::EDGetTokenT< DTuROSFEDDataCollectionfedToken
 
MonitorElementhFEDEntry
 
MonitorElementhFEDFatal
 
int mode
 
MonitorElementnEventMonitor
 
int nevents
 
int nLinksForFatal
 
const int NuROS = 12
 
std::map< std::string, std::map< int, MonitorElement * > > summaryHistos
 
std::map< unsigned int, MonitorElement * > urosHistos
 
std::map< unsigned int, DTTimeEvolutionHisto * > urosTimeHistos
 

Additional Inherited Members

- Public Types inherited from DQMOneEDAnalyzer< edm::LuminosityBlockCache< dtdi::LumiCache > >
typedef dqm::reco::DQMStore DQMStore
 
typedef dqm::reco::MonitorElement MonitorElement
 
- Public Types inherited from edm::one::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
template<typename T >
using BranchAliasSetterT = ProductRegistryHelper::BranchAliasSetterT< T >
 
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex > >
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Attributes inherited from DQMOneEDAnalyzer< edm::LuminosityBlockCache< dtdi::LumiCache > >
edm::EDPutTokenT< DQMTokenrunToken_
 

Detailed Description

Class for DT Data Integrity at Online DQM (Single Thread) expected to monitor uROS Class with MEs vs Time/LS

Author
Javier Fernandez (Uni. Oviedo)

Definition at line 42 of file DTDataIntegrityTask.h.

Member Enumeration Documentation

◆ histoTypes

Constructor & Destructor Documentation

◆ DTDataIntegrityTask()

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

Definition at line 29 of file DTDataIntegrityTask.cc.

References Exception, fedIntegrityFolder, fedToken, edm::ParameterSet::getUntrackedParameter(), LogTrace, mode, nLinksForFatal, and DTskim_cfg::processingMode.

31  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask") << "[DTDataIntegrityTask]: Constructor" << endl;
32 
33  fedToken = consumes<DTuROSFEDDataCollection>(ps.getUntrackedParameter<InputTag>("dtFEDlabel"));
34 
35 #ifdef EDM_ML_DEBUG
36  neventsFED = 0;
37  neventsuROS = 0;
38 #endif
39 
40  fedIntegrityFolder = ps.getUntrackedParameter<string>("fedIntegrityFolder", "DT/FEDIntegrity");
41  nLinksForFatal = ps.getUntrackedParameter<int>("nLinksForFatal", 15); //per wheel
42 
43  string processingMode = ps.getUntrackedParameter<string>("processingMode", "Online");
44 
45  // processing mode flag to select plots to be produced and basedirs CB vedi se farlo meglio...
46  if (processingMode == "Online") {
47  mode = 0;
48  } else if (processingMode == "SM") {
49  mode = 1;
50  } else if (processingMode == "Offline") {
51  mode = 2;
52  } else if (processingMode == "HLT") {
53  mode = 3;
54  } else {
55  throw cms::Exception("MissingParameter") << "[DTDataIntegrityTask]: processingMode :" << processingMode
56  << " invalid! Must be Online, SM, Offline or HLT !" << endl;
57  }
58 }
edm::EDGetTokenT< DTuROSFEDDataCollection > fedToken
#define LogTrace(id)
T getUntrackedParameter(std::string const &, T const &) const

◆ ~DTDataIntegrityTask()

DTDataIntegrityTask::~DTDataIntegrityTask ( )
override

Definition at line 60 of file DTDataIntegrityTask.cc.

References LogTrace.

60  {
61 #ifdef EDM_ML_DEBUG
62  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
63  << "[DTDataIntegrityTask]: Destructor. Analyzed " << neventsFED << " events" << endl;
64  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
65  << "[DTDataIntegrityTask]: postEndJob called!" << endl;
66 #endif
67 }
#define LogTrace(id)

Member Function Documentation

◆ analyze()

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

Reimplemented from DQMOneEDAnalyzer< edm::LuminosityBlockCache< dtdi::LumiCache > >.

Definition at line 970 of file DTDataIntegrityTask.cc.

References DOCESLOTS, MillePedeFileConverter_cfg::e, errorX, FEDIDmax, FEDIDmin, fedToken, dqm::impl::MonitorElement::Fill(), ntuplemaker::fill, DTuROSFEDData::getfed(), DTuROSROSData::getslot(), DTuROSFEDData::getslotsize(), DTuROSFEDData::getuROS(), edm::HandleBase::isValid(), dqmiolumiharvest::j, LogTrace, mode, nEventMonitor, nevents, processFED(), processuROS(), and FCDTask_cfi::slot.

970  {
971  nevents++;
973  luminosityBlockCache(e.getLuminosityBlock().index())->nEventsLS++;
974 
975  //errorX[6][12][5] = {0}; //5th is notOK flag and 6th is TDC Fatal; ros; wheel
976  fill(&errorX[0][0][0], &errorX[0][0][0] + 360, 0);
977 
978  LogTrace("DTRawToDigi|TDQM|DTMonitorModule|DTDataIntegrityTask") << "[DTDataIntegrityTask]: preProcessEvent" << endl;
979 
980  // Digi collection
982  e.getByToken(fedToken, fedCol);
983  DTuROSFEDData fedData;
984  DTuROSROSData urosData;
985 
986  if (fedCol.isValid()) {
987  for (unsigned int j = 0; j < fedCol->size(); ++j) {
988  fedData = fedCol->at(j);
989  int fed = fedData.getfed(); //argument should be void
990  if (fed > FEDIDmax || fed < FEDIDmin) {
991  LogError("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
992  << "[DTDataIntegrityTask]: analyze, FED ID " << fed << " not expected." << endl;
993  continue;
994  }
995 
996  if (mode == 3)
997  continue; //Not needed for FEDIntegrity_EvF
998 
999  for (int slot = 1; slot <= DOCESLOTS; ++slot) {
1000  urosData = fedData.getuROS(slot);
1001  if (fedData.getslotsize(slot) == 0 || urosData.getslot() == -1)
1002  continue;
1003  processuROS(urosData, fed, slot);
1004  }
1005  processFED(fedData, fed);
1006  }
1007  }
1008 }
DTuROSROSData getuROS(int slot) const
edm::EDGetTokenT< DTuROSFEDDataCollection > fedToken
Log< level::Error, false > LogError
int getfed() const
void processuROS(DTuROSROSData &data, int fed, int uRos)
#define LogTrace(id)
static const int DOCESLOTS
void Fill(long long x)
int getslot() const
MonitorElement * nEventMonitor
bool isValid() const
Definition: HandleBase.h:70
void processFED(DTuROSFEDData &data, int fed)
int getslotsize(int slot) const

◆ bookHistograms()

void DTDataIntegrityTask::bookHistograms ( DQMStore::IBooker ibooker,
edm::Run const &  iRun,
edm::EventSetup const &  iSetup 
)
overrideprotectedvirtual

Implements DQMOneEDAnalyzer< edm::LuminosityBlockCache< dtdi::LumiCache > >.

Definition at line 78 of file DTDataIntegrityTask.cc.

References bookHistos(), bookHistosROS(), bookHistosuROS(), FEDIDmax, FEDIDmin, LogTrace, mode, NuROS, and makeMuonMisalignmentScenario::wheel.

80  {
81  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask") << "[DTDataIntegrityTask]: postBeginJob" << endl;
82 
83  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
84  << "[DTDataIntegrityTask] Get DQMStore service" << endl;
85 
86  // Loop over the DT FEDs
87 
88  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
89  << " FEDS: " << FEDIDmin << " to " << FEDIDmax << " in the RO" << endl;
90 
91  // book FED integrity histos
92  bookHistos(ibooker, FEDIDmin, FEDIDmax);
93 
94  // static booking of the histograms
95 
96  if (mode == 0 || mode == 2) {
97  for (int fed = FEDIDmin; fed <= FEDIDmax; ++fed) { // loop over the FEDs in the readout
98 
99  bookHistos(ibooker, string("FED"), fed);
100 
101  bookHistos(ibooker, string("CRATE"), fed);
102 
103  for (int uRos = 1; uRos <= NuROS; ++uRos) { // loop over all ROS
104  bookHistosuROS(ibooker, fed, uRos);
105  }
106  }
107 
108  for (int wheel = -2; wheel < 3; ++wheel) {
109  for (int ros = 1; ros <= NuROS; ++ros) { // loop over all ROS
110  bookHistosROS(ibooker, wheel, ros);
111  }
112  }
113 
114  } //Not in HLT or SM mode
115 }
void bookHistosROS(DQMStore::IBooker &, const int wheel, const int ros)
void bookHistosuROS(DQMStore::IBooker &, const int fed, const int uRos)
void bookHistos(DQMStore::IBooker &, const int fedMin, const int fedMax)
#define LogTrace(id)

◆ bookHistos() [1/2]

void DTDataIntegrityTask::bookHistos ( DQMStore::IBooker ibooker,
const int  fedMin,
const int  fedMax 
)
private

Definition at line 117 of file DTDataIntegrityTask.cc.

References dqm::implementation::IBooker::book1D(), dqm::implementation::IBooker::book2D(), dqm::implementation::IBooker::bookFloat(), FEDIDmax, FEDIDmin, hFEDEntry, hFEDFatal, timingPdfMaker::histo, HltBtagPostValidation_cff::histoName, mode, nEventMonitor, dqm::implementation::NavigatorBase::setCurrentFolder(), summaryHistos, to_string(), topFolder(), and makeMuonMisalignmentScenario::wheel.

Referenced by bookHistograms().

117  {
118  ibooker.setCurrentFolder("DT/EventInfo/Counters");
119  nEventMonitor = ibooker.bookFloat("nProcessedEventsDataIntegrity");
120 
121  // Standard FED integrity histos
122  ibooker.setCurrentFolder(topFolder(true));
123 
124  int nFED = (fedMax - fedMin) + 1;
125 
126  hFEDEntry = ibooker.book1D("FEDEntries", "# entries per DT FED", nFED, fedMin, fedMax + 1);
127  hFEDFatal = ibooker.book1D("FEDFatal", "# fatal errors DT FED", nFED, fedMin, fedMax + 1);
128 
129  if (mode == 1)
130  return; // to avoid duplication in FEDIntegrity_EvF folder
131 
132  string histoType = "ROSSummary";
133  for (int wheel = -2; wheel < 3; ++wheel) {
134  string wheel_s = to_string(wheel);
135  string histoName = "ROSSummary_W" + wheel_s;
136  string fed_s = to_string(FEDIDmin + 1); //3 FEDs from 2018 onwards
137  if (wheel < 0)
138  fed_s = to_string(FEDIDmin);
139  else if (wheel > 0)
140  fed_s = to_string(FEDIDmax);
141  string histoTitle = "Summary Wheel" + wheel_s + " (FED " + fed_s + ")";
142 
143  ((summaryHistos[histoType])[wheel]) = ibooker.book2D(histoName, histoTitle, 11, 0, 11, 12, 1, 13);
144  MonitorElement* histo = ((summaryHistos[histoType])[wheel]);
145  histo->setBinLabel(1, "Error 1", 1);
146  histo->setBinLabel(2, "Error 2", 1);
147  histo->setBinLabel(3, "Error 3", 1);
148  histo->setBinLabel(4, "Error 4", 1);
149  histo->setBinLabel(5, "Not OKflag", 1);
150  // TDC error bins
151  histo->setBinLabel(6, "TDC Fatal", 1);
152  histo->setBinLabel(7, "TDC RO FIFO ov.", 1);
153  histo->setBinLabel(8, "TDC L1 buf. ov.", 1);
154  histo->setBinLabel(9, "TDC L1A FIFO ov.", 1);
155  histo->setBinLabel(10, "TDC hit err.", 1);
156  histo->setBinLabel(11, "TDC hit rej.", 1);
157 
158  histo->setBinLabel(1, "Sector1", 2);
159  histo->setBinLabel(2, "Sector2", 2);
160  histo->setBinLabel(3, "Sector3", 2);
161  histo->setBinLabel(4, "Sector4", 2);
162  histo->setBinLabel(5, "Sector5", 2);
163  histo->setBinLabel(6, "Sector6", 2);
164  histo->setBinLabel(7, "Sector7", 2);
165  histo->setBinLabel(8, "Sector8", 2);
166  histo->setBinLabel(9, "Sector9", 2);
167  histo->setBinLabel(10, "Sector10", 2);
168  histo->setBinLabel(11, "Sector11", 2);
169  histo->setBinLabel(12, "Sector12", 2);
170  }
171 }
MonitorElement * bookFloat(TString const &name, FUNC onbooking=NOOP())
Definition: DQMStore.h:80
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
MonitorElement * hFEDFatal
static std::string to_string(const XMLCh *ch)
std::map< std::string, std::map< int, MonitorElement * > > summaryHistos
MonitorElement * nEventMonitor
MonitorElement * hFEDEntry
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:221
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
std::string topFolder(bool isFEDIntegrity) const

◆ bookHistos() [2/2]

void DTDataIntegrityTask::bookHistos ( DQMStore::IBooker ,
std::string  folder,
const int  fed 
)
private

◆ bookHistosROS()

void DTDataIntegrityTask::bookHistosROS ( DQMStore::IBooker ibooker,
const int  wheel,
const int  ros 
)
private

Definition at line 306 of file DTDataIntegrityTask.cc.

References dqm::implementation::IBooker::book2D(), timingPdfMaker::histo, HltBtagPostValidation_cff::histoName, createfilelist::int, plotFactory::keyHisto, mode, nano_mu_digi_cff::sector, dqm::implementation::NavigatorBase::setCurrentFolder(), relativeConstraints::station, TDCError, to_string(), topFolder(), uROSError, urosHistos, and makeMuonMisalignmentScenario::wheel.

Referenced by bookHistograms().

306  {
307  string wheel_s = to_string(wheel);
308  string ros_s = to_string(ros);
309  ibooker.setCurrentFolder(topFolder(false) + "Wheel" + wheel_s + "/Sector" + ros_s);
310 
311  string histoType = "ROSError";
312  int linkDown = 0;
313  string linkDown_s = to_string(linkDown);
314  int linkUp = linkDown + 24;
315  string linkUp_s = to_string(linkUp);
316  string histoName = "W" + wheel_s + "_" + "Sector" + ros_s + "_" + histoType;
317  string histoTitle = histoName + " (Channel " + linkDown_s + "-" + linkUp_s + " error summary)";
318  unsigned int keyHisto = (uROSError)*1000 + (wheel + 2) * 100 + (ros - 1);
319  if (mode < 1) // Online only
320  urosHistos[keyHisto] = ibooker.book2D(histoName, histoTitle, 11, 0, 11, 25, 0, 25);
321  else if (mode > 1)
322  urosHistos[keyHisto] = ibooker.book2D(histoName, histoTitle, 5, 0, 5, 25, 0, 25);
323 
325  // uROS error bins
326  // Placeholders for the moment
327  histo->setBinLabel(1, "Error 1", 1);
328  histo->setBinLabel(2, "Error 2", 1);
329  histo->setBinLabel(3, "Error 3", 1);
330  histo->setBinLabel(4, "Error 4", 1);
331  histo->setBinLabel(5, "Not OKFlag", 1);
332  if (mode < 1) { //Online only
333  // TDC error bins
334  histo->setBinLabel(6, "TDC Fatal", 1);
335  histo->setBinLabel(7, "TDC RO FIFO ov.", 1);
336  histo->setBinLabel(8, "TDC L1 buf. ov.", 1);
337  histo->setBinLabel(9, "TDC L1A FIFO ov.", 1);
338  histo->setBinLabel(10, "TDC hit err.", 1);
339  histo->setBinLabel(11, "TDC hit rej.", 1);
340  }
341  for (int link = linkDown; link < linkUp; ++link) {
342  int sector = ros;
343 
344  int station = int(link / 6) + 1;
345  if (link == 18)
346  station = 3;
347 
348  int rob = link % 6;
349  if (link == 18)
350  rob = 6;
351  else if (link > 18)
352  rob = rob - 1;
353 
354  //Sector 4 exceptions
355  if (ros == 4) {
356  if (link > 18 && link < 22)
357  rob = rob + 2;
358  else if (link == 22 || link == 23) {
359  sector = 13;
360  rob = rob - 1;
361  }
362  }
363 
364  //Sector 9 exceptions
365  if (ros == 9 && (link == 22 || link == 23)) {
366  sector = 13;
367  rob = rob - 3;
368  }
369 
370  //Sector 10 exceptions
371  if (ros == 10) {
372  if (link > 18 && link < 22)
373  sector = 14;
374  else if (link == 22 || link == 23)
375  rob = rob - 3;
376  }
377 
378  //Sector 11 exceptions
379  if (ros == 11 && (link == 22 || link == 23)) {
380  sector = 4;
381  rob = rob - 3;
382  }
383 
384  string sector_s = to_string(sector);
385  string st_s = to_string(station);
386  string rob_s = to_string(rob);
387  histo->setBinLabel(link + 1, "S" + sector_s + " MB" + st_s + " ROB" + rob_s, 2);
388  }
389 
390  int link25 = linkUp;
391  string label25[12] = {"S1 MB4 ROB5",
392  "S2 MB4 ROB5",
393  "S3 MB4 ROB5",
394  "S13 MB4 ROB4",
395  "S5 MB4 ROB5",
396  "S6 MB4 ROB5",
397  "S7 MB4 ROB5",
398  "S8 MB4 ROB5",
399  "S10 MB4 ROB3",
400  "S10 MB4 ROB2",
401  "S14 MB4 ROB3",
402  "S12 MB4 ROB5"};
403  histo->setBinLabel(link25 + 1, label25[ros - 1], 2);
404 
405  if (mode > 1)
406  return;
407 
408  histoType = "TDCError";
409  linkDown = 0;
410  linkDown_s = to_string(linkDown);
411  linkUp = linkDown + 24;
412  linkUp_s = to_string(linkUp);
413  histoName = "W" + wheel_s + "_" + "Sector" + ros_s + "_" + histoType;
414  histoTitle = histoName + " (Channel " + linkDown_s + "-" + linkUp_s + " error summary)";
415  keyHisto = (TDCError)*1000 + (wheel + 2) * 100 + (ros - 1);
416  urosHistos[keyHisto] = ibooker.book2D(histoName, histoTitle, 24, 0, 24, 25, 0, 25);
418  // TDC error bins
419  histo->setBinLabel(1, "Fatal", 1);
420  histo->setBinLabel(2, "RO FIFO ov.", 1);
421  histo->setBinLabel(3, "L1 buf. ov.", 1);
422  histo->setBinLabel(4, "L1A FIFO ov.", 1);
423  histo->setBinLabel(5, "hit err.", 1);
424  histo->setBinLabel(6, "hit rej.", 1);
425  histo->setBinLabel(7, "Fatal", 1);
426  histo->setBinLabel(8, "RO FIFO ov.", 1);
427  histo->setBinLabel(9, "L1 buf. ov.", 1);
428  histo->setBinLabel(10, "L1A FIFO ov.", 1);
429  histo->setBinLabel(11, "hit err.", 1);
430  histo->setBinLabel(12, "hit rej.", 1);
431  histo->setBinLabel(13, "Fatal", 1);
432  histo->setBinLabel(14, "RO FIFO ov.", 1);
433  histo->setBinLabel(15, "L1 buf. ov.", 1);
434  histo->setBinLabel(16, "L1A FIFO ov.", 1);
435  histo->setBinLabel(17, "hit err.", 1);
436  histo->setBinLabel(18, "hit rej.", 1);
437  histo->setBinLabel(19, "Fatal", 1);
438  histo->setBinLabel(20, "RO FIFO ov.", 1);
439  histo->setBinLabel(21, "L1 buf. ov.", 1);
440  histo->setBinLabel(22, "L1A FIFO ov.", 1);
441  histo->setBinLabel(23, "hit err.", 1);
442  histo->setBinLabel(24, "hit rej.", 1);
443 
444  for (int link = linkDown; link < linkUp; ++link) {
445  int sector = ros;
446 
447  int station = int(link / 6) + 1;
448  if (link == 18)
449  station = 3;
450 
451  int rob = link % 6;
452  if (link == 18)
453  rob = 6;
454  else if (link > 18)
455  rob = rob - 1;
456 
457  //Sector 4 exceptions
458  if (ros == 4) {
459  if (link > 18 && link < 22)
460  rob = rob + 2;
461  else if (link == 22 || link == 23) {
462  sector = 13;
463  rob = rob - 1;
464  }
465  }
466 
467  //Sector 9 exceptions
468  if (ros == 9 && (link == 22 || link == 23))
469  rob = rob - 3;
470 
471  //Sector 10 exceptions
472  if (ros == 10) {
473  if (link > 18 && link < 22)
474  sector = 14;
475  else if (link == 22 || link == 23)
476  rob = rob - 3;
477  }
478 
479  //Sector 11 exceptions
480  if (ros == 11 && (link == 22 || link == 23)) {
481  sector = 4;
482  rob = rob - 3;
483  }
484 
485  string sector_s = to_string(sector);
486  string st_s = to_string(station);
487  string rob_s = to_string(rob);
488  histo->setBinLabel(link + 1, "S" + sector_s + " MB" + st_s + " ROB" + rob_s, 2);
489  }
490 
491  link25 = linkUp;
492  histo->setBinLabel(link25 + 1, label25[ros - 1], 2);
493 
494 } //bookHistosROS
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
static std::string to_string(const XMLCh *ch)
std::map< unsigned int, MonitorElement * > urosHistos
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:221
std::string topFolder(bool isFEDIntegrity) const

◆ bookHistosuROS()

void DTDataIntegrityTask::bookHistosuROS ( DQMStore::IBooker ibooker,
const int  fed,
const int  uRos 
)
private

Definition at line 496 of file DTDataIntegrityTask.cc.

References dqm::implementation::IBooker::book1D(), FEDIDmin, timingPdfMaker::histo, HltBtagPostValidation_cff::histoName, plotFactory::keyHisto, mode, dqm::implementation::NavigatorBase::setCurrentFolder(), to_string(), topFolder(), TTSValues, uROSEventLength, urosHistos, and urosTimeHistos.

Referenced by bookHistograms().

496  {
497  string fed_s = to_string(fed);
498  string uRos_s = to_string(uRos);
499  ibooker.setCurrentFolder(topFolder(false) + "FED" + fed_s + "/uROS" + uRos_s);
500 
501  if (mode >= 1)
502  return;
503 
504  string histoType = "uROSEventLength";
505  string histoName = "FED" + fed_s + "_uROS" + uRos_s + "_" + "EventLength";
506  string histoTitle = "Event Length (Bytes) FED " + fed_s + " uROS" + uRos_s;
507  unsigned int keyHisto = (uROSEventLength)*1000 + (fed - FEDIDmin) * 100 + (uRos - 1);
508  urosHistos[keyHisto] = ibooker.book1D(histoName, histoTitle, 101, 0, 5000);
509 
510  histoType = "uROSAvgEventLengthvsLumi";
511  histoName = "FED" + fed_s + "_ROS" + uRos_s + "AvgEventLengthvsLumi";
512  histoTitle = "Event Length (Bytes) FED " + fed_s + " ROS" + uRos_s;
513  keyHisto = (fed - FEDIDmin) * 100 + (uRos - 1);
514  urosTimeHistos[keyHisto] = new DTTimeEvolutionHisto(ibooker, histoName, histoTitle, 200, 10, true, 0);
515 
516  histoType = "TTSValues";
517  histoName = "FED" + fed_s + "_" + "uROS" + uRos_s + "_" + histoType;
518  keyHisto = TTSValues * 1000 + (fed - FEDIDmin) * 100 + (uRos - 1);
519  urosHistos[keyHisto] = ibooker.book1D(histoName, histoName, 4, 1, 5);
521  histo->setBinLabel(1, "Overflow Warning ", 1);
522  histo->setBinLabel(2, "Busy", 1);
523  histo->setBinLabel(3, "Ready", 1);
524  histo->setBinLabel(4, "Unknown", 1);
525 }
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
static std::string to_string(const XMLCh *ch)
std::map< unsigned int, MonitorElement * > urosHistos
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
std::map< unsigned int, DTTimeEvolutionHisto * > urosTimeHistos
std::string topFolder(bool isFEDIntegrity) const

◆ globalBeginLuminosityBlock()

std::shared_ptr< dtdi::LumiCache > DTDataIntegrityTask::globalBeginLuminosityBlock ( const edm::LuminosityBlock ls,
const edm::EventSetup es 
) const
override

Definition at line 944 of file DTDataIntegrityTask.cc.

945  {
946  return std::make_shared<dtdi::LumiCache>();
947 }

◆ globalEndLuminosityBlock()

void DTDataIntegrityTask::globalEndLuminosityBlock ( const edm::LuminosityBlock ls,
const edm::EventSetup es 
)
override

Definition at line 949 of file DTDataIntegrityTask.cc.

References fedTimeHistos, eostools::ls(), and urosTimeHistos.

949  {
950  int lumiBlock = ls.id().luminosityBlock();
951  const auto nEventsLS = luminosityBlockCache(ls.index())->nEventsLS;
952 
953  map<string, map<int, DTTimeEvolutionHisto*> >::iterator fedIt = fedTimeHistos.begin();
954  map<string, map<int, DTTimeEvolutionHisto*> >::iterator fedEnd = fedTimeHistos.end();
955  for (; fedIt != fedEnd; ++fedIt) {
956  map<int, DTTimeEvolutionHisto*>::iterator histoIt = fedIt->second.begin();
957  map<int, DTTimeEvolutionHisto*>::iterator histoEnd = fedIt->second.end();
958  for (; histoIt != histoEnd; ++histoIt) {
959  histoIt->second->updateTimeSlot(lumiBlock, nEventsLS);
960  }
961  }
962 
963  map<unsigned int, DTTimeEvolutionHisto*>::iterator urosIt = urosTimeHistos.begin();
964  map<unsigned int, DTTimeEvolutionHisto*>::iterator urosEnd = urosTimeHistos.end();
965  for (; urosIt != urosEnd; ++urosIt) {
966  urosIt->second->updateTimeSlot(lumiBlock, nEventsLS);
967  }
968 }
std::map< std::string, std::map< int, DTTimeEvolutionHisto * > > fedTimeHistos
def ls(path, rec=False)
Definition: eostools.py:349
std::map< unsigned int, DTTimeEvolutionHisto * > urosTimeHistos

◆ processFED()

void DTDataIntegrityTask::processFED ( DTuROSFEDData data,
int  fed 
)

Definition at line 834 of file DTDataIntegrityTask.cc.

References data, errorX, fedHistos, FEDIDmax, FEDIDmin, fedTimeHistos, dqm::impl::MonitorElement::Fill(), hFEDEntry, hFEDFatal, LogTrace, mode, nLinksForFatal, and makeMuonMisalignmentScenario::wheel.

Referenced by analyze().

834  {
835 #ifdef EDM_ML_DEBUG
836  neventsFED++;
837  if (neventsFED % 1000 == 0)
838  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
839  << "[DTDataIntegrityTask]: " << neventsFED << " events analyzed by processFED" << endl;
840 #endif
841 
842  if (fed < FEDIDmin || fed > FEDIDmax)
843  return;
844 
845  hFEDEntry->Fill(fed);
846 
847  if (mode == 3)
848  return; //Avoid duplication of Info in FEDIntegrity_EvF
849 
850  if (mode != 1) {
851  //1D HISTOS: EVENT LENGHT from trailer
852  int fedEvtLength = data.getevtlgth() * 8; //1 word = 8 bytes
853  // if(fedEvtLength > 16000) fedEvtLength = 16000; // overflow bin
854  fedHistos["EventLength"][fed]->Fill(fedEvtLength);
855 
856  if (mode == 0) {
857  fedTimeHistos["FEDAvgEvLengthvsLumi"][fed]->accumulateValueTimeSlot(fedEvtLength);
858 
859  // fill the distribution of the BX ids
860  fedHistos["BXID"][fed]->Fill(data.getBXId());
861 
862  // size of the list of ROS in the Read-Out
863  fedHistos["uROSList"][fed]->Fill(data.getnslots());
864  }
865 
866  } //mode != 1
867 
868  // Fill the status summary of the TTS
869 
870  //1D HISTO WITH TTS VALUES form trailer
871  //Not used for the moment due to wrong coding from AMC13
872  /*
873  int ttsCodeValue = -1;
874  int value = data.getTTS();
875  switch (value) {
876  case 0: { //ready
877  ttsCodeValue = 0;
878  break;
879  }
880  case 1: { //warning overflow
881  ttsCodeValue = 1;
882  break;
883  }
884  case 2: { //busy
885  ttsCodeValue = 2;
886  break;
887  }
888  case 4: { //synch lost
889  ttsCodeValue = 3;
890  break;
891  }
892  case 8: { //error
893  ttsCodeValue = 4;
894  break;
895  }
896  default: {
897  LogError("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
898  << "[DTDataIntegrityTask] FED TTS control: wrong TTS value " << value << " in FED " << fed << endl;
899  ttsCodeValue = 5;
900  }
901  }
902  if (mode < 1)
903  fedHistos["TTSValues"][fed]->Fill(ttsCodeValue);
904  */
905 
906  //FEDFatal definition per wheel: 5*TDCFatal/6000 + 5*NotOKFlag/1500
907  int wheel = 0;
908  if (fed == FEDIDmin)
909  wheel = -2;
910  else if (fed == FEDIDmax)
911  wheel = 1;
912 
913  float sumTDC = 0., sumNotOKFlag = 0.;
914  for (int ros = 0; ros < 12; ros++) {
915  sumNotOKFlag += errorX[4][ros][wheel + 2];
916  sumTDC += errorX[5][ros][wheel + 2];
917  }
918 
919  if (wheel != 0) { // consider both wheels for FEDs 1369 & 1371
920  wheel += 1;
921  for (int ros = 0; ros < 12; ros++) {
922  sumNotOKFlag += errorX[4][ros][wheel + 2];
923  sumTDC += errorX[5][ros][wheel + 2];
924  }
925  }
926 
927  //Divide by 2 for egde FEDs to normalize per wheel
928  sumNotOKFlag = sumNotOKFlag / ((wheel != 0) ? 2. : 1.);
929  sumTDC = sumTDC / ((wheel != 0) ? 2. : 1.);
930 
931  if (sumNotOKFlag > nLinksForFatal || sumTDC > nLinksForFatal)
932  hFEDFatal->Fill(fed);
933 }
MonitorElement * hFEDFatal
#define LogTrace(id)
void Fill(long long x)
std::map< std::string, std::map< int, DTTimeEvolutionHisto * > > fedTimeHistos
std::map< std::string, std::map< int, MonitorElement * > > fedHistos
MonitorElement * hFEDEntry
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80

◆ processuROS()

void DTDataIntegrityTask::processuROS ( DTuROSROSData data,
int  fed,
int  uRos 
)

Definition at line 527 of file DTDataIntegrityTask.cc.

References funct::abs(), newFWLiteAna::bin, data, relativeConstraints::error, errorX, fedHistos, FEDIDmin, dqm::impl::MonitorElement::Fill(), HcalObjRepresent::Fill(), RemoveAddSevLevel::flag, plotFactory::keyHisto, LogTrace, mode, nano_mu_digi_cff::sector, summaryHistos, TDCError, theDDU(), theROS(), TTSValues, uROSError, uROSEventLength, urosHistos, urosTimeHistos, makeMuonMisalignmentScenario::wheel, and testProducerWithPsetDescEmpty_cfi::x1.

Referenced by analyze().

527  {
528 #ifdef EDM_ML_DEBUG
529  neventsuROS++;
530 
531  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
532  << "[DTDataIntegrityTask]: " << neventsuROS << " events analyzed by processuROS" << endl;
533 #endif
534 
535  if (mode == 3) // || mode == 1)
536  return; //Avoid duplication of Info in FEDIntegrity_EvF
537 
538  MonitorElement* uROSSummary = nullptr;
539  MonitorElement* uROSStatus = nullptr;
540 
541  unsigned int slotMap = (data.getboardId()) & 0xF;
542  if (slotMap == 0)
543  return; //prevention for Simulation empty uROS data
544  unsigned int ros = theROS(slotMap, 0); //first sector correspondign to link 0
545  int ddu = theDDU(fed, slotMap, 0, false);
546  int wheel = (ddu - 770) % 5 - 2;
547  int sector4 = 3; //Asymmetry in mapping
548 
549  MonitorElement* ROSSummary = nullptr;
550  ROSSummary = summaryHistos["ROSSummary"][wheel];
551 
552  // Summary of all Link errors
553  MonitorElement* uROSError0 = nullptr;
554  MonitorElement* uROSError1 = nullptr;
555  MonitorElement* uROSError2 = nullptr;
556  MonitorElement* uROSErrorS4 = nullptr;
557 
558  if (mode <= 2) {
559  if (uRos > 2) { //sectors 1-12
560  if (mode != 1) {
561  uROSSummary = summaryHistos["uROSSummary"][fed];
562  uROSStatus = fedHistos["uROSStatus"][fed];
563  if (!uROSSummary) {
564  LogError("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
565  << "Trying to access non existing ME at FED " << fed << std::endl;
566  return;
567  }
568 
569  uROSError0 = urosHistos[(uROSError)*1000 + (wheel + 2) * 100 + (ros - 1)]; //links 0-23
570  uROSError1 = urosHistos[(uROSError)*1000 + (wheel + 2) * 100 + (ros)]; //links 24-47
571  uROSError2 = urosHistos[(uROSError)*1000 + (wheel + 2) * 100 + (ros + 1)]; //links 48-71
572  uROSErrorS4 = urosHistos[(uROSError)*1000 + (wheel + 2) * 100 + 3];
573 
574  if ((!uROSError2) || (!uROSError1) || (!uROSError0)) {
575  LogError("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
576  << "Trying to access non existing ME at uROS " << uRos << std::endl;
577  return;
578  }
579  }
580 
581  // uROS errors
582  for (unsigned int link = 0; link < 72; ++link) {
583  for (unsigned int flag = 0; flag < 5; ++flag) {
584  if ((data.getokxflag(link) >> flag) & 0x1) { // Undefined Flag 1-4 64bits word for each MTP (12 channels)
585 
586  int value = flag != 0 ? flag : 5; //if flag = 0 move it to the 5th bin
587  if (link < 24) {
588  errorX[value - 1][ros - 1][wheel + 2] += 1;
589  if (mode != 1)
590  uROSError0->Fill(value - 1, link); //bins start at 0 despite labeling
591  } else if (link < 48) {
592  if ((link == 46 || link == 57) && ros == 10)
593  errorX[value - 1][sector4][wheel + 2] += 1;
594  else
595  errorX[value - 1][ros][wheel + 2] += 1;
596  if (mode != 1) {
597  if ((link == 46 || link == 57) && ros == 10)
598  uROSErrorS4->Fill(value - 1, link - 24);
599  else
600  uROSError1->Fill(value - 1, link - 24);
601  }
602  } else if (link < 72) {
603  errorX[value - 1][ros + 1][wheel + 2] += 1;
604  if (mode != 1)
605  uROSError2->Fill(value - 1, link - 48);
606  }
607  } //flag value
608  } //loop on flags
609  } //loop on links
610  } //uROS>2
611 
612  else { //uRos<3 25th Channel slot
613 
614  for (unsigned int link = 0; link < 12; ++link) {
615  for (unsigned int flag = 0; flag < 5; ++flag) {
616  if ((data.getokxflag(link) >> flag) & 0x1) { // Undefined Flag 1-4 64bits word for each MTP (12 channels)
617  int value = flag;
618  int ch25 = 24;
619  int sector = link + 1;
620  if (flag == 0)
621  value = 5; //move it to the 5th bin
622 
623  if (value > 0) {
624  if (mode != 1) {
625  if (sector == 9)
626  sector = 10;
627  unsigned int keyHisto =
628  (uROSError)*1000 + (wheel + 2) * 100 + abs(sector - 1); //ros -1 = link in this case
629  uROSError0 = urosHistos[keyHisto];
630  if (!uROSError0) {
631  LogError("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
632  << "Trying to access non existing ME at uROS " << uRos << std::endl;
633  return;
634  }
635  }
636  errorX[value - 1][sector - 1][wheel + 2] += 1; // ros-1=link in this case
637  if (mode != 1)
638  uROSError0->Fill(value - 1, ch25); //bins start at 0 despite labeling, this is the old SC
639  }
640  } //flag values
641  } //loop on flags
642  } //loop on links
643  } //else uRos<3
644 
645  if (mode != 1) {
646  // Global Errors for uROS
647  for (unsigned int flag = 4; flag < 16; ++flag) {
648  if ((data.getuserWord() >> flag) & 0x1) {
649  uROSSummary->Fill(flag - 4, uRos);
650  uROSStatus->Fill(flag - 4, uRos); //duplicated info?
651  }
652  }
653  }
654 
655  } //mode<=2
656 
657  if (mode != 1) {
658  // Fill the ROSSummary (1 per wheel) histo
659  for (unsigned int iros = ros - 1; iros < (ros + 2); ++iros) {
660  for (unsigned int bin = 0; bin < 5; ++bin) {
661  if (errorX[bin][iros][wheel + 2] != 0) {
662  ROSSummary->Fill(bin, iros + 1, errorX[bin][iros][wheel + 2]); //bins start at 1
663  }
664  }
665  }
666  }
667 
668  // ROS error
669  for (unsigned int icounter = 0; icounter < data.geterrors().size(); ++icounter) {
670  int link = data.geterrorROBID(icounter);
671  int tdc = data.geterrorTDCID(icounter);
672  int error = data.geterror(icounter);
673  int tdcError_ROSSummary = 0;
674  int tdcError_ROSError = 0;
675  int tdcError_TDCHisto = 0;
676 
677  if (error & 0x4000) {
678  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
679  << " ROS " << uRos << " ROB " << link << " Internal fatal Error 4000 in TDC " << error << endl;
680 
681  tdcError_ROSSummary = 5;
682  tdcError_ROSError = 5;
683  tdcError_TDCHisto = 0;
684 
685  } else if (error & 0x0249) {
686  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
687  << " ROS " << uRos << " ROB " << link << " TDC FIFO overflow in TDC " << error << endl;
688 
689  tdcError_ROSSummary = 6;
690  tdcError_ROSError = 6;
691  tdcError_TDCHisto = 1;
692 
693  } else if (error & 0x0492) {
694  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
695  << " ROS " << uRos << " ROB " << link << " TDC L1 buffer overflow in TDC " << error << endl;
696 
697  tdcError_ROSSummary = 7;
698  tdcError_ROSError = 7;
699  tdcError_TDCHisto = 2;
700 
701  } else if (error & 0x2000) {
702  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
703  << " ROS " << uRos << " ROB " << link << " TDC L1A FIFO overflow in TDC " << error << endl;
704 
705  tdcError_ROSSummary = 8;
706  tdcError_ROSError = 8;
707  tdcError_TDCHisto = 3;
708 
709  } else if (error & 0x0924) {
710  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
711  << " uROS " << uRos << " ROB " << link << " TDC hit error in TDC " << error << endl;
712 
713  tdcError_ROSSummary = 9;
714  tdcError_ROSError = 9;
715  tdcError_TDCHisto = 4;
716 
717  } else if (error & 0x1000) {
718  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
719  << " uROS " << uRos << " ROB " << link << " TDC hit rejected in TDC " << error << endl;
720 
721  tdcError_ROSSummary = 10;
722  tdcError_ROSError = 10;
723  tdcError_TDCHisto = 5;
724 
725  } else {
726  LogWarning("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
727  << " TDC error code not known " << error << endl;
728  }
729 
730  if (uRos < 3) {
731  int sector = link + 1;
732  if (tdcError_ROSSummary == 5)
733  errorX[5][link][wheel + 2] += 1;
734  if (mode != 1) {
735  if (sector == 9)
736  sector = 10;
737  ROSSummary->Fill(tdcError_ROSSummary, sector - 1); //link 0 = ROS 1
738  int ch25 = 24;
739  if (mode <= 2) {
740  urosHistos[(uROSError)*1000 + (wheel + 2) * 100 + (sector - 1)]->Fill(tdcError_ROSError, ch25);
741  if (mode < 1)
742  urosHistos[(TDCError)*1000 + (wheel + 2) * 100 + (sector - 1)]->Fill(tdcError_TDCHisto + 6 * tdc,
743  ch25); // ros-1=link in this case
744  } //mode <= 2
745  } //mode!=1
746  } //uRos<3
747  else { //uRos>2
748  if (link < 24) {
749  if (tdcError_ROSSummary == 5)
750  errorX[5][ros - 1][wheel + 2] += 1;
751  if (mode != 1)
752  ROSSummary->Fill(tdcError_ROSSummary, ros);
753  } else if (link < 48) {
754  if (tdcError_ROSSummary == 5) {
755  if ((link == 46 || link == 57) && ros == 10)
756  errorX[5][sector4][wheel + 2] += 1;
757  else
758  errorX[5][ros][wheel + 2] += 1;
759  }
760  if (mode != 1) {
761  if ((link == 46 || link == 57) && ros == 10)
762  ROSSummary->Fill(tdcError_ROSSummary, sector4);
763  else
764  ROSSummary->Fill(tdcError_ROSSummary, ros + 1);
765  }
766  } else if (link < 72) {
767  if (tdcError_ROSSummary == 5)
768  errorX[5][ros + 1][wheel + 2] += 1;
769  if (mode != 1)
770  ROSSummary->Fill(tdcError_ROSSummary, ros + 2);
771  }
772 
773  if (mode <= 2 && mode != 1) {
774  if (link < 24)
775  uROSError0->Fill(tdcError_ROSError, link);
776  else if (link < 48)
777  if ((link == 46 || link == 57) && ros == 10)
778  uROSError1->Fill(tdcError_ROSError, sector4);
779  else
780  uROSError1->Fill(tdcError_ROSError, link - 24);
781  else if (link < 72)
782  uROSError2->Fill(tdcError_ROSError, link - 48);
783 
784  if (mode < 1) {
785  if (link < 24)
786  urosHistos[(TDCError)*1000 + (wheel + 2) * 100 + (ros - 1)]->Fill(tdcError_TDCHisto + 6 * tdc, link);
787  else if (link < 48)
788  urosHistos[(TDCError)*1000 + (wheel + 2) * 100 + (ros)]->Fill(tdcError_TDCHisto + 6 * tdc, link - 24);
789  else if (link < 72)
790  urosHistos[(TDCError)*1000 + (wheel + 2) * 100 + (ros + 1)]->Fill(tdcError_TDCHisto + 6 * tdc, link - 48);
791 
792  } //mode<1
793  } //mode<=2 && mode != 1
794  } //uROS>2
795  } //loop on errors
796 
797  // 1D histograms for TTS values per uROS
798  if (mode < 1) {
799  int ttsCodeValue = -1;
800  int value = (data.getuserWord() & 0xF);
801  switch (value) {
802  case 1: { //warning overflow
803  ttsCodeValue = 1;
804  break;
805  }
806  case 4: { //busy
807  ttsCodeValue = 2;
808  break;
809  }
810  case 8: { //ready
811  ttsCodeValue = 3;
812  break;
813  }
814  default: {
815  LogError("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
816  << "[DTDataIntegrityTask] FED User control: wrong TTS value " << value << " in FED " << fed << " uROS "
817  << uRos << endl;
818  ttsCodeValue = 4;
819  }
820  }
821 
822  urosHistos[TTSValues * 1000 + (fed - FEDIDmin) * 100 + (uRos - 1)]->Fill(ttsCodeValue);
823 
824  // Plot the event length //NOHLT
825  int uRosEventLength = (data.gettrailer() & 0xFFFFF) * 8;
826  urosTimeHistos[(fed - FEDIDmin) * 100 + (uRos - 1)]->accumulateValueTimeSlot(uRosEventLength);
827 
828  if (uRosEventLength > 5000)
829  uRosEventLength = 5000;
830  urosHistos[uROSEventLength * 1000 + (fed - FEDIDmin) * 100 + (uRos - 1)]->Fill(uRosEventLength);
831  }
832 }
Log< level::Error, false > LogError
#define LogTrace(id)
void Fill(long long x)
std::map< std::string, std::map< int, MonitorElement * > > summaryHistos
int theROS(int slot, int link)
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
std::map< unsigned int, MonitorElement * > urosHistos
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
Definition: value.py:1
std::map< std::string, std::map< int, MonitorElement * > > fedHistos
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80
Log< level::Warning, false > LogWarning
std::map< unsigned int, DTTimeEvolutionHisto * > urosTimeHistos
int theDDU(int crate, int slot, int link, bool tenDDU)

◆ theDDU()

int DTDataIntegrityTask::theDDU ( int  crate,
int  slot,
int  link,
bool  tenDDU 
)
private

Definition at line 1011 of file DTDataIntegrityTask.cc.

References FCDTask_cfi::crate, FEDNumbering::MAXDTUROSFEDID, FEDNumbering::MINDTUROSFEDID, FCDTask_cfi::slot, and theROS().

Referenced by processuROS().

1011  {
1012  int ros = theROS(slot, link);
1013 
1014  int ddu = 772;
1015  //if (crate == 1368) { ddu = 775; }
1016  //Needed just in case this FED should be used due to fibers length
1017 
1019  if (slot < 7)
1020  ddu = 770;
1021  else
1022  ddu = 771;
1023  }
1024 
1025  if (crate == (FEDNumbering::MINDTUROSFEDID + 1)) {
1026  ddu = 772;
1027  }
1028 
1030  if (slot < 7)
1031  ddu = 773;
1032  else
1033  ddu = 774;
1034  }
1035 
1036  if (ros > 6 && tenDDU && ddu < 775)
1037  ddu += 5;
1038 
1039  return ddu;
1040 }
int theROS(int slot, int link)

◆ theROS()

int DTDataIntegrityTask::theROS ( int  slot,
int  link 
)
private

Definition at line 1042 of file DTDataIntegrityTask.cc.

References FCDTask_cfi::slot.

Referenced by processuROS(), and theDDU().

1042  {
1043  if (slot % 6 == 5)
1044  return link + 1;
1045 
1046  int ros = (link / 24) + 3 * (slot % 6) - 2;
1047  return ros;
1048 }

◆ TimeHistos()

void DTDataIntegrityTask::TimeHistos ( DQMStore::IBooker ,
std::string  histoType 
)

◆ topFolder()

std::string DTDataIntegrityTask::topFolder ( bool  isFEDIntegrity) const
private

Definition at line 935 of file DTDataIntegrityTask.cc.

References fedIntegrityFolder, printsummarytable::folder, and mode.

Referenced by bookHistos(), bookHistosROS(), and bookHistosuROS().

935  {
936  string folder = isFEDIntegrity ? fedIntegrityFolder : "DT/00-DataIntegrity/";
937 
938  if (mode == 0)
939  folder = "DT/00-DataIntegrity/"; //Move everything from FEDIntegrity except for SM and HLT modes
940 
941  return folder;
942 }

Member Data Documentation

◆ doTimeHisto

bool DTDataIntegrityTask::doTimeHisto
private

Definition at line 75 of file DTDataIntegrityTask.h.

◆ errorX

int DTDataIntegrityTask::errorX[6][12][5] = {{{0}}}
private

Definition at line 110 of file DTDataIntegrityTask.h.

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

◆ fedHistos

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

Definition at line 82 of file DTDataIntegrityTask.h.

Referenced by processFED(), and processuROS().

◆ FEDIDmax

const int DTDataIntegrityTask::FEDIDmax
private

Definition at line 108 of file DTDataIntegrityTask.h.

Referenced by analyze(), bookHistograms(), bookHistos(), and processFED().

◆ FEDIDmin

const int DTDataIntegrityTask::FEDIDmin
private

◆ fedIntegrityFolder

std::string DTDataIntegrityTask::fedIntegrityFolder
private

Definition at line 118 of file DTDataIntegrityTask.h.

Referenced by DTDataIntegrityTask(), and topFolder().

◆ fedTimeHistos

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

Definition at line 97 of file DTDataIntegrityTask.h.

Referenced by globalEndLuminosityBlock(), and processFED().

◆ fedToken

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

Definition at line 121 of file DTDataIntegrityTask.h.

Referenced by analyze(), and DTDataIntegrityTask().

◆ hFEDEntry

MonitorElement* DTDataIntegrityTask::hFEDEntry
private

Definition at line 93 of file DTDataIntegrityTask.h.

Referenced by bookHistos(), and processFED().

◆ hFEDFatal

MonitorElement* DTDataIntegrityTask::hFEDFatal
private

Definition at line 94 of file DTDataIntegrityTask.h.

Referenced by bookHistos(), and processFED().

◆ mode

int DTDataIntegrityTask::mode
private

◆ nEventMonitor

MonitorElement* DTDataIntegrityTask::nEventMonitor
private

Definition at line 80 of file DTDataIntegrityTask.h.

Referenced by analyze(), and bookHistos().

◆ nevents

int DTDataIntegrityTask::nevents
private

Definition at line 77 of file DTDataIntegrityTask.h.

Referenced by analyze().

◆ nLinksForFatal

int DTDataIntegrityTask::nLinksForFatal
private

Definition at line 111 of file DTDataIntegrityTask.h.

Referenced by DTDataIntegrityTask(), and processFED().

◆ NuROS

const int DTDataIntegrityTask::NuROS = 12
private

Definition at line 114 of file DTDataIntegrityTask.h.

Referenced by bookHistograms().

◆ summaryHistos

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

Definition at line 84 of file DTDataIntegrityTask.h.

Referenced by bookHistos(), and processuROS().

◆ urosHistos

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

Definition at line 86 of file DTDataIntegrityTask.h.

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

◆ urosTimeHistos

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

Definition at line 99 of file DTDataIntegrityTask.h.

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