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::Void > > 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::VoidglobalBeginLuminosityBlock (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::Void > >
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
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > 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
 
bool registeredToConsumeMany (TypeID const &, 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::ESRecordsToProxyIndices 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::Void > >
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 ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
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
 
int FEDIDmax
 
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 neventsFED
 
int nEventsLS
 
int neventsuROS
 
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::Void > >
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
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::Void > >
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 40 of file DTDataIntegrityTask.h.

Member Enumeration Documentation

◆ histoTypes

Constructor & Destructor Documentation

◆ DTDataIntegrityTask()

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

Definition at line 33 of file DTDataIntegrityTask.cc.

References Exception, FEDIDmax, FEDIDmin, fedIntegrityFolder, fedToken, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), LogTrace, FEDNumbering::MAXDTUROSFEDID, FEDNumbering::MINDTUROSFEDID, mode, neventsFED, neventsuROS, nLinksForFatal, and DTskim_cfg::processingMode.

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

◆ ~DTDataIntegrityTask()

DTDataIntegrityTask::~DTDataIntegrityTask ( )
override

Definition at line 63 of file DTDataIntegrityTask.cc.

References LogTrace, and neventsFED.

63  {
64  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
65  << "[DTDataIntegrityTask]: Destructor. Analyzed " << neventsFED << " events" << endl;
66  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
67  << "[DTDataIntegrityTask]: postEndJob called!" << endl;
68 }
#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::Void > >.

Definition at line 969 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, nEventsLS, processFED(), and processuROS().

969  {
970  nevents++;
972  nEventsLS++;
973 
974  //errorX[6][12][5] = {0}; //5th is notOK flag and 6th is TDC Fatal; ros; wheel
975  fill(&errorX[0][0][0], &errorX[0][0][0] + 360, 0);
976 
977  LogTrace("DTRawToDigi|TDQM|DTMonitorModule|DTDataIntegrityTask") << "[DTDataIntegrityTask]: preProcessEvent" << endl;
978 
979  // Digi collection
981  e.getByToken(fedToken, fedCol);
982  DTuROSFEDData fedData;
983  DTuROSROSData urosData;
984 
985  if (fedCol.isValid()) {
986  for (unsigned int j = 0; j < fedCol->size(); ++j) {
987  fedData = fedCol->at(j);
988  int fed = fedData.getfed(); //argument should be void
989  if (fed > FEDIDmax || fed < FEDIDmin) {
990  LogError("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
991  << "[DTDataIntegrityTask]: analyze, FED ID " << fed << " not expected." << endl;
992  continue;
993  }
994 
995  if (mode == 3)
996  continue; //Not needed for FEDIntegrity_EvF
997 
998  for (int slot = 1; slot <= DOCESLOTS; ++slot) {
999  urosData = fedData.getuROS(slot);
1000  if (fedData.getslotsize(slot) == 0 || urosData.getslot() == -1)
1001  continue;
1002  processuROS(urosData, fed, slot);
1003  }
1004  processFED(fedData, fed);
1005  }
1006  }
1007 }
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::Void > >.

Definition at line 79 of file DTDataIntegrityTask.cc.

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

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

Referenced by bookHistograms().

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

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

Referenced by bookHistograms().

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

◆ bookHistosuROS()

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

Definition at line 497 of file DTDataIntegrityTask.cc.

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

Referenced by bookHistograms().

497  {
498  string fed_s = to_string(fed);
499  string uRos_s = to_string(uRos);
500  ibooker.setCurrentFolder(topFolder(false) + "FED" + fed_s + "/uROS" + uRos_s);
501 
502  if (mode >= 1)
503  return;
504 
505  string histoType = "uROSEventLength";
506  string histoName = "FED" + fed_s + "_uROS" + uRos_s + "_" + "EventLength";
507  string histoTitle = "Event Length (Bytes) FED " + fed_s + " uROS" + uRos_s;
508  unsigned int keyHisto = (uROSEventLength)*1000 + (fed - FEDIDmin) * 100 + (uRos - 1);
509  urosHistos[keyHisto] = ibooker.book1D(histoName, histoTitle, 101, 0, 5000);
510 
511  histoType = "uROSAvgEventLengthvsLumi";
512  histoName = "FED" + fed_s + "_ROS" + uRos_s + "AvgEventLengthvsLumi";
513  histoTitle = "Event Length (Bytes) FED " + fed_s + " ROS" + uRos_s;
514  keyHisto = (fed - FEDIDmin) * 100 + (uRos - 1);
515  urosTimeHistos[keyHisto] = new DTTimeEvolutionHisto(ibooker, histoName, histoTitle, 200, 10, true, 0);
516 
517  histoType = "TTSValues";
518  histoName = "FED" + fed_s + "_" + "uROS" + uRos_s + "_" + histoType;
519  keyHisto = TTSValues * 1000 + (fed - FEDIDmin) * 100 + (uRos - 1);
520  urosHistos[keyHisto] = ibooker.book1D(histoName, histoName, 4, 1, 5);
522  histo->setBinLabel(1, "Overflow Warning ", 1);
523  histo->setBinLabel(2, "Busy", 1);
524  histo->setBinLabel(3, "Ready", 1);
525  histo->setBinLabel(4, "Unknown", 1);
526 }
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
std::string to_string(const V &value)
Definition: OMSAccess.h:71
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::Void > DTDataIntegrityTask::globalBeginLuminosityBlock ( const edm::LuminosityBlock ls,
const edm::EventSetup es 
) const
override

Definition at line 943 of file DTDataIntegrityTask.cc.

References nEventsLS.

944  {
945  nEventsLS = 0;
946  return std::shared_ptr<dtdi::Void>();
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(), nEventsLS, and urosTimeHistos.

949  {
950  int lumiBlock = ls.id().luminosityBlock();
951 
952  map<string, map<int, DTTimeEvolutionHisto*> >::iterator fedIt = fedTimeHistos.begin();
953  map<string, map<int, DTTimeEvolutionHisto*> >::iterator fedEnd = fedTimeHistos.end();
954  for (; fedIt != fedEnd; ++fedIt) {
955  map<int, DTTimeEvolutionHisto*>::iterator histoIt = fedIt->second.begin();
956  map<int, DTTimeEvolutionHisto*>::iterator histoEnd = fedIt->second.end();
957  for (; histoIt != histoEnd; ++histoIt) {
958  histoIt->second->updateTimeSlot(lumiBlock, nEventsLS);
959  }
960  }
961 
962  map<unsigned int, DTTimeEvolutionHisto*>::iterator urosIt = urosTimeHistos.begin();
963  map<unsigned int, DTTimeEvolutionHisto*>::iterator urosEnd = urosTimeHistos.end();
964  for (; urosIt != urosEnd; ++urosIt) {
965  urosIt->second->updateTimeSlot(lumiBlock, nEventsLS);
966  }
967 }
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 836 of file DTDataIntegrityTask.cc.

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

Referenced by analyze().

836  {
837  neventsFED++;
838  if (neventsFED % 1000 == 0)
839  LogTrace("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
840  << "[DTDataIntegrityTask]: " << neventsFED << " events analyzed by processFED" << endl;
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  if (sumNotOKFlag > nLinksForFatal || sumTDC > nLinksForFatal)
931  hFEDFatal->Fill(fed);
932 }
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:79

◆ processuROS()

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

Definition at line 528 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, neventsuROS, summaryHistos, TDCError, theDDU(), theROS(), TTSValues, uROSError, uROSEventLength, urosHistos, urosTimeHistos, makeMuonMisalignmentScenario::wheel, and testProducerWithPsetDescEmpty_cfi::x1.

Referenced by analyze().

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

References FEDNumbering::MAXDTUROSFEDID, FEDNumbering::MINDTUROSFEDID, and theROS().

Referenced by processuROS().

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

◆ theROS()

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

Definition at line 1041 of file DTDataIntegrityTask.cc.

Referenced by processuROS(), and theDDU().

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

◆ TimeHistos()

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

◆ topFolder()

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

Definition at line 934 of file DTDataIntegrityTask.cc.

References fedIntegrityFolder, printsummarytable::folder, and mode.

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

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

Member Data Documentation

◆ doTimeHisto

bool DTDataIntegrityTask::doTimeHisto
private

Definition at line 73 of file DTDataIntegrityTask.h.

◆ errorX

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

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

Referenced by processFED(), and processuROS().

◆ FEDIDmax

int DTDataIntegrityTask::FEDIDmax
private

◆ FEDIDmin

int DTDataIntegrityTask::FEDIDmin
private

◆ fedIntegrityFolder

std::string DTDataIntegrityTask::fedIntegrityFolder
private

Definition at line 116 of file DTDataIntegrityTask.h.

Referenced by DTDataIntegrityTask(), and topFolder().

◆ fedTimeHistos

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

Definition at line 95 of file DTDataIntegrityTask.h.

Referenced by globalEndLuminosityBlock(), and processFED().

◆ fedToken

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

Definition at line 119 of file DTDataIntegrityTask.h.

Referenced by analyze(), and DTDataIntegrityTask().

◆ hFEDEntry

MonitorElement* DTDataIntegrityTask::hFEDEntry
private

Definition at line 91 of file DTDataIntegrityTask.h.

Referenced by bookHistos(), and processFED().

◆ hFEDFatal

MonitorElement* DTDataIntegrityTask::hFEDFatal
private

Definition at line 92 of file DTDataIntegrityTask.h.

Referenced by bookHistos(), and processFED().

◆ mode

int DTDataIntegrityTask::mode
private

◆ nEventMonitor

MonitorElement* DTDataIntegrityTask::nEventMonitor
private

Definition at line 78 of file DTDataIntegrityTask.h.

Referenced by analyze(), and bookHistos().

◆ nevents

int DTDataIntegrityTask::nevents
private

Definition at line 75 of file DTDataIntegrityTask.h.

Referenced by analyze().

◆ neventsFED

int DTDataIntegrityTask::neventsFED
private

Definition at line 102 of file DTDataIntegrityTask.h.

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

◆ nEventsLS

int DTDataIntegrityTask::nEventsLS
mutableprivate

◆ neventsuROS

int DTDataIntegrityTask::neventsuROS
private

Definition at line 103 of file DTDataIntegrityTask.h.

Referenced by DTDataIntegrityTask(), and processuROS().

◆ nLinksForFatal

int DTDataIntegrityTask::nLinksForFatal
private

Definition at line 109 of file DTDataIntegrityTask.h.

Referenced by DTDataIntegrityTask(), and processFED().

◆ NuROS

const int DTDataIntegrityTask::NuROS = 12
private

Definition at line 112 of file DTDataIntegrityTask.h.

Referenced by bookHistograms().

◆ summaryHistos

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

Definition at line 82 of file DTDataIntegrityTask.h.

Referenced by bookHistos(), and processuROS().

◆ urosHistos

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

Definition at line 84 of file DTDataIntegrityTask.h.

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

◆ urosTimeHistos

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

Definition at line 97 of file DTDataIntegrityTask.h.

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