CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
GEMDAQStatusSource Class Reference

#include <GEMDAQStatusSource.h>

Inheritance diagram for GEMDAQStatusSource:
GEMDQMBase DQMEDAnalyzer edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >

Public Member Functions

 GEMDAQStatusSource (const edm::ParameterSet &cfg)
 
 ~GEMDAQStatusSource () override
 
- Public Member Functions inherited from GEMDQMBase
 GEMDQMBase (const edm::ParameterSet &cfg)
 
int readGeometryPhiInfoChamber (const GEMStation *station, MEStationInfo &stationInfo)
 
int readGeometryRadiusInfoChamber (const GEMStation *station, MEStationInfo &stationInfo)
 
 ~GEMDQMBase () override
 
- Public Member Functions inherited from DQMEDAnalyzer
void accumulate (edm::Event const &event, edm::EventSetup const &setup) final
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
void beginStream (edm::StreamID id) final
 
 DQMEDAnalyzer ()
 
void endLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual bool getCanSaveByLumi ()
 
- Public Member Functions inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
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
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static void globalEndJob (DQMEDAnalyzerGlobalCache const *)
 
static void globalEndLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup, LuminosityBlockContext const *context)
 
static void globalEndRunProduce (edm::Run &run, edm::EventSetup const &setup, RunContext const *context)
 
static std::unique_ptr< DQMEDAnalyzerGlobalCacheinitializeGlobalCache (edm::ParameterSet const &)
 

Protected Member Functions

void analyze (edm::Event const &e, edm::EventSetup const &eSetup) override
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
void dqmBeginRun (edm::Run const &, edm::EventSetup const &) override
 
void FillStatusSummaryPlot (std::map< ME4IdsKey, bool > &mapChamber, MonitorElement *h2Plot, std::map< ME4IdsKey, bool > *pmapSummary=nullptr)
 
void FillWithRiseErr (MonitorElement *h, Int_t nX, Int_t nY, Bool_t &bErr)
 
void LoadROMap (edm::EventSetup const &iSetup)
 
- Protected Member Functions inherited from GEMDQMBase
template<typename T >
bool checkRefs (const std::vector< T *> &)
 
dqm::impl::MonitorElementCreateSummaryHist (DQMStore::IBooker &ibooker, TString strName)
 
int GenerateMEPerChamber (DQMStore::IBooker &ibooker)
 
int getDetOccXBin (const int, const int, const int)
 
int getIdxModule (const int, const int)
 
int getIEtaFromVFAT (const int station, const int vfat)
 
int getIEtaFromVFATGE0 (const int vfat)
 
int getIEtaFromVFATGE11 (const int vfat)
 
int getIEtaFromVFATGE21 (const int vfat)
 
int getMaxVFAT (const int)
 
std::string getNameDirLayer (ME3IdsKey key3)
 
int getNumEtaPartitions (const GEMStation *)
 
int getNumModule (const int)
 
int getVFATNumber (const int, const int, const int)
 
int getVFATNumberByDigi (const int, const int, const int)
 
int getVFATNumberGE11 (const int, const int, const int)
 
int initGeometry (edm::EventSetup const &iSetup)
 
ME2IdsKey key3Tokey2 (ME3IdsKey key)
 
ME3IdsKey key4Tokey3 (ME4IdsKey key)
 
int keyToChamber (ME4IdsKey key)
 
int keyToIEta (ME3IdsKey key)
 
int keyToIEta (ME4IdsKey key)
 
int keyToLayer (ME3IdsKey key)
 
int keyToLayer (ME4IdsKey key)
 
int keyToRegion (ME2IdsKey key)
 
int keyToRegion (ME3IdsKey key)
 
int keyToRegion (ME4IdsKey key)
 
int keyToStation (ME2IdsKey key)
 
int keyToStation (ME3IdsKey key)
 
int keyToStation (ME4IdsKey key)
 
int loadChambers ()
 
virtual int ProcessWithMEMap2 (BookingHelper &bh, ME2IdsKey key)
 
virtual int ProcessWithMEMap2AbsReWithEta (BookingHelper &bh, ME3IdsKey key)
 
virtual int ProcessWithMEMap2WithEta (BookingHelper &bh, ME3IdsKey key)
 
virtual int ProcessWithMEMap4 (BookingHelper &bh, ME4IdsKey key)
 
Float_t restrictAngle (const Float_t fTheta, const Float_t fStart)
 
int SortingLayers (std::vector< ME3IdsKey > &listLayers)
 
- Protected Member Functions inherited from DQMEDAnalyzer
uint64_t meId () const
 

Private Member Functions

int ProcessWithMEMap3 (BookingHelper &bh, ME3IdsKey key) override
 
int ProcessWithMEMap3WithChamber (BookingHelper &bh, ME4IdsKey key) override
 
void SetLabelAMC13Status (MonitorElement *h2Status)
 
void SetLabelAMCStatus (MonitorElement *h2Status)
 
void SetLabelOHStatus (MonitorElement *h2Status)
 
void SetLabelVFATStatus (MonitorElement *h2Status)
 

Private Attributes

Bool_t bFillAMC_
 
Bool_t bWarnedNotFound_
 
const edm::ESGetToken< GEMChMap, GEMChMapRcdgemChMapToken_
 
MonitorElementh2AMC13Status_
 
MonitorElementh2SummaryStatusAll
 
MonitorElementh2SummaryStatusAMC13Error
 
MonitorElementh2SummaryStatusAMCError
 
MonitorElementh2SummaryStatusAMCWarning
 
MonitorElementh2SummaryStatusError
 
MonitorElementh2SummaryStatusOHError
 
MonitorElementh2SummaryStatusOHWarning
 
MonitorElementh2SummaryStatusVFATError
 
MonitorElementh2SummaryStatusVFATWarning
 
MonitorElementh2SummaryStatusWarning
 
std::map< int, std::vector< GEMDetId > > mapAMC13ToListChamber_
 
std::map< std::tuple< int, int >, std::vector< GEMDetId > > mapAMCToListChamber_
 
std::map< UInt_t, MonitorElement * > mapFEDIdToAMCStatus_
 
std::map< UInt_t, int > mapFEDIdToPosition_
 
std::map< UInt_t, int > mapFEDIdToRe_
 
std::map< UInt_t, int > mapFEDIdToSt_
 
MEMap3Inf mapStatusErrVFATPerLayer_
 
MEMap3Inf mapStatusOH_
 
MEMap3Inf mapStatusVFAT_
 
MEMap4Inf mapStatusVFATPerCh_
 
MEMap3Inf mapStatusWarnVFATPerLayer_
 
Int_t nAMCSlots_
 
int nBitAMC13_ = 10
 
int nBitAMC_ = 12
 
int nBitOH_ = 17
 
int nBitVFAT_ = 7
 
Int_t nBXMax_
 
Int_t nBXMin_
 
std::string strFolderMain_
 
edm::EDGetToken tagAMC13_
 
edm::EDGetToken tagAMC_
 
edm::EDGetToken tagOH_
 
edm::EDGetToken tagVFAT_
 

Additional Inherited Members

- Public Types inherited from GEMDQMBase
enum  {
  GEMDQM_RUNTYPE_ONLINE, GEMDQM_RUNTYPE_OFFLINE, GEMDQM_RUNTYPE_RELVAL, GEMDQM_RUNTYPE_ALLPLOTS,
  GEMDQM_RUNTYPE_NONE = -1
}
 
typedef MEMapInfT< MEMap2Ids, ME2IdsKeyMEMap2Inf
 
typedef MEMapInfT< MEMap3Ids, ME3IdsKeyMEMap3Inf
 
typedef MEMapInfT< MEMap4Ids, ME4IdsKeyMEMap4Inf
 
- Public Types inherited from DQMEDAnalyzer
typedef dqm::reco::DQMStore DQMStore
 
typedef dqm::reco::MonitorElement MonitorElement
 
- Public Types inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 
- Public Attributes inherited from GEMDQMBase
std::string log_category_
 
Int_t nRunType_
 
- Protected Attributes inherited from GEMDQMBase
const GEMGeometryGEMGeometry_
 
edm::ESGetToken< GEMGeometry, MuonGeometryRecordgeomToken_
 
std::vector< GEMDetIdlistChamberId_
 
std::map< GEMDetId, std::vector< const GEMEtaPartition * > > mapEtaPartition_
 
std::map< ME3IdsKey, MEStationInfomapStationInfo_
 
std::map< ME3IdsKey, int > mapStationToIdx_
 
std::map< ME3IdsKey, bool > MEMap2AbsReWithEtaCheck_
 
std::map< ME2IdsKey, bool > MEMap2Check_
 
std::map< ME3IdsKey, bool > MEMap2WithEtaCheck_
 
std::map< ME3IdsKey, bool > MEMap3Check_
 
std::map< ME4IdsKey, bool > MEMap3WithChCheck_
 
std::map< ME4IdsKey, bool > MEMap4Check_
 
int nMaxNumCh_
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 
unsigned int streamId_
 

Detailed Description

Definition at line 33 of file GEMDAQStatusSource.h.

Constructor & Destructor Documentation

◆ GEMDAQStatusSource()

GEMDAQStatusSource::GEMDAQStatusSource ( const edm::ParameterSet cfg)
explicit

Definition at line 6 of file GEMDAQStatusSource.cc.

References edm::BeginRun, bWarnedNotFound_, looper::cfg, nAMCSlots_, tagAMC13_, tagAMC_, tagOH_, and tagVFAT_.

7  : GEMDQMBase(cfg), gemChMapToken_(esConsumes<GEMChMap, GEMChMapRcd, edm::Transition::BeginRun>()) {
8  tagVFAT_ = consumes<GEMVFATStatusCollection>(cfg.getParameter<edm::InputTag>("VFATInputLabel"));
9  tagOH_ = consumes<GEMOHStatusCollection>(cfg.getParameter<edm::InputTag>("OHInputLabel"));
10  tagAMC_ = consumes<GEMAMCStatusCollection>(cfg.getParameter<edm::InputTag>("AMCInputLabel"));
11  tagAMC13_ = consumes<GEMAMC13StatusCollection>(cfg.getParameter<edm::InputTag>("AMC13InputLabel"));
12 
13  nAMCSlots_ = cfg.getParameter<Int_t>("AMCSlots");
14 
15  bWarnedNotFound_ = false;
16 }
edm::EDGetToken tagAMC13_
edm::EDGetToken tagVFAT_
const edm::ESGetToken< GEMChMap, GEMChMapRcd > gemChMapToken_
edm::EDGetToken tagOH_
GEMDQMBase(const edm::ParameterSet &cfg)
Definition: GEMDQMBase.cc:7
edm::EDGetToken tagAMC_

◆ ~GEMDAQStatusSource()

GEMDAQStatusSource::~GEMDAQStatusSource ( )
inlineoverride

Definition at line 36 of file GEMDAQStatusSource.h.

36 {};

Member Function Documentation

◆ analyze()

void GEMDAQStatusSource::analyze ( edm::Event const &  e,
edm::EventSetup const &  eSetup 
)
overrideprotectedvirtual

Reimplemented from DQMEDAnalyzer.

Definition at line 299 of file GEMDAQStatusSource.cc.

References MuonDigiCollection< IndexType, DigiType >::begin(), bFillAMC_, bWarnedNotFound_, GEMDetId::chamber(), MuonDigiCollection< IndexType, DigiType >::end(), l1tstage2_dqm_sourceclient-live_cfg::fedId, dqm::impl::MonitorElement::Fill(), GEMDQMBase::MEMapInfT< M, K >::Fill(), FillWithRiseErr(), GEMDQMBase::GEMDQM_RUNTYPE_RELVAL, GEMDQMBase::getIdxModule(), h2AMC13Status_, edm::HandleBase::isValid(), GEMDetId::layer(), GEMDQMBase::log_category_, mapAMC13ToListChamber_, mapAMCToListChamber_, mapFEDIdToAMCStatus_, mapFEDIdToPosition_, GEMDQMBase::mapStationInfo_, mapStatusOH_, GEMDQMBase::MEStationInfo::nNumModules_, GEMDQMBase::nRunType_, FastTimerService_cff::range, GEMDetId::region(), GEMDetId::station(), tagAMC13_, tagAMC_, tagOH_, tagVFAT_, and GCP_Ntuples_cfg::warnings.

299  {
304 
305  event.getByToken(tagVFAT_, gemVFAT);
306  event.getByToken(tagOH_, gemOH);
307  event.getByToken(tagAMC_, gemAMC);
308  event.getByToken(tagAMC13_, gemAMC13);
309 
310  if (!(gemVFAT.isValid() && gemOH.isValid() && gemAMC.isValid() && gemAMC13.isValid())) {
311  if (!bWarnedNotFound_) {
312  edm::LogWarning(log_category_) << "DAQ sources from muonGEMDigis are not found";
313  bWarnedNotFound_ = true;
314  }
315  return;
316  }
317 
318  std::map<ME4IdsKey, bool> mapChamberAll;
319  std::map<ME4IdsKey, bool> mapChamberWarning;
320  std::map<ME4IdsKey, bool> mapChamberError;
321  std::map<ME4IdsKey, bool> mapChamberVFATWarning;
322  std::map<ME4IdsKey, bool> mapChamberVFATError;
323  std::map<ME4IdsKey, bool> mapChamberOHWarning;
324  std::map<ME4IdsKey, bool> mapChamberOHError;
325  std::map<ME4IdsKey, bool> mapChamberAMCWarning;
326  std::map<ME4IdsKey, bool> mapChamberAMCError;
327  std::map<ME4IdsKey, bool> mapChamberAMC13Error;
328 
329  for (auto amc13It = gemAMC13->begin(); amc13It != gemAMC13->end(); ++amc13It) {
330  int fedId = (*amc13It).first;
331  if (mapFEDIdToPosition_.find(fedId) == mapFEDIdToPosition_.end()) {
332  continue;
333  }
334  int nXBin = mapFEDIdToPosition_[fedId];
335 
336  const auto &range = (*amc13It).second;
337  for (auto amc13 = range.first; amc13 != range.second; ++amc13) {
338  Bool_t bWarn = false;
339  Bool_t bErr = false;
340 
343 
344  if (bFillAMC_) {
346  if (warnings.InValidAMC)
347  FillWithRiseErr(h2AMC13Status_, nXBin, 2, bWarn);
348  }
349 
351  if (errors.InValidSize)
352  FillWithRiseErr(h2AMC13Status_, nXBin, 3, bErr);
353  if (errors.failTrailerCheck)
354  FillWithRiseErr(h2AMC13Status_, nXBin, 4, bErr);
355  if (errors.failFragmentLength)
356  FillWithRiseErr(h2AMC13Status_, nXBin, 5, bErr);
357  if (errors.failTrailerMatch)
358  FillWithRiseErr(h2AMC13Status_, nXBin, 6, bErr);
359  if (errors.moreTrailers)
360  FillWithRiseErr(h2AMC13Status_, nXBin, 7, bErr);
361  if (errors.crcModified)
362  FillWithRiseErr(h2AMC13Status_, nXBin, 8, bErr);
363  if (errors.slinkError)
364  FillWithRiseErr(h2AMC13Status_, nXBin, 9, bErr);
365  if (errors.wrongFedId)
366  FillWithRiseErr(h2AMC13Status_, nXBin, 10, bErr);
367  }
368  }
369 
370  if (!bWarn && !bErr) {
372  h2AMC13Status_->Fill(nXBin, 1);
373  }
374  } else {
375  auto &listChamber = mapAMC13ToListChamber_[fedId];
376  for (auto gid : listChamber) {
377  ME4IdsKey key4Ch{gid.region(), gid.station(), gid.layer(), gid.chamber()};
378  if (bErr)
379  mapChamberAMC13Error[key4Ch] = false;
380  }
381  }
382  }
383  }
384 
385  MonitorElement *h2AMCStatus = nullptr;
386 
387  for (auto amcIt = gemAMC->begin(); amcIt != gemAMC->end(); ++amcIt) {
388  int fedId = (*amcIt).first;
389  if (mapFEDIdToAMCStatus_.find(fedId) == mapFEDIdToAMCStatus_.end()) {
390  continue;
391  }
392  h2AMCStatus = mapFEDIdToAMCStatus_[fedId];
393 
394  const GEMAMCStatusCollection::Range &range = (*amcIt).second;
395  for (auto amc = range.first; amc != range.second; ++amc) {
396  Bool_t bWarn = false;
397  Bool_t bErr = false;
398 
399  Int_t nAMCNum = amc->amcNumber();
400 
401  GEMAMCStatus::Warnings warnings{amc->warnings()};
402  GEMAMCStatus::Errors errors{amc->errors()};
403 
404  if (bFillAMC_) {
406  if (warnings.InValidOH)
407  FillWithRiseErr(h2AMCStatus, nAMCNum, 2, bWarn);
408  if (warnings.backPressure)
409  FillWithRiseErr(h2AMCStatus, nAMCNum, 3, bWarn);
410  }
411 
413  if (errors.badEC)
414  FillWithRiseErr(h2AMCStatus, nAMCNum, 4, bErr);
415  if (errors.badBC)
416  FillWithRiseErr(h2AMCStatus, nAMCNum, 5, bErr);
417  if (errors.badOC)
418  FillWithRiseErr(h2AMCStatus, nAMCNum, 6, bErr);
419  if (errors.badRunType)
420  FillWithRiseErr(h2AMCStatus, nAMCNum, 7, bErr);
421  if (errors.badCRC)
422  FillWithRiseErr(h2AMCStatus, nAMCNum, 8, bErr);
423  if (errors.MMCMlocked)
424  FillWithRiseErr(h2AMCStatus, nAMCNum, 9, bErr);
425  if (errors.DAQclocklocked)
426  FillWithRiseErr(h2AMCStatus, nAMCNum, 10, bErr);
427  if (errors.DAQnotReday)
428  FillWithRiseErr(h2AMCStatus, nAMCNum, 11, bErr);
429  if (errors.BC0locked)
430  FillWithRiseErr(h2AMCStatus, nAMCNum, 12, bErr);
431  }
432  }
433 
434  if (!bWarn && !bErr) {
436  h2AMCStatus->Fill(nAMCNum, 1);
437  }
438  } else {
439  auto &listChamber = mapAMCToListChamber_[{fedId, nAMCNum}];
440  for (auto gid : listChamber) {
441  ME4IdsKey key4Ch{gid.region(), gid.station(), gid.layer(), gid.chamber()};
442  if (bErr)
443  mapChamberAMCError[key4Ch] = false;
444  if (bWarn)
445  mapChamberAMCWarning[key4Ch] = false;
446  }
447  }
448  }
449  }
450 
451  for (auto ohIt = gemOH->begin(); ohIt != gemOH->end(); ++ohIt) {
452  GEMDetId gid = (*ohIt).first;
453  ME3IdsKey key3{gid.region(), gid.station(), gid.layer()};
454  ME4IdsKey key4{gid.region(), gid.station(), gid.layer(), gid.chamber()}; // WARNING: Chamber, not iEta
455  MEStationInfo &stationInfo = mapStationInfo_[key3];
456 
457  const GEMOHStatusCollection::Range &range = (*ohIt).second;
458  for (auto OHStatus = range.first; OHStatus != range.second; ++OHStatus) {
459  Int_t nIdxModule = getIdxModule(gid.station(), OHStatus->chamberType());
460  Int_t nCh = (gid.chamber() - 1) * stationInfo.nNumModules_ + nIdxModule;
461  ME4IdsKey key4Mod{gid.region(), gid.station(), gid.layer(), nCh}; // WARNING: Chamber+Module, not iEta
462 
463  GEMOHStatus::Warnings warnings{OHStatus->warnings()};
464  if (warnings.EvtNF)
465  mapStatusOH_.Fill(key3, nCh, 2);
466  if (warnings.InNF)
467  mapStatusOH_.Fill(key3, nCh, 3);
468  if (warnings.L1aNF)
469  mapStatusOH_.Fill(key3, nCh, 4);
470  if (warnings.EvtSzW)
471  mapStatusOH_.Fill(key3, nCh, 5);
472  if (warnings.InValidVFAT)
473  mapStatusOH_.Fill(key3, nCh, 6);
474 
475  GEMOHStatus::Errors errors{OHStatus->errors()};
476  if (errors.EvtF)
477  mapStatusOH_.Fill(key3, nCh, 7);
478  if (errors.InF)
479  mapStatusOH_.Fill(key3, nCh, 8);
480  if (errors.L1aF)
481  mapStatusOH_.Fill(key3, nCh, 9);
482  if (errors.EvtSzOFW)
483  mapStatusOH_.Fill(key3, nCh, 10);
484  if (errors.Inv)
485  mapStatusOH_.Fill(key3, nCh, 11);
486  if (errors.OOScAvV)
487  mapStatusOH_.Fill(key3, nCh, 12);
488  if (errors.OOScVvV)
489  mapStatusOH_.Fill(key3, nCh, 13);
490  if (errors.BxmAvV)
491  mapStatusOH_.Fill(key3, nCh, 14);
492  if (errors.BxmVvV)
493  mapStatusOH_.Fill(key3, nCh, 15);
494  if (errors.InUfw)
495  mapStatusOH_.Fill(key3, nCh, 16);
496  if (errors.badVFatCount)
497  mapStatusOH_.Fill(key3, nCh, 17);
498 
499  Bool_t bWarn = warnings.wcodes != 0;
500  Bool_t bErr = errors.codes != 0;
501  if (!bWarn && !bErr)
502  mapStatusOH_.Fill(key3, nCh, 1);
503  if (bWarn)
504  mapChamberOHWarning[key4Mod] = false;
505  if (bErr)
506  mapChamberOHError[key4Mod] = false;
507  mapChamberAll[key4Mod] = true;
508  }
509  }
510 
511  for (auto vfatIt = gemVFAT->begin(); vfatIt != gemVFAT->end(); ++vfatIt) {
512  GEMDetId gid = (*vfatIt).first;
513  ME3IdsKey key3{gid.region(), gid.station(), gid.layer()};
514  ME4IdsKey key4Ch{gid.region(), gid.station(), gid.layer(), gid.chamber()}; // WARNING: Chamber, not iEta
515  MEStationInfo &stationInfo = mapStationInfo_[key3];
516  Int_t nNumVFATPerModule = stationInfo.nMaxVFAT_ / stationInfo.nNumModules_;
517 
518  const GEMVFATStatusCollection::Range &range = (*vfatIt).second;
519 
520  for (auto vfatStat = range.first; vfatStat != range.second; ++vfatStat) {
521  Int_t nIdxModule = getIdxModule(gid.station(), vfatStat->chamberType());
522  Int_t nCh = (gid.chamber() - 1) * stationInfo.nNumModules_ + nIdxModule;
523  ME4IdsKey key4Mod{gid.region(), gid.station(), gid.layer(), nCh}; // WARNING: Chamber+Module, not iEta
524 
525  Int_t nIdxVFAT = vfatStat->vfatPosition();
526  Int_t nIdxVFATMod = nIdxVFAT;
527  if (stationInfo.nNumModules_ > 1) {
528  nIdxVFATMod = nIdxVFAT + nNumVFATPerModule * (nIdxModule - 1);
529  }
530 
531  GEMVFATStatus::Warnings warnings{vfatStat->warnings()};
532  if (warnings.basicOFW)
533  mapStatusVFATPerCh_.Fill(key4Ch, nIdxVFATMod, 2);
534  if (warnings.zeroSupOFW)
535  mapStatusVFATPerCh_.Fill(key4Ch, nIdxVFATMod, 3);
536 
537  GEMVFATStatus::Errors errors{(uint8_t)vfatStat->errors()};
538  if (errors.vc)
539  mapStatusVFATPerCh_.Fill(key4Ch, nIdxVFATMod, 4);
540  if (errors.InValidHeader)
541  mapStatusVFATPerCh_.Fill(key4Ch, nIdxVFATMod, 5);
542  if (errors.EC)
543  mapStatusVFATPerCh_.Fill(key4Ch, nIdxVFATMod, 6);
544  if (errors.BC)
545  mapStatusVFATPerCh_.Fill(key4Ch, nIdxVFATMod, 7);
546 
547  Bool_t bWarn = warnings.wcodes != 0;
548  Bool_t bErr = errors.codes != 0;
549  if (!bWarn && !bErr)
550  mapStatusVFATPerCh_.Fill(key4Ch, nIdxVFATMod, 1);
551  if (bWarn)
552  mapChamberVFATWarning[key4Mod] = false;
553  if (bErr)
554  mapChamberVFATError[key4Mod] = false;
555  if (bWarn)
556  mapStatusWarnVFATPerLayer_.Fill(key3, nCh, nIdxVFAT);
557  if (bErr)
558  mapStatusErrVFATPerLayer_.Fill(key3, nCh, nIdxVFAT);
559  mapChamberAll[key4Mod] = true;
560  }
561  }
562 
564  // Summarizing all presence of status of each chamber
565  for (auto const &[key4, bErr] : mapChamberAll) {
566  ME3IdsKey key3 = key4Tokey3(key4);
567  Int_t nChamber = keyToChamber(key4);
568  h2SummaryStatusAll->Fill(nChamber, mapStationToIdx_[key3]);
569  }
570 
571  // Summarizing all presence of status of each chamber
573  // Summarizing all the error and warning occupancy
574  FillStatusSummaryPlot(mapChamberVFATWarning, h2SummaryStatusVFATWarning, &mapChamberWarning);
575  FillStatusSummaryPlot(mapChamberVFATError, h2SummaryStatusVFATError, &mapChamberError);
576  FillStatusSummaryPlot(mapChamberOHWarning, h2SummaryStatusOHWarning, &mapChamberWarning);
577  FillStatusSummaryPlot(mapChamberOHError, h2SummaryStatusOHError, &mapChamberError);
578  FillStatusSummaryPlot(mapChamberAMCWarning, h2SummaryStatusAMCWarning, &mapChamberWarning);
579  FillStatusSummaryPlot(mapChamberAMCError, h2SummaryStatusAMCError, &mapChamberError);
580  FillStatusSummaryPlot(mapChamberAMC13Error, h2SummaryStatusAMC13Error, &mapChamberError);
581 
582  FillStatusSummaryPlot(mapChamberWarning, h2SummaryStatusWarning);
584  }
585 }
constexpr int station() const
Definition: GEMDetId.h:179
constexpr int region() const
Definition: GEMDetId.h:171
Int_t nRunType_
Definition: GEMDQMBase.h:550
int getIdxModule(const int, const int)
Definition: GEMDQMBase.h:660
void FillWithRiseErr(MonitorElement *h, Int_t nX, Int_t nY, Bool_t &bErr)
edm::EDGetToken tagAMC13_
MonitorElement * h2SummaryStatusAMCWarning
MonitorElement * h2AMC13Status_
MonitorElement * h2SummaryStatusAMCError
std::tuple< Int_t, Int_t, Int_t, Int_t > ME4IdsKey
std::map< ME3IdsKey, MEStationInfo > mapStationInfo_
Definition: GEMDQMBase.h:624
std::map< std::tuple< int, int >, std::vector< GEMDetId > > mapAMCToListChamber_
std::map< ME3IdsKey, int > mapStationToIdx_
Definition: GEMDQMBase.h:623
constexpr int layer() const
Definition: GEMDetId.h:190
int Fill(K key, Double_t x)
Definition: GEMDQMBase.h:401
std::string log_category_
Definition: GEMDQMBase.h:552
constexpr int chamber() const
Definition: GEMDetId.h:183
edm::EDGetToken tagVFAT_
MonitorElement * h2SummaryStatusVFATError
void Fill(long long x)
MEMap3Inf mapStatusWarnVFATPerLayer_
std::map< UInt_t, MonitorElement * > mapFEDIdToAMCStatus_
edm::EDGetToken tagOH_
MonitorElement * h2SummaryStatusError
MEMap3Inf mapStatusErrVFATPerLayer_
std::map< UInt_t, int > mapFEDIdToPosition_
DigiRangeIterator begin() const
std::map< int, std::vector< GEMDetId > > mapAMC13ToListChamber_
MonitorElement * h2SummaryStatusVFATWarning
MonitorElement * h2SummaryStatusAll
std::pair< const_iterator, const_iterator > Range
int keyToChamber(ME4IdsKey key)
Definition: GEMDQMBase.h:574
bool isValid() const
Definition: HandleBase.h:70
MonitorElement * h2SummaryStatusOHWarning
ME3IdsKey key4Tokey3(ME4IdsKey key)
Definition: GEMDQMBase.h:583
MonitorElement * h2SummaryStatusAMC13Error
std::tuple< Int_t, Int_t, Int_t > ME3IdsKey
Definition: errors.py:1
MonitorElement * h2SummaryStatusWarning
Log< level::Warning, false > LogWarning
Definition: AMCSpec.h:8
void FillStatusSummaryPlot(std::map< ME4IdsKey, bool > &mapChamber, MonitorElement *h2Plot, std::map< ME4IdsKey, bool > *pmapSummary=nullptr)
MonitorElement * h2SummaryStatusOHError
DigiRangeIterator end() const
edm::EDGetToken tagAMC_

◆ bookHistograms()

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

Implements DQMEDAnalyzer.

Definition at line 159 of file GEMDAQStatusSource.cc.

References bFillAMC_, dqm::implementation::IBooker::book2D(), dqm::implementation::NavigatorBase::cd(), GEMDQMBase::CreateSummaryHist(), l1tstage2_dqm_sourceclient-live_cfg::fedId, GEMDQMBase::GEMDQM_RUNTYPE_ALLPLOTS, GEMDQMBase::GEMDQM_RUNTYPE_OFFLINE, GEMDQMBase::GEMDQM_RUNTYPE_ONLINE, GEMDQMBase::GEMDQM_RUNTYPE_RELVAL, GEMDQMBase::GEMGeometry_, GEMDQMBase::GenerateMEPerChamber(), h2AMC13Status_, h2SummaryStatusAll, h2SummaryStatusAMC13Error, h2SummaryStatusAMCError, h2SummaryStatusAMCWarning, h2SummaryStatusError, h2SummaryStatusOHError, h2SummaryStatusOHWarning, h2SummaryStatusVFATError, h2SummaryStatusVFATWarning, h2SummaryStatusWarning, GEMDQMBase::initGeometry(), GEMDQMBase::loadChambers(), LoadROMap(), mapAMC13ToListChamber_, mapAMCToListChamber_, mapFEDIdToAMCStatus_, mapFEDIdToPosition_, mapFEDIdToRe_, mapFEDIdToSt_, mapStatusErrVFATPerLayer_, mapStatusOH_, mapStatusVFATPerCh_, mapStatusWarnVFATPerLayer_, nAMCSlots_, nBitAMC13_, nBitAMC_, nBitOH_, nBitVFAT_, nBXMax_, nBXMin_, GEMDQMBase::nRunType_, dqm::implementation::NavigatorBase::setCurrentFolder(), SetLabelAMC13Status(), SetLabelAMCStatus(), dqm::impl::MonitorElement::setTitle(), strFolderMain_, and GEMDQMBase::MEMapInfT< M, K >::TurnOff().

159  {
160  LoadROMap(iSetup);
161  if (mapAMC13ToListChamber_.empty() || mapAMCToListChamber_.empty())
162  return;
163  initGeometry(iSetup);
164  if (GEMGeometry_ == nullptr)
165  return;
166  loadChambers();
167 
168  strFolderMain_ = "GEM/DAQStatus";
169 
170  nBXMin_ = -10;
171  nBXMax_ = 10;
172 
173  ibooker.cd();
175 
176  h2AMC13Status_ = nullptr;
177 
178  bFillAMC_ = false;
179 
180  //if (nRunType_ != GEMDQM_RUNTYPE_RELVAL)
182  Int_t nNumAMC13 = (Int_t)mapFEDIdToRe_.size();
183  h2AMC13Status_ = ibooker.book2D(
184  "amc13_status", "AMC13 Status;AMC13;", nNumAMC13, 0.5, nNumAMC13 + 0.5, nBitAMC13_, 0.5, nBitAMC13_ + 0.5);
186 
187  for (auto &[fedId, nIdx] : mapFEDIdToPosition_) {
188  auto st = mapFEDIdToSt_[fedId];
189  auto re = (mapFEDIdToRe_[fedId] > 0 ? 'P' : 'M');
190  auto strName = Form("amc_status_GE%i1-%c", st, re);
191  auto strTitle = Form("AMC Status GE%i1-%c;AMC slot;", st, re);
193  ibooker.book2D(strName, strTitle, nAMCSlots_, -0.5, nAMCSlots_ - 0.5, nBitAMC_, 0.5, nBitAMC_ + 0.5);
195  }
196 
197  bFillAMC_ = true;
198  }
199 
200  mapStatusOH_ =
201  MEMap3Inf(this, "oh_status", "OptoHybrid Status", 36, 0.5, 36.5, nBitOH_, 0.5, nBitOH_ + 0.5, "Chamber");
202 
204  this, "vfat_statusWarnSum", "VFAT reporting warnings", 36, 0.5, 36.5, 24, -0.5, 24 - 0.5, "Chamber", "VFAT");
206  this, "vfat_statusErrSum", "VFAT reporting errors", 36, 0.5, 36.5, 24, -0.5, 24 - 0.5, "Chamber", "VFAT");
208  MEMap4Inf(this, "vfat_status", "VFAT Status", 24, -0.5, 24 - 0.5, nBitVFAT_, 0.5, nBitVFAT_ + 0.5, "VFAT");
209 
215  }
216 
217  GenerateMEPerChamber(ibooker);
218 
220  h2SummaryStatusAll = CreateSummaryHist(ibooker, "chamberAllStatus");
221  h2SummaryStatusWarning = CreateSummaryHist(ibooker, "chamberWarnings");
222  h2SummaryStatusError = CreateSummaryHist(ibooker, "chamberErrors");
223  }
224 
226  h2SummaryStatusVFATWarning = CreateSummaryHist(ibooker, "chamberVFATWarnings");
227  h2SummaryStatusVFATError = CreateSummaryHist(ibooker, "chamberVFATErrors");
228  h2SummaryStatusOHWarning = CreateSummaryHist(ibooker, "chamberOHWarnings");
229  h2SummaryStatusOHError = CreateSummaryHist(ibooker, "chamberOHErrors");
230  h2SummaryStatusAMCWarning = CreateSummaryHist(ibooker, "chamberAMCWarnings");
231  h2SummaryStatusAMCError = CreateSummaryHist(ibooker, "chamberAMCErrors");
232  h2SummaryStatusAMC13Error = CreateSummaryHist(ibooker, "chamberAMC13Errors");
233 
234  h2SummaryStatusAll->setTitle("Summary of all number of OH or VFAT status of each chambers");
235  h2SummaryStatusWarning->setTitle("Summary of all warnings of each chambers");
236  h2SummaryStatusError->setTitle("Summary of all errors of each chambers");
237  h2SummaryStatusVFATWarning->setTitle("Summary of VFAT warnings of each chambers");
238  h2SummaryStatusVFATError->setTitle("Summary of VFAT errors of each chambers");
239  h2SummaryStatusOHWarning->setTitle("Summary of OH warnings of each chambers");
240  h2SummaryStatusOHError->setTitle("Summary of OH errors of each chambers");
241  h2SummaryStatusAMCWarning->setTitle("Summary of AMC warnings of each chambers");
242  h2SummaryStatusAMCError->setTitle("Summary of AMC errors of each chambers");
243  h2SummaryStatusAMC13Error->setTitle("Summary of AMC13 errors of each chambers");
244  }
245 }
virtual void setTitle(const std::string &title)
set (ie. change) histogram/profile title
MEMapInfT< MEMap4Ids, ME4IdsKey > MEMap4Inf
Definition: GEMDQMBase.h:481
dqm::impl::MonitorElement * CreateSummaryHist(DQMStore::IBooker &ibooker, TString strName)
Definition: GEMDQMBase.cc:148
Int_t nRunType_
Definition: GEMDQMBase.h:550
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:36
MonitorElement * h2SummaryStatusAMCWarning
MEMapInfT< MEMap3Ids, ME3IdsKey > MEMap3Inf
Definition: GEMDQMBase.h:480
MonitorElement * h2AMC13Status_
MonitorElement * h2SummaryStatusAMCError
int initGeometry(edm::EventSetup const &iSetup)
Definition: GEMDQMBase.cc:27
std::map< UInt_t, int > mapFEDIdToRe_
std::map< UInt_t, int > mapFEDIdToSt_
std::map< std::tuple< int, int >, std::vector< GEMDetId > > mapAMCToListChamber_
int loadChambers()
Definition: GEMDQMBase.cc:56
MonitorElement * h2SummaryStatusVFATError
MEMap3Inf mapStatusWarnVFATPerLayer_
std::map< UInt_t, MonitorElement * > mapFEDIdToAMCStatus_
MonitorElement * h2SummaryStatusError
MEMap3Inf mapStatusErrVFATPerLayer_
int GenerateMEPerChamber(DQMStore::IBooker &ibooker)
Definition: GEMDQMBase.cc:180
void SetLabelAMCStatus(MonitorElement *h2Status)
void LoadROMap(edm::EventSetup const &iSetup)
std::map< UInt_t, int > mapFEDIdToPosition_
void SetLabelAMC13Status(MonitorElement *h2Status)
std::map< int, std::vector< GEMDetId > > mapAMC13ToListChamber_
MonitorElement * h2SummaryStatusVFATWarning
MonitorElement * h2SummaryStatusAll
const GEMGeometry * GEMGeometry_
Definition: GEMDQMBase.h:609
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 * h2SummaryStatusOHWarning
MonitorElement * h2SummaryStatusAMC13Error
MonitorElement * h2SummaryStatusWarning
MonitorElement * h2SummaryStatusOHError

◆ dqmBeginRun()

void GEMDAQStatusSource::dqmBeginRun ( edm::Run const &  ,
edm::EventSetup const &   
)
inlineoverrideprotectedvirtual

Reimplemented from DQMEDAnalyzer.

Definition at line 42 of file GEMDAQStatusSource.h.

42 {};

◆ fillDescriptions()

void GEMDAQStatusSource::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 18 of file GEMDAQStatusSource.cc.

References edm::ConfigurationDescriptions::add(), submitPVResolutionJobs::desc, ProducerED_cfi::InputTag, and AlCaHLTBitMon_QueryRunRegistry::string.

18  {
20  desc.add<edm::InputTag>("VFATInputLabel", edm::InputTag("muonGEMDigis", "VFATStatus"));
21  desc.add<edm::InputTag>("OHInputLabel", edm::InputTag("muonGEMDigis", "OHStatus"));
22  desc.add<edm::InputTag>("AMCInputLabel", edm::InputTag("muonGEMDigis", "AMCStatus"));
23  desc.add<edm::InputTag>("AMC13InputLabel", edm::InputTag("muonGEMDigis", "AMC13Status"));
24 
25  desc.add<Int_t>("AMCSlots", 13);
26  desc.addUntracked<std::string>("runType", "relval");
27  desc.addUntracked<std::string>("logCategory", "GEMDAQStatusSource");
28 
29  descriptions.add("GEMDAQStatusSource", desc);
30 }
void add(std::string const &label, ParameterSetDescription const &psetDescription)

◆ FillStatusSummaryPlot()

void GEMDAQStatusSource::FillStatusSummaryPlot ( std::map< ME4IdsKey, bool > &  mapChamber,
MonitorElement h2Plot,
std::map< ME4IdsKey, bool > *  pmapSummary = nullptr 
)
inlineprotected

Definition at line 51 of file GEMDAQStatusSource.h.

References dqm::impl::MonitorElement::Fill(), GEMDQMBase::key4Tokey3(), GEMDQMBase::keyToChamber(), and GEMDQMBase::mapStationToIdx_.

53  {
54  for (auto const &[key4, bFlag] : mapChamber) { // bFlag is not used
55  ME3IdsKey key3 = key4Tokey3(key4);
56  Int_t nChamber = keyToChamber(key4);
57  h2Plot->Fill(nChamber, mapStationToIdx_[key3]);
58  if (pmapSummary != nullptr)
59  (*pmapSummary)[key4] = true;
60  }
61  };
std::map< ME3IdsKey, int > mapStationToIdx_
Definition: GEMDQMBase.h:623
void Fill(long long x)
int keyToChamber(ME4IdsKey key)
Definition: GEMDQMBase.h:574
ME3IdsKey key4Tokey3(ME4IdsKey key)
Definition: GEMDQMBase.h:583
std::tuple< Int_t, Int_t, Int_t > ME3IdsKey

◆ FillWithRiseErr()

void GEMDAQStatusSource::FillWithRiseErr ( MonitorElement h,
Int_t  nX,
Int_t  nY,
Bool_t &  bErr 
)
inlineprotected

Definition at line 46 of file GEMDAQStatusSource.h.

References h.

Referenced by analyze().

46  {
47  h->Fill(nX, nY);
48  bErr = true;
49  };
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4

◆ LoadROMap()

void GEMDAQStatusSource::LoadROMap ( edm::EventSetup const &  iSetup)
protected

Definition at line 32 of file GEMDAQStatusSource.cc.

References l1tstage2_dqm_sourceclient-live_cfg::fedId, gemChMapToken_, edm::EventSetup::getData(), mapAMC13ToListChamber_, mapAMCToListChamber_, mapFEDIdToPosition_, mapFEDIdToRe_, mapFEDIdToSt_, GEMDetId::region(), and GEMDetId::station().

Referenced by bookHistograms().

32  {
33  //if (useDBEMap_)
34  if (true) {
35  const auto &chMap = iSetup.getData(gemChMapToken_);
36  auto gemChMap = std::make_unique<GEMChMap>(chMap);
37 
38  std::vector<unsigned int> listFEDId;
39  for (auto const &[ec, dc] : gemChMap->chamberMap()) {
40  unsigned int fedId = ec.fedId;
41  uint8_t amcNum = ec.amcNum;
42  GEMDetId gemChId(dc.detId);
43 
44  if (mapFEDIdToRe_.find(fedId) == mapFEDIdToRe_.end()) {
45  listFEDId.push_back(fedId);
46  }
47  mapFEDIdToRe_[fedId] = gemChId.region();
48  mapFEDIdToSt_[fedId] = gemChId.station();
49  mapAMC13ToListChamber_[fedId].push_back(gemChId);
50  mapAMCToListChamber_[{fedId, amcNum}].push_back(gemChId);
51  }
52 
53  Int_t nIdx = 1;
54  for (auto fedId : listFEDId) {
55  mapFEDIdToPosition_[fedId] = nIdx++;
56  }
57 
58  } else {
59  // no EMap in DB, using dummy
60  auto gemChMap = std::make_unique<GEMChMap>();
61  gemChMap->setDummy();
62 
63  for (auto const &[ec, dc] : gemChMap->chamberMap()) {
64  unsigned int fedId = ec.fedId;
65  uint8_t amcNum = ec.amcNum;
66  GEMDetId gemChId(dc.detId);
67 
68  mapFEDIdToRe_[fedId] = gemChId.region();
69  mapAMC13ToListChamber_[fedId].push_back(gemChId);
70  mapAMCToListChamber_[{fedId, amcNum}].push_back(gemChId);
71  }
72  }
73 }
std::map< UInt_t, int > mapFEDIdToRe_
std::map< UInt_t, int > mapFEDIdToSt_
std::map< std::tuple< int, int >, std::vector< GEMDetId > > mapAMCToListChamber_
const edm::ESGetToken< GEMChMap, GEMChMapRcd > gemChMapToken_
std::map< UInt_t, int > mapFEDIdToPosition_
std::map< int, std::vector< GEMDetId > > mapAMC13ToListChamber_

◆ ProcessWithMEMap3()

int GEMDAQStatusSource::ProcessWithMEMap3 ( BookingHelper bh,
ME3IdsKey  key 
)
overrideprivatevirtual

Reimplemented from GEMDQMBase.

Definition at line 247 of file GEMDAQStatusSource.cc.

References GEMDQMBase::MEMapInfT< M, K >::bookND(), GEMDQMBase::MEMapInfT< M, K >::FindHist(), GEMDQMBase::MEMapInfT< M, K >::isOperating(), crabWrapper::key, GEMDQMBase::mapStationInfo_, mapStatusErrVFATPerLayer_, mapStatusOH_, mapStatusWarnVFATPerLayer_, GEMDQMBase::MEStationInfo::nMaxIdxChamber_, GEMDQMBase::MEStationInfo::nMaxVFAT_, GEMDQMBase::MEStationInfo::nMinIdxChamber_, GEMDQMBase::MEStationInfo::nNumEtaPartitions_, GEMDQMBase::MEStationInfo::nNumModules_, GEMDQMBase::MEMapInfT< M, K >::SetBinConfX(), GEMDQMBase::MEMapInfT< M, K >::SetBinConfY(), GEMDQMBase::MEMapInfT< M, K >::SetLabelForChambers(), GEMDQMBase::MEMapInfT< M, K >::SetLabelForVFATs(), and SetLabelOHStatus().

247  {
248  MEStationInfo &stationInfo = mapStationInfo_[key];
249 
250  Int_t nNewNumCh = stationInfo.nMaxIdxChamber_ - stationInfo.nMinIdxChamber_ + 1;
251  Int_t nNewMinIdxChamber = stationInfo.nNumModules_ * (stationInfo.nMinIdxChamber_ - 1) + 1;
252  Int_t nNewMaxIdxChamber = stationInfo.nNumModules_ * stationInfo.nMaxIdxChamber_;
253 
254  nNewNumCh *= stationInfo.nNumModules_;
255 
256  mapStatusOH_.SetBinConfX(nNewNumCh, nNewMinIdxChamber - 0.5, nNewMaxIdxChamber + 0.5);
257  mapStatusOH_.bookND(bh, key);
258  mapStatusOH_.SetLabelForChambers(key, 1, -1, nNewMinIdxChamber, stationInfo.nNumModules_);
259 
260  if (mapStatusOH_.isOperating()) {
262  }
263 
264  Int_t nNumVFATPerModule = stationInfo.nMaxVFAT_ / stationInfo.nNumModules_;
265 
266  mapStatusWarnVFATPerLayer_.SetBinConfX(nNewNumCh, nNewMinIdxChamber - 0.5, nNewMaxIdxChamber + 0.5);
267  mapStatusWarnVFATPerLayer_.SetBinConfY(nNumVFATPerModule, -0.5);
269  mapStatusWarnVFATPerLayer_.SetLabelForChambers(key, 1, -1, nNewMinIdxChamber, stationInfo.nNumModules_);
270  mapStatusWarnVFATPerLayer_.SetLabelForVFATs(key, stationInfo.nNumEtaPartitions_, 2);
271 
272  mapStatusErrVFATPerLayer_.SetBinConfX(nNewNumCh, nNewMinIdxChamber - 0.5, nNewMaxIdxChamber + 0.5);
273  mapStatusErrVFATPerLayer_.SetBinConfY(nNumVFATPerModule, -0.5);
275  mapStatusErrVFATPerLayer_.SetLabelForChambers(key, 1, -1, nNewMinIdxChamber, stationInfo.nNumModules_);
276  mapStatusErrVFATPerLayer_.SetLabelForVFATs(key, stationInfo.nNumEtaPartitions_, 2);
277 
278  return 0;
279 }
int SetLabelForVFATs(K key, Int_t nNumEtaPartitions, Int_t nAxis, Int_t nNumBin=-1)
Definition: GEMDQMBase.h:365
std::map< ME3IdsKey, MEStationInfo > mapStationInfo_
Definition: GEMDQMBase.h:624
MEMap3Inf mapStatusWarnVFATPerLayer_
MEMap3Inf mapStatusErrVFATPerLayer_
void SetLabelOHStatus(MonitorElement *h2Status)
int bookND(BookingHelper &bh, K key)
Definition: GEMDQMBase.h:307
void SetBinConfX(Int_t nBins, Double_t dL=0.5, Double_t dH=-1048576.0)
Definition: GEMDQMBase.h:281
void SetBinConfY(Int_t nBins, Double_t dL=0.5, Double_t dH=-1048576.0)
Definition: GEMDQMBase.h:289
dqm::impl::MonitorElement * FindHist(K key)
Definition: GEMDQMBase.h:328
int SetLabelForChambers(K key, Int_t nAxis, Int_t nNumBin=-1, Int_t nIdxStart=1, Int_t nNumModules=1)
Definition: GEMDQMBase.h:337

◆ ProcessWithMEMap3WithChamber()

int GEMDAQStatusSource::ProcessWithMEMap3WithChamber ( BookingHelper bh,
ME4IdsKey  key 
)
overrideprivatevirtual

Reimplemented from GEMDQMBase.

Definition at line 281 of file GEMDAQStatusSource.cc.

References GEMDQMBase::MEMapInfT< M, K >::bookND(), GEMDQMBase::MEMapInfT< M, K >::FindHist(), GEMDQMBase::BookingHelper::getBooker(), GEMDQMBase::getNameDirLayer(), GEMDQMBase::MEMapInfT< M, K >::isOperating(), crabWrapper::key, GEMDQMBase::key4Tokey3(), GEMDQMBase::mapStationInfo_, mapStatusVFATPerCh_, GEMDQMBase::MEStationInfo::nMaxVFAT_, GEMDQMBase::MEStationInfo::nNumEtaPartitions_, GEMDQMBase::MEMapInfT< M, K >::SetBinConfX(), dqm::implementation::NavigatorBase::setCurrentFolder(), GEMDQMBase::MEMapInfT< M, K >::SetLabelForVFATs(), SetLabelVFATStatus(), and strFolderMain_.

281  {
282  ME3IdsKey key3 = key4Tokey3(key);
283  MEStationInfo &stationInfo = mapStationInfo_[key3];
284 
285  bh.getBooker()->setCurrentFolder(strFolderMain_ + "/VFATStatus_" + getNameDirLayer(key3));
286 
287  mapStatusVFATPerCh_.SetBinConfX(stationInfo.nMaxVFAT_, -0.5);
289  mapStatusVFATPerCh_.SetLabelForVFATs(key, stationInfo.nNumEtaPartitions_, 1);
292  }
293 
294  bh.getBooker()->setCurrentFolder(strFolderMain_);
295 
296  return 0;
297 }
int SetLabelForVFATs(K key, Int_t nNumEtaPartitions, Int_t nAxis, Int_t nNumBin=-1)
Definition: GEMDQMBase.h:365
std::map< ME3IdsKey, MEStationInfo > mapStationInfo_
Definition: GEMDQMBase.h:624
void SetLabelVFATStatus(MonitorElement *h2Status)
std::string getNameDirLayer(ME3IdsKey key3)
Definition: GEMDQMBase.h:718
int bookND(BookingHelper &bh, K key)
Definition: GEMDQMBase.h:307
ME3IdsKey key4Tokey3(ME4IdsKey key)
Definition: GEMDQMBase.h:583
std::tuple< Int_t, Int_t, Int_t > ME3IdsKey
void SetBinConfX(Int_t nBins, Double_t dL=0.5, Double_t dH=-1048576.0)
Definition: GEMDQMBase.h:281
dqm::impl::MonitorElement * FindHist(K key)
Definition: GEMDQMBase.h:328

◆ SetLabelAMC13Status()

void GEMDAQStatusSource::SetLabelAMC13Status ( MonitorElement h2Status)
private

Definition at line 75 of file GEMDAQStatusSource.cc.

References l1tstage2_dqm_sourceclient-live_cfg::fedId, mapFEDIdToPosition_, mapFEDIdToRe_, mapFEDIdToSt_, and dqm::impl::MonitorElement::setBinLabel().

Referenced by bookHistograms().

75  {
76  if (h2Status == nullptr) {
77  return;
78  }
79 
80  unsigned int unBinPos = 1;
81  h2Status->setBinLabel(unBinPos++, "Good", 2);
82  h2Status->setBinLabel(unBinPos++, "Invalid AMC", 2);
83  h2Status->setBinLabel(unBinPos++, "Invalid size", 2);
84  h2Status->setBinLabel(unBinPos++, "Fail trailer check", 2);
85  h2Status->setBinLabel(unBinPos++, "Fail fragment length", 2);
86  h2Status->setBinLabel(unBinPos++, "Fail trailer match", 2);
87  h2Status->setBinLabel(unBinPos++, "More trailer", 2);
88  h2Status->setBinLabel(unBinPos++, "CRC modified", 2);
89  h2Status->setBinLabel(unBinPos++, "S-link error", 2);
90  h2Status->setBinLabel(unBinPos++, "Wrong FED ID", 2);
91 
92  for (auto const &[fedId, nPos] : mapFEDIdToPosition_) {
93  auto st = mapFEDIdToSt_[fedId];
94  auto re = (mapFEDIdToRe_[fedId] > 0 ? 'P' : 'M');
95  h2Status->setBinLabel(nPos, Form("GE%i1-%c", st, re), 1);
96  }
97 }
std::map< UInt_t, int > mapFEDIdToRe_
std::map< UInt_t, int > mapFEDIdToSt_
std::map< UInt_t, int > mapFEDIdToPosition_
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)

◆ SetLabelAMCStatus()

void GEMDAQStatusSource::SetLabelAMCStatus ( MonitorElement h2Status)
private

Definition at line 99 of file GEMDAQStatusSource.cc.

References dqm::impl::MonitorElement::setBinLabel().

Referenced by bookHistograms().

99  {
100  if (h2Status == nullptr) {
101  return;
102  }
103 
104  unsigned int unBinPos = 1;
105  h2Status->setBinLabel(unBinPos++, "Good", 2);
106  h2Status->setBinLabel(unBinPos++, "Invalid OH", 2);
107  h2Status->setBinLabel(unBinPos++, "Back pressure", 2);
108  h2Status->setBinLabel(unBinPos++, "Bad EC", 2);
109  h2Status->setBinLabel(unBinPos++, "Bad BC", 2);
110  h2Status->setBinLabel(unBinPos++, "Bad OC", 2);
111  h2Status->setBinLabel(unBinPos++, "Bad run type", 2);
112  h2Status->setBinLabel(unBinPos++, "Bad CRC", 2);
113  h2Status->setBinLabel(unBinPos++, "MMCM locked", 2);
114  h2Status->setBinLabel(unBinPos++, "DAQ clock locked", 2);
115  h2Status->setBinLabel(unBinPos++, "DAQ not ready", 2);
116  h2Status->setBinLabel(unBinPos++, "BC0 not locked", 2);
117 }
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)

◆ SetLabelOHStatus()

void GEMDAQStatusSource::SetLabelOHStatus ( MonitorElement h2Status)
private

Definition at line 119 of file GEMDAQStatusSource.cc.

References dqm::impl::MonitorElement::setBinLabel().

Referenced by ProcessWithMEMap3().

119  {
120  if (h2Status == nullptr) {
121  return;
122  }
123 
124  unsigned int unBinPos = 1;
125  h2Status->setBinLabel(unBinPos++, "Good", 2);
126  h2Status->setBinLabel(unBinPos++, "Event FIFO near full", 2);
127  h2Status->setBinLabel(unBinPos++, "Input FIFO near full", 2);
128  h2Status->setBinLabel(unBinPos++, "L1A FIFO near full", 2);
129  h2Status->setBinLabel(unBinPos++, "Event size warn", 2);
130  h2Status->setBinLabel(unBinPos++, "Invalid VFAT", 2);
131  h2Status->setBinLabel(unBinPos++, "Event FIFO full", 2);
132  h2Status->setBinLabel(unBinPos++, "Input FIFO full", 2);
133  h2Status->setBinLabel(unBinPos++, "L1A FIFO full", 2);
134  h2Status->setBinLabel(unBinPos++, "Event size overflow", 2);
135  h2Status->setBinLabel(unBinPos++, "Invalid event", 2);
136  h2Status->setBinLabel(unBinPos++, "Out of Sync AMC vs VFAT", 2);
137  h2Status->setBinLabel(unBinPos++, "Out of Sync VFAT vs VFAT", 2);
138  h2Status->setBinLabel(unBinPos++, "BX mismatch AMC vs VFAT", 2);
139  h2Status->setBinLabel(unBinPos++, "BX mismatch VFAT vs VFAT", 2);
140  h2Status->setBinLabel(unBinPos++, "Input FIFO underflow", 2);
141  h2Status->setBinLabel(unBinPos++, "Bad VFAT count", 2);
142 }
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)

◆ SetLabelVFATStatus()

void GEMDAQStatusSource::SetLabelVFATStatus ( MonitorElement h2Status)
private

Definition at line 144 of file GEMDAQStatusSource.cc.

References dqm::impl::MonitorElement::setBinLabel().

Referenced by ProcessWithMEMap3WithChamber().

144  {
145  if (h2Status == nullptr) {
146  return;
147  }
148 
149  unsigned int unBinPos = 1;
150  h2Status->setBinLabel(unBinPos++, "Good", 2);
151  h2Status->setBinLabel(unBinPos++, "Basic overflow", 2);
152  h2Status->setBinLabel(unBinPos++, "Zero-sup overflow", 2);
153  h2Status->setBinLabel(unBinPos++, "VFAT CRC error", 2);
154  h2Status->setBinLabel(unBinPos++, "Invalid header", 2);
155  h2Status->setBinLabel(unBinPos++, "AMC EC mismatch", 2);
156  h2Status->setBinLabel(unBinPos++, "AMC BC mismatch", 2);
157 }
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)

Member Data Documentation

◆ bFillAMC_

Bool_t GEMDAQStatusSource::bFillAMC_
private

Definition at line 103 of file GEMDAQStatusSource.h.

Referenced by analyze(), and bookHistograms().

◆ bWarnedNotFound_

Bool_t GEMDAQStatusSource::bWarnedNotFound_
private

Definition at line 79 of file GEMDAQStatusSource.h.

Referenced by analyze(), and GEMDAQStatusSource().

◆ gemChMapToken_

const edm::ESGetToken<GEMChMap, GEMChMapRcd> GEMDAQStatusSource::gemChMapToken_
private

Definition at line 72 of file GEMDAQStatusSource.h.

Referenced by LoadROMap().

◆ h2AMC13Status_

MonitorElement* GEMDAQStatusSource::h2AMC13Status_
private

Definition at line 81 of file GEMDAQStatusSource.h.

Referenced by analyze(), and bookHistograms().

◆ h2SummaryStatusAll

MonitorElement* GEMDAQStatusSource::h2SummaryStatusAll
private

Definition at line 90 of file GEMDAQStatusSource.h.

Referenced by bookHistograms().

◆ h2SummaryStatusAMC13Error

MonitorElement* GEMDAQStatusSource::h2SummaryStatusAMC13Error
private

Definition at line 99 of file GEMDAQStatusSource.h.

Referenced by bookHistograms().

◆ h2SummaryStatusAMCError

MonitorElement* GEMDAQStatusSource::h2SummaryStatusAMCError
private

Definition at line 98 of file GEMDAQStatusSource.h.

Referenced by bookHistograms().

◆ h2SummaryStatusAMCWarning

MonitorElement* GEMDAQStatusSource::h2SummaryStatusAMCWarning
private

Definition at line 97 of file GEMDAQStatusSource.h.

Referenced by bookHistograms().

◆ h2SummaryStatusError

MonitorElement* GEMDAQStatusSource::h2SummaryStatusError
private

Definition at line 92 of file GEMDAQStatusSource.h.

Referenced by bookHistograms().

◆ h2SummaryStatusOHError

MonitorElement* GEMDAQStatusSource::h2SummaryStatusOHError
private

Definition at line 96 of file GEMDAQStatusSource.h.

Referenced by bookHistograms().

◆ h2SummaryStatusOHWarning

MonitorElement* GEMDAQStatusSource::h2SummaryStatusOHWarning
private

Definition at line 95 of file GEMDAQStatusSource.h.

Referenced by bookHistograms().

◆ h2SummaryStatusVFATError

MonitorElement* GEMDAQStatusSource::h2SummaryStatusVFATError
private

Definition at line 94 of file GEMDAQStatusSource.h.

Referenced by bookHistograms().

◆ h2SummaryStatusVFATWarning

MonitorElement* GEMDAQStatusSource::h2SummaryStatusVFATWarning
private

Definition at line 93 of file GEMDAQStatusSource.h.

Referenced by bookHistograms().

◆ h2SummaryStatusWarning

MonitorElement* GEMDAQStatusSource::h2SummaryStatusWarning
private

Definition at line 91 of file GEMDAQStatusSource.h.

Referenced by bookHistograms().

◆ mapAMC13ToListChamber_

std::map<int, std::vector<GEMDetId> > GEMDAQStatusSource::mapAMC13ToListChamber_
private

Definition at line 111 of file GEMDAQStatusSource.h.

Referenced by analyze(), bookHistograms(), and LoadROMap().

◆ mapAMCToListChamber_

std::map<std::tuple<int, int>, std::vector<GEMDetId> > GEMDAQStatusSource::mapAMCToListChamber_
private

Definition at line 112 of file GEMDAQStatusSource.h.

Referenced by analyze(), bookHistograms(), and LoadROMap().

◆ mapFEDIdToAMCStatus_

std::map<UInt_t, MonitorElement *> GEMDAQStatusSource::mapFEDIdToAMCStatus_
private

Definition at line 110 of file GEMDAQStatusSource.h.

Referenced by analyze(), and bookHistograms().

◆ mapFEDIdToPosition_

std::map<UInt_t, int> GEMDAQStatusSource::mapFEDIdToPosition_
private

Definition at line 109 of file GEMDAQStatusSource.h.

Referenced by analyze(), bookHistograms(), LoadROMap(), and SetLabelAMC13Status().

◆ mapFEDIdToRe_

std::map<UInt_t, int> GEMDAQStatusSource::mapFEDIdToRe_
private

Definition at line 107 of file GEMDAQStatusSource.h.

Referenced by bookHistograms(), LoadROMap(), and SetLabelAMC13Status().

◆ mapFEDIdToSt_

std::map<UInt_t, int> GEMDAQStatusSource::mapFEDIdToSt_
private

Definition at line 108 of file GEMDAQStatusSource.h.

Referenced by bookHistograms(), LoadROMap(), and SetLabelAMC13Status().

◆ mapStatusErrVFATPerLayer_

MEMap3Inf GEMDAQStatusSource::mapStatusErrVFATPerLayer_
private

Definition at line 87 of file GEMDAQStatusSource.h.

Referenced by bookHistograms(), and ProcessWithMEMap3().

◆ mapStatusOH_

MEMap3Inf GEMDAQStatusSource::mapStatusOH_
private

Definition at line 83 of file GEMDAQStatusSource.h.

Referenced by analyze(), bookHistograms(), and ProcessWithMEMap3().

◆ mapStatusVFAT_

MEMap3Inf GEMDAQStatusSource::mapStatusVFAT_
private

Definition at line 84 of file GEMDAQStatusSource.h.

◆ mapStatusVFATPerCh_

MEMap4Inf GEMDAQStatusSource::mapStatusVFATPerCh_
private

Definition at line 88 of file GEMDAQStatusSource.h.

Referenced by bookHistograms(), and ProcessWithMEMap3WithChamber().

◆ mapStatusWarnVFATPerLayer_

MEMap3Inf GEMDAQStatusSource::mapStatusWarnVFATPerLayer_
private

Definition at line 86 of file GEMDAQStatusSource.h.

Referenced by bookHistograms(), and ProcessWithMEMap3().

◆ nAMCSlots_

Int_t GEMDAQStatusSource::nAMCSlots_
private

Definition at line 113 of file GEMDAQStatusSource.h.

Referenced by bookHistograms(), and GEMDAQStatusSource().

◆ nBitAMC13_

int GEMDAQStatusSource::nBitAMC13_ = 10
private

Definition at line 115 of file GEMDAQStatusSource.h.

Referenced by bookHistograms().

◆ nBitAMC_

int GEMDAQStatusSource::nBitAMC_ = 12
private

Definition at line 116 of file GEMDAQStatusSource.h.

Referenced by bookHistograms().

◆ nBitOH_

int GEMDAQStatusSource::nBitOH_ = 17
private

Definition at line 117 of file GEMDAQStatusSource.h.

Referenced by bookHistograms().

◆ nBitVFAT_

int GEMDAQStatusSource::nBitVFAT_ = 7
private

Definition at line 118 of file GEMDAQStatusSource.h.

Referenced by bookHistograms().

◆ nBXMax_

Int_t GEMDAQStatusSource::nBXMax_
private

Definition at line 105 of file GEMDAQStatusSource.h.

Referenced by bookHistograms().

◆ nBXMin_

Int_t GEMDAQStatusSource::nBXMin_
private

Definition at line 105 of file GEMDAQStatusSource.h.

Referenced by bookHistograms().

◆ strFolderMain_

std::string GEMDAQStatusSource::strFolderMain_
private

Definition at line 101 of file GEMDAQStatusSource.h.

Referenced by bookHistograms(), and ProcessWithMEMap3WithChamber().

◆ tagAMC13_

edm::EDGetToken GEMDAQStatusSource::tagAMC13_
private

Definition at line 77 of file GEMDAQStatusSource.h.

Referenced by analyze(), and GEMDAQStatusSource().

◆ tagAMC_

edm::EDGetToken GEMDAQStatusSource::tagAMC_
private

Definition at line 76 of file GEMDAQStatusSource.h.

Referenced by analyze(), and GEMDAQStatusSource().

◆ tagOH_

edm::EDGetToken GEMDAQStatusSource::tagOH_
private

Definition at line 75 of file GEMDAQStatusSource.h.

Referenced by analyze(), and GEMDAQStatusSource().

◆ tagVFAT_

edm::EDGetToken GEMDAQStatusSource::tagVFAT_
private

Definition at line 74 of file GEMDAQStatusSource.h.

Referenced by analyze(), and GEMDAQStatusSource().