File indexing completed on 2024-09-08 23:51:48
0001 #ifndef GeneratorInterface_RivetInterface_DQMRivetClient_H
0002 #define GeneratorInterface_RivetInterface_DQMRivetClient_H
0003
0004 #include "FWCore/Framework/interface/Frameworkfwd.h"
0005 #include "FWCore/Framework/interface/one/EDAnalyzer.h"
0006 #include "DQMServices/Core/interface/DQMStore.h"
0007 #include <set>
0008 #include <string>
0009 #include <vector>
0010 #include <TH1.h>
0011
0012 class DQMRivetClient : public edm::one::EDAnalyzer<edm::one::SharedResources, edm::one::WatchRuns> {
0013 public:
0014 typedef dqm::legacy::DQMStore DQMStore;
0015 typedef dqm::legacy::MonitorElement MonitorElement;
0016 struct NormOption {
0017 std::string name, normHistName;
0018 };
0019
0020 DQMRivetClient(const edm::ParameterSet& pset);
0021 ~DQMRivetClient() override {}
0022
0023 void analyze(const edm::Event& event, const edm::EventSetup& eventSetup) override {}
0024
0025 void endJob() override;
0026
0027 void beginRun(const edm::Run& r, const edm::EventSetup& c) override {}
0028 void endRun(const edm::Run& r, const edm::EventSetup& c) override;
0029
0030 struct LumiOption {
0031 std::string name, normHistName;
0032 double xsection;
0033 };
0034
0035 struct ScaleFactorOption {
0036 std::string name;
0037 double scale;
0038 };
0039
0040 void normalizeToIntegral(const std::string& startDir, const std::string& histName, const std::string& normHistName);
0041 void normalizeToLumi(const std::string& startDir,
0042 const std::string& histName,
0043 const std::string& normHistName,
0044 double xsection);
0045 void scaleByFactor(const std::string& startDir, const std::string& histName, double factor);
0046
0047 private:
0048 unsigned int verbose_;
0049
0050 DQMStore* theDQM;
0051 std::vector<std::string> subDirs_;
0052 std::string outputFileName_;
0053
0054 std::vector<NormOption> normOptions_;
0055 std::vector<LumiOption> lumiOptions_;
0056 std::vector<ScaleFactorOption> scaleOptions_;
0057 };
0058
0059 #endif