CMS 3D CMS Logo

DemoHarvester.cc
Go to the documentation of this file.
3 
5 
6 class DemoHarvester : public DQMEDHarvester {
7 private:
9  int ctr_ = 0;
10 
11 public:
12  explicit DemoHarvester(const edm::ParameterSet &);
13  ~DemoHarvester() override {}
14 
15  void beginRun(const edm::Run &run, const edm::EventSetup &c) override;
16  void dqmEndJob(DQMStore::IBooker &ib, DQMStore::IGetter &ig) override;
20  edm::EventSetup const &) override;
21 };
22 
24  : DQMEDHarvester(iConfig), target_(iConfig.getParameter<std::string>("target")) {}
25 
26 void DemoHarvester::beginRun(const edm::Run &run, const edm::EventSetup &iSetup) {}
27 
30  MonitorElement *me = ig.get(target_ + "/EXAMPLE");
31  me->getTH1()->Fill(3);
32 
33  ib.setCurrentFolder(target_ + "_runsummary");
34  MonitorElement *out = ib.book1D("EXAMPLE", "EXAMPLE", 100, 0., 100.);
35  out->setBinContent(5, me->getBinContent(5));
36 }
37 
41  edm::EventSetup const &) {
43  MonitorElement *me = ig.get(target_ + "/EXAMPLE");
44  me->getTH1()->Fill(4);
45 
46  ctr_++;
47 
48  ib.setCurrentFolder(target_ + "_lumisummary");
49  MonitorElement *out = ib.book1D("EXAMPLE", "EXAMPLE", 100, 0., 100.);
50  out->setBinContent(ctr_, lumi.luminosityBlock());
51 }
52 
54 
~DemoHarvester() override
void dqmEndLuminosityBlock(DQMStore::IBooker &ib, DQMStore::IGetter &ig, edm::LuminosityBlock const &lumi, edm::EventSetup const &) override
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
void dqmEndJob(DQMStore::IBooker &ib, DQMStore::IGetter &ig) override
void beginRun(const edm::Run &run, const edm::EventSetup &c) override
std::string target_
Definition: DemoHarvester.cc:8
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:673
DemoHarvester(const edm::ParameterSet &)
Definition: Run.h:45
ib
Definition: cuy.py:661