CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
 
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)
 
 ~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
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< B > consumes (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 () noexcept
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
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
< DTuROSFEDDataCollection
fedToken
 
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

Constructor & Destructor Documentation

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 dtDQMClient_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 getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< DTuROSFEDDataCollection > fedToken
#define LogTrace(id)
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
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

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

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

Definition at line 965 of file DTDataIntegrityTask.cc.

References DOCESLOTS, errorX, FEDIDmax, FEDIDmin, fedToken, PVValHelper::fill(), dqm::impl::MonitorElement::Fill(), edm::Event::getByToken(), DTuROSFEDData::getfed(), DTuROSROSData::getslot(), DTuROSFEDData::getslotsize(), DTuROSFEDData::getuROS(), edm::HandleBase::isValid(), dqmiolumiharvest::j, LogTrace, mode, nEventMonitor, nevents, nEventsLS, processFED(), and processuROS().

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

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)
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, mode, nEventMonitor, dqm::impl::MonitorElement::setBinLabel(), dqm::implementation::NavigatorBase::setCurrentFolder(), summaryHistos, and topFolder().

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
MonitorElement * hFEDFatal
std::map< std::string, std::map< int, MonitorElement * > > summaryHistos
virtual void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
MonitorElement * nEventMonitor
std::string topFolder(bool isFEDIntegrity) const
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:177
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
void DTDataIntegrityTask::bookHistos ( DQMStore::IBooker ,
std::string  folder,
const int  fed 
)
private
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(), plotFactory::keyHisto, MainPageGenerator::link, mode, dqm::impl::MonitorElement::setBinLabel(), dqm::implementation::NavigatorBase::setCurrentFolder(), relativeConstraints::station, TDCError, topFolder(), uROSError, and urosHistos.

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);
418  histo = urosHistos[keyHisto];
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
string keyHisto
Definition: plotFactory.py:80
std::map< unsigned int, MonitorElement * > urosHistos
virtual void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
std::string topFolder(bool isFEDIntegrity) const
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:177
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, plotFactory::keyHisto, mode, dqm::impl::MonitorElement::setBinLabel(), dqm::implementation::NavigatorBase::setCurrentFolder(), 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
string keyHisto
Definition: plotFactory.py:80
std::map< unsigned int, MonitorElement * > urosHistos
virtual void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
std::string topFolder(bool isFEDIntegrity) const
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::shared_ptr< dtdi::Void > DTDataIntegrityTask::globalBeginLuminosityBlock ( const edm::LuminosityBlock ls,
const edm::EventSetup es 
) const
override

Definition at line 939 of file DTDataIntegrityTask.cc.

References nEventsLS.

940  {
941  nEventsLS = 0;
942  return std::shared_ptr<dtdi::Void>();
943 }
void DTDataIntegrityTask::globalEndLuminosityBlock ( const edm::LuminosityBlock ls,
const edm::EventSetup es 
)
override

Definition at line 945 of file DTDataIntegrityTask.cc.

References fedTimeHistos, edm::LuminosityBlockBase::id(), edm::LuminosityBlockID::luminosityBlock(), nEventsLS, and urosTimeHistos.

945  {
946  int lumiBlock = ls.id().luminosityBlock();
947 
948  map<string, map<int, DTTimeEvolutionHisto*> >::iterator fedIt = fedTimeHistos.begin();
949  map<string, map<int, DTTimeEvolutionHisto*> >::iterator fedEnd = fedTimeHistos.end();
950  for (; fedIt != fedEnd; ++fedIt) {
951  map<int, DTTimeEvolutionHisto*>::iterator histoIt = fedIt->second.begin();
952  map<int, DTTimeEvolutionHisto*>::iterator histoEnd = fedIt->second.end();
953  for (; histoIt != histoEnd; ++histoIt) {
954  histoIt->second->updateTimeSlot(lumiBlock, nEventsLS);
955  }
956  }
957 
958  map<unsigned int, DTTimeEvolutionHisto*>::iterator urosIt = urosTimeHistos.begin();
959  map<unsigned int, DTTimeEvolutionHisto*>::iterator urosEnd = urosTimeHistos.end();
960  for (; urosIt != urosEnd; ++urosIt) {
961  urosIt->second->updateTimeSlot(lumiBlock, nEventsLS);
962  }
963 }
LuminosityBlockID id() const
std::map< std::string, std::map< int, DTTimeEvolutionHisto * > > fedTimeHistos
LuminosityBlockNumber_t luminosityBlock() const
std::map< unsigned int, DTTimeEvolutionHisto * > urosTimeHistos
void DTDataIntegrityTask::processFED ( DTuROSFEDData data,
int  fed 
)

Definition at line 831 of file DTDataIntegrityTask.cc.

References errorX, fedHistos, FEDIDmax, FEDIDmin, fedTimeHistos, dqm::impl::MonitorElement::Fill(), DTuROSFEDData::getBXId(), DTuROSFEDData::getevtlgth(), DTuROSFEDData::getnslots(), hFEDEntry, hFEDFatal, LogTrace, mode, neventsFED, and nLinksForFatal.

Referenced by analyze().

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

Definition at line 528 of file DTDataIntegrityTask.cc.

References funct::abs(), newFWLiteAna::bin, relativeConstraints::error, errorX, fedHistos, FEDIDmin, dqm::impl::MonitorElement::Fill(), HcalObjRepresent::Fill(), DTuROSROSData::getboardId(), DTuROSROSData::geterror(), DTuROSROSData::geterrorROBID(), DTuROSROSData::geterrors(), DTuROSROSData::geterrorTDCID(), DTuROSROSData::getokxflag(), DTuROSROSData::gettrailer(), DTuROSROSData::getuserWord(), plotFactory::keyHisto, MainPageGenerator::link, LogTrace, mode, neventsuROS, summaryHistos, TDCError, theDDU(), theROS(), TTSValues, uROSError, uROSEventLength, urosHistos, urosTimeHistos, and relativeConstraints::value.

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  errorX[5][link][wheel + 2] += 1;
735  if (mode != 1) {
736  if (sector == 9)
737  sector = 10;
738  ROSSummary->Fill(tdcError_ROSSummary, sector - 1); //link 0 = ROS 1
739  int ch25 = 24;
740  if (mode <= 2) {
741  urosHistos[(uROSError)*1000 + (wheel + 2) * 100 + (sector - 1)]->Fill(tdcError_ROSError, ch25);
742  if (mode < 1)
743  urosHistos[(TDCError)*1000 + (wheel + 2) * 100 + (sector - 1)]->Fill(tdcError_TDCHisto + 6 * tdc,
744  ch25); // ros-1=link in this case
745  } //mode <= 2
746  } //mode!=1
747  } //uRos<3
748  else { //uRos>2
749  if (link < 24) {
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 ((link == 46 || link == 57) && ros == 10)
755  errorX[5][sector4][wheel + 2] += 1;
756  else
757  errorX[5][ros][wheel + 2] += 1;
758  if (mode != 1) {
759  if ((link == 46 || link == 57) && ros == 10)
760  ROSSummary->Fill(tdcError_ROSSummary, sector4);
761  else
762  ROSSummary->Fill(tdcError_ROSSummary, ros + 1);
763  }
764  } else if (link < 72) {
765  errorX[5][ros + 1][wheel + 2] += 1;
766  if (mode != 1)
767  ROSSummary->Fill(tdcError_ROSSummary, ros + 2);
768  }
769 
770  if (mode <= 2 && mode != 1) {
771  if (link < 24)
772  uROSError0->Fill(tdcError_ROSError, link);
773  else if (link < 48)
774  if ((link == 46 || link == 57) && ros == 10)
775  uROSError1->Fill(tdcError_ROSError, sector4);
776  else
777  uROSError1->Fill(tdcError_ROSError, link - 24);
778  else if (link < 72)
779  uROSError2->Fill(tdcError_ROSError, link - 48);
780 
781  if (mode < 1) {
782  if (link < 24)
783  urosHistos[(TDCError)*1000 + (wheel + 2) * 100 + (ros - 1)]->Fill(tdcError_TDCHisto + 6 * tdc, link);
784  else if (link < 48)
785  urosHistos[(TDCError)*1000 + (wheel + 2) * 100 + (ros)]->Fill(tdcError_TDCHisto + 6 * tdc, link - 24);
786  else if (link < 72)
787  urosHistos[(TDCError)*1000 + (wheel + 2) * 100 + (ros + 1)]->Fill(tdcError_TDCHisto + 6 * tdc, link - 48);
788 
789  } //mode<1
790  } //mode<=2 && mode != 1
791  } //uROS>2
792  } //loop on errors
793 
794  // 1D histograms for TTS values per uROS
795  if (mode < 1) {
796  int ttsCodeValue = -1;
797  int value = (data.getuserWord() & 0xF);
798  switch (value) {
799  case 1: { //warning overflow
800  ttsCodeValue = 1;
801  break;
802  }
803  case 4: { //busy
804  ttsCodeValue = 2;
805  break;
806  }
807  case 8: { //ready
808  ttsCodeValue = 3;
809  break;
810  }
811  default: {
812  LogError("DTRawToDigi|DTDQM|DTMonitorModule|DTDataIntegrityTask")
813  << "[DTDataIntegrityTask] FED User control: wrong TTS value " << value << " in FED " << fed << " uROS "
814  << uRos << endl;
815  ttsCodeValue = 4;
816  }
817  }
818 
819  urosHistos[TTSValues * 1000 + (fed - FEDIDmin) * 100 + (uRos - 1)]->Fill(ttsCodeValue);
820 
821  // Plot the event length //NOHLT
822  int uRosEventLength = (data.gettrailer() & 0xFFFFF) * 8;
823  urosTimeHistos[(fed - FEDIDmin) * 100 + (uRos - 1)]->accumulateValueTimeSlot(uRosEventLength);
824 
825  if (uRosEventLength > 5000)
826  uRosEventLength = 5000;
827  urosHistos[uROSEventLength * 1000 + (fed - FEDIDmin) * 100 + (uRos - 1)]->Fill(uRosEventLength);
828  }
829 }
std::vector< int > geterrors() const
string keyHisto
Definition: plotFactory.py:80
int geterrorTDCID(int i) const
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
int getokxflag(int i) const
std::map< std::string, std::map< int, MonitorElement * > > fedHistos
int getuserWord() const
int getboardId() const
long gettrailer() const
int geterror(int i) const
int geterrorROBID(int i) const
Log< level::Warning, false > LogWarning
std::map< unsigned int, DTTimeEvolutionHisto * > urosTimeHistos
int theDDU(int crate, int slot, int link, bool tenDDU)
int DTDataIntegrityTask::theDDU ( int  crate,
int  slot,
int  link,
bool  tenDDU 
)
private

Definition at line 1006 of file DTDataIntegrityTask.cc.

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

Referenced by processuROS().

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

Definition at line 1037 of file DTDataIntegrityTask.cc.

Referenced by processuROS(), and theDDU().

1037  {
1038  if (slot % 6 == 5)
1039  return link + 1;
1040 
1041  int ros = (link / 24) + 3 * (slot % 6) - 2;
1042  return ros;
1043 }
void DTDataIntegrityTask::TimeHistos ( DQMStore::IBooker ,
std::string  histoType 
)
std::string DTDataIntegrityTask::topFolder ( bool  isFEDIntegrity) const
private

Definition at line 930 of file DTDataIntegrityTask.cc.

References fedIntegrityFolder, printsummarytable::folder, and mode.

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

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

Member Data Documentation

bool DTDataIntegrityTask::doTimeHisto
private

Definition at line 73 of file DTDataIntegrityTask.h.

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

Definition at line 108 of file DTDataIntegrityTask.h.

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

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

Definition at line 80 of file DTDataIntegrityTask.h.

Referenced by processFED(), and processuROS().

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

Definition at line 116 of file DTDataIntegrityTask.h.

Referenced by DTDataIntegrityTask(), and topFolder().

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

Definition at line 95 of file DTDataIntegrityTask.h.

Referenced by globalEndLuminosityBlock(), and processFED().

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

Definition at line 119 of file DTDataIntegrityTask.h.

Referenced by analyze(), and DTDataIntegrityTask().

MonitorElement* DTDataIntegrityTask::hFEDEntry
private

Definition at line 91 of file DTDataIntegrityTask.h.

Referenced by bookHistos(), and processFED().

MonitorElement* DTDataIntegrityTask::hFEDFatal
private

Definition at line 92 of file DTDataIntegrityTask.h.

Referenced by bookHistos(), and processFED().

int DTDataIntegrityTask::mode
private
MonitorElement* DTDataIntegrityTask::nEventMonitor
private

Definition at line 78 of file DTDataIntegrityTask.h.

Referenced by analyze(), and bookHistos().

int DTDataIntegrityTask::nevents
private

Definition at line 75 of file DTDataIntegrityTask.h.

Referenced by analyze().

int DTDataIntegrityTask::neventsFED
private

Definition at line 102 of file DTDataIntegrityTask.h.

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

int DTDataIntegrityTask::nEventsLS
mutableprivate
int DTDataIntegrityTask::neventsuROS
private

Definition at line 103 of file DTDataIntegrityTask.h.

Referenced by DTDataIntegrityTask(), and processuROS().

int DTDataIntegrityTask::nLinksForFatal
private

Definition at line 109 of file DTDataIntegrityTask.h.

Referenced by DTDataIntegrityTask(), and processFED().

const int DTDataIntegrityTask::NuROS = 12
private

Definition at line 112 of file DTDataIntegrityTask.h.

Referenced by bookHistograms().

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

Definition at line 82 of file DTDataIntegrityTask.h.

Referenced by bookHistos(), and processuROS().

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

Definition at line 84 of file DTDataIntegrityTask.h.

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

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

Definition at line 97 of file DTDataIntegrityTask.h.

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