File indexing completed on 2024-04-06 12:10:11
0001 #include "FWCore/Framework/interface/Frameworkfwd.h"
0002 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0003
0004 #include "DQMServices/Core/interface/DQMEDHarvester.h"
0005
0006 class DemoRunHarvester : public DQMEDHarvester {
0007 private:
0008 std::string target_;
0009 int ctr_ = 0;
0010
0011 public:
0012 explicit DemoRunHarvester(const edm::ParameterSet&);
0013 ~DemoRunHarvester() override {}
0014
0015 void beginRun(const edm::Run& run, const edm::EventSetup& c) override;
0016 void dqmEndJob(DQMStore::IBooker& ib, DQMStore::IGetter& ig) override;
0017 };
0018
0019 DemoRunHarvester::DemoRunHarvester(const edm::ParameterSet& iConfig)
0020 : DQMEDHarvester(iConfig), target_(iConfig.getParameter<std::string>("target")) {}
0021
0022 void DemoRunHarvester::beginRun(const edm::Run& run, const edm::EventSetup& iSetup) {}
0023
0024 void DemoRunHarvester::dqmEndJob(DQMStore::IBooker& ib, DQMStore::IGetter& ig) {
0025 ig.setCurrentFolder(target_);
0026 MonitorElement* me = ig.get(target_ + "/EXAMPLE");
0027 me->getTH1()->Fill(3);
0028
0029 ib.setCurrentFolder(target_ + "_runsummary");
0030 MonitorElement* out = ib.book1D("EXAMPLE", "EXAMPLE", 100, 0., 100.);
0031 out->setBinContent(5, me->getBinContent(5));
0032 }
0033
0034 #include "FWCore/Framework/interface/MakerMacros.h"
0035
0036 DEFINE_FWK_MODULE(DemoRunHarvester);