CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Static Public Member Functions | Protected Types | 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 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 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 (std::string strName, MonitorElement *h2Sum, MonitorElement *h2SrcOcc, MonitorElement *h2SrcAllNum, MonitorElement *h2SrcStatusE, MonitorElement *h2SrcStatusW)
 
Int_t refineSummaryVFAT (std::string strName, MonitorElement *h2Sum, MonitorElement *h2SrcOcc, MonitorElement *h2SrcStatusE, MonitorElement *h2SrcStatusW)
 

Protected Attributes

Float_t fCutErr_
 
Float_t fCutLowErr_
 
Float_t fCutWarn_
 
std::vector< std::string > listLayer_
 
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::vector<std::vector<Int_t> > GEMDQMHarvester::TableStatusNum
protected

Definition at line 68 of file GEMDQMHarvester.cc.

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

Definition at line 67 of file GEMDQMHarvester.cc.

Constructor & Destructor Documentation

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

Definition at line 73 of file GEMDQMHarvester.cc.

References edm::ParameterSet::getParameter().

73  {
74  fCutErr_ = cfg.getParameter<double>("cutErr");
75  fCutLowErr_ = cfg.getParameter<double>("cutLowErr");
76  fCutWarn_ = cfg.getParameter<double>("cutWarn");
77 }
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  fNumWarn,
Float_t  fNumErr 
)
protected

Definition at line 192 of file GEMDQMHarvester.cc.

193  {
194  if (fNumErr > fCutErr_ * fAll) // The error status criterion
195  return 2;
196  else if (fNumErr > fCutLowErr_ * fAll) // The low-error status criterion
197  return 4;
198  else if (fNumWarn > fCutWarn_ * fAll) // The warning status criterion
199  return 3;
200  else if (fNumOcc > 0)
201  return 1;
202 
203  return 0;
204 }
void GEMDQMHarvester::copyLabels ( MonitorElement h2Src,
MonitorElement h2Dst 
)
protected

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

142  {
143  Int_t nBinX = h2Src->getNbinsX(), nBinY = h2Src->getNbinsY();
144 
145  for (Int_t i = 1; i <= nBinX; i++) {
146  h2Dst->setBinLabel(i, h2Src->getTH2F()->GetXaxis()->GetBinLabel(i), 1);
147  }
148  for (Int_t i = 1; i <= nBinY; i++) {
149  h2Dst->setBinLabel(i, h2Src->getTH2F()->GetYaxis()->GetBinLabel(i), 2);
150  }
151  h2Dst->setTitle(h2Src->getTitle());
152  h2Dst->setXTitle(h2Src->getAxisTitle(1));
153  h2Dst->setYTitle(h2Src->getAxisTitle(2));
154 }
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::createSummaryHist ( edm::Service< DQMStore > &  store,
MonitorElement h2Src,
MonitorElement *&  h2Sum,
std::vector< std::string > &  listLayers 
)
protected

Definition at line 156 of file GEMDQMHarvester.cc.

References dqm::implementation::IBooker::book2D(), 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.

159  {
160  //store->setCurrentFolder(strDirSummary_);
161 
162  Int_t nBinX = h2Src->getNbinsX(), nBinY = h2Src->getNbinsY();
163  h2Sum = store->book2D("reportSummaryMap", "", nBinX, 0.5, nBinX + 0.5, nBinY, 0.5, nBinY + 0.5);
164  h2Sum->setTitle("Summary plot");
165  h2Sum->setXTitle("Chamber");
166  h2Sum->setYTitle("Layer");
167 
168  listLayers.clear();
169  for (Int_t i = 1; i <= nBinX; i++)
170  h2Sum->setBinLabel(i, h2Src->getTH2F()->GetXaxis()->GetBinLabel(i), 1);
171  for (Int_t i = 1; i <= nBinY; i++) {
172  std::string strLabelFull = h2Src->getTH2F()->GetYaxis()->GetBinLabel(i);
173  auto nPos = strLabelFull.find(';');
174  auto strLabel = strLabelFull.substr(0, nPos);
175  listLayers.push_back(strLabelFull.substr(nPos + 1));
176  h2Sum->setBinLabel(i, strLabel, 2);
177  }
178 }
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 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 180 of file GEMDQMHarvester.cc.

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

183  {
184  //store->setCurrentFolder(strDirStatus_);
185  //store->setCurrentFolder(strDirSummary_);
186 
187  Int_t nBinX = h2Src->getNbinsX(), nBinY = h2Src->getNbinsY();
188  h2Sum = store->book2D("vfat_statusSummary" + strSuffix, "", nBinX, 0.5, nBinX + 0.5, nBinY, -0.5, nBinY - 0.5);
189  copyLabels(h2Src, h2Sum);
190 }
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::dqmEndJob ( DQMStore::IBooker ,
DQMStore::IGetter  
)
inlineoverrideprotected

Definition at line 35 of file GEMDQMHarvester.cc.

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

Definition at line 87 of file GEMDQMHarvester.cc.

90  {
92  drawSummaryHistogram(store);
93 }
void drawSummaryHistogram(edm::Service< DQMStore > &store)
void GEMDQMHarvester::drawSummaryHistogram ( edm::Service< DQMStore > &  store)
protected

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

95  {
96  Float_t fReportSummary = -1.0;
97 
98  std::string strSrcDigiOcc = "GEM/Digis/summaryOccDigi";
99  std::string strSrcStatusA = "GEM/DAQStatus/chamberAllStatus";
100  std::string strSrcStatusW = "GEM/DAQStatus/chamberWarnings";
101  std::string strSrcStatusE = "GEM/DAQStatus/chamberErrors";
102 
103  std::string strSrcVFATOcc = "GEM/Digis/det";
104  std::string strSrcVFATStatusW = "GEM/DAQStatus/vfat_statusWarnSum";
105  std::string strSrcVFATStatusE = "GEM/DAQStatus/vfat_statusErrSum";
106 
108 
109  MonitorElement *h2SrcDigiOcc = store->get(strSrcDigiOcc);
110  MonitorElement *h2SrcStatusA = store->get(strSrcStatusA);
111  MonitorElement *h2SrcStatusW = store->get(strSrcStatusW);
112  MonitorElement *h2SrcStatusE = store->get(strSrcStatusE);
113 
114  std::string strTitleSummary = "summary";
115 
116  if (h2SrcDigiOcc != nullptr && h2SrcStatusA != nullptr && h2SrcStatusW != nullptr && h2SrcStatusE != nullptr) {
117  MonitorElement *h2Sum = nullptr;
118  createSummaryHist(store, h2SrcStatusE, h2Sum, listLayer_);
119  fReportSummary =
120  refineSummaryHistogram(strTitleSummary, h2Sum, h2SrcDigiOcc, h2SrcStatusA, h2SrcStatusE, h2SrcStatusW);
121 
122  for (const auto &strSuffix : listLayer_) {
123  MonitorElement *h2SrcVFATOcc = store->get(strSrcVFATOcc + strSuffix);
124  MonitorElement *h2SrcVFATStatusW = store->get(strSrcVFATStatusW + strSuffix);
125  MonitorElement *h2SrcVFATStatusE = store->get(strSrcVFATStatusE + strSuffix);
126  if (h2SrcVFATOcc == nullptr || h2SrcVFATStatusW == nullptr || h2SrcVFATStatusE == nullptr)
127  continue;
128 
129  MonitorElement *h2SumVFAT = nullptr;
130  createSummaryVFAT(store, h2SrcVFATStatusE, strSuffix, h2SumVFAT);
131  refineSummaryVFAT(strSuffix, h2SumVFAT, h2SrcVFATOcc, h2SrcVFATStatusE, h2SrcVFATStatusW);
132  TString strNewTitle = h2SrcVFATStatusE->getTitle();
133  h2SumVFAT->setTitle((const char *)strNewTitle.ReplaceAll("errors", "errors/warnings"));
134  h2SumVFAT->setXTitle(h2SrcVFATStatusE->getAxisTitle(1));
135  h2SumVFAT->setYTitle(h2SrcVFATStatusE->getAxisTitle(2));
136  }
137  }
138 
139  store->bookFloat("reportSummary")->Fill(fReportSummary);
140 }
virtual std::string getTitle() const
get MonitorElement title
virtual void setTitle(const std::string &title)
set (ie. change) histogram/profile title
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 createSummaryHist(edm::Service< DQMStore > &store, MonitorElement *h2Src, MonitorElement *&h2Sum, std::vector< std::string > &listLayers)
Int_t refineSummaryVFAT(std::string strName, MonitorElement *h2Sum, MonitorElement *h2SrcOcc, MonitorElement *h2SrcStatusE, MonitorElement *h2SrcStatusW)
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)
std::vector< std::string > listLayer_
void Fill(long long x)
virtual void setXTitle(std::string const &title)
Float_t refineSummaryHistogram(std::string strName, MonitorElement *h2Sum, MonitorElement *h2SrcOcc, MonitorElement *h2SrcAllNum, MonitorElement *h2SrcStatusE, MonitorElement *h2SrcStatusW)
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:673
virtual void setYTitle(std::string const &title)
void GEMDQMHarvester::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 79 of file GEMDQMHarvester.cc.

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

79  {
81  desc.add<double>("cutErr", 0.05);
82  desc.add<double>("cutLowErr", 0.00);
83  desc.add<double>("cutWarn", 0.05);
84  descriptions.add("GEMDQMHarvester", desc);
85 }
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 h2SrcAllNum,
MonitorElement h2SrcStatusE,
MonitorElement h2SrcStatusW 
)
protected

Definition at line 207 of file GEMDQMHarvester.cc.

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

212  {
213  Int_t nBinY = h2Sum->getNbinsY();
214  Int_t nAllBin = 0, nFineBin = 0;
215  for (Int_t j = 1; j <= nBinY; j++) {
216  Int_t nBinX = (Int_t)(h2SrcOcc->getBinContent(0, j) + 0.5);
217  h2Sum->setBinContent(0, j, nBinX);
218  for (Int_t i = 1; i <= nBinX; i++) {
219  Float_t fOcc = h2SrcOcc->getBinContent(i, j);
220  Float_t fStatusAll = h2SrcStatusA->getBinContent(i, j);
221  Float_t fStatusWarn = h2SrcStatusW->getBinContent(i, j);
222  Float_t fStatusErr = h2SrcStatusE->getBinContent(i, j);
223 
224  Int_t nRes = assessOneBin(strName, i, j, fStatusAll, fOcc, fStatusWarn, fStatusErr);
225  if (nRes == 1)
226  nFineBin++;
227 
228  h2Sum->setBinContent(i, j, (Float_t)nRes);
229  nAllBin++;
230  }
231  }
232 
233  return ((Float_t)nFineBin) / nAllBin;
234 }
virtual int getNbinsY() const
get # of bins in Y-axis
virtual double getBinContent(int binx) const
get content of bin (1-D)
Int_t assessOneBin(std::string strName, Int_t nIdxX, Int_t nIdxY, Float_t fAll, Float_t fNumOcc, Float_t fNumWarn, Float_t fNumErr)
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
Int_t GEMDQMHarvester::refineSummaryVFAT ( std::string  strName,
MonitorElement h2Sum,
MonitorElement h2SrcOcc,
MonitorElement h2SrcStatusE,
MonitorElement h2SrcStatusW 
)
protected

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

240  {
241  Int_t nBinY = h2Sum->getNbinsY();
242  for (Int_t j = 1; j <= nBinY; j++) {
243  Int_t nBinX = h2Sum->getNbinsX();
244  for (Int_t i = 1; i <= nBinX; i++) {
245  Float_t fOcc = h2SrcOcc->getBinContent(i, j);
246  Float_t fStatusWarn = h2SrcStatusW->getBinContent(i, j);
247  Float_t fStatusErr = h2SrcStatusE->getBinContent(i, j);
248  Float_t fStatusAll = fOcc + fStatusWarn + fStatusErr;
249 
250  Int_t nRes = assessOneBin(strName, i, j, fStatusAll, fOcc, fStatusWarn, fStatusErr);
251  h2Sum->setBinContent(i, j, (Float_t)nRes);
252  }
253  }
254 
255  return 0;
256 }
virtual int getNbinsY() const
get # of bins in Y-axis
virtual int getNbinsX() const
get # of bins in X-axis
virtual double getBinContent(int binx) const
get content of bin (1-D)
Int_t assessOneBin(std::string strName, Int_t nIdxX, Int_t nIdxY, Float_t fAll, Float_t fNumOcc, Float_t fNumWarn, Float_t fNumErr)
virtual void setBinContent(int binx, double content)
set content of bin (1-D)

Member Data Documentation

Float_t GEMDQMHarvester::fCutErr_
protected

Definition at line 61 of file GEMDQMHarvester.cc.

Float_t GEMDQMHarvester::fCutLowErr_
protected

Definition at line 61 of file GEMDQMHarvester.cc.

Float_t GEMDQMHarvester::fCutWarn_
protected

Definition at line 61 of file GEMDQMHarvester.cc.

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

Definition at line 70 of file GEMDQMHarvester.cc.

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

Definition at line 64 of file GEMDQMHarvester.cc.

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

Definition at line 65 of file GEMDQMHarvester.cc.

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

Definition at line 63 of file GEMDQMHarvester.cc.