CMS 3D CMS Logo

PSMonitorClient.cc
Go to the documentation of this file.
1 // C++ headers
2 #include <string>
3 #include <cstring>
4 
5 // boost headers
6 #include <boost/regex.hpp>
7 
8 // Root headers
9 #include <TH1F.h>
10 
11 // CMSSW headers
22 
23 struct MEPSet {
26 };
27 
29 public:
30  explicit PSMonitorClient(edm::ParameterSet const &);
31  ~PSMonitorClient() override = default;
32 
33  static void fillDescriptions(edm::ConfigurationDescriptions &descriptions);
35 
36 private:
38 
40 
42  DQMStore::IGetter &getter,
43  edm::LuminosityBlock const &,
44  edm::EventSetup const &) override;
45  void dqmEndJob(DQMStore::IBooker &booker, DQMStore::IGetter &getter) override;
46 
47  void check(DQMStore::IBooker &booker, DQMStore::IGetter &getter);
48 
50 };
51 
53  : m_dqm_path(config.getUntrackedParameter<std::string>("dqmPath")),
54  psColumnVSlumiPSet(getHistoPSet(config.getParameter<edm::ParameterSet>("me"))) {}
55 
57  return MEPSet{
58  pset.getParameter<std::string>("name"),
59  pset.getParameter<std::string>("folder"),
60  };
61 }
62 
64  pset.add<std::string>("folder", "HLT/PSMonitoring");
65  pset.add<std::string>("name", "psColumnVSlumi");
66 }
67 
68 void PSMonitorClient::dqmEndJob(DQMStore::IBooker &booker, DQMStore::IGetter &getter) { check(booker, getter); }
69 
71  DQMStore::IGetter &getter,
73  edm::EventSetup const &setup) {
74  check(booker, getter);
75 }
76 
81 
82  getter.setCurrentFolder(folder);
83  MonitorElement *psColumnVSlumi = getter.get(psColumnVSlumiPSet.folder + "/" + psColumnVSlumiPSet.name);
84  // if no ME available, return
85  if (!psColumnVSlumi) {
86  edm::LogWarning("PSMonitorClient") << "no " << psColumnVSlumiPSet.name << " ME is available in "
87  << psColumnVSlumiPSet.folder << std::endl;
88  return;
89  }
90 
91  /*
92  TH2F* h = psColumnVSlumi->getTH2F();
93  size_t nbinsX = psColumnVSlumi->getNbinsX();
94  size_t nbinsY = psColumnVSlumi->getNbinsY();
95 
96  for ( size_t ibinY=1; ibinY < nbinsY; ++ibinY )
97  std::cout << h->GetXaxis()->GetBinLabel(ibinY) << std::endl;
98  for ( size_t ibinX=1; ibinX< nbinsX; ++ibinX )
99  if ( psColumnVSlumi->getBinContent(ibinX) )
100  std::cout << "ibinX: " << psColumnVSlumi->getBinContent(ibinX) << std::endl;
101  */
102 }
103 
105  // The following says we do not know what parameters are allowed so do no validation
106  // Please change this to state exactly what you do use, even if it is no parameters
108  desc.addUntracked<std::string>("dqmPath", "HLT/PSMonitoring");
109 
111  fillMePSetDescription(mePSet);
112  desc.add<edm::ParameterSetDescription>("me", mePSet);
113 
114  descriptions.add("psMonitorClient", desc);
115 }
116 
117 //define this as a plug-in
ConfigurationDescriptions.h
DQMEDHarvester.h
MEPSet::folder
std::string folder
Definition: DQMCorrelationClient.h:19
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
MessageLogger.h
edm::LuminosityBlock
Definition: LuminosityBlock.h:50
printsummarytable.folder
folder
Definition: printsummarytable.py:7
LuminosityBlock.h
edm
HLT enums.
Definition: AlignableModifier.h:19
PSMonitorClient::dqmEndJob
void dqmEndJob(DQMStore::IBooker &booker, DQMStore::IGetter &getter) override
Definition: PSMonitorClient.cc:68
PSMonitorClient::PSMonitorClient
PSMonitorClient(edm::ParameterSet const &)
Definition: PSMonitorClient.cc:52
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
dqm::implementation::NavigatorBase::setCurrentFolder
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
DQMStore.h
dqm::legacy::MonitorElement
Definition: MonitorElement.h:461
PSMonitorClient::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: PSMonitorClient.cc:104
singleTopDQM_cfi.setup
setup
Definition: singleTopDQM_cfi.py:37
config
Definition: config.py:1
MakerMacros.h
PSMonitorClient
Definition: PSMonitorClient.cc:28
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
PSMonitorClient::fillMePSetDescription
static void fillMePSetDescription(edm::ParameterSetDescription &pset)
Definition: PSMonitorClient.cc:63
Run.h
PSMonitorClient::check
void check(DQMStore::IBooker &booker, DQMStore::IGetter &getter)
Definition: PSMonitorClient.cc:78
ParameterSetDescription.h
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::LogWarning
Definition: MessageLogger.h:141
edm::ParameterSetDescription::addUntracked
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:100
edm::ParameterSet
Definition: ParameterSet.h:36
Event.h
ParameterSet
Definition: Functions.h:16
edm::EventSetup
Definition: EventSetup.h:57
MEPSet
Definition: DQMCorrelationClient.h:17
MEPSet::name
std::string name
Definition: DQMCorrelationClient.h:18
Registry.h
DQMEDHarvester
Definition: DQMEDHarvester.py:1
PSMonitorClient::getHistoPSet
static MEPSet getHistoPSet(edm::ParameterSet pset)
Definition: PSMonitorClient.cc:56
PSMonitorClient::dqmEndLuminosityBlock
void dqmEndLuminosityBlock(DQMStore::IBooker &booker, DQMStore::IGetter &getter, edm::LuminosityBlock const &, edm::EventSetup const &) override
Definition: PSMonitorClient.cc:70
PSMonitorClient::~PSMonitorClient
~PSMonitorClient() override=default
std
Definition: JetResolutionObject.h:76
Frameworkfwd.h
dqm::implementation::IGetter
Definition: DQMStore.h:484
PSMonitorClient::m_dqm_path
std::string m_dqm_path
Definition: PSMonitorClient.cc:39
PSMonitorClient::psColumnVSlumiPSet
MEPSet psColumnVSlumiPSet
Definition: PSMonitorClient.cc:49
dqm::implementation::IGetter::get
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:651
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
dqm::implementation::IBooker
Definition: DQMStore.h:43
ParameterSet.h
lumi
Definition: LumiSectionData.h:20
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27