CMS 3D CMS Logo

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

Public Member Functions

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

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Protected Member Functions

Int_t assessOneBin (Float_t fAll, Float_t fNumOcc, Float_t fNumWarn, Float_t fNumErr)
 
void copyLabels (MonitorElement *h2Src, MonitorElement *h2Dst)
 
void createSummaryHist (edm::Service< DQMStore > &store, MonitorElement *h2Src, MonitorElement *&h2Sum, std::vector< std::string > &listLayers)
 
void createSummaryVFAT (edm::Service< DQMStore > &store, MonitorElement *h2Src, std::string strSuffix, MonitorElement *&h2Sum)
 
void dqmEndJob (DQMStore::IBooker &, DQMStore::IGetter &) override
 
void dqmEndLuminosityBlock (DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &) override
 
void drawSummaryHistogram (edm::Service< DQMStore > &store)
 
Float_t refineSummaryHistogram (MonitorElement *h2Sum, MonitorElement *h2SrcOcc, MonitorElement *h2SrcAllNum, MonitorElement *h2SrcStatusE, MonitorElement *h2SrcStatusW)
 
Int_t refineSummaryVFAT (MonitorElement *h2Sum, MonitorElement *h2SrcOcc, MonitorElement *h2SrcStatusE, MonitorElement *h2SrcStatusW)
 

Protected Attributes

Float_t fReportSummary_
 
std::vector< std::string > listLayer_
 
std::string strDirRecHit_
 
std::string strDirStatus_
 
std::string strDirSummary_
 
std::string strOutFile_
 

Detailed Description

Definition at line 24 of file GEMDQMHarvester.cc.

Constructor & Destructor Documentation

◆ GEMDQMHarvester()

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

Definition at line 68 of file GEMDQMHarvester.cc.

68  {
69  fReportSummary_ = -1.0;
70  strOutFile_ = cfg.getParameter<std::string>("fromFile");
71  strDirSummary_ = "GEM/EventInfo";
72  strDirRecHit_ = "GEM/RecHits";
73  strDirStatus_ = "GEM/DAQStatus";
74 }

References looper::cfg, and AlCaHLTBitMon_QueryRunRegistry::string.

◆ ~GEMDQMHarvester()

GEMDQMHarvester::~GEMDQMHarvester ( )
inlineoverride

Definition at line 27 of file GEMDQMHarvester.cc.

27 {};

Member Function Documentation

◆ assessOneBin()

Int_t GEMDQMHarvester::assessOneBin ( Float_t  fAll,
Float_t  fNumOcc,
Float_t  fNumWarn,
Float_t  fNumErr 
)
protected

Definition at line 181 of file GEMDQMHarvester.cc.

181  {
182  if (fNumErr > 0.05 * fAll) // The error status criterion
183  return 2;
184  else if (fNumErr > 0.00 * fAll || fNumWarn > 0.05 * fAll) // The warning status criterion
185  return 3;
186  else if (fNumOcc > 0)
187  return 1;
188 
189  return 0;
190 }

◆ copyLabels()

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

Definition at line 131 of file GEMDQMHarvester.cc.

131  {
132  Int_t nBinX = h2Src->getNbinsX(), nBinY = h2Src->getNbinsY();
133 
134  for (Int_t i = 1; i <= nBinX; i++) {
135  h2Dst->setBinLabel(i, h2Src->getTH2F()->GetXaxis()->GetBinLabel(i), 1);
136  }
137  for (Int_t i = 1; i <= nBinY; i++) {
138  h2Dst->setBinLabel(i, h2Src->getTH2F()->GetYaxis()->GetBinLabel(i), 2);
139  }
140  h2Dst->setTitle(h2Src->getTitle());
141  h2Dst->setXTitle(h2Src->getAxisTitle(1));
142  h2Dst->setYTitle(h2Src->getAxisTitle(2));
143 }

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().

◆ createSummaryHist()

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

Definition at line 145 of file GEMDQMHarvester.cc.

148  {
149  //store->setCurrentFolder(strDirSummary_);
150 
151  Int_t nBinX = h2Src->getNbinsX(), nBinY = h2Src->getNbinsY();
152  h2Sum = store->book2D("reportSummaryMap", "", nBinX, 0.5, nBinX + 0.5, nBinY, 0.5, nBinY + 0.5);
153  h2Sum->setTitle("Summary plot");
154  h2Sum->setXTitle("Chamber");
155  h2Sum->setYTitle("Layer");
156 
157  listLayers.clear();
158  for (Int_t i = 1; i <= nBinX; i++)
159  h2Sum->setBinLabel(i, h2Src->getTH2F()->GetXaxis()->GetBinLabel(i), 1);
160  for (Int_t i = 1; i <= nBinY; i++) {
161  std::string strLabelFull = h2Src->getTH2F()->GetYaxis()->GetBinLabel(i);
162  auto nPos = strLabelFull.find(';');
163  auto strLabel = strLabelFull.substr(0, nPos);
164  listLayers.push_back(strLabelFull.substr(nPos + 1));
165  h2Sum->setBinLabel(i, strLabel, 2);
166  }
167 }

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(), dqm::impl::MonitorElement::setYTitle(), and AlCaHLTBitMon_QueryRunRegistry::string.

◆ createSummaryVFAT()

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

Definition at line 169 of file GEMDQMHarvester.cc.

172  {
173  //store->setCurrentFolder(strDirStatus_);
174  //store->setCurrentFolder(strDirSummary_);
175 
176  Int_t nBinX = h2Src->getNbinsX(), nBinY = h2Src->getNbinsY();
177  h2Sum = store->book2D("vfat_statusSummary" + strSuffix, "", nBinX, 0.5, nBinX + 0.5, nBinY, -0.5, nBinY - 0.5);
178  copyLabels(h2Src, h2Sum);
179 }

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

◆ dqmEndJob()

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

Definition at line 35 of file GEMDQMHarvester.cc.

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

◆ dqmEndLuminosityBlock()

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

Definition at line 82 of file GEMDQMHarvester.cc.

85  {
87  drawSummaryHistogram(store);
88 }

◆ drawSummaryHistogram()

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

Definition at line 90 of file GEMDQMHarvester.cc.

90  {
91  std::string strSrcDigiOcc = "GEM/Digis/summaryOccDigi";
92  std::string strSrcStatusA = "GEM/DAQStatus/chamberAllStatus";
93  std::string strSrcStatusW = "GEM/DAQStatus/chamberWarnings";
94  std::string strSrcStatusE = "GEM/DAQStatus/chamberErrors";
95 
96  std::string strSrcVFATOcc = "GEM/Digis/det";
97  std::string strSrcVFATStatusW = "GEM/DAQStatus/vfat_statusWarnSum";
98  std::string strSrcVFATStatusE = "GEM/DAQStatus/vfat_statusErrSum";
99 
101 
102  MonitorElement *h2SrcDigiOcc = store->get(strSrcDigiOcc);
103  MonitorElement *h2SrcStatusA = store->get(strSrcStatusA);
104  MonitorElement *h2SrcStatusW = store->get(strSrcStatusW);
105  MonitorElement *h2SrcStatusE = store->get(strSrcStatusE);
106 
107  if (h2SrcDigiOcc != nullptr && h2SrcStatusA != nullptr && h2SrcStatusW != nullptr && h2SrcStatusE != nullptr) {
108  MonitorElement *h2Sum = nullptr;
109  createSummaryHist(store, h2SrcStatusE, h2Sum, listLayer_);
110  fReportSummary_ = refineSummaryHistogram(h2Sum, h2SrcDigiOcc, h2SrcStatusA, h2SrcStatusE, h2SrcStatusW);
111 
112  for (const auto &strSuffix : listLayer_) {
113  MonitorElement *h2SrcVFATOcc = store->get(strSrcVFATOcc + strSuffix);
114  MonitorElement *h2SrcVFATStatusW = store->get(strSrcVFATStatusW + strSuffix);
115  MonitorElement *h2SrcVFATStatusE = store->get(strSrcVFATStatusE + strSuffix);
116  if (h2SrcVFATOcc == nullptr || h2SrcVFATStatusW == nullptr || h2SrcVFATStatusE == nullptr)
117  continue;
118  MonitorElement *h2SumVFAT = nullptr;
119  createSummaryVFAT(store, h2SrcVFATStatusE, strSuffix, h2SumVFAT);
120  refineSummaryVFAT(h2SumVFAT, h2SrcVFATOcc, h2SrcVFATStatusE, h2SrcVFATStatusW);
121  TString strNewTitle = h2SrcVFATStatusE->getTitle();
122  h2SumVFAT->setTitle((const char *)strNewTitle.ReplaceAll("errors", "errors/warnings"));
123  h2SumVFAT->setXTitle(h2SrcVFATStatusE->getAxisTitle(1));
124  h2SumVFAT->setYTitle(h2SrcVFATStatusE->getAxisTitle(2));
125  }
126  }
127 
128  store->bookFloat("reportSummary")->Fill(fReportSummary_);
129 }

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.

◆ fillDescriptions()

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

Definition at line 76 of file GEMDQMHarvester.cc.

76  {
78  desc.add<std::string>("fromFile", "");
79  descriptions.add("GEMDQMHarvester", desc);
80 }

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

◆ refineSummaryHistogram()

Float_t GEMDQMHarvester::refineSummaryHistogram ( MonitorElement h2Sum,
MonitorElement h2SrcOcc,
MonitorElement h2SrcAllNum,
MonitorElement h2SrcStatusE,
MonitorElement h2SrcStatusW 
)
protected

Definition at line 193 of file GEMDQMHarvester.cc.

197  {
198  Int_t nBinY = h2Sum->getNbinsY();
199  Int_t nAllBin = 0, nFineBin = 0;
200  for (Int_t j = 1; j <= nBinY; j++) {
201  Int_t nBinX = h2Sum->getNbinsX();
202  nBinX = (Int_t)(h2SrcOcc->getBinContent(0, j) + 0.5);
203  h2Sum->setBinContent(0, j, nBinX);
204  for (Int_t i = 1; i <= nBinX; i++) {
205  Float_t fOcc = h2SrcOcc->getBinContent(i, j);
206  Float_t fStatusAll = h2SrcStatusA->getBinContent(i, j);
207  Float_t fStatusWarn = h2SrcStatusW->getBinContent(i, j);
208  Float_t fStatusErr = h2SrcStatusE->getBinContent(i, j);
209 
210  Int_t nRes = assessOneBin(fStatusAll, fOcc, fStatusWarn, fStatusErr);
211  if (nRes == 1)
212  nFineBin++;
213 
214  h2Sum->setBinContent(i, j, (Float_t)nRes);
215  nAllBin++;
216  }
217  }
218 
219  return ((Float_t)nFineBin) / nAllBin;
220 }

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().

◆ refineSummaryVFAT()

Int_t GEMDQMHarvester::refineSummaryVFAT ( MonitorElement h2Sum,
MonitorElement h2SrcOcc,
MonitorElement h2SrcStatusE,
MonitorElement h2SrcStatusW 
)
protected

Definition at line 222 of file GEMDQMHarvester.cc.

225  {
226  Int_t nBinY = h2Sum->getNbinsY();
227  for (Int_t j = 1; j <= nBinY; j++) {
228  Int_t nBinX = h2Sum->getNbinsX();
229  for (Int_t i = 1; i <= nBinX; i++) {
230  Float_t fOcc = h2SrcOcc->getBinContent(i, j);
231  Float_t fStatusWarn = h2SrcStatusW->getBinContent(i, j);
232  Float_t fStatusErr = h2SrcStatusE->getBinContent(i, j);
233  Float_t fStatusAll = fOcc + fStatusWarn + fStatusErr;
234  Int_t nRes = assessOneBin(fStatusAll, fOcc, fStatusWarn, fStatusErr);
235  h2Sum->setBinContent(i, j, (Float_t)nRes);
236  }
237  }
238 
239  return 0;
240 }

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().

Member Data Documentation

◆ fReportSummary_

Float_t GEMDQMHarvester::fReportSummary_
protected

Definition at line 58 of file GEMDQMHarvester.cc.

◆ listLayer_

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

Definition at line 65 of file GEMDQMHarvester.cc.

◆ strDirRecHit_

std::string GEMDQMHarvester::strDirRecHit_
protected

Definition at line 62 of file GEMDQMHarvester.cc.

◆ strDirStatus_

std::string GEMDQMHarvester::strDirStatus_
protected

Definition at line 63 of file GEMDQMHarvester.cc.

◆ strDirSummary_

std::string GEMDQMHarvester::strDirSummary_
protected

Definition at line 61 of file GEMDQMHarvester.cc.

◆ strOutFile_

std::string GEMDQMHarvester::strOutFile_
protected

Definition at line 59 of file GEMDQMHarvester.cc.

GEMDQMHarvester::drawSummaryHistogram
void drawSummaryHistogram(edm::Service< DQMStore > &store)
Definition: GEMDQMHarvester.cc:90
mps_fire.i
i
Definition: mps_fire.py:428
GEMDQMHarvester::fReportSummary_
Float_t fReportSummary_
Definition: GEMDQMHarvester.cc:58
dqm::implementation::IBooker::bookFloat
MonitorElement * bookFloat(TString const &name, FUNC onbooking=NOOP())
Definition: DQMStore.h:80
dqm::impl::MonitorElement::setTitle
virtual void setTitle(const std::string &title)
set (ie. change) histogram/profile title
Definition: MonitorElement.cc:809
GEMDQMHarvester::strOutFile_
std::string strOutFile_
Definition: GEMDQMHarvester.cc:59
dqm::impl::MonitorElement::getAxisTitle
virtual std::string getAxisTitle(int axis=1) const
get x-, y- or z-axis title (axis=1, 2, 3 respectively)
Definition: MonitorElement.cc:668
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
dqm::legacy::MonitorElement
Definition: MonitorElement.h:462
GEMDQMHarvester::strDirRecHit_
std::string strDirRecHit_
Definition: GEMDQMHarvester.cc:62
GEMDQMHarvester::strDirSummary_
std::string strDirSummary_
Definition: GEMDQMHarvester.cc:61
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
dqm::impl::MonitorElement::Fill
void Fill(long long x)
Definition: MonitorElement.h:290
GEMDQMHarvester::strDirStatus_
std::string strDirStatus_
Definition: GEMDQMHarvester.cc:63
dqm::implementation::DQMStore::setCurrentFolder
void setCurrentFolder(std::string const &fullpath) override
Definition: DQMStore.h:569
dqm::impl::MonitorElement::setXTitle
virtual void setXTitle(std::string const &title)
Definition: MonitorElement.cc:852
GEMDQMHarvester::createSummaryVFAT
void createSummaryVFAT(edm::Service< DQMStore > &store, MonitorElement *h2Src, std::string strSuffix, MonitorElement *&h2Sum)
Definition: GEMDQMHarvester.cc:169
anotherprimaryvertexanalyzer_cfi.nBinY
nBinY
Definition: anotherprimaryvertexanalyzer_cfi.py:13
dqm::impl::MonitorElement::getNbinsY
virtual int getNbinsY() const
get # of bins in Y-axis
Definition: MonitorElement.cc:571
edm::Service
Definition: Service.h:30
dqm::impl::MonitorElement::setYTitle
virtual void setYTitle(std::string const &title)
Definition: MonitorElement.cc:857
dqm::impl::MonitorElement::setBinLabel
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)
Definition: MonitorElement.cc:762
GEMDQMHarvester::refineSummaryVFAT
Int_t refineSummaryVFAT(MonitorElement *h2Sum, MonitorElement *h2SrcOcc, MonitorElement *h2SrcStatusE, MonitorElement *h2SrcStatusW)
Definition: GEMDQMHarvester.cc:222
GEMDQMHarvester::createSummaryHist
void createSummaryHist(edm::Service< DQMStore > &store, MonitorElement *h2Src, MonitorElement *&h2Sum, std::vector< std::string > &listLayers)
Definition: GEMDQMHarvester.cc:145
dqm::impl::MonitorElement::getTitle
virtual std::string getTitle() const
get MonitorElement title
Definition: MonitorElement.cc:674
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
looper.cfg
cfg
Definition: looper.py:296
dqm::impl::MonitorElement::setBinContent
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
Definition: MonitorElement.cc:682
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
dqm::implementation::IBooker::book2D
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
dqm::impl::MonitorElement::getNbinsX
virtual int getNbinsX() const
get # of bins in X-axis
Definition: MonitorElement.cc:565
anotherprimaryvertexanalyzer_cfi.nBinX
nBinX
Definition: anotherprimaryvertexanalyzer_cfi.py:12
dqm::implementation::IGetter::get
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:673
GEMDQMHarvester::listLayer_
std::vector< std::string > listLayer_
Definition: GEMDQMHarvester.cc:65
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
GEMDQMHarvester::refineSummaryHistogram
Float_t refineSummaryHistogram(MonitorElement *h2Sum, MonitorElement *h2SrcOcc, MonitorElement *h2SrcAllNum, MonitorElement *h2SrcStatusE, MonitorElement *h2SrcStatusW)
Definition: GEMDQMHarvester.cc:193
GEMDQMHarvester::assessOneBin
Int_t assessOneBin(Float_t fAll, Float_t fNumOcc, Float_t fNumWarn, Float_t fNumErr)
Definition: GEMDQMHarvester.cc:181
dqm::impl::MonitorElement::getBinContent
virtual double getBinContent(int binx) const
get content of bin (1-D)
Definition: MonitorElement.cc:583
GEMDQMHarvester::copyLabels
void copyLabels(MonitorElement *h2Src, MonitorElement *h2Dst)
Definition: GEMDQMHarvester.cc:131
dqm::legacy::MonitorElement::getTH2F
virtual TH2F * getTH2F() const
Definition: MonitorElement.h:491