CMS 3D CMS Logo

DQMGenericClient.h
Go to the documentation of this file.
1 #ifndef DQMServices_ClientConfig_DQMGenericClient_H
2 #define DQMServices_ClientConfig_DQMGenericClient_H
3 
4 /*
5  * Class:DQMGenericClient
6  *
7  * DQM histogram post processor
8  *
9  *
10  * \author Junghwan Goh - SungKyunKwan University
11  */
12 
16 #include <set>
17 #include <string>
18 #include <vector>
19 #include <TH1.h>
20 #include <RVersion.h>
21 #if ROOT_VERSION_CODE >= ROOT_VERSION(5, 27, 0)
22 #include <TEfficiency.h>
23 #else
24 #include <TGraphAsymmErrors.h>
25 #endif
26 
28 public:
30  ~DQMGenericClient() override{};
31 
33  DQMStore::IGetter& igetter,
34  const edm::LuminosityBlock& lumiSeg,
35  const edm::EventSetup& c) override;
37 
38  enum class EfficType { none = 0, efficiency, fakerate, simpleratio };
39 
40  struct EfficOption {
44  bool isProfile;
45  };
46 
47  struct ResolOption {
50  };
51 
52  struct ProfileOption {
55  };
56 
57  struct NormOption {
59  };
60 
61  struct CDOption {
63  bool ascending;
64  };
65 
66  struct NoFlowOption {
68  };
69 
71  DQMStore::IGetter& igetter,
72  const std::string& startDir,
73  const std::string& efficMEName,
74  const std::string& efficMETitle,
75  const std::string& recoMEName,
76  const std::string& simMEName,
78  const bool makeProfile = false);
80  DQMStore::IGetter& igetter,
81  const std::string& startDir,
82  const std::string& fitMEPrefix,
83  const std::string& fitMETitlePrefix,
84  const std::string& srcMEName);
85  void computeProfile(DQMStore::IBooker& ibooker,
86  DQMStore::IGetter& igetter,
87  const std::string& startDir,
88  const std::string& profileMEName,
89  const std::string& profileMETitle,
90  const std::string& srcMEName);
91 
93  DQMStore::IGetter& igetter,
94  const std::string& startDir,
95  const std::string& histName,
96  const std::string& normHistName);
98  DQMStore::IGetter& igetter,
99  const std::string& startDir,
100  const std::string& cdName,
101  bool ascending = true);
102  void makeNoFlowDist(DQMStore::IBooker& ibooker,
103  DQMStore::IGetter& igetter,
104  const std::string& startDir,
105  const std::string& cdName);
106 
107  void limitedFit(MonitorElement* srcME, MonitorElement* meanME, MonitorElement* sigmaME);
108 
109 private:
110  unsigned int verbose_;
116 
118  std::vector<std::string> subDirs_;
120 
121  std::vector<EfficOption> efficOptions_;
122  std::vector<ResolOption> resolOptions_;
123  std::vector<ProfileOption> profileOptions_;
124  std::vector<NormOption> normOptions_;
125  std::vector<CDOption> cdOptions_;
126  std::vector<NoFlowOption> noFlowOptions_;
127 
128  void generic_eff(TH1* denom, TH1* numer, MonitorElement* efficiencyHist, const EfficType type = EfficType::efficiency);
129 
131  DQMStore::IGetter& igetter,
133  std::set<std::string>* myList,
134  const TString& pattern);
135 
137 
138 #if ROOT_VERSION_CODE >= ROOT_VERSION(5, 27, 0)
139 
140 #else
141  class TGraphAsymmErrorsWrapper : public TGraphAsymmErrors {
142  public:
143  std::pair<double, double> efficiency(int numerator, int denominator) {
144  double eff, low, high;
145  Efficiency(numerator, denominator, 0.683, eff, low, high);
146  double error = (eff - low > high - eff) ? eff - low : high - eff;
147  return std::pair<double, double>(eff, error);
148  }
149  };
150 #endif
151 };
152 
153 #endif
154 
155 /* vim:set ts=2 sts=2 sw=2 expandtab: */
std::vector< EfficOption > efficOptions_
type
Definition: HCALResponse.h:21
void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &) override
std::vector< ProfileOption > profileOptions_
void makeCumulativeDist(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter, const std::string &startDir, const std::string &cdName, bool ascending=true)
std::vector< ResolOption > resolOptions_
std::vector< std::string > subDirs_
void makeAllPlots(DQMStore::IBooker &, DQMStore::IGetter &)
void normalizeToEntries(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter, const std::string &startDir, const std::string &histName, const std::string &normHistName)
void computeResolution(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter, const std::string &startDir, const std::string &fitMEPrefix, const std::string &fitMETitlePrefix, const std::string &srcMEName)
void makeNoFlowDist(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter, const std::string &startDir, const std::string &cdName)
std::string outputFileName_
void findAllSubdirectories(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter, std::string dir, std::set< std::string > *myList, const TString &pattern)
unsigned int verbose_
void dqmEndLuminosityBlock(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter, const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c) override
std::vector< CDOption > cdOptions_
void computeEfficiency(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter, const std::string &startDir, const std::string &efficMEName, const std::string &efficMETitle, const std::string &recoMEName, const std::string &simMEName, const EfficType type=EfficType::efficiency, const bool makeProfile=false)
std::vector< NoFlowOption > noFlowOptions_
~DQMGenericClient() override
DQMGenericClient(const edm::ParameterSet &pset)
void computeProfile(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter, const std::string &startDir, const std::string &profileMEName, const std::string &profileMETitle, const std::string &srcMEName)
void limitedFit(MonitorElement *srcME, MonitorElement *meanME, MonitorElement *sigmaME)
void generic_eff(TH1 *denom, TH1 *numer, MonitorElement *efficiencyHist, const EfficType type=EfficType::efficiency)
std::vector< NormOption > normOptions_