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

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 *h2SrcStatusE, MonitorElement *h2SrcStatusW=nullptr, Bool_t bVarXBin=false)
 

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

63  {
64  fReportSummary_ = -1.0;
65  strOutFile_ = cfg.getParameter<std::string>("fromFile");
66  strDirSummary_ = "GEM/EventInfo";
67  strDirRecHit_ = "GEM/RecHits";
68  strDirStatus_ = "GEM/DAQStatus";
69 }

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

◆ ~GEMDQMHarvester()

GEMDQMHarvester::~GEMDQMHarvester ( )
inlineoverride

Definition at line 27 of file GEMDQMHarvester.cc.

27 {};

Member Function Documentation

◆ copyLabels()

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

Definition at line 124 of file GEMDQMHarvester.cc.

124  {
125  Int_t nBinX = h2Src->getNbinsX(), nBinY = h2Src->getNbinsY();
126 
127  for (Int_t i = 1; i <= nBinX; i++) {
128  h2Dst->setBinLabel(i, h2Src->getTH2F()->GetXaxis()->GetBinLabel(i), 1);
129  }
130  for (Int_t i = 1; i <= nBinY; i++) {
131  h2Dst->setBinLabel(i, h2Src->getTH2F()->GetYaxis()->GetBinLabel(i), 2);
132  }
133  h2Dst->setTitle(h2Src->getTitle());
134  h2Dst->setXTitle(h2Src->getAxisTitle(1));
135  h2Dst->setYTitle(h2Src->getAxisTitle(2));
136 }

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

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

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

165  {
166  //store->setCurrentFolder(strDirStatus_);
167  //store->setCurrentFolder(strDirSummary_);
168 
169  Int_t nBinX = h2Src->getNbinsX(), nBinY = h2Src->getNbinsY();
170  h2Sum = store->book2D("vfat_statusSummary" + strSuffix, "", nBinX, 0.5, nBinX + 0.5, nBinY, -0.5, nBinY - 0.5);
171  copyLabels(h2Src, h2Sum);
172 }

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

80  {
82  drawSummaryHistogram(store);
83 }

◆ drawSummaryHistogram()

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

Definition at line 85 of file GEMDQMHarvester.cc.

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

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

71  {
73  desc.add<std::string>("fromFile", "");
74  descriptions.add("GEMDQMHarvester", desc);
75 }

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

◆ refineSummaryHistogram()

Float_t GEMDQMHarvester::refineSummaryHistogram ( MonitorElement h2Sum,
MonitorElement h2SrcOcc,
MonitorElement h2SrcStatusE,
MonitorElement h2SrcStatusW = nullptr,
Bool_t  bVarXBin = false 
)
protected

Definition at line 175 of file GEMDQMHarvester.cc.

179  {
180  Int_t nBinY = h2Sum->getNbinsY();
181  Int_t nAllBin = 0, nFineBin = 0;
182  for (Int_t j = 1; j <= nBinY; j++) {
183  Int_t nBinX = h2Sum->getNbinsX();
184  if (bVarXBin) {
185  nBinX = (Int_t)(h2SrcOcc->getBinContent(0, j) + 0.5);
186  h2Sum->setBinContent(0, j, nBinX);
187  }
188  for (Int_t i = 1; i <= nBinX; i++) {
189  Float_t fOcc = h2SrcOcc->getBinContent(i, j);
190  Float_t fStatusWarn = (h2SrcStatusW != nullptr ? h2SrcStatusW->getBinContent(i, j) : 0.0);
191  Float_t fStatusErr = h2SrcStatusE->getBinContent(i, j);
192 
193  Float_t fRes = 0;
194  if (fStatusErr > 0)
195  fRes = 2;
196  else if (fStatusWarn > 0)
197  fRes = 3;
198  else if (fOcc > 0) {
199  fRes = 1;
200  nFineBin++;
201  }
202 
203  h2Sum->setBinContent(i, j, fRes);
204  nAllBin++;
205  }
206  }
207 
208  return ((Float_t)nFineBin) / nAllBin;
209 }

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

◆ listLayer_

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

Definition at line 60 of file GEMDQMHarvester.cc.

◆ strDirRecHit_

std::string GEMDQMHarvester::strDirRecHit_
protected

Definition at line 57 of file GEMDQMHarvester.cc.

◆ strDirStatus_

std::string GEMDQMHarvester::strDirStatus_
protected

Definition at line 58 of file GEMDQMHarvester.cc.

◆ strDirSummary_

std::string GEMDQMHarvester::strDirSummary_
protected

Definition at line 56 of file GEMDQMHarvester.cc.

◆ strOutFile_

std::string GEMDQMHarvester::strOutFile_
protected

Definition at line 54 of file GEMDQMHarvester.cc.

GEMDQMHarvester::drawSummaryHistogram
void drawSummaryHistogram(edm::Service< DQMStore > &store)
Definition: GEMDQMHarvester.cc:85
mps_fire.i
i
Definition: mps_fire.py:428
GEMDQMHarvester::fReportSummary_
Float_t fReportSummary_
Definition: GEMDQMHarvester.cc:53
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:818
GEMDQMHarvester::strOutFile_
std::string strOutFile_
Definition: GEMDQMHarvester.cc:54
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:677
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
dqm::legacy::MonitorElement
Definition: MonitorElement.h:462
GEMDQMHarvester::strDirRecHit_
std::string strDirRecHit_
Definition: GEMDQMHarvester.cc:57
GEMDQMHarvester::strDirSummary_
std::string strDirSummary_
Definition: GEMDQMHarvester.cc:56
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
GEMDQMHarvester::refineSummaryHistogram
Float_t refineSummaryHistogram(MonitorElement *h2Sum, MonitorElement *h2SrcOcc, MonitorElement *h2SrcStatusE, MonitorElement *h2SrcStatusW=nullptr, Bool_t bVarXBin=false)
Definition: GEMDQMHarvester.cc:175
dqm::impl::MonitorElement::Fill
void Fill(long long x)
Definition: MonitorElement.h:290
GEMDQMHarvester::strDirStatus_
std::string strDirStatus_
Definition: GEMDQMHarvester.cc:58
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:861
GEMDQMHarvester::createSummaryVFAT
void createSummaryVFAT(edm::Service< DQMStore > &store, MonitorElement *h2Src, std::string strSuffix, MonitorElement *&h2Sum)
Definition: GEMDQMHarvester.cc:162
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:580
edm::Service
Definition: Service.h:30
dqm::impl::MonitorElement::setYTitle
virtual void setYTitle(std::string const &title)
Definition: MonitorElement.cc:866
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:771
GEMDQMHarvester::createSummaryHist
void createSummaryHist(edm::Service< DQMStore > &store, MonitorElement *h2Src, MonitorElement *&h2Sum, std::vector< std::string > &listLayers)
Definition: GEMDQMHarvester.cc:138
dqm::impl::MonitorElement::getTitle
virtual std::string getTitle() const
get MonitorElement title
Definition: MonitorElement.cc:683
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:691
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:574
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:60
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
dqm::impl::MonitorElement::getBinContent
virtual double getBinContent(int binx) const
get content of bin (1-D)
Definition: MonitorElement.cc:592
GEMDQMHarvester::copyLabels
void copyLabels(MonitorElement *h2Src, MonitorElement *h2Dst)
Definition: GEMDQMHarvester.cc:124
dqm::legacy::MonitorElement::getTH2F
virtual TH2F * getTH2F() const
Definition: MonitorElement.h:491