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 ( const edm::ParameterSet cfg)

Definition at line 46 of file GEMDQMHarvester.cc.

References edm::ParameterSet::getParameter(), and AlCaHLTBitMon_QueryRunRegistry::string.

46  {
47  m_fReportSummary = -1.0;
48  strOutFile_ = cfg.getParameter<std::string>("fromFile");
49 }
T getParameter(std::string const &) const
std::string strOutFile_
Float_t m_fReportSummary
GEMDQMHarvester::~GEMDQMHarvester ( )
inlineoverride

Definition at line 27 of file GEMDQMHarvester.cc.

References fillDescriptions().

27 {};

Member Function Documentation

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

Definition at line 35 of file GEMDQMHarvester.cc.

References AlCaHLTBitMon_QueryRunRegistry::string.

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 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 }
void fillUnderOverflowBunchCrossing(edm::Service< DQMStore > &, std::string)
void refineSummaryHistogram(edm::Service< DQMStore > &)
void GEMDQMHarvester::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 51 of file GEMDQMHarvester.cc.

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

51  {
53  desc.add<std::string>("fromFile", "");
54  descriptions.add("GEMDQMHarvester", desc);
55 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void GEMDQMHarvester::fillUnderOverflowBunchCrossing ( edm::Service< DQMStore > &  store,
std::string  strNameSrc 
)
protected

Definition at line 133 of file GEMDQMHarvester.cc.

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

133  {
134  std::string strDirCurr = "GEM/StatusDigi";
135 
136  store->setCurrentFolder(strDirCurr);
137  MonitorElement *h2Curr = store->get(strDirCurr + "/" + strNameSrc);
138 
139  Int_t nNBinX = h2Curr->getNbinsX();
140  Int_t nNBinY = h2Curr->getNbinsY();
141 
142  for (Int_t i = 0; i < nNBinY; i++) {
143  h2Curr->setBinContent(1, i, h2Curr->getBinContent(0, i) + h2Curr->getBinContent(1, i));
144  h2Curr->setBinContent(nNBinX, i, h2Curr->getBinContent(nNBinX, i) + h2Curr->getBinContent(nNBinX + 1, i));
145  }
146 }
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)
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
void GEMDQMHarvester::refineSummaryHistogram ( edm::Service< DQMStore > &  store)
protected

Definition at line 74 of file GEMDQMHarvester.cc.

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

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  TH2F *h2New = nullptr;
83 
84  refineSummaryHistogramCore(h3Curr->getTH3F(), strNewName, h2New);
85  store->book2D(strNewName, h2New);
86 
87  store->bookFloat("reportSummary")->Fill(m_fReportSummary);
88 }
void refineSummaryHistogramCore(TH3F *, std::string &, TH2F *&, std::string strTmpPrefix="tmp_")
Float_t m_fReportSummary
virtual TH3F * getTH3F() const
void GEMDQMHarvester::refineSummaryHistogramCore ( TH3F *  h3Src,
std::string &  strNewName,
TH2F *&  h2New,
std::string  strTmpPrefix = "tmp_" 
)
protected

Definition at line 90 of file GEMDQMHarvester.cc.

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

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

Member Data Documentation

Float_t GEMDQMHarvester::m_fReportSummary
protected

Definition at line 42 of file GEMDQMHarvester.cc.

std::string GEMDQMHarvester::strOutFile_
protected

Definition at line 43 of file GEMDQMHarvester.cc.