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 dqmEndJob (DQMStore::IBooker &, DQMStore::IGetter &) override
 
void dqmEndLuminosityBlock (DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &) override
 
void fillUnderOverflowBunchCrossing (edm::Service< DQMStore > &, std::string)
 
void refineSummaryHistogram (edm::Service< DQMStore > &)
 
void refineSummaryHistogramCore (TH3F *, std::string &, TH2F *&, std::string strTmpPrefix="tmp_")
 

Protected Attributes

Float_t m_fReportSummary
 
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 46 of file GEMDQMHarvester.cc.

46  {
47  m_fReportSummary = -1.0;
48  strOutFile_ = cfg.getParameter<std::string>("fromFile");
49 }

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

◆ ~GEMDQMHarvester()

GEMDQMHarvester::~GEMDQMHarvester ( )
inlineoverride

Definition at line 27 of file GEMDQMHarvester.cc.

27 {};

Member Function Documentation

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

60  {
63 
64  store->setCurrentFolder("GEM/StatusDigi");
65  auto listME = store->getMEs();
66 
67  for (auto strName : listME) {
68  if (strName.find("vfatStatus_BC_") != std::string::npos) {
69  fillUnderOverflowBunchCrossing(store, strName);
70  }
71  }
72 }

◆ fillDescriptions()

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

Definition at line 51 of file GEMDQMHarvester.cc.

51  {
53  desc.add<std::string>("fromFile", "");
54  descriptions.add("GEMDQMHarvester", desc);
55 }

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

◆ fillUnderOverflowBunchCrossing()

void GEMDQMHarvester::fillUnderOverflowBunchCrossing ( edm::Service< DQMStore > &  store,
std::string  strNameSrc 
)
protected

Definition at line 135 of file GEMDQMHarvester.cc.

135  {
136  std::string strDirCurr = "GEM/StatusDigi";
137 
138  store->setCurrentFolder(strDirCurr);
139  MonitorElement *h2Curr = store->get(strDirCurr + "/" + strNameSrc);
140 
141  Int_t nNBinX = h2Curr->getNbinsX();
142  Int_t nNBinY = h2Curr->getNbinsY();
143 
144  for (Int_t i = 0; i < nNBinY; i++) {
145  h2Curr->setBinContent(1, i, h2Curr->getBinContent(0, i) + h2Curr->getBinContent(1, i));
146  h2Curr->setBinContent(nNBinX, i, h2Curr->getBinContent(nNBinX, i) + h2Curr->getBinContent(nNBinX + 1, i));
147  }
148 }

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

◆ refineSummaryHistogram()

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

Definition at line 74 of file GEMDQMHarvester.cc.

74  {
75  std::string strDirCurr = "GEM/EventInfo";
76  std::string strNameSrc = "reportSummaryMapPreliminary";
77  std::string strNewName = "reportSummaryMap";
78 
79  store->setCurrentFolder(strDirCurr);
80 
81  MonitorElement *h3Curr = store->get(strDirCurr + "/" + strNameSrc);
82  if (h3Curr) {
83  TH2F *h2New = nullptr;
84 
85  refineSummaryHistogramCore(h3Curr->getTH3F(), strNewName, h2New);
86  store->book2D(strNewName, h2New);
87  }
88 
89  store->bookFloat("reportSummary")->Fill(m_fReportSummary);
90 }

References dqm::legacy::MonitorElement::getTH3F(), and AlCaHLTBitMon_QueryRunRegistry::string.

◆ refineSummaryHistogramCore()

void GEMDQMHarvester::refineSummaryHistogramCore ( TH3F *  h3Src,
std::string &  strNewName,
TH2F *&  h2New,
std::string  strTmpPrefix = "tmp_" 
)
protected

Definition at line 92 of file GEMDQMHarvester.cc.

95  {
96  Int_t i, j;
97 
98  Int_t nNBinX = h3Src->GetNbinsX();
99  Int_t nNBinY = h3Src->GetNbinsY();
100 
101  Float_t arrfBinX[128], arrfBinY[32];
102 
103  Float_t fNumPass, fNumError, fNumTotal;
104 
105  for (i = 0; i <= nNBinX; i++)
106  arrfBinX[i] = h3Src->GetXaxis()->GetBinLowEdge(i + 1);
107  for (i = 0; i <= nNBinY; i++)
108  arrfBinY[i] = h3Src->GetYaxis()->GetBinLowEdge(i + 1);
109 
110  h2New = new TH2F(strNewName.c_str(), h3Src->GetTitle(), nNBinX, arrfBinX, nNBinY, arrfBinY);
111 
112  fNumTotal = fNumPass = fNumError = 0.0;
113 
114  for (i = 0; i < nNBinX; i++) {
115  h2New->GetXaxis()->SetBinLabel(i + 1, h3Src->GetXaxis()->GetBinLabel(i + 1));
116  for (j = 0; j < nNBinY; j++) {
117  h2New->GetYaxis()->SetBinLabel(j + 1, h3Src->GetYaxis()->GetBinLabel(j + 1));
118 
119  if (h3Src->GetBinContent(i + 1, j + 1, 2) != 0) {
120  h2New->SetBinContent(i + 1, j + 1, 2);
121  fNumError += 1.0;
122  } else if (h3Src->GetBinContent(i + 1, j + 1, 1) != 0) {
123  h2New->SetBinContent(i + 1, j + 1, 1);
124  fNumPass += 1.0;
125  }
126 
127  fNumTotal += 1.0;
128  }
129  }
130 
131  if (fNumPass > 0.0 || fNumError > 0.0)
132  m_fReportSummary = fNumPass / fNumTotal;
133 }

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

Member Data Documentation

◆ m_fReportSummary

Float_t GEMDQMHarvester::m_fReportSummary
protected

Definition at line 42 of file GEMDQMHarvester.cc.

◆ strOutFile_

std::string GEMDQMHarvester::strOutFile_
protected

Definition at line 43 of file GEMDQMHarvester.cc.

GEMDQMHarvester::fillUnderOverflowBunchCrossing
void fillUnderOverflowBunchCrossing(edm::Service< DQMStore > &, std::string)
Definition: GEMDQMHarvester.cc:135
mps_fire.i
i
Definition: mps_fire.py:355
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
GEMDQMHarvester::strOutFile_
std::string strOutFile_
Definition: GEMDQMHarvester.cc:43
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
dqm::legacy::MonitorElement
Definition: MonitorElement.h:461
GEMDQMHarvester::m_fReportSummary
Float_t m_fReportSummary
Definition: GEMDQMHarvester.cc:42
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
GEMDQMHarvester::refineSummaryHistogram
void refineSummaryHistogram(edm::Service< DQMStore > &)
Definition: GEMDQMHarvester.cc:74
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
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::legacy::MonitorElement::getTH3F
virtual TH3F * getTH3F() const
Definition: MonitorElement.h:502
looper.cfg
cfg
Definition: looper.py:297
dqm::impl::MonitorElement::setBinContent
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
Definition: MonitorElement.cc:691
dqm::impl::MonitorElement::getNbinsX
virtual int getNbinsX() const
get # of bins in X-axis
Definition: MonitorElement.cc:574
GEMDQMHarvester::refineSummaryHistogramCore
void refineSummaryHistogramCore(TH3F *, std::string &, TH2F *&, std::string strTmpPrefix="tmp_")
Definition: GEMDQMHarvester.cc:92
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