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 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)
 
void refineSummaryHistogram (MonitorElement *h2Sum, MonitorElement *h2SrcOcc, MonitorElement *h2SrcCStatus, MonitorElement *h2SrcMal=nullptr, Bool_t bVarXBin=false)
 

Protected Attributes

Float_t fReportSummary_
 
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 59 of file GEMDQMHarvester.cc.

59  {
60  fReportSummary_ = -1.0;
61  strOutFile_ = cfg.getParameter<std::string>("fromFile");
62  strDirSummary_ = "GEM/EventInfo";
63  strDirStatus_ = "GEM/DAQStatus";
64 }

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

◆ ~GEMDQMHarvester()

GEMDQMHarvester::~GEMDQMHarvester ( )
inlineoverride

Definition at line 27 of file GEMDQMHarvester.cc.

27 {};

Member Function Documentation

◆ createSummaryHist()

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

Definition at line 117 of file GEMDQMHarvester.cc.

120  {
122 
123  Int_t nBinX = h2Src->getNbinsX(), nBinY = h2Src->getNbinsY();
124  h2Sum = store->book2D("reportSummaryMap", "", nBinX, 0.5, nBinX + 0.5, nBinY, 0.5, nBinY + 0.5);
125 
126  listLayers.clear();
127  for (Int_t i = 1; i <= nBinX; i++)
128  h2Sum->setBinLabel(i, h2Src->getTH2F()->GetXaxis()->GetBinLabel(i), 1);
129  for (Int_t i = 1; i <= nBinY; i++) {
130  std::string strLabelFull = h2Src->getTH2F()->GetYaxis()->GetBinLabel(i);
131  auto nPos = strLabelFull.find(';');
132  auto strLabel = strLabelFull.substr(0, nPos);
133  listLayers.push_back(strLabelFull.substr(nPos + 1));
134  h2Sum->setBinLabel(i, strLabel, 2);
135  }
136 }

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::implementation::DQMStore::setCurrentFolder(), and AlCaHLTBitMon_QueryRunRegistry::string.

◆ createSummaryVFAT()

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

Definition at line 138 of file GEMDQMHarvester.cc.

141  {
143 
144  Int_t nBinX = h2Src->getNbinsX(), nBinY = h2Src->getNbinsY();
145  h2Sum = store->book2D("vfat_statusSummary" + strSuffix, "", nBinX, 0.5, nBinX + 0.5, nBinY, 0.5, nBinY + 0.5);
146 
147  for (Int_t i = 1; i <= nBinX; i++)
148  h2Sum->setBinLabel(i, h2Src->getTH2F()->GetXaxis()->GetBinLabel(i), 1);
149  for (Int_t i = 1; i <= nBinY; i++)
150  h2Sum->setBinLabel(i, h2Src->getTH2F()->GetYaxis()->GetBinLabel(i), 2);
151 }

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(), and dqm::implementation::DQMStore::setCurrentFolder().

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

75  {
77  drawSummaryHistogram(store);
78 }

◆ drawSummaryHistogram()

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

Definition at line 80 of file GEMDQMHarvester.cc.

80  {
81  std::string strSrcDigiOcc = "GEM/digi/summaryOccDigi";
82  std::string strSrcDigiMal = "GEM/digi/summaryMalfuncDigi";
83  std::string strSrcCStatus = "GEM/DAQStatus/summaryStatus";
84 
85  std::string strSrcVFATOcc = "GEM/digi/digi_det";
86  std::string strSrcVFATStatus = "GEM/DAQStatus/vfat_statusSum";
87 
89 
90  MonitorElement *h2SrcDigiOcc = store->get(strSrcDigiOcc);
91  MonitorElement *h2SrcDigiMal = store->get(strSrcDigiMal);
92  MonitorElement *h2SrcCStatus = store->get(strSrcCStatus);
93 
94  if (h2SrcDigiOcc != nullptr && h2SrcDigiMal != nullptr && h2SrcCStatus != nullptr) {
95  MonitorElement *h2Sum = nullptr;
96  std::vector<std::string> listLayer;
97  createSummaryHist(store, h2SrcCStatus, h2Sum, listLayer);
98  refineSummaryHistogram(h2Sum, h2SrcDigiOcc, h2SrcCStatus, h2SrcDigiMal, true);
99 
100  for (const auto &strSuffix : listLayer) {
101  MonitorElement *h2SrcVFATOcc = store->get(strSrcVFATOcc + strSuffix);
102  MonitorElement *h2SrcVFATStatus = store->get(strSrcVFATStatus + strSuffix);
103  if (h2SrcVFATOcc == nullptr || h2SrcVFATStatus == nullptr)
104  continue;
105  MonitorElement *h2SumVFAT = nullptr;
106  createSummaryVFAT(store, h2SrcVFATStatus, strSuffix, h2SumVFAT);
107  refineSummaryHistogram(h2SumVFAT, h2SrcVFATOcc, h2SrcVFATStatus);
108  h2SumVFAT->setTitle(h2SrcVFATStatus->getTitle());
109  h2SumVFAT->setXTitle(h2SrcVFATStatus->getAxisTitle(1));
110  h2SumVFAT->setYTitle(h2SrcVFATStatus->getAxisTitle(2));
111  }
112  }
113 
114  store->bookFloat("reportSummary")->Fill(fReportSummary_);
115 }

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

66  {
68  desc.add<std::string>("fromFile", "");
69  descriptions.add("GEMDQMHarvester", desc);
70 }

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

◆ refineSummaryHistogram()

void GEMDQMHarvester::refineSummaryHistogram ( MonitorElement h2Sum,
MonitorElement h2SrcOcc,
MonitorElement h2SrcCStatus,
MonitorElement h2SrcMal = nullptr,
Bool_t  bVarXBin = false 
)
protected

Definition at line 154 of file GEMDQMHarvester.cc.

158  {
159  Int_t nBinY = h2Sum->getNbinsY();
160  for (Int_t j = 1; j <= nBinY; j++) {
161  Int_t nBinX = h2Sum->getNbinsX();
162  if (bVarXBin) {
163  nBinX = (Int_t)(h2SrcOcc->getBinContent(0, j) + 0.5);
164  h2Sum->setBinContent(0, j, nBinX);
165  }
166  for (Int_t i = 1; i <= nBinX; i++) {
167  Float_t fOcc = h2SrcOcc->getBinContent(i, j);
168  Float_t fStatus = h2SrcCStatus->getBinContent(i, j);
169  Float_t fMal = (h2SrcMal != nullptr ? h2SrcMal->getBinContent(i, j) : 0.0);
170 
171  Float_t fRes = 0;
172  if (fStatus > 0 || fMal > 0)
173  fRes = 2;
174  else if (fOcc > 0)
175  fRes = 1;
176 
177  h2Sum->setBinContent(i, j, fRes);
178  }
179  }
180 }

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

◆ strDirStatus_

std::string GEMDQMHarvester::strDirStatus_
protected

Definition at line 56 of file GEMDQMHarvester.cc.

◆ strDirSummary_

std::string GEMDQMHarvester::strDirSummary_
protected

Definition at line 55 of file GEMDQMHarvester.cc.

◆ strOutFile_

std::string GEMDQMHarvester::strOutFile_
protected

Definition at line 53 of file GEMDQMHarvester.cc.

GEMDQMHarvester::drawSummaryHistogram
void drawSummaryHistogram(edm::Service< DQMStore > &store)
Definition: GEMDQMHarvester.cc:80
mps_fire.i
i
Definition: mps_fire.py:428
GEMDQMHarvester::fReportSummary_
Float_t fReportSummary_
Definition: GEMDQMHarvester.cc:52
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:53
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::strDirSummary_
std::string strDirSummary_
Definition: GEMDQMHarvester.cc:55
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:56
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:138
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
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:117
dqm::impl::MonitorElement::getTitle
virtual std::string getTitle() const
get MonitorElement title
Definition: MonitorElement.cc:683
looper.cfg
cfg
Definition: looper.py:297
GEMDQMHarvester::refineSummaryHistogram
void refineSummaryHistogram(MonitorElement *h2Sum, MonitorElement *h2SrcOcc, MonitorElement *h2SrcCStatus, MonitorElement *h2SrcMal=nullptr, Bool_t bVarXBin=false)
Definition: GEMDQMHarvester.cc:154
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:651
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
dqm::legacy::MonitorElement::getTH2F
virtual TH2F * getTH2F() const
Definition: MonitorElement.h:491