CMS 3D CMS Logo

TriggerRatesMonitorClient.cc
Go to the documentation of this file.
2 
4 
5 //
6 // -------------------------------------- Constructor --------------------------------------------
7 //
9  : m_dqm_path(iConfig.getUntrackedParameter<std::string>("dqmPath")) {
10  edm::LogInfo("TriggerRatesMonitorClient")
11  << "Constructor TriggerRatesMonitorClient::TriggerRatesMonitorClient " << std::endl;
12 }
13 
14 //
15 // -------------------------------------- beginJob --------------------------------------------
16 //
18  edm::LogInfo("TriggerRatesMonitorClient") << "TriggerRatesMonitorClient::beginJob " << std::endl;
19 }
20 
21 //
22 // -------------------------------------- get and book in the endJob --------------------------------------------
23 //
25  // create and cd into new folder
26  ibooker_.setCurrentFolder(m_dqm_path);
27 
28  //get available histograms
29  std::vector<std::string> directories = igetter_.getSubdirs();
30  m_hltXpd_counts.resize(directories.size());
31 
32  int i = 0;
33  for (auto const& dir : directories) {
34  // std::cout << "dir: " << dir << std::endl;
35  ibooker_.setCurrentFolder(m_dqm_path + "/" + dir);
36 
37  std::vector<std::string> const& all_mes = igetter_.getMEs();
38  std::vector<std::string> mes;
39  for (auto const& me : all_mes)
40  if (me.find("accept") != std::string::npos)
41  mes.push_back(me);
42 
43  int nbinsY = mes.size();
44  double xminY = 0.;
45  double xmaxY = xminY + 1. * nbinsY;
46  int nbinsX = 0;
47  int ibinY = 1;
48  for (auto const& me : mes) {
49  // std::cout << "me: " << me << std::endl;
50  ibooker_.setCurrentFolder(m_dqm_path + "/" + dir);
51  TH1F* histo = igetter_.get(me)->getTH1F();
52 
53  if (m_hltXpd_counts[i] == nullptr) {
54  // get range and binning for new MEs
55  nbinsX = histo->GetNbinsX();
56  double xminX = histo->GetXaxis()->GetXmin();
57  double xmaxX = histo->GetXaxis()->GetXmax();
58 
59  //book new histogram
60  std::string hname = dir + "_summary";
61  ibooker_.setCurrentFolder(m_dqm_path);
62  m_hltXpd_counts[i] = ibooker_.book2D(hname, hname, nbinsX, xminX, xmaxX, nbinsY, xminY, xmaxY)->getTH2F();
63  } else {
64  m_hltXpd_counts[i]->GetYaxis()->SetBinLabel(ibinY, me.c_str());
65  }
66 
67  // handle mes
68  for (int ibinX = 1; ibinX <= nbinsX; ++ibinX) {
69  float rate = histo->GetBinContent(ibinX);
70  m_hltXpd_counts[i]->SetBinContent(ibinX, ibinY, rate);
71  }
72  ibinY++;
73  }
74 
75  i++;
76  }
77 }
78 
79 //
80 // -------------------------------------- get in the endLumi if needed --------------------------------------------
81 //
83  DQMStore::IGetter& igetter_,
84  edm::LuminosityBlock const& iLumi,
85  edm::EventSetup const& iSetup) {
86  edm::LogInfo("TriggerRatesMonitorClient") << "TriggerRatesMonitorClient::endLumi " << std::endl;
87 }
88 
91  desc.addUntracked<std::string>("dqmPath", "HLT/Datasets");
92  descriptions.add("triggerRatesMonitorClient", desc);
93 }
94 
95 // Define this as a plug-in
mps_fire.i
i
Definition: mps_fire.py:355
MessageLogger.h
hlt_dqm_clientPB-live_cfg.xmaxX
xmaxX
Definition: hlt_dqm_clientPB-live_cfg.py:67
TriggerRatesMonitorClient
Definition: TriggerRatesMonitorClient.h:17
edm::LuminosityBlock
Definition: LuminosityBlock.h:50
TriggerRatesMonitorClient.h
hlt_dqm_clientPB-live_cfg.xminY
xminY
Definition: hlt_dqm_clientPB-live_cfg.py:70
dqm::implementation::IGetter::getMEs
virtual std::vector< std::string > getMEs() const
Definition: DQMStore.cc:698
TriggerRatesMonitorClient::TriggerRatesMonitorClient
TriggerRatesMonitorClient(const edm::ParameterSet &ps)
Definition: TriggerRatesMonitorClient.cc:8
edm::LogInfo
Definition: MessageLogger.h:254
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
dqm::implementation::NavigatorBase::setCurrentFolder
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
hlt_dqm_clientPB-live_cfg.nbinsX
nbinsX
Definition: hlt_dqm_clientPB-live_cfg.py:65
timingPdfMaker.histo
histo
Definition: timingPdfMaker.py:279
dqm::implementation::IGetter::getSubdirs
virtual DQM_DEPRECATED std::vector< std::string > getSubdirs() const
Definition: DQMStore.cc:678
hlt_dqm_clientPB-live_cfg.xminX
xminX
Definition: hlt_dqm_clientPB-live_cfg.py:66
TriggerRatesMonitorClient::m_hltXpd_counts
std::vector< TH2F * > m_hltXpd_counts
Definition: TriggerRatesMonitorClient.h:36
RPCpg::rate
double rate(double x)
Definition: Constants.cc:3
dqm::legacy::MonitorElement::getTH1F
virtual TH1F * getTH1F() const
Definition: MonitorElement.h:478
MakerMacros.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
TriggerRatesMonitorClient::m_dqm_path
std::string m_dqm_path
Definition: TriggerRatesMonitorClient.h:33
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
hlt_dqm_clientPB-live_cfg.nbinsY
nbinsY
Definition: hlt_dqm_clientPB-live_cfg.py:69
edm::ParameterSetDescription::addUntracked
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:100
edm::ParameterSet
Definition: ParameterSet.h:36
edm::EventSetup
Definition: EventSetup.h:57
TriggerRatesMonitorClient::dqmEndLuminosityBlock
void dqmEndLuminosityBlock(DQMStore::IBooker &, DQMStore::IGetter &, edm::LuminosityBlock const &, edm::EventSetup const &) override
Definition: TriggerRatesMonitorClient.cc:82
std
Definition: JetResolutionObject.h:76
TriggerRatesMonitorClient::dqmEndJob
void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &) override
Definition: TriggerRatesMonitorClient.cc:24
TriggerRatesMonitorClient::beginJob
void beginJob() override
Definition: TriggerRatesMonitorClient.cc:17
dqm::implementation::IGetter
Definition: DQMStore.h:484
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::implementation::IGetter::get
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:651
TriggerRatesMonitorClient::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: TriggerRatesMonitorClient.cc:89
dqm::implementation::IBooker
Definition: DQMStore.h:43
hlt_dqm_clientPB-live_cfg.me
me
Definition: hlt_dqm_clientPB-live_cfg.py:61
hlt_dqm_clientPB-live_cfg.xmaxY
xmaxY
Definition: hlt_dqm_clientPB-live_cfg.py:71
DeadROC_duringRun.dir
dir
Definition: DeadROC_duringRun.py:23
dqm::legacy::MonitorElement::getTH2F
virtual TH2F * getTH2F() const
Definition: MonitorElement.h:490