CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 createLumiFuncHist (edm::Service< DQMStore > &store, std::string strSuffix, Int_t nIdxLayer, Int_t nLumiCurr)
 
void createSummaryHist (edm::Service< DQMStore > &store, MonitorElement *h2Src, MonitorElement *&h2Sum, std::vector< std::string > &listLayers, std::map< std::string, int > &mapIdxLayer, std::map< int, int > &mapNumChPerChamber)
 
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)
 
Float_t refineSummaryHistogram (std::string strName, MonitorElement *h2Sum, MonitorElement *h2SrcOcc, 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, int > mapNumChPerChamber_
 
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 24 of file GEMDQMHarvester.cc.

Member Typedef Documentation

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

Definition at line 30 of file GEMDQMHarvester.cc.

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

Definition at line 31 of file GEMDQMHarvester.cc.

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

Definition at line 148 of file GEMDQMHarvester.cc.

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

Definition at line 147 of file GEMDQMHarvester.cc.

Constructor & Destructor Documentation

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

Definition at line 162 of file GEMDQMHarvester.cc.

References edm::ParameterSet::getParameter().

162  {
163  fCutErr_ = cfg.getParameter<double>("cutErr");
164  fCutLowErr_ = cfg.getParameter<double>("cutLowErr");
165  fCutWarn_ = cfg.getParameter<double>("cutWarn");
166  nResolutionLumi_ = cfg.getParameter<int>("resolutionLumi");
167  bIsStatusChambersInit_ = false;
168 }
Bool_t bIsStatusChambersInit_
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
GEMDQMHarvester::~GEMDQMHarvester ( )
inlineoverride

Definition at line 27 of file GEMDQMHarvester.cc.

27 {};

Member Function Documentation

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 345 of file GEMDQMHarvester.cc.

346  {
347  if (fNumErr > fCutErr_ * fAll) // The error status criterion
348  return nCodeError_;
349  else if (fNumErr > fCutLowErr_ * fAll) // The low-error status criterion
350  return nCodeLowError_;
351  else if (fNumWarn > fCutWarn_ * fAll) // The warning status criterion
352  return nCodeWarning_;
353  else if (fNumOcc > 0)
354  return nCodeFine_;
355 
356  return 0;
357 }
const Int_t nCodeWarning_
const Int_t nCodeError_
const Int_t nCodeLowError_
const Int_t nCodeFine_
void GEMDQMHarvester::copyLabels ( MonitorElement h2Src,
MonitorElement h2Dst 
)
protected

Definition at line 286 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, dqm::impl::MonitorElement::setBinLabel(), dqm::impl::MonitorElement::setTitle(), dqm::impl::MonitorElement::setXTitle(), and dqm::impl::MonitorElement::setYTitle().

286  {
287  Int_t nBinX = h2Src->getNbinsX(), nBinY = h2Src->getNbinsY();
288 
289  for (Int_t i = 1; i <= nBinX; i++) {
290  h2Dst->setBinLabel(i, h2Src->getTH2F()->GetXaxis()->GetBinLabel(i), 1);
291  }
292  for (Int_t i = 1; i <= nBinY; i++) {
293  h2Dst->setBinLabel(i, h2Src->getTH2F()->GetYaxis()->GetBinLabel(i), 2);
294  }
295  h2Dst->setTitle(h2Src->getTitle());
296  h2Dst->setXTitle(h2Src->getAxisTitle(1));
297  h2Dst->setYTitle(h2Src->getAxisTitle(2));
298 }
virtual std::string getTitle() const
get MonitorElement title
virtual void setTitle(const std::string &title)
set (ie. change) histogram/profile title
virtual TH2F * getTH2F() const
virtual int getNbinsY() const
get # of bins in Y-axis
virtual std::string getAxisTitle(int axis=1) const
get x-, y- or z-axis title (axis=1, 2, 3 respectively)
virtual void setXTitle(std::string const &title)
virtual int getNbinsX() const
get # of bins in X-axis
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 void setYTitle(std::string const &title)
void GEMDQMHarvester::createLumiFuncHist ( edm::Service< DQMStore > &  store,
std::string  strSuffix,
Int_t  nIdxLayer,
Int_t  nLumiCurr 
)
protected

Definition at line 513 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().

516  {
517  auto &nNumCh = mapNumChPerChamber_[nIdxLayer];
518 
519  MonitorElement *h2Summary;
520 
521  //Int_t nLumiCurrLowRes = ( ( nLumiCurr - 1 ) / nResolutionLumi_ ) * nResolutionLumi_;
522  Int_t nNumBinLumi = ((nLumiCurr - 1) / nResolutionLumi_) + 1;
523  Int_t nMaxBin = 0;
524 
525  // Creating or Summoning the corresponding histogram
526  if (mapHistLumiFunc_.find(nIdxLayer) == mapHistLumiFunc_.end()) {
528  h2Summary = store->book2S("chamberStatus_inLumi" + strSuffix,
529  "Chamber status on lumi-block " + strSuffix.substr(1),
531  1.0,
532  (Float_t)(nMaxLumi_ + 1),
533  //nNumBinLumi, 1.0, (Float_t)( nLumiCurr + 1 ),
534  nNumCh,
535  0.5,
536  nNumCh + 0.5);
537  mapHistLumiFunc_[nIdxLayer] = h2Summary;
538 
539  h2Summary->setXTitle("Luminosity block");
540  h2Summary->setYTitle("Chamber");
541  for (Int_t i = 1; i <= nNumCh; i++) {
542  h2Summary->setBinLabel(i, Form("%i", i), 2);
543  }
544  } else {
545  h2Summary = mapHistLumiFunc_[nIdxLayer];
546  }
547 
548  for (Int_t nIdxCh = 1; nIdxCh <= nNumCh; nIdxCh++) {
549  auto &listStatus = mapStatusChambersSummary_[{nIdxLayer, nIdxCh}];
550 
551  Int_t nIdxStatus = 0;
552  for (Int_t nIdxLumi = 0; nIdxLumi < nNumBinLumi; nIdxLumi++) {
553  // Lumis covered by these values (nLumiStart <=, <= nLumiEnd) are counted for the current bin
554  Int_t nLumiStart = 1 + nIdxLumi * nResolutionLumi_;
555  Int_t nLumiEnd = (1 + nIdxLumi) * nResolutionLumi_;
556  if (nLumiEnd > nLumiCurr)
557  nLumiEnd = nLumiCurr;
558 
559  Int_t nStatusSum = 0;
560  while (true) { // No worries, nIdxStatus must increase and reach at listStatus.size()
561  // True: It was too past so that
562  // the lumi range of listStatus[ nIdxStatus ] is out of the coverage of the current bin
563  if (listStatus[nIdxStatus].nLumiEnd < nLumiStart) {
564  nIdxStatus++;
565  if (nIdxStatus >= (int)listStatus.size()) {
566  break; // For safety
567  }
568  continue;
569  }
570 
571  nStatusSum = listStatus[nIdxStatus].nStatus;
572 
573  // True: This is the last item of listStatus which is covered by the current bin
574  if (nIdxStatus + 1 >= (int)listStatus.size() || listStatus[nIdxStatus].nLumiEnd >= nLumiEnd) {
575  break;
576  }
577 
578  nIdxStatus++;
579  if (nIdxStatus >= (int)listStatus.size()) {
580  break; // For safety
581  }
582  }
583 
584  h2Summary->setBinContent(nIdxLumi + 1, nIdxCh, nStatusSum);
585  if (nMaxBin < nIdxLumi + 1)
586  nMaxBin = nIdxLumi + 1;
587  }
588  }
589 
590  for (Int_t nX = 1; nX <= nMaxBin; nX++) {
591  h2Summary->setBinContent(nX, 0, 1);
592  }
593 }
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:219
const std::string strDirSummary_
void setCurrentFolder(std::string const &fullpath) override
Definition: DQMStore.h:569
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_
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_
void GEMDQMHarvester::createSummaryHist ( edm::Service< DQMStore > &  store,
MonitorElement h2Src,
MonitorElement *&  h2Sum,
std::vector< std::string > &  listLayers,
std::map< std::string, int > &  mapIdxLayer,
std::map< int, int > &  mapNumChPerChamber 
)
protected

Definition at line 300 of file GEMDQMHarvester.cc.

References dqm::implementation::IBooker::book2D(), dqm::impl::MonitorElement::getBinContent(), dqm::impl::MonitorElement::getNbinsX(), dqm::impl::MonitorElement::getNbinsY(), dqm::legacy::MonitorElement::getTH2F(), mps_fire::i, dqm::impl::MonitorElement::setBinLabel(), dqm::impl::MonitorElement::setTitle(), dqm::impl::MonitorElement::setXTitle(), dqm::impl::MonitorElement::setYTitle(), and AlCaHLTBitMon_QueryRunRegistry::string.

305  {
306  //store->setCurrentFolder(strDirSummary_);
307 
308  Int_t nBinX = h2Src->getNbinsX(), nBinY = h2Src->getNbinsY();
309  h2Sum = store->book2D("reportSummaryMap", "", nBinX, 0.5, nBinX + 0.5, nBinY, 0.5, nBinY + 0.5);
310  h2Sum->setTitle("Summary plot");
311  h2Sum->setXTitle("Chamber");
312  h2Sum->setYTitle("Layer");
313 
314  listLayers.clear();
315  mapIdxLayer.clear();
316  mapNumChPerChamber.clear();
317 
318  for (Int_t i = 1; i <= nBinX; i++)
319  h2Sum->setBinLabel(i, h2Src->getTH2F()->GetXaxis()->GetBinLabel(i), 1);
320  for (Int_t i = 1; i <= nBinY; i++) {
321  std::string strLabelFull = h2Src->getTH2F()->GetYaxis()->GetBinLabel(i);
322  Int_t nBinXActual = (Int_t)(h2Src->getBinContent(0, i) + 0.5);
323  auto nPos = strLabelFull.find(';');
324  auto strLabel = strLabelFull.substr(0, nPos);
325  auto strLayer = strLabelFull.substr(nPos + 1);
326  listLayers.push_back(strLabelFull.substr(nPos + 1));
327  h2Sum->setBinLabel(i, strLabel, 2);
328  mapIdxLayer[strLayer] = i;
329  mapNumChPerChamber[i] = nBinXActual;
330  }
331 }
virtual void setTitle(const std::string &title)
set (ie. change) histogram/profile title
virtual TH2F * getTH2F() const
virtual int getNbinsY() const
get # of bins in Y-axis
virtual void setXTitle(std::string const &title)
virtual int getNbinsX() const
get # of bins in X-axis
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 double getBinContent(int binx) const
get content of bin (1-D)
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:177
void GEMDQMHarvester::createSummaryVFAT ( edm::Service< DQMStore > &  store,
MonitorElement h2Src,
std::string  strSuffix,
MonitorElement *&  h2Sum 
)
protected

Definition at line 333 of file GEMDQMHarvester.cc.

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

336  {
337  //store->setCurrentFolder(strDirStatus_);
338  //store->setCurrentFolder(strDirSummary_);
339 
340  Int_t nBinX = h2Src->getNbinsX(), nBinY = h2Src->getNbinsY();
341  h2Sum = store->book2D("vfat_statusSummary" + strSuffix, "", nBinX, 0.5, nBinX + 0.5, nBinY, -0.5, nBinY - 0.5);
342  copyLabels(h2Src, h2Sum);
343 }
virtual int getNbinsY() const
get # of bins in Y-axis
void copyLabels(MonitorElement *h2Src, MonitorElement *h2Dst)
virtual int getNbinsX() const
get # of bins in X-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:177
void GEMDQMHarvester::createTableWatchingSummary ( )
protected

Definition at line 268 of file GEMDQMHarvester.cc.

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

268  {
270  return;
271 
272  for (const auto &[nIdxLayer, nNumCh] : mapNumChPerChamber_) {
273  for (Int_t i = 1; i <= nNumCh; i++) {
274  mapStatusChambersSummary_[{nIdxLayer, i}] = std::vector<StatusInfo>();
275  mapNumStatusChambersSummary_[{nIdxLayer, i}] = NumStatus();
276  for (Int_t j = 1; j <= nNumVFATs_; j++) {
277  mapStatusVFATsSummary_[{nIdxLayer, i, j}] = std::vector<StatusInfo>();
278  mapNumStatusVFATsSummary_[{nIdxLayer, i, j}] = NumStatus();
279  }
280  }
281  }
282 
283  bIsStatusChambersInit_ = true;
284 }
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_
void GEMDQMHarvester::dqmEndJob ( DQMStore::IBooker ,
DQMStore::IGetter  
)
inlineoverrideprotected

Definition at line 74 of file GEMDQMHarvester.cc.

74 {}; // Cannot use; it is called after dqmSaver
void GEMDQMHarvester::dqmEndLuminosityBlock ( DQMStore::IBooker ,
DQMStore::IGetter ,
edm::LuminosityBlock const &  iLumi,
edm::EventSetup const &   
)
overrideprotected

Definition at line 179 of file GEMDQMHarvester.cc.

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

182  {
184  Int_t nLumiCurr = iLumi.id().luminosityBlock();
185  drawSummaryHistogram(store, nLumiCurr);
186 }
void drawSummaryHistogram(edm::Service< DQMStore > &store, Int_t nLumiCurr)
void GEMDQMHarvester::drawSummaryHistogram ( edm::Service< DQMStore > &  store,
Int_t  nLumiCurr 
)
protected

Definition at line 188 of file GEMDQMHarvester.cc.

References dqm::implementation::IBooker::bookFloat(), dqm::impl::MonitorElement::Fill(), dqm::implementation::IGetter::get(), dqm::impl::MonitorElement::getAxisTitle(), dqm::impl::MonitorElement::getTitle(), dqm::implementation::DQMStore::setCurrentFolder(), dqm::impl::MonitorElement::setTitle(), dqm::impl::MonitorElement::setXTitle(), dqm::impl::MonitorElement::setYTitle(), and AlCaHLTBitMon_QueryRunRegistry::string.

188  {
189  Float_t fReportSummary = -1.0;
190 
191  std::string strSrcDigiOcc = "GEM/Digis/summaryOccDigi";
192  std::string strSrcStatusA = "GEM/DAQStatus/chamberAllStatus";
193  std::string strSrcStatusE = "GEM/DAQStatus/chamberErrors";
194  std::string strSrcStatusW = "GEM/DAQStatus/chamberWarnings";
195  std::string strSrcStatusEVFAT = "GEM/DAQStatus/chamberVFATErrors";
196  std::string strSrcStatusWVFAT = "GEM/DAQStatus/chamberVFATWarnings";
197  std::string strSrcStatusEOH = "GEM/DAQStatus/chamberOHErrors";
198  std::string strSrcStatusWOH = "GEM/DAQStatus/chamberOHWarnings";
199  std::string strSrcStatusEAMC = "GEM/DAQStatus/chamberAMCErrors";
200  std::string strSrcStatusWAMC = "GEM/DAQStatus/chamberAMCWarnings";
201  std::string strSrcStatusEAMC13 = "GEM/DAQStatus/chamberAMC13Errors";
202 
203  std::string strSrcVFATOcc = "GEM/Digis/det";
204  std::string strSrcVFATStatusW = "GEM/DAQStatus/vfat_statusWarnSum";
205  std::string strSrcVFATStatusE = "GEM/DAQStatus/vfat_statusErrSum";
206 
208 
209  MonitorElement *h2SrcDigiOcc = store->get(strSrcDigiOcc);
210  MonitorElement *h2SrcStatusA = store->get(strSrcStatusA);
211  MonitorElement *h2SrcStatusE = store->get(strSrcStatusE);
212  MonitorElement *h2SrcStatusW = store->get(strSrcStatusW);
213  MonitorElement *h2SrcStatusEVFAT = store->get(strSrcStatusEVFAT);
214  MonitorElement *h2SrcStatusWVFAT = store->get(strSrcStatusWVFAT);
215  MonitorElement *h2SrcStatusEOH = store->get(strSrcStatusEOH);
216  MonitorElement *h2SrcStatusWOH = store->get(strSrcStatusWOH);
217  MonitorElement *h2SrcStatusEAMC = store->get(strSrcStatusEAMC);
218  MonitorElement *h2SrcStatusWAMC = store->get(strSrcStatusWAMC);
219  MonitorElement *h2SrcStatusEAMC13 = store->get(strSrcStatusEAMC13);
220 
221  std::string strTitleSummary = "summary";
222 
223  if (h2SrcDigiOcc != nullptr && h2SrcStatusA != nullptr && h2SrcStatusE != nullptr && h2SrcStatusW != nullptr &&
224  h2SrcStatusEVFAT != nullptr && h2SrcStatusWVFAT != nullptr && h2SrcStatusEOH != nullptr &&
225  h2SrcStatusWOH != nullptr && h2SrcStatusEAMC != nullptr && h2SrcStatusWAMC != nullptr &&
226  h2SrcStatusEAMC13 != nullptr) {
227  MonitorElement *h2Sum = nullptr;
228  createSummaryHist(store, h2SrcStatusEOH, h2Sum, listLayer_, mapIdxLayer_, mapNumChPerChamber_);
230  fReportSummary = refineSummaryHistogram(strTitleSummary,
231  h2Sum,
232  h2SrcDigiOcc,
233  h2SrcStatusA,
234  h2SrcStatusE,
235  h2SrcStatusW,
236  h2SrcStatusEVFAT,
237  h2SrcStatusWVFAT,
238  h2SrcStatusEOH,
239  h2SrcStatusWOH,
240  h2SrcStatusEAMC,
241  h2SrcStatusWAMC,
242  h2SrcStatusEAMC13,
243  nLumiCurr);
244 
245  for (const auto &strSuffix : listLayer_) {
246  auto nIdxLayer = mapIdxLayer_[strSuffix];
247  MonitorElement *h2SrcVFATOcc = store->get(strSrcVFATOcc + strSuffix);
248  MonitorElement *h2SrcVFATStatusW = store->get(strSrcVFATStatusW + strSuffix);
249  MonitorElement *h2SrcVFATStatusE = store->get(strSrcVFATStatusE + strSuffix);
250  if (h2SrcVFATOcc == nullptr || h2SrcVFATStatusW == nullptr || h2SrcVFATStatusE == nullptr)
251  continue;
252 
253  MonitorElement *h2SumVFAT = nullptr;
254  createSummaryVFAT(store, h2SrcVFATStatusE, strSuffix, h2SumVFAT);
255  refineSummaryVFAT(strSuffix, h2SumVFAT, h2SrcVFATOcc, h2SrcVFATStatusE, h2SrcVFATStatusW, nLumiCurr, nIdxLayer);
256  TString strNewTitle = h2SrcVFATStatusE->getTitle();
257  h2SumVFAT->setTitle((const char *)strNewTitle.ReplaceAll("errors", "errors/warnings"));
258  h2SumVFAT->setXTitle(h2SrcVFATStatusE->getAxisTitle(1));
259  h2SumVFAT->setYTitle(h2SrcVFATStatusE->getAxisTitle(2));
260 
261  createLumiFuncHist(store, strSuffix, nIdxLayer, nLumiCurr);
262  }
263  }
264 
265  store->bookFloat("reportSummary")->Fill(fReportSummary);
266 }
virtual std::string getTitle() const
get MonitorElement title
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)
const std::string strDirSummary_
void setCurrentFolder(std::string const &fullpath) override
Definition: DQMStore.h:569
virtual std::string getAxisTitle(int axis=1) const
get x-, y- or z-axis title (axis=1, 2, 3 respectively)
void createTableWatchingSummary()
std::vector< std::string > listLayer_
void Fill(long long x)
virtual void setXTitle(std::string const &title)
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:673
void createSummaryHist(edm::Service< DQMStore > &store, MonitorElement *h2Src, MonitorElement *&h2Sum, std::vector< std::string > &listLayers, std::map< std::string, int > &mapIdxLayer, std::map< int, int > &mapNumChPerChamber)
virtual void setYTitle(std::string const &title)
Int_t refineSummaryVFAT(std::string strName, MonitorElement *h2Sum, MonitorElement *h2SrcOcc, MonitorElement *h2SrcStatusE, MonitorElement *h2SrcStatusW, Int_t nLumiCurr, Int_t nIdxLayer)
Float_t refineSummaryHistogram(std::string strName, MonitorElement *h2Sum, MonitorElement *h2SrcOcc, MonitorElement *h2SrcStatusA, MonitorElement *h2SrcStatusE, MonitorElement *h2SrcStatusW, MonitorElement *h2SrcStatusEVFAT, MonitorElement *h2SrcStatusWVFAT, MonitorElement *h2SrcStatusEOH, MonitorElement *h2SrcStatusWOH, MonitorElement *h2SrcStatusEAMC, MonitorElement *h2SrcStatusWAMC, MonitorElement *h2SrcStatusEAMC13, Int_t nLumiCurr)
std::map< int, int > mapNumChPerChamber_
void createLumiFuncHist(edm::Service< DQMStore > &store, std::string strSuffix, Int_t nIdxLayer, Int_t nLumiCurr)
void GEMDQMHarvester::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 170 of file GEMDQMHarvester.cc.

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

170  {
172  desc.add<double>("cutErr", 0.05);
173  desc.add<double>("cutLowErr", 0.00);
174  desc.add<double>("cutWarn", 0.05);
175  desc.add<int>("resolutionLumi", 1);
176  descriptions.add("GEMDQMHarvester", desc);
177 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Float_t GEMDQMHarvester::refineSummaryHistogram ( std::string  strName,
MonitorElement h2Sum,
MonitorElement h2SrcOcc,
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 360 of file GEMDQMHarvester.cc.

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

373  {
374  Int_t nBinY = h2Sum->getNbinsY();
375  Int_t nAllBin = 0, nFineBin = 0;
376  for (Int_t j = 1; j <= nBinY; j++) {
377  Int_t nBinX = (Int_t)(h2SrcOcc->getBinContent(0, j) + 0.5);
378  h2Sum->setBinContent(0, j, nBinX);
379  for (Int_t i = 1; i <= nBinX; i++) {
380  Float_t fOcc = h2SrcOcc->getBinContent(i, j);
381  Float_t fStatusAll = h2SrcStatusA->getBinContent(i, j);
382  Float_t fStatusErr = h2SrcStatusE->getBinContent(i, j);
383  Float_t fStatusWarn = h2SrcStatusW->getBinContent(i, j);
384  Float_t fStatusErrVFAT = h2SrcStatusEVFAT->getBinContent(i, j);
385  Float_t fStatusWarnVFAT = h2SrcStatusWVFAT->getBinContent(i, j);
386  Float_t fStatusErrOH = h2SrcStatusEOH->getBinContent(i, j);
387  Float_t fStatusWarnOH = h2SrcStatusWOH->getBinContent(i, j);
388  Float_t fStatusErrAMC = h2SrcStatusEAMC->getBinContent(i, j);
389  Float_t fStatusWarnAMC = h2SrcStatusWAMC->getBinContent(i, j);
390  Float_t fStatusErrAMC13 = h2SrcStatusEAMC13->getBinContent(i, j);
391  NumStatus numStatus(fStatusAll,
392  fOcc,
393  fStatusErrVFAT,
394  fStatusWarnVFAT,
395  fStatusErrOH,
396  fStatusWarnOH,
397  fStatusErrAMC,
398  fStatusWarnAMC,
399  fStatusErrAMC13);
400  UpdateStatusChamber(j, i, nLumiCurr, numStatus);
401 
402  Int_t nRes = assessOneBin(strName, i, j, fStatusAll, fOcc, fStatusErr, fStatusWarn);
403  if (nRes == 1)
404  nFineBin++;
405 
406  h2Sum->setBinContent(i, j, (Float_t)nRes);
407  nAllBin++;
408  }
409  }
410 
411  return ((Float_t)nFineBin) / nAllBin;
412 }
virtual int getNbinsY() const
get # of bins in Y-axis
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 double getBinContent(int binx) const
get content of bin (1-D)
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)
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 414 of file GEMDQMHarvester.cc.

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

420  {
421  Int_t nBinY = h2Sum->getNbinsY();
422  for (Int_t j = 1; j <= nBinY; j++) {
423  Int_t nBinX = h2Sum->getNbinsX();
424  for (Int_t i = 1; i <= nBinX; i++) {
425  Float_t fOcc = h2SrcOcc->getBinContent(i, j);
426  Float_t fStatusErr = h2SrcStatusE->getBinContent(i, j);
427  Float_t fStatusWarn = h2SrcStatusW->getBinContent(i, j);
428  Float_t fStatusAll = fOcc + fStatusErr + fStatusWarn;
429  NumStatus numStatus(fStatusAll, fOcc, fStatusErr, fStatusWarn, 0, 0, 0, 0, 0);
430  UpdateStatusChamber(nIdxLayer, i, j, nLumiCurr, numStatus);
431 
432  Int_t nRes = assessOneBin(strName, i, j, fStatusAll, fOcc, fStatusErr, fStatusWarn);
433  h2Sum->setBinContent(i, j, (Float_t)nRes);
434  }
435  }
436 
437  return 0;
438 }
virtual int getNbinsY() const
get # of bins in Y-axis
virtual int getNbinsX() const
get # of bins in X-axis
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 double getBinContent(int binx) const
get content of bin (1-D)
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)
Int_t GEMDQMHarvester::UpdateStatusChamber ( Int_t  nIdxLayer,
Int_t  nIdxCh,
Int_t  nLumiCurr,
NumStatus  numStatus 
)
protected

Definition at line 440 of file GEMDQMHarvester.cc.

440  {
442  return 0;
443  if (0 >= nIdxCh || nIdxCh > mapNumChPerChamber_[nIdxLayer])
444  return 0;
445  auto &listStatus = mapStatusChambersSummary_[{nIdxLayer, nIdxCh}];
446  auto &numStatusPrev = mapNumStatusChambersSummary_[{nIdxLayer, nIdxCh}];
447  return UpdateStatusChamber(listStatus, numStatusPrev, nLumiCurr, numStatus);
448 }
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_
Int_t GEMDQMHarvester::UpdateStatusChamber ( Int_t  nIdxLayer,
Int_t  nIdxCh,
Int_t  nIdxVFAT,
Int_t  nLumiCurr,
NumStatus  numStatus 
)
protected

Definition at line 450 of file GEMDQMHarvester.cc.

451  {
453  return 0;
454  if (0 >= nIdxCh || nIdxCh > mapNumChPerChamber_[nIdxLayer])
455  return 0;
456  if (0 >= nIdxVFAT || nIdxVFAT > nNumVFATs_)
457  return 0;
458  auto &listStatus = mapStatusVFATsSummary_[{nIdxLayer, nIdxCh, nIdxVFAT}];
459  auto &numStatusPrev = mapNumStatusVFATsSummary_[{nIdxLayer, nIdxCh, nIdxVFAT}];
460  return UpdateStatusChamber(listStatus, numStatusPrev, nLumiCurr, numStatus);
461 }
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_
Int_t GEMDQMHarvester::UpdateStatusChamber ( std::vector< StatusInfo > &  listStatus,
NumStatus numStatus,
Int_t  nLumiCurr,
NumStatus  numStatusNew 
)
protected

Definition at line 463 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.

466  {
467  // First of all, the current lumi section will be assessed, of which the result will be stored in nStatus
468  Int_t nStatus = 0;
469 
470  Float_t fNumAddErrVFAT = numStatusNew.fNumErrVFAT_ - numStatus.fNumErrVFAT_;
471  Float_t fNumAddWarnVFAT = numStatusNew.fNumWarnVFAT_ - numStatus.fNumWarnVFAT_;
472  Float_t fNumAddErrOH = numStatusNew.fNumErrOH_ - numStatus.fNumErrOH_;
473  Float_t fNumAddWarnOH = numStatusNew.fNumWarnOH_ - numStatus.fNumWarnOH_;
474  Float_t fNumAddErrAMC = numStatusNew.fNumErrAMC_ - numStatus.fNumErrAMC_;
475  Float_t fNumAddWarnAMC = numStatusNew.fNumWarnAMC_ - numStatus.fNumWarnAMC_;
476  Float_t fNumAddErrAMC13 = numStatusNew.fNumErrAMC13_ - numStatus.fNumErrAMC13_;
477 
478  numStatus.fNumTotal_ = numStatusNew.fNumTotal_;
479  numStatus.fNumOcc_ = numStatusNew.fNumOcc_;
480  numStatus.fNumErrVFAT_ = numStatusNew.fNumErrVFAT_;
481  numStatus.fNumWarnVFAT_ = numStatusNew.fNumWarnVFAT_;
482  numStatus.fNumErrOH_ = numStatusNew.fNumErrOH_;
483  numStatus.fNumWarnOH_ = numStatusNew.fNumWarnOH_;
484  numStatus.fNumErrAMC_ = numStatusNew.fNumErrAMC_;
485  numStatus.fNumWarnAMC_ = numStatusNew.fNumWarnAMC_;
486  numStatus.fNumErrAMC13_ = numStatusNew.fNumErrAMC13_;
487 
488  nStatus = (numStatusNew.fNumOcc_ > 0 ? 1 << nBitOcc_ : 0) | (fNumAddErrAMC13 > 0 ? 1 << nBitErrAMC13_ : 0) |
489  (fNumAddErrAMC > 0 ? 1 << nBitErrAMC_ : 0) | (fNumAddWarnAMC > 0 ? 1 << nBitWarnAMC_ : 0) |
490  (fNumAddErrOH > 0 ? 1 << nBitErrOH_ : 0) | (fNumAddWarnOH > 0 ? 1 << nBitWarnOH_ : 0) |
491  (fNumAddErrVFAT > 0 ? 1 << nBitErrVFAT_ : 0) | (fNumAddWarnVFAT > 0 ? 1 << nBitWarnVFAT_ : 0);
492 
493  // Only used in the next if statement; See statusLast
494  StatusInfo statusNew;
495  statusNew.nLumiStart = nLumiCurr;
496  statusNew.nLumiEnd = nLumiCurr;
497  statusNew.nStatus = nStatus;
498 
499  if (listStatus.empty()) {
500  listStatus.push_back(statusNew);
501  } else {
502  auto &statusLastPre = listStatus.back();
503  if (statusLastPre.nStatus == nStatus) {
504  statusLastPre.nLumiEnd = nLumiCurr;
505  } else {
506  listStatus.push_back(statusNew);
507  }
508  }
509 
510  return 0;
511 }
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

Bool_t GEMDQMHarvester::bIsStatusChambersInit_
protected

Definition at line 159 of file GEMDQMHarvester.cc.

Float_t GEMDQMHarvester::fCutErr_
protected

Definition at line 121 of file GEMDQMHarvester.cc.

Float_t GEMDQMHarvester::fCutLowErr_
protected

Definition at line 121 of file GEMDQMHarvester.cc.

Float_t GEMDQMHarvester::fCutWarn_
protected

Definition at line 121 of file GEMDQMHarvester.cc.

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

Definition at line 155 of file GEMDQMHarvester.cc.

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

Definition at line 158 of file GEMDQMHarvester.cc.

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

Definition at line 156 of file GEMDQMHarvester.cc.

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

Definition at line 157 of file GEMDQMHarvester.cc.

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

Definition at line 152 of file GEMDQMHarvester.cc.

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

Definition at line 153 of file GEMDQMHarvester.cc.

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

Definition at line 150 of file GEMDQMHarvester.cc.

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

Definition at line 151 of file GEMDQMHarvester.cc.

const Int_t GEMDQMHarvester::nBitErrAMC13_ = 1
protected

Definition at line 138 of file GEMDQMHarvester.cc.

const Int_t GEMDQMHarvester::nBitErrAMC_ = 2
protected

Definition at line 137 of file GEMDQMHarvester.cc.

const Int_t GEMDQMHarvester::nBitErrOH_ = 4
protected

Definition at line 135 of file GEMDQMHarvester.cc.

const Int_t GEMDQMHarvester::nBitErrVFAT_ = 6
protected

Definition at line 133 of file GEMDQMHarvester.cc.

const Int_t GEMDQMHarvester::nBitOcc_ = 0
protected

Definition at line 139 of file GEMDQMHarvester.cc.

const Int_t GEMDQMHarvester::nBitWarnAMC_ = 3
protected

Definition at line 136 of file GEMDQMHarvester.cc.

const Int_t GEMDQMHarvester::nBitWarnOH_ = 5
protected

Definition at line 134 of file GEMDQMHarvester.cc.

const Int_t GEMDQMHarvester::nBitWarnVFAT_ = 7
protected

Definition at line 132 of file GEMDQMHarvester.cc.

const Int_t GEMDQMHarvester::nCodeError_ = 2
protected

Definition at line 128 of file GEMDQMHarvester.cc.

const Int_t GEMDQMHarvester::nCodeFine_ = 1
protected

Definition at line 127 of file GEMDQMHarvester.cc.

const Int_t GEMDQMHarvester::nCodeLowError_ = 4
protected

Definition at line 130 of file GEMDQMHarvester.cc.

const Int_t GEMDQMHarvester::nCodeWarning_ = 3
protected

Definition at line 129 of file GEMDQMHarvester.cc.

const Int_t GEMDQMHarvester::nMaxLumi_ = 6000
protected

Definition at line 143 of file GEMDQMHarvester.cc.

const Int_t GEMDQMHarvester::nNumVFATs_ = 24
protected

Definition at line 141 of file GEMDQMHarvester.cc.

Int_t GEMDQMHarvester::nResolutionLumi_
protected

Definition at line 145 of file GEMDQMHarvester.cc.

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

Definition at line 124 of file GEMDQMHarvester.cc.

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

Definition at line 125 of file GEMDQMHarvester.cc.

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

Definition at line 123 of file GEMDQMHarvester.cc.