CMS 3D CMS Logo

List of all members | Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes
GEMDQMHarvester Class Reference
Inheritance diagram for GEMDQMHarvester:

Classes

class  NumStatus
 
struct  PreStatusInfo
 

Public Types

typedef std::tuple< int, int > IdChamber
 
typedef std::tuple< int, int, int > IdVFAT
 
typedef struct GEMDQMHarvester::PreStatusInfo StatusInfo
 

Public Member Functions

 GEMDQMHarvester (const edm::ParameterSet &)
 
 ~GEMDQMHarvester () override
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Protected Types

typedef std::vector< std::vector< Int_t > > TableStatusNum
 
typedef std::vector< std::vector< Float_t > > TableStatusOcc
 

Protected Member Functions

Int_t assessOneBin (std::string strName, Int_t nIdxX, Int_t nIdxY, Float_t fAll, Float_t fNumOcc, Float_t fNumErr, Float_t fNumWarn)
 
void copyLabels (MonitorElement *h2Src, MonitorElement *h2Dst)
 
void createInactiveChannelFracHist (edm::Service< DQMStore > &store, std::string strSuffix, Int_t nNumChamber)
 
void createLumiFuncHist (edm::Service< DQMStore > &store, std::string strSuffix, Int_t nIdxLayer, Int_t nLumiCurr)
 
void createSummaryHist (edm::Service< DQMStore > &store, MonitorElement *h2Src, MonitorElement *&h2Sum)
 
void createSummaryVFAT (edm::Service< DQMStore > &store, MonitorElement *h2Src, std::string strSuffix, MonitorElement *&h2Sum)
 
void createTableWatchingSummary ()
 
void dqmEndJob (DQMStore::IBooker &, DQMStore::IGetter &) override
 
void dqmEndLuminosityBlock (DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &iLumi, edm::EventSetup const &) override
 
void drawSummaryHistogram (edm::Service< DQMStore > &store, Int_t nLumiCurr)
 
void getGeometryInfo (edm::Service< DQMStore > &store, MonitorElement *h2Src)
 
Float_t refineSummaryHistogram (std::string strName, MonitorElement *h2Sum, std::vector< MonitorElement *> &listOccPlots, MonitorElement *h2SrcStatusA, MonitorElement *h2SrcStatusE, MonitorElement *h2SrcStatusW, MonitorElement *h2SrcStatusEVFAT, MonitorElement *h2SrcStatusWVFAT, MonitorElement *h2SrcStatusEOH, MonitorElement *h2SrcStatusWOH, MonitorElement *h2SrcStatusEAMC, MonitorElement *h2SrcStatusWAMC, MonitorElement *h2SrcStatusEAMC13, Int_t nLumiCurr)
 
Int_t refineSummaryVFAT (std::string strName, MonitorElement *h2Sum, MonitorElement *h2SrcOcc, MonitorElement *h2SrcStatusE, MonitorElement *h2SrcStatusW, Int_t nLumiCurr, Int_t nIdxLayer)
 
Int_t UpdateStatusChamber (Int_t nIdxLayer, Int_t nIdxCh, Int_t nLumiCurr, NumStatus numStatus)
 
Int_t UpdateStatusChamber (Int_t nIdxLayer, Int_t nIdxCh, Int_t nIdxVFAT, Int_t nLumiCurr, NumStatus numStatus)
 
Int_t UpdateStatusChamber (std::vector< StatusInfo > &listStatus, NumStatus &numStatus, Int_t nLumiCurr, NumStatus numStatusNew)
 

Protected Attributes

Bool_t bIsStatusChambersInit_
 
Float_t fCutErr_
 
Float_t fCutLowErr_
 
Float_t fCutWarn_
 
std::vector< std::string > listLayer_
 
std::map< int, MonitorElement * > mapHistLumiFunc_
 
std::map< std::string, int > mapIdxLayer_
 
std::map< int, std::map< int, int > > mapIdxToChamberInOcc_
 
std::map< int, int > mapNumChPerChamber_
 
std::map< int, int > mapNumModule_
 
std::map< IdChamber, NumStatusmapNumStatusChambersSummary_
 
std::map< IdVFAT, NumStatusmapNumStatusVFATsSummary_
 
std::map< IdChamber, std::vector< StatusInfo > > mapStatusChambersSummary_
 
std::map< IdVFAT, std::vector< StatusInfo > > mapStatusVFATsSummary_
 
const Int_t nBitErrAMC13_ = 1
 
const Int_t nBitErrAMC_ = 2
 
const Int_t nBitErrOH_ = 4
 
const Int_t nBitErrVFAT_ = 6
 
const Int_t nBitOcc_ = 0
 
const Int_t nBitWarnAMC_ = 3
 
const Int_t nBitWarnOH_ = 5
 
const Int_t nBitWarnVFAT_ = 7
 
const Int_t nCodeError_ = 2
 
const Int_t nCodeFine_ = 1
 
const Int_t nCodeLowError_ = 4
 
const Int_t nCodeWarning_ = 3
 
const Int_t nMaxLumi_ = 6000
 
const Int_t nNumVFATs_ = 24
 
Int_t nResolutionLumi_
 
const std::string strDirRecHit_ = "GEM/RecHits"
 
const std::string strDirStatus_ = "GEM/DAQStatus"
 
const std::string strDirSummary_ = "GEM/EventInfo"
 

Detailed Description

Definition at line 22 of file GEMDQMHarvester.cc.

Member Typedef Documentation

◆ IdChamber

typedef std::tuple<int, int> GEMDQMHarvester::IdChamber

Definition at line 28 of file GEMDQMHarvester.cc.

◆ IdVFAT

typedef std::tuple<int, int, int> GEMDQMHarvester::IdVFAT

Definition at line 29 of file GEMDQMHarvester.cc.

◆ StatusInfo

◆ TableStatusNum

typedef std::vector<std::vector<Int_t> > GEMDQMHarvester::TableStatusNum
protected

Definition at line 143 of file GEMDQMHarvester.cc.

◆ TableStatusOcc

typedef std::vector<std::vector<Float_t> > GEMDQMHarvester::TableStatusOcc
protected

Definition at line 142 of file GEMDQMHarvester.cc.

Constructor & Destructor Documentation

◆ GEMDQMHarvester()

GEMDQMHarvester::GEMDQMHarvester ( const edm::ParameterSet cfg)

Definition at line 159 of file GEMDQMHarvester.cc.

References looper::cfg.

159  {
160  fCutErr_ = cfg.getParameter<double>("cutErr");
161  fCutLowErr_ = cfg.getParameter<double>("cutLowErr");
162  fCutWarn_ = cfg.getParameter<double>("cutWarn");
163  nResolutionLumi_ = cfg.getParameter<int>("resolutionLumi");
164  bIsStatusChambersInit_ = false;
165 }
Bool_t bIsStatusChambersInit_

◆ ~GEMDQMHarvester()

GEMDQMHarvester::~GEMDQMHarvester ( )
inlineoverride

Definition at line 25 of file GEMDQMHarvester.cc.

25 {};

Member Function Documentation

◆ assessOneBin()

Int_t GEMDQMHarvester::assessOneBin ( std::string  strName,
Int_t  nIdxX,
Int_t  nIdxY,
Float_t  fAll,
Float_t  fNumOcc,
Float_t  fNumErr,
Float_t  fNumWarn 
)
protected

Definition at line 424 of file GEMDQMHarvester.cc.

425  {
426  if (fNumErr > fCutErr_ * fAll) // The error status criterion
427  return nCodeError_;
428  else if (fNumErr > fCutLowErr_ * fAll) // The low-error status criterion
429  return nCodeLowError_;
430  else if (fNumWarn > fCutWarn_ * fAll) // The warning status criterion
431  return nCodeWarning_;
432  else if (fNumOcc > 0)
433  return nCodeFine_;
434 
435  return 0;
436 }
const Int_t nCodeWarning_
const Int_t nCodeError_
const Int_t nCodeLowError_
const Int_t nCodeFine_

◆ copyLabels()

void GEMDQMHarvester::copyLabels ( MonitorElement h2Src,
MonitorElement h2Dst 
)
protected

Definition at line 335 of file GEMDQMHarvester.cc.

References dqm::impl::MonitorElement::getAxisTitle(), dqm::impl::MonitorElement::getNbinsX(), dqm::impl::MonitorElement::getNbinsY(), dqm::legacy::MonitorElement::getTH2F(), dqm::impl::MonitorElement::getTitle(), mps_fire::i, anotherprimaryvertexanalyzer_cfi::nBinX, anotherprimaryvertexanalyzer_cfi::nBinY, dqm::impl::MonitorElement::setBinLabel(), dqm::impl::MonitorElement::setTitle(), dqm::impl::MonitorElement::setXTitle(), and dqm::impl::MonitorElement::setYTitle().

335  {
336  Int_t nBinX = h2Src->getNbinsX(), nBinY = h2Src->getNbinsY();
337 
338  for (Int_t i = 1; i <= nBinX; i++) {
339  h2Dst->setBinLabel(i, h2Src->getTH2F()->GetXaxis()->GetBinLabel(i), 1);
340  }
341  for (Int_t i = 1; i <= nBinY; i++) {
342  h2Dst->setBinLabel(i, h2Src->getTH2F()->GetYaxis()->GetBinLabel(i), 2);
343  }
344  h2Dst->setTitle(h2Src->getTitle());
345  h2Dst->setXTitle(h2Src->getAxisTitle(1));
346  h2Dst->setYTitle(h2Src->getAxisTitle(2));
347 }
virtual void setTitle(const std::string &title)
set (ie. change) histogram/profile title
virtual std::string getAxisTitle(int axis=1) const
get x-, y- or z-axis title (axis=1, 2, 3 respectively)
virtual TH2F * getTH2F() const
virtual void setXTitle(std::string const &title)
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)
virtual int getNbinsY() const
get # of bins in Y-axis
virtual std::string getTitle() const
get MonitorElement title
virtual void setYTitle(std::string const &title)
virtual int getNbinsX() const
get # of bins in X-axis

◆ createInactiveChannelFracHist()

void GEMDQMHarvester::createInactiveChannelFracHist ( edm::Service< DQMStore > &  store,
std::string  strSuffix,
Int_t  nNumChamber 
)
protected

Definition at line 744 of file GEMDQMHarvester.cc.

References dqm::implementation::IBooker::book1D(), dqm::implementation::IGetter::get(), getNameChamberOccGE11(), getNameChamberOccGE21(), getNameChamberOccNull(), dqm::impl::MonitorElement::getNbinsX(), dqm::impl::MonitorElement::getNbinsY(), dqm::legacy::MonitorElement::getTH2F(), mps_fire::i, dqmiolumiharvest::j, dqm::impl::MonitorElement::setBinContent(), dqm::impl::MonitorElement::setBinLabel(), dqm::impl::MonitorElement::setXTitle(), dqm::impl::MonitorElement::setYTitle(), and AlCaHLTBitMon_QueryRunRegistry::string.

746  {
747  std::string strTitle = "The fraction of inactive channels in " + strSuffix.substr(1);
748  MonitorElement *h2InactiveChannel =
749  store->book1D("inactive_frac_chamber" + strSuffix, strTitle, nNumChamber, 0.5, nNumChamber + 0.5);
750  h2InactiveChannel->setXTitle("Chamber");
751  h2InactiveChannel->setYTitle("Fraction of inactive channels");
752  for (Int_t i = 1; i <= nNumChamber; i++) {
753  h2InactiveChannel->setBinLabel(i, Form("%i", i), 1);
754  }
755 
756  std::string (*funcNameCh)(std::string, Int_t) = getNameChamberOccNull;
757 
758  if (strSuffix.find("_GE11") != std::string::npos) {
759  funcNameCh = getNameChamberOccGE11;
760  } else if (strSuffix.find("_GE21") != std::string::npos) {
761  funcNameCh = getNameChamberOccGE21;
762  }
763 
764  for (Int_t nIdxCh = 1; nIdxCh <= nNumChamber; nIdxCh++) {
765  std::string strNameCh = funcNameCh(strSuffix, nIdxCh);
766  MonitorElement *h2SrcChamberOcc = store->get(strNameCh);
767  if (h2SrcChamberOcc == nullptr) {
768  // FIXME: It's about sending a message
769  continue;
770  }
771 
772  Int_t nNumBinX = h2SrcChamberOcc->getNbinsX();
773  Int_t nNumBinY = h2SrcChamberOcc->getNbinsY();
774  Int_t nNumAllChannel = nNumBinX * nNumBinY;
775  auto *histData = h2SrcChamberOcc->getTH2F();
776  auto *pdData = histData->GetArray();
777  Int_t nNumChannelInactive = 0;
778  for (Int_t j = 1; j <= nNumBinY; j++)
779  for (Int_t i = 1; i <= nNumBinX; i++) {
780  if (pdData[j * (nNumBinX + 2) + i] <= 0) {
781  nNumChannelInactive++;
782  }
783  }
784  h2InactiveChannel->setBinContent(nIdxCh, ((Double_t)nNumChannelInactive) / nNumAllChannel);
785  }
786 }
std::string getNameChamberOccGE21(std::string strSuffix, Int_t nIdxCh)
std::string getNameChamberOccNull(std::string strSuffix, Int_t nIdxChamber)
virtual TH2F * getTH2F() const
virtual void setXTitle(std::string const &title)
std::string getNameChamberOccGE11(std::string strSuffix, Int_t nIdxCh)
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)
virtual int getNbinsY() const
get # of bins in Y-axis
virtual void setYTitle(std::string const &title)
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:712
virtual int getNbinsX() const
get # of bins in X-axis
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98

◆ createLumiFuncHist()

void GEMDQMHarvester::createLumiFuncHist ( edm::Service< DQMStore > &  store,
std::string  strSuffix,
Int_t  nIdxLayer,
Int_t  nLumiCurr 
)
protected

Definition at line 604 of file GEMDQMHarvester.cc.

References dqm::implementation::IBooker::book2S(), mps_fire::i, dqm::impl::MonitorElement::setBinContent(), dqm::impl::MonitorElement::setBinLabel(), dqm::implementation::DQMStore::setCurrentFolder(), dqm::impl::MonitorElement::setXTitle(), and dqm::impl::MonitorElement::setYTitle().

607  {
608  auto &nNumCh = mapNumChPerChamber_[nIdxLayer];
609 
610  MonitorElement *h2Summary;
611 
612  //Int_t nLumiCurrLowRes = ( ( nLumiCurr - 1 ) / nResolutionLumi_ ) * nResolutionLumi_;
613  Int_t nNumBinLumi = ((nLumiCurr - 1) / nResolutionLumi_) + 1;
614  Int_t nMaxBin = 0;
615 
616  // Creating or Summoning the corresponding histogram
617  if (mapHistLumiFunc_.find(nIdxLayer) == mapHistLumiFunc_.end()) {
619  h2Summary = store->book2S("chamberStatus_inLumi" + strSuffix,
620  "Chamber status on lumi-block " + strSuffix.substr(1),
622  1.0,
623  (Float_t)(nMaxLumi_ + 1),
624  //nNumBinLumi, 1.0, (Float_t)( nLumiCurr + 1 ),
625  nNumCh,
626  0.5,
627  nNumCh + 0.5);
628  mapHistLumiFunc_[nIdxLayer] = h2Summary;
629 
630  h2Summary->setXTitle("Luminosity block");
631  h2Summary->setYTitle("Chamber");
632  Int_t nNumModule = mapNumModule_[nIdxLayer];
633  for (Int_t i = 1; i <= nNumCh; i++) {
634  if (nNumModule <= 1) {
635  h2Summary->setBinLabel(i, Form("%i", i), 2);
636  } else {
637  Int_t nCh = (i - 1) / nNumModule + 1;
638  Int_t nModule = (i - 1) / nNumModule + 1;
639  h2Summary->setBinLabel(i, Form("%i M%i", nCh, nModule), 2);
640  }
641  }
642  } else {
643  h2Summary = mapHistLumiFunc_[nIdxLayer];
644  }
645 
646  for (Int_t nIdxCh = 1; nIdxCh <= nNumCh; nIdxCh++) {
647  auto &listStatus = mapStatusChambersSummary_[{nIdxLayer, nIdxCh}];
648 
649  Int_t nIdxStatus = 0;
650  for (Int_t nIdxLumi = 0; nIdxLumi < nNumBinLumi; nIdxLumi++) {
651  // Lumis covered by these values (nLumiStart <=, <= nLumiEnd) are counted for the current bin
652  Int_t nLumiStart = 1 + nIdxLumi * nResolutionLumi_;
653  Int_t nLumiEnd = (1 + nIdxLumi) * nResolutionLumi_;
654  if (nLumiEnd > nLumiCurr)
655  nLumiEnd = nLumiCurr;
656 
657  Int_t nStatusSum = 0;
658  while (true) { // No worries, nIdxStatus must increase and reach at listStatus.size()
659  // True: It was too past so that
660  // the lumi range of listStatus[ nIdxStatus ] is out of the coverage of the current bin
661  if (listStatus[nIdxStatus].nLumiEnd < nLumiStart) {
662  nIdxStatus++;
663  if (nIdxStatus >= (int)listStatus.size()) {
664  break; // For safety
665  }
666  continue;
667  }
668 
669  nStatusSum = listStatus[nIdxStatus].nStatus;
670 
671  // True: This is the last item of listStatus which is covered by the current bin
672  if (nIdxStatus + 1 >= (int)listStatus.size() || listStatus[nIdxStatus].nLumiEnd >= nLumiEnd) {
673  break;
674  }
675 
676  nIdxStatus++;
677  if (nIdxStatus >= (int)listStatus.size()) {
678  break; // For safety
679  }
680  }
681 
682  h2Summary->setBinContent(nIdxLumi + 1, nIdxCh, nStatusSum);
683  if (nMaxBin < nIdxLumi + 1)
684  nMaxBin = nIdxLumi + 1;
685  }
686  }
687 
688  for (Int_t nX = 1; nX <= nMaxBin; nX++) {
689  h2Summary->setBinContent(nX, 0, 1);
690  }
691 }
MonitorElement * book2S(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:254
const std::string strDirSummary_
void setCurrentFolder(std::string const &fullpath) override
Definition: DQMStore.h:646
std::map< IdChamber, std::vector< StatusInfo > > mapStatusChambersSummary_
virtual void setXTitle(std::string const &title)
std::map< int, MonitorElement * > mapHistLumiFunc_
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)
const Int_t nMaxLumi_
std::map< int, int > mapNumModule_
virtual void setYTitle(std::string const &title)
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
std::map< int, int > mapNumChPerChamber_

◆ createSummaryHist()

void GEMDQMHarvester::createSummaryHist ( edm::Service< DQMStore > &  store,
MonitorElement h2Src,
MonitorElement *&  h2Sum 
)
protected

Definition at line 397 of file GEMDQMHarvester.cc.

References dqm::implementation::IBooker::book2D(), dqm::impl::MonitorElement::getNbinsX(), dqm::impl::MonitorElement::getNbinsY(), dqm::legacy::MonitorElement::getTH2F(), mps_fire::i, anotherprimaryvertexanalyzer_cfi::nBinX, anotherprimaryvertexanalyzer_cfi::nBinY, dqm::impl::MonitorElement::setBinLabel(), dqm::impl::MonitorElement::setTitle(), dqm::impl::MonitorElement::setXTitle(), and dqm::impl::MonitorElement::setYTitle().

397  {
398  //store->setCurrentFolder(strDirSummary_);
399 
400  Int_t nBinX = h2Src->getNbinsX(), nBinY = h2Src->getNbinsY();
401  h2Sum = store->book2D("reportSummaryMap", "", nBinX, 0.5, nBinX + 0.5, nBinY, 0.5, nBinY + 0.5);
402  h2Sum->setTitle("Summary plot");
403  h2Sum->setXTitle("Chamber");
404  h2Sum->setYTitle("Layer");
405 
406  for (Int_t i = 1; i <= nBinX; i++)
407  h2Sum->setBinLabel(i, h2Src->getTH2F()->GetXaxis()->GetBinLabel(i), 1);
408  for (Int_t i = 1; i <= nBinY; i++)
409  h2Sum->setBinLabel(i, listLayer_[i].substr(1), 2);
410 }
virtual void setTitle(const std::string &title)
set (ie. change) histogram/profile title
std::vector< std::string > listLayer_
virtual TH2F * getTH2F() const
virtual void setXTitle(std::string const &title)
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)
virtual int getNbinsY() const
get # of bins in Y-axis
virtual void setYTitle(std::string const &title)
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
virtual int getNbinsX() const
get # of bins in X-axis

◆ createSummaryVFAT()

void GEMDQMHarvester::createSummaryVFAT ( edm::Service< DQMStore > &  store,
MonitorElement h2Src,
std::string  strSuffix,
MonitorElement *&  h2Sum 
)
protected

Definition at line 412 of file GEMDQMHarvester.cc.

References dqm::implementation::IBooker::book2D(), dqm::impl::MonitorElement::getNbinsX(), dqm::impl::MonitorElement::getNbinsY(), anotherprimaryvertexanalyzer_cfi::nBinX, and anotherprimaryvertexanalyzer_cfi::nBinY.

415  {
416  //store->setCurrentFolder(strDirStatus_);
417  //store->setCurrentFolder(strDirSummary_);
418 
419  Int_t nBinX = h2Src->getNbinsX(), nBinY = h2Src->getNbinsY();
420  h2Sum = store->book2D("vfat_statusSummary" + strSuffix, "", nBinX, 0.5, nBinX + 0.5, nBinY, -0.5, nBinY - 0.5);
421  copyLabels(h2Src, h2Sum);
422 }
void copyLabels(MonitorElement *h2Src, MonitorElement *h2Dst)
virtual int getNbinsY() const
get # of bins in Y-axis
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
virtual int getNbinsX() const
get # of bins in X-axis

◆ createTableWatchingSummary()

void GEMDQMHarvester::createTableWatchingSummary ( )
protected

Definition at line 317 of file GEMDQMHarvester.cc.

References mps_fire::i, and dqmiolumiharvest::j.

317  {
319  return;
320 
321  for (const auto &[nIdxLayer, nNumCh] : mapNumChPerChamber_) {
322  for (Int_t i = 1; i <= nNumCh; i++) {
323  mapStatusChambersSummary_[{nIdxLayer, i}] = std::vector<StatusInfo>();
324  mapNumStatusChambersSummary_[{nIdxLayer, i}] = NumStatus();
325  for (Int_t j = 1; j <= nNumVFATs_; j++) {
326  mapStatusVFATsSummary_[{nIdxLayer, i, j}] = std::vector<StatusInfo>();
327  mapNumStatusVFATsSummary_[{nIdxLayer, i, j}] = NumStatus();
328  }
329  }
330  }
331 
332  bIsStatusChambersInit_ = true;
333 }
std::map< IdChamber, std::vector< StatusInfo > > mapStatusChambersSummary_
std::map< IdVFAT, NumStatus > mapNumStatusVFATsSummary_
std::map< IdVFAT, std::vector< StatusInfo > > mapStatusVFATsSummary_
Bool_t bIsStatusChambersInit_
const Int_t nNumVFATs_
std::map< IdChamber, NumStatus > mapNumStatusChambersSummary_
std::map< int, int > mapNumChPerChamber_

◆ dqmEndJob()

void GEMDQMHarvester::dqmEndJob ( DQMStore::IBooker ,
DQMStore::IGetter  
)
inlineoverrideprotected

Definition at line 72 of file GEMDQMHarvester.cc.

72 {}; // Cannot use; it is called after dqmSaver

◆ dqmEndLuminosityBlock()

void GEMDQMHarvester::dqmEndLuminosityBlock ( DQMStore::IBooker ,
DQMStore::IGetter ,
edm::LuminosityBlock const &  iLumi,
edm::EventSetup const &   
)
overrideprotected

Definition at line 176 of file GEMDQMHarvester.cc.

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

179  {
181  Int_t nLumiCurr = iLumi.id().luminosityBlock();
182  drawSummaryHistogram(store, nLumiCurr);
183 }
void drawSummaryHistogram(edm::Service< DQMStore > &store, Int_t nLumiCurr)

◆ drawSummaryHistogram()

void GEMDQMHarvester::drawSummaryHistogram ( edm::Service< DQMStore > &  store,
Int_t  nLumiCurr 
)
protected

Definition at line 185 of file GEMDQMHarvester.cc.

References dqm::implementation::IBooker::bookFloat(), dqm::impl::MonitorElement::Fill(), dqm::implementation::IGetter::get(), dqm::impl::MonitorElement::getAxisTitle(), dqm::impl::MonitorElement::getNbinsX(), dqm::legacy::MonitorElement::getTH2F(), dqm::impl::MonitorElement::getTitle(), mps_fire::i, dqm::implementation::DQMStore::setCurrentFolder(), dqm::impl::MonitorElement::setTitle(), dqm::impl::MonitorElement::setXTitle(), dqm::impl::MonitorElement::setYTitle(), contentValuesCheck::ss, and AlCaHLTBitMon_QueryRunRegistry::string.

185  {
186  Float_t fReportSummary = -1.0;
187 
188  std::string strSrcStatusA = "GEM/DAQStatus/chamberAllStatus";
189  std::string strSrcStatusE = "GEM/DAQStatus/chamberErrors";
190  std::string strSrcStatusW = "GEM/DAQStatus/chamberWarnings";
191  std::string strSrcStatusEVFAT = "GEM/DAQStatus/chamberVFATErrors";
192  std::string strSrcStatusWVFAT = "GEM/DAQStatus/chamberVFATWarnings";
193  std::string strSrcStatusEOH = "GEM/DAQStatus/chamberOHErrors";
194  std::string strSrcStatusWOH = "GEM/DAQStatus/chamberOHWarnings";
195  std::string strSrcStatusEAMC = "GEM/DAQStatus/chamberAMCErrors";
196  std::string strSrcStatusWAMC = "GEM/DAQStatus/chamberAMCWarnings";
197  std::string strSrcStatusEAMC13 = "GEM/DAQStatus/chamberAMC13Errors";
198 
199  std::string strSrcVFATOcc = "GEM/Digis/occ";
200  std::string strSrcVFATStatusW = "GEM/DAQStatus/vfat_statusWarnSum";
201  std::string strSrcVFATStatusE = "GEM/DAQStatus/vfat_statusErrSum";
202 
204 
205  MonitorElement *h2SrcStatusA = store->get(strSrcStatusA);
206  MonitorElement *h2SrcStatusE = store->get(strSrcStatusE);
207  MonitorElement *h2SrcStatusW = store->get(strSrcStatusW);
208  MonitorElement *h2SrcStatusEVFAT = store->get(strSrcStatusEVFAT);
209  MonitorElement *h2SrcStatusWVFAT = store->get(strSrcStatusWVFAT);
210  MonitorElement *h2SrcStatusEOH = store->get(strSrcStatusEOH);
211  MonitorElement *h2SrcStatusWOH = store->get(strSrcStatusWOH);
212  MonitorElement *h2SrcStatusEAMC = store->get(strSrcStatusEAMC);
213  MonitorElement *h2SrcStatusWAMC = store->get(strSrcStatusWAMC);
214  MonitorElement *h2SrcStatusEAMC13 = store->get(strSrcStatusEAMC13);
215 
216  std::string strTitleSummary = "summary";
217 
218  getGeometryInfo(store, h2SrcStatusE);
219 
220  if (h2SrcStatusA != nullptr && h2SrcStatusE != nullptr && h2SrcStatusW != nullptr) {
221  MonitorElement *h2Sum = nullptr;
222  createSummaryHist(store, h2SrcStatusE, h2Sum);
224 
225  std::vector<MonitorElement *> listOccPlots(listLayer_.size() + 1); // The index starts at 1
226  for (const auto &strSuffix : listLayer_) {
227  if (mapIdxLayer_.find(strSuffix) == mapIdxLayer_.end())
228  continue;
229  auto nIdxLayer = mapIdxLayer_[strSuffix];
230  MonitorElement *h2SrcVFATOcc = store->get(strSrcVFATOcc + strSuffix);
231  if (h2SrcVFATOcc == nullptr)
232  continue;
233  listOccPlots[nIdxLayer] = h2SrcVFATOcc;
234  mapIdxToChamberInOcc_[nIdxLayer] = {};
235  Int_t nNumModule = mapNumModule_[nIdxLayer]; // FIXME: Is this way to obtain the module number fully general?
236  // Obtaining the bin indices of chambers from their labels
237  for (Int_t i = 1; i <= h2SrcVFATOcc->getNbinsX(); i++) {
238  std::string strLabel = h2SrcVFATOcc->getTH2F()->GetXaxis()->GetBinLabel(i);
239  std::string strSrc = strLabel;
240  std::vector<int> listNumExtract;
241 
242  while (!strSrc.empty()) {
243  auto nPosDigit = strSrc.find_first_of("0123456789");
244  if (nPosDigit == std::string::npos)
245  break;
246  std::stringstream ss;
247  ss << strSrc.substr(nPosDigit);
248  Int_t nExtract;
249  ss >> nExtract;
250  if (!ss.eof()) {
251  ss >> strSrc;
252  } else {
253  strSrc = "";
254  }
255  listNumExtract.push_back(nExtract);
256  }
257 
258  if (listNumExtract.empty()) { // Errneous case; but the job should not be dead
259  edm::LogError("GEMDQMHarvester") << "Error: Wrong label of GEM VFAT occupancy plot: " << strLabel;
260  } else if (listNumExtract.size() > 1 && nNumModule > 1) {
261  Int_t nCh = (listNumExtract[0] - 1) * nNumModule + listNumExtract[1];
262  mapIdxToChamberInOcc_[nIdxLayer][nCh] = i;
263  } else {
264  mapIdxToChamberInOcc_[nIdxLayer][listNumExtract[0]] = i;
265  }
266  }
267  }
268 
269  fReportSummary = refineSummaryHistogram(strTitleSummary,
270  h2Sum,
271  listOccPlots,
272  h2SrcStatusA,
273  h2SrcStatusE,
274  h2SrcStatusW,
275  h2SrcStatusEVFAT,
276  h2SrcStatusWVFAT,
277  h2SrcStatusEOH,
278  h2SrcStatusWOH,
279  h2SrcStatusEAMC,
280  h2SrcStatusWAMC,
281  h2SrcStatusEAMC13,
282  nLumiCurr);
283 
284  for (const auto &strSuffix : listLayer_) {
285  if (mapIdxLayer_.find(strSuffix) == mapIdxLayer_.end())
286  continue;
287  auto nIdxLayer = mapIdxLayer_[strSuffix];
288  MonitorElement *h2SrcVFATOcc = store->get(strSrcVFATOcc + strSuffix);
289  MonitorElement *h2SrcVFATStatusW = store->get(strSrcVFATStatusW + strSuffix);
290  MonitorElement *h2SrcVFATStatusE = store->get(strSrcVFATStatusE + strSuffix);
291  if (h2SrcVFATOcc == nullptr || h2SrcVFATStatusW == nullptr || h2SrcVFATStatusE == nullptr)
292  continue;
293 
294  MonitorElement *h2SumVFAT = nullptr;
295  createSummaryVFAT(store, h2SrcVFATStatusE, strSuffix, h2SumVFAT);
296  refineSummaryVFAT(strSuffix, h2SumVFAT, h2SrcVFATOcc, h2SrcVFATStatusE, h2SrcVFATStatusW, nLumiCurr, nIdxLayer);
297  TString strNewTitle = h2SrcVFATStatusE->getTitle();
298  h2SumVFAT->setTitle((const char *)strNewTitle.ReplaceAll("errors", "errors/warnings"));
299  h2SumVFAT->setXTitle(h2SrcVFATStatusE->getAxisTitle(1));
300  h2SumVFAT->setYTitle(h2SrcVFATStatusE->getAxisTitle(2));
301 
302  createLumiFuncHist(store, strSuffix, nIdxLayer, nLumiCurr);
303  }
304  }
305 
306  for (const auto &strSuffix : listLayer_) {
307  if (mapIdxLayer_.find(strSuffix) == mapIdxLayer_.end())
308  continue;
309  Int_t nIdxLayer = mapIdxLayer_[strSuffix];
310  auto nNumChamber = mapNumChPerChamber_[nIdxLayer] / mapNumModule_[nIdxLayer];
311  createInactiveChannelFracHist(store, strSuffix, nNumChamber);
312  }
313 
314  store->bookFloat("reportSummary")->Fill(fReportSummary);
315 }
virtual void setTitle(const std::string &title)
set (ie. change) histogram/profile title
std::map< std::string, int > mapIdxLayer_
MonitorElement * bookFloat(TString const &name, FUNC onbooking=NOOP())
Definition: DQMStore.h:80
void createSummaryVFAT(edm::Service< DQMStore > &store, MonitorElement *h2Src, std::string strSuffix, MonitorElement *&h2Sum)
void createInactiveChannelFracHist(edm::Service< DQMStore > &store, std::string strSuffix, Int_t nNumChamber)
const std::string strDirSummary_
void setCurrentFolder(std::string const &fullpath) override
Definition: DQMStore.h:646
virtual std::string getAxisTitle(int axis=1) const
get x-, y- or z-axis title (axis=1, 2, 3 respectively)
Float_t refineSummaryHistogram(std::string strName, MonitorElement *h2Sum, std::vector< MonitorElement *> &listOccPlots, MonitorElement *h2SrcStatusA, MonitorElement *h2SrcStatusE, MonitorElement *h2SrcStatusW, MonitorElement *h2SrcStatusEVFAT, MonitorElement *h2SrcStatusWVFAT, MonitorElement *h2SrcStatusEOH, MonitorElement *h2SrcStatusWOH, MonitorElement *h2SrcStatusEAMC, MonitorElement *h2SrcStatusWAMC, MonitorElement *h2SrcStatusEAMC13, Int_t nLumiCurr)
Log< level::Error, false > LogError
void createTableWatchingSummary()
std::vector< std::string > listLayer_
void Fill(long long x)
virtual TH2F * getTH2F() const
virtual void setXTitle(std::string const &title)
void getGeometryInfo(edm::Service< DQMStore > &store, MonitorElement *h2Src)
virtual std::string getTitle() const
get MonitorElement title
std::map< int, int > mapNumModule_
virtual void setYTitle(std::string const &title)
std::map< int, std::map< int, int > > mapIdxToChamberInOcc_
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:712
virtual int getNbinsX() const
get # of bins in X-axis
void createSummaryHist(edm::Service< DQMStore > &store, MonitorElement *h2Src, MonitorElement *&h2Sum)
Int_t refineSummaryVFAT(std::string strName, MonitorElement *h2Sum, MonitorElement *h2SrcOcc, MonitorElement *h2SrcStatusE, MonitorElement *h2SrcStatusW, Int_t nLumiCurr, Int_t nIdxLayer)
std::map< int, int > mapNumChPerChamber_
void createLumiFuncHist(edm::Service< DQMStore > &store, std::string strSuffix, Int_t nIdxLayer, Int_t nLumiCurr)

◆ fillDescriptions()

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

Definition at line 167 of file GEMDQMHarvester.cc.

References edm::ConfigurationDescriptions::add(), and submitPVResolutionJobs::desc.

167  {
169  desc.add<double>("cutErr", 0.05);
170  desc.add<double>("cutLowErr", 0.00);
171  desc.add<double>("cutWarn", 0.05);
172  desc.add<int>("resolutionLumi", 1);
173  descriptions.add("GEMDQMHarvester", desc);
174 }
void add(std::string const &label, ParameterSetDescription const &psetDescription)

◆ getGeometryInfo()

void GEMDQMHarvester::getGeometryInfo ( edm::Service< DQMStore > &  store,
MonitorElement h2Src 
)
protected

Definition at line 349 of file GEMDQMHarvester.cc.

References dqm::implementation::IGetter::get(), dqm::impl::MonitorElement::getBinContent(), dqm::impl::MonitorElement::getNbinsY(), dqm::legacy::MonitorElement::getTH2F(), mps_fire::i, anotherprimaryvertexanalyzer_cfi::nBinY, and AlCaHLTBitMon_QueryRunRegistry::string.

349  {
350  listLayer_.clear();
351  mapIdxLayer_.clear();
352  mapNumChPerChamber_.clear();
353 
354  if (h2Src != nullptr) { // For online and offline
355  Int_t nBinY = h2Src->getNbinsY();
356  listLayer_.push_back("");
357 
358  for (Int_t i = 1; i <= nBinY; i++) {
359  std::string strLabelFull = h2Src->getTH2F()->GetYaxis()->GetBinLabel(i);
360  auto nPos = strLabelFull.find(';');
361  auto strLayer = strLabelFull.substr(nPos + 1);
362  Int_t nBinXActual = (Int_t)(h2Src->getBinContent(0, i) + 0.5);
363  if (nBinXActual > 108) { // When the number seems wrong
364  if (strLayer.find("GE11") != std::string::npos) {
365  nBinXActual = 36;
366  } else if (strLayer.find("GE21") != std::string::npos) {
367  nBinXActual = 72;
368  } else if (strLayer.find("GE01") != std::string::npos) {
369  nBinXActual = 36;
370  }
371  }
372  listLayer_.push_back(strLayer);
373  mapIdxLayer_[strLayer] = i;
374  mapNumChPerChamber_[i] = nBinXActual;
375  mapNumModule_[i] = (strLayer.find("GE21") != std::string::npos ? 4 : 1);
376  }
377  } else { // For others (validation and...?)
378  listLayer_.push_back("");
379  if (store->get("GEM/Digis/occupancy_GE11-M-L1/occ_GE11-M-01L1-S") != nullptr) {
380  listLayer_.push_back("_GE11-P-L2");
381  listLayer_.push_back("_GE11-P-L1");
382  listLayer_.push_back("_GE11-M-L1");
383  listLayer_.push_back("_GE11-M-L2");
384  mapIdxLayer_["_GE11-P-L2"] = 1;
385  mapIdxLayer_["_GE11-P-L1"] = 2;
386  mapIdxLayer_["_GE11-M-L1"] = 3;
387  mapIdxLayer_["_GE11-M-L2"] = 4;
388  mapNumChPerChamber_[1] = 36;
389  mapNumChPerChamber_[2] = 36;
390  mapNumChPerChamber_[3] = 36;
391  mapNumChPerChamber_[4] = 36;
392  }
393  // FIXME: How about GE21 and ME0?
394  }
395 }
std::map< std::string, int > mapIdxLayer_
std::vector< std::string > listLayer_
virtual TH2F * getTH2F() const
virtual int getNbinsY() const
get # of bins in Y-axis
std::map< int, int > mapNumModule_
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:712
std::map< int, int > mapNumChPerChamber_
virtual double getBinContent(int binx) const
get content of bin (1-D)

◆ refineSummaryHistogram()

Float_t GEMDQMHarvester::refineSummaryHistogram ( std::string  strName,
MonitorElement h2Sum,
std::vector< MonitorElement *> &  listOccPlots,
MonitorElement h2SrcStatusA,
MonitorElement h2SrcStatusE,
MonitorElement h2SrcStatusW,
MonitorElement h2SrcStatusEVFAT,
MonitorElement h2SrcStatusWVFAT,
MonitorElement h2SrcStatusEOH,
MonitorElement h2SrcStatusWOH,
MonitorElement h2SrcStatusEAMC,
MonitorElement h2SrcStatusWAMC,
MonitorElement h2SrcStatusEAMC13,
Int_t  nLumiCurr 
)
protected

Definition at line 439 of file GEMDQMHarvester.cc.

References dqm::impl::MonitorElement::getBinContent(), dqm::impl::MonitorElement::getNbinsY(), mps_fire::i, dqmiolumiharvest::j, anotherprimaryvertexanalyzer_cfi::nBinX, anotherprimaryvertexanalyzer_cfi::nBinY, and dqm::impl::MonitorElement::setBinContent().

452  {
453  Int_t nBinY = h2Sum->getNbinsY();
454  Int_t nAllBin = 0, nFineBin = 0;
455  for (Int_t j = 1; j <= nBinY; j++) {
456  Int_t nBinX = mapNumChPerChamber_[j];
457  auto h2SrcOcc = listOccPlots[j];
458  auto &mapIdxOccChamber = mapIdxToChamberInOcc_[j];
459  Int_t nBinYOcc = 0;
460  if (h2SrcOcc != nullptr) {
461  nBinYOcc = h2SrcOcc->getNbinsY();
462  }
463 
464  h2Sum->setBinContent(0, j, nBinX);
465  for (Int_t i = 1; i <= nBinX; i++) {
466  Float_t fOcc = 0;
467  Int_t nIdxChOcc = mapIdxOccChamber[i];
468  for (Int_t r = 1; r <= nBinYOcc; r++) {
469  fOcc += h2SrcOcc->getBinContent(nIdxChOcc, r);
470  }
471 
472  Float_t fStatusAll = h2SrcStatusA->getBinContent(i, j);
473  Float_t fStatusErr = h2SrcStatusE->getBinContent(i, j);
474  Float_t fStatusWarn = h2SrcStatusW->getBinContent(i, j);
475  Float_t fStatusErrVFAT = h2SrcStatusEVFAT != nullptr ? h2SrcStatusEVFAT->getBinContent(i, j) : 0;
476  Float_t fStatusWarnVFAT = h2SrcStatusWVFAT != nullptr ? h2SrcStatusWVFAT->getBinContent(i, j) : 0;
477  Float_t fStatusErrOH = h2SrcStatusEOH != nullptr ? h2SrcStatusEOH->getBinContent(i, j) : 0;
478  Float_t fStatusWarnOH = h2SrcStatusWOH != nullptr ? h2SrcStatusWOH->getBinContent(i, j) : 0;
479  Float_t fStatusErrAMC = h2SrcStatusEAMC != nullptr ? h2SrcStatusEAMC->getBinContent(i, j) : 0;
480  Float_t fStatusWarnAMC = h2SrcStatusWAMC != nullptr ? h2SrcStatusWAMC->getBinContent(i, j) : 0;
481  Float_t fStatusErrAMC13 = h2SrcStatusEAMC13 != nullptr ? h2SrcStatusEAMC13->getBinContent(i, j) : 0;
482  NumStatus numStatus(fStatusAll,
483  fOcc,
484  fStatusErrVFAT,
485  fStatusWarnVFAT,
486  fStatusErrOH,
487  fStatusWarnOH,
488  fStatusErrAMC,
489  fStatusWarnAMC,
490  fStatusErrAMC13);
491  UpdateStatusChamber(j, i, nLumiCurr, numStatus);
492 
493  Int_t nRes = assessOneBin(strName, i, j, fStatusAll, fOcc, fStatusErr, fStatusWarn);
494  if (nRes == 1)
495  nFineBin++;
496 
497  h2Sum->setBinContent(i, j, (Float_t)nRes);
498  nAllBin++;
499  }
500  }
501 
502  return ((Float_t)nFineBin) / nAllBin;
503 }
Int_t assessOneBin(std::string strName, Int_t nIdxX, Int_t nIdxY, Float_t fAll, Float_t fNumOcc, Float_t fNumErr, Float_t fNumWarn)
virtual int getNbinsY() const
get # of bins in Y-axis
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
std::map< int, std::map< int, int > > mapIdxToChamberInOcc_
Int_t UpdateStatusChamber(Int_t nIdxLayer, Int_t nIdxCh, Int_t nLumiCurr, NumStatus numStatus)
std::map< int, int > mapNumChPerChamber_
virtual double getBinContent(int binx) const
get content of bin (1-D)

◆ refineSummaryVFAT()

Int_t GEMDQMHarvester::refineSummaryVFAT ( std::string  strName,
MonitorElement h2Sum,
MonitorElement h2SrcOcc,
MonitorElement h2SrcStatusE,
MonitorElement h2SrcStatusW,
Int_t  nLumiCurr,
Int_t  nIdxLayer 
)
protected

Definition at line 505 of file GEMDQMHarvester.cc.

References dqm::impl::MonitorElement::getBinContent(), dqm::impl::MonitorElement::getNbinsX(), dqm::impl::MonitorElement::getNbinsY(), mps_fire::i, dqmiolumiharvest::j, anotherprimaryvertexanalyzer_cfi::nBinX, anotherprimaryvertexanalyzer_cfi::nBinY, and dqm::impl::MonitorElement::setBinContent().

511  {
512  Int_t nBinY = h2Sum->getNbinsY();
513  for (Int_t j = 1; j <= nBinY; j++) {
514  Int_t nBinX = h2Sum->getNbinsX();
515  for (Int_t i = 1; i <= nBinX; i++) {
516  Float_t fOcc = h2SrcOcc->getBinContent(i, j);
517  Float_t fStatusErr = h2SrcStatusE->getBinContent(i, j);
518  Float_t fStatusWarn = h2SrcStatusW->getBinContent(i, j);
519  Float_t fStatusAll = fOcc + fStatusErr + fStatusWarn;
520  NumStatus numStatus(fStatusAll, fOcc, fStatusErr, fStatusWarn, 0, 0, 0, 0, 0);
521  UpdateStatusChamber(nIdxLayer, i, j, nLumiCurr, numStatus);
522 
523  Int_t nRes = assessOneBin(strName, i, j, fStatusAll, fOcc, fStatusErr, fStatusWarn);
524  h2Sum->setBinContent(i, j, (Float_t)nRes);
525  }
526  }
527 
528  return 0;
529 }
Int_t assessOneBin(std::string strName, Int_t nIdxX, Int_t nIdxY, Float_t fAll, Float_t fNumOcc, Float_t fNumErr, Float_t fNumWarn)
virtual int getNbinsY() const
get # of bins in Y-axis
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
Int_t UpdateStatusChamber(Int_t nIdxLayer, Int_t nIdxCh, Int_t nLumiCurr, NumStatus numStatus)
virtual int getNbinsX() const
get # of bins in X-axis
virtual double getBinContent(int binx) const
get content of bin (1-D)

◆ UpdateStatusChamber() [1/3]

Int_t GEMDQMHarvester::UpdateStatusChamber ( Int_t  nIdxLayer,
Int_t  nIdxCh,
Int_t  nLumiCurr,
NumStatus  numStatus 
)
protected

Definition at line 531 of file GEMDQMHarvester.cc.

531  {
533  return 0;
534  if (0 >= nIdxCh || nIdxCh > mapNumChPerChamber_[nIdxLayer])
535  return 0;
536  auto &listStatus = mapStatusChambersSummary_[{nIdxLayer, nIdxCh}];
537  auto &numStatusPrev = mapNumStatusChambersSummary_[{nIdxLayer, nIdxCh}];
538  return UpdateStatusChamber(listStatus, numStatusPrev, nLumiCurr, numStatus);
539 }
std::map< IdChamber, std::vector< StatusInfo > > mapStatusChambersSummary_
Bool_t bIsStatusChambersInit_
Int_t UpdateStatusChamber(Int_t nIdxLayer, Int_t nIdxCh, Int_t nLumiCurr, NumStatus numStatus)
std::map< IdChamber, NumStatus > mapNumStatusChambersSummary_
std::map< int, int > mapNumChPerChamber_

◆ UpdateStatusChamber() [2/3]

Int_t GEMDQMHarvester::UpdateStatusChamber ( Int_t  nIdxLayer,
Int_t  nIdxCh,
Int_t  nIdxVFAT,
Int_t  nLumiCurr,
NumStatus  numStatus 
)
protected

Definition at line 541 of file GEMDQMHarvester.cc.

542  {
544  return 0;
545  if (0 >= nIdxCh || nIdxCh > mapNumChPerChamber_[nIdxLayer])
546  return 0;
547  if (0 >= nIdxVFAT || nIdxVFAT > nNumVFATs_)
548  return 0;
549  auto &listStatus = mapStatusVFATsSummary_[{nIdxLayer, nIdxCh, nIdxVFAT}];
550  auto &numStatusPrev = mapNumStatusVFATsSummary_[{nIdxLayer, nIdxCh, nIdxVFAT}];
551  return UpdateStatusChamber(listStatus, numStatusPrev, nLumiCurr, numStatus);
552 }
std::map< IdVFAT, NumStatus > mapNumStatusVFATsSummary_
std::map< IdVFAT, std::vector< StatusInfo > > mapStatusVFATsSummary_
Bool_t bIsStatusChambersInit_
const Int_t nNumVFATs_
Int_t UpdateStatusChamber(Int_t nIdxLayer, Int_t nIdxCh, Int_t nLumiCurr, NumStatus numStatus)
std::map< int, int > mapNumChPerChamber_

◆ UpdateStatusChamber() [3/3]

Int_t GEMDQMHarvester::UpdateStatusChamber ( std::vector< StatusInfo > &  listStatus,
NumStatus numStatus,
Int_t  nLumiCurr,
NumStatus  numStatusNew 
)
protected

Definition at line 554 of file GEMDQMHarvester.cc.

References GEMDQMHarvester::NumStatus::fNumErrAMC13_, GEMDQMHarvester::NumStatus::fNumErrAMC_, GEMDQMHarvester::NumStatus::fNumErrOH_, GEMDQMHarvester::NumStatus::fNumErrVFAT_, GEMDQMHarvester::NumStatus::fNumOcc_, GEMDQMHarvester::NumStatus::fNumTotal_, GEMDQMHarvester::NumStatus::fNumWarnAMC_, GEMDQMHarvester::NumStatus::fNumWarnOH_, GEMDQMHarvester::NumStatus::fNumWarnVFAT_, GEMDQMHarvester::PreStatusInfo::nLumiEnd, GEMDQMHarvester::PreStatusInfo::nLumiStart, and GEMDQMHarvester::PreStatusInfo::nStatus.

557  {
558  // First of all, the current lumi section will be assessed, of which the result will be stored in nStatus
559  Int_t nStatus = 0;
560 
561  Float_t fNumAddErrVFAT = numStatusNew.fNumErrVFAT_ - numStatus.fNumErrVFAT_;
562  Float_t fNumAddWarnVFAT = numStatusNew.fNumWarnVFAT_ - numStatus.fNumWarnVFAT_;
563  Float_t fNumAddErrOH = numStatusNew.fNumErrOH_ - numStatus.fNumErrOH_;
564  Float_t fNumAddWarnOH = numStatusNew.fNumWarnOH_ - numStatus.fNumWarnOH_;
565  Float_t fNumAddErrAMC = numStatusNew.fNumErrAMC_ - numStatus.fNumErrAMC_;
566  Float_t fNumAddWarnAMC = numStatusNew.fNumWarnAMC_ - numStatus.fNumWarnAMC_;
567  Float_t fNumAddErrAMC13 = numStatusNew.fNumErrAMC13_ - numStatus.fNumErrAMC13_;
568 
569  numStatus.fNumTotal_ = numStatusNew.fNumTotal_;
570  numStatus.fNumOcc_ = numStatusNew.fNumOcc_;
571  numStatus.fNumErrVFAT_ = numStatusNew.fNumErrVFAT_;
572  numStatus.fNumWarnVFAT_ = numStatusNew.fNumWarnVFAT_;
573  numStatus.fNumErrOH_ = numStatusNew.fNumErrOH_;
574  numStatus.fNumWarnOH_ = numStatusNew.fNumWarnOH_;
575  numStatus.fNumErrAMC_ = numStatusNew.fNumErrAMC_;
576  numStatus.fNumWarnAMC_ = numStatusNew.fNumWarnAMC_;
577  numStatus.fNumErrAMC13_ = numStatusNew.fNumErrAMC13_;
578 
579  nStatus = (numStatusNew.fNumOcc_ > 0 ? 1 << nBitOcc_ : 0) | (fNumAddErrAMC13 > 0 ? 1 << nBitErrAMC13_ : 0) |
580  (fNumAddErrAMC > 0 ? 1 << nBitErrAMC_ : 0) | (fNumAddWarnAMC > 0 ? 1 << nBitWarnAMC_ : 0) |
581  (fNumAddErrOH > 0 ? 1 << nBitErrOH_ : 0) | (fNumAddWarnOH > 0 ? 1 << nBitWarnOH_ : 0) |
582  (fNumAddErrVFAT > 0 ? 1 << nBitErrVFAT_ : 0) | (fNumAddWarnVFAT > 0 ? 1 << nBitWarnVFAT_ : 0);
583 
584  // Only used in the next if statement; See statusLast
585  StatusInfo statusNew;
586  statusNew.nLumiStart = nLumiCurr;
587  statusNew.nLumiEnd = nLumiCurr;
588  statusNew.nStatus = nStatus;
589 
590  if (listStatus.empty()) {
591  listStatus.push_back(statusNew);
592  } else {
593  auto &statusLastPre = listStatus.back();
594  if (statusLastPre.nStatus == nStatus) {
595  statusLastPre.nLumiEnd = nLumiCurr;
596  } else {
597  listStatus.push_back(statusNew);
598  }
599  }
600 
601  return 0;
602 }
const Int_t nBitErrVFAT_
const Int_t nBitErrOH_
struct GEMDQMHarvester::PreStatusInfo StatusInfo
const Int_t nBitOcc_
const Int_t nBitErrAMC13_
const Int_t nBitErrAMC_
const Int_t nBitWarnVFAT_
const Int_t nBitWarnAMC_
const Int_t nBitWarnOH_

Member Data Documentation

◆ bIsStatusChambersInit_

Bool_t GEMDQMHarvester::bIsStatusChambersInit_
protected

Definition at line 156 of file GEMDQMHarvester.cc.

◆ fCutErr_

Float_t GEMDQMHarvester::fCutErr_
protected

Definition at line 116 of file GEMDQMHarvester.cc.

◆ fCutLowErr_

Float_t GEMDQMHarvester::fCutLowErr_
protected

Definition at line 116 of file GEMDQMHarvester.cc.

◆ fCutWarn_

Float_t GEMDQMHarvester::fCutWarn_
protected

Definition at line 116 of file GEMDQMHarvester.cc.

◆ listLayer_

std::vector<std::string> GEMDQMHarvester::listLayer_
protected

Definition at line 150 of file GEMDQMHarvester.cc.

◆ mapHistLumiFunc_

std::map<int, MonitorElement *> GEMDQMHarvester::mapHistLumiFunc_
protected

Definition at line 155 of file GEMDQMHarvester.cc.

◆ mapIdxLayer_

std::map<std::string, int> GEMDQMHarvester::mapIdxLayer_
protected

Definition at line 151 of file GEMDQMHarvester.cc.

◆ mapIdxToChamberInOcc_

std::map<int, std::map<int, int> > GEMDQMHarvester::mapIdxToChamberInOcc_
protected

Definition at line 154 of file GEMDQMHarvester.cc.

◆ mapNumChPerChamber_

std::map<int, int> GEMDQMHarvester::mapNumChPerChamber_
protected

Definition at line 152 of file GEMDQMHarvester.cc.

◆ mapNumModule_

std::map<int, int> GEMDQMHarvester::mapNumModule_
protected

Definition at line 153 of file GEMDQMHarvester.cc.

◆ mapNumStatusChambersSummary_

std::map<IdChamber, NumStatus> GEMDQMHarvester::mapNumStatusChambersSummary_
protected

Definition at line 147 of file GEMDQMHarvester.cc.

◆ mapNumStatusVFATsSummary_

std::map<IdVFAT, NumStatus> GEMDQMHarvester::mapNumStatusVFATsSummary_
protected

Definition at line 148 of file GEMDQMHarvester.cc.

◆ mapStatusChambersSummary_

std::map<IdChamber, std::vector<StatusInfo> > GEMDQMHarvester::mapStatusChambersSummary_
protected

Definition at line 145 of file GEMDQMHarvester.cc.

◆ mapStatusVFATsSummary_

std::map<IdVFAT, std::vector<StatusInfo> > GEMDQMHarvester::mapStatusVFATsSummary_
protected

Definition at line 146 of file GEMDQMHarvester.cc.

◆ nBitErrAMC13_

const Int_t GEMDQMHarvester::nBitErrAMC13_ = 1
protected

Definition at line 133 of file GEMDQMHarvester.cc.

◆ nBitErrAMC_

const Int_t GEMDQMHarvester::nBitErrAMC_ = 2
protected

Definition at line 132 of file GEMDQMHarvester.cc.

◆ nBitErrOH_

const Int_t GEMDQMHarvester::nBitErrOH_ = 4
protected

Definition at line 130 of file GEMDQMHarvester.cc.

◆ nBitErrVFAT_

const Int_t GEMDQMHarvester::nBitErrVFAT_ = 6
protected

Definition at line 128 of file GEMDQMHarvester.cc.

◆ nBitOcc_

const Int_t GEMDQMHarvester::nBitOcc_ = 0
protected

Definition at line 134 of file GEMDQMHarvester.cc.

◆ nBitWarnAMC_

const Int_t GEMDQMHarvester::nBitWarnAMC_ = 3
protected

Definition at line 131 of file GEMDQMHarvester.cc.

◆ nBitWarnOH_

const Int_t GEMDQMHarvester::nBitWarnOH_ = 5
protected

Definition at line 129 of file GEMDQMHarvester.cc.

◆ nBitWarnVFAT_

const Int_t GEMDQMHarvester::nBitWarnVFAT_ = 7
protected

Definition at line 127 of file GEMDQMHarvester.cc.

◆ nCodeError_

const Int_t GEMDQMHarvester::nCodeError_ = 2
protected

Definition at line 123 of file GEMDQMHarvester.cc.

◆ nCodeFine_

const Int_t GEMDQMHarvester::nCodeFine_ = 1
protected

Definition at line 122 of file GEMDQMHarvester.cc.

◆ nCodeLowError_

const Int_t GEMDQMHarvester::nCodeLowError_ = 4
protected

Definition at line 125 of file GEMDQMHarvester.cc.

◆ nCodeWarning_

const Int_t GEMDQMHarvester::nCodeWarning_ = 3
protected

Definition at line 124 of file GEMDQMHarvester.cc.

◆ nMaxLumi_

const Int_t GEMDQMHarvester::nMaxLumi_ = 6000
protected

Definition at line 138 of file GEMDQMHarvester.cc.

◆ nNumVFATs_

const Int_t GEMDQMHarvester::nNumVFATs_ = 24
protected

Definition at line 136 of file GEMDQMHarvester.cc.

◆ nResolutionLumi_

Int_t GEMDQMHarvester::nResolutionLumi_
protected

Definition at line 140 of file GEMDQMHarvester.cc.

◆ strDirRecHit_

const std::string GEMDQMHarvester::strDirRecHit_ = "GEM/RecHits"
protected

Definition at line 119 of file GEMDQMHarvester.cc.

◆ strDirStatus_

const std::string GEMDQMHarvester::strDirStatus_ = "GEM/DAQStatus"
protected

Definition at line 120 of file GEMDQMHarvester.cc.

◆ strDirSummary_

const std::string GEMDQMHarvester::strDirSummary_ = "GEM/EventInfo"
protected

Definition at line 118 of file GEMDQMHarvester.cc.