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 
15 #include <set>
16 #include <string>
17 #include <vector>
18 #include <TH1.h>
19 #include <RVersion.h>
20 #if ROOT_VERSION_CODE >= ROOT_VERSION(5,27,0)
21 #include <TEfficiency.h>
22 #else
23 #include <TGraphAsymmErrors.h>
24 #endif
25 
26 class MonitorElement;
27 
29 {
30  public:
32  ~DQMGenericClient() override {};
33 
34  void dqmEndLuminosityBlock(DQMStore::IBooker& ibooker,DQMStore::IGetter& igetter,const edm::LuminosityBlock& lumiSeg, const edm::EventSetup& c) override;
35  void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &) override;
36 
37  enum class EfficType {
38  none = 0,
39  efficiency,
40  fakerate,
42  };
43 
44  struct EfficOption
45  {
49  bool isProfile;
50  };
51 
52  struct ResolOption
53  {
56  };
57 
59  {
62  };
63 
64  struct NormOption
65  {
67  };
68 
69  struct CDOption
70  {
72  bool ascending;
73  };
74 
75  struct NoFlowOption
76  {
78  };
79 
81  DQMStore::IGetter& igetter,
82  const std::string& startDir,
83  const std::string& efficMEName,
84  const std::string& efficMETitle,
85  const std::string& recoMEName,
86  const std::string& simMEName,
88  const bool makeProfile = false);
90  DQMStore::IGetter& igetter,
91  const std::string& startDir,
92  const std::string& fitMEPrefix, const std::string& fitMETitlePrefix,
93  const std::string& srcMEName);
94  void computeProfile(DQMStore::IBooker& ibooker,
95  DQMStore::IGetter& igetter,
96  const std::string& startDir,
97  const std::string& profileMEName, const std::string& profileMETitle,
98  const std::string& srcMEName);
99 
101  DQMStore::IGetter& igetter,
102  const std::string& startDir,
103  const std::string& histName,
104  const std::string& normHistName);
106  DQMStore::IGetter& igetter,
107  const std::string& startDir,
108  const std::string& cdName,
109  bool ascending=true);
110  void makeNoFlowDist(DQMStore::IBooker& ibooker,
111  DQMStore::IGetter& igetter,
112  const std::string& startDir,
113  const std::string& cdName);
114 
115  void limitedFit(MonitorElement * srcME, MonitorElement * meanME, MonitorElement * sigmaME);
116 
117  private:
118  unsigned int verbose_;
124 
126  std::vector<std::string> subDirs_;
128 
129  std::vector<EfficOption> efficOptions_;
130  std::vector<ResolOption> resolOptions_;
131  std::vector<ProfileOption> profileOptions_;
132  std::vector<NormOption> normOptions_;
133  std::vector<CDOption> cdOptions_;
134  std::vector<NoFlowOption> noFlowOptions_;
135 
136  void generic_eff (TH1 * denom, TH1 * numer, MonitorElement * efficiencyHist, const EfficType type=EfficType::efficiency);
137 
139  DQMStore::IGetter& igetter,
141  std::set<std::string> * myList,
142  const TString& pattern);
143 
145 
146  void removeMEIfBooked(const std::string& meName, DQMStore::IGetter& igetter);
147 
148 #if ROOT_VERSION_CODE >= ROOT_VERSION(5,27,0)
149 
150 #else
151  class TGraphAsymmErrorsWrapper : public TGraphAsymmErrors {
152  public:
153  std::pair<double, double> efficiency(int numerator, int denominator) {
154  double eff, low, high;
155  Efficiency(numerator, denominator, 0.683, eff, low, high);
156  double error = (eff - low > high - eff) ? eff - low : high - eff;
157  return std::pair<double, double>(eff, error);
158  }
159  };
160 #endif
161 
162 };
163 
164 #endif
165 
166 /* 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)
dbl *** dir
Definition: mlp_gen.cc:35
void removeMEIfBooked(const std::string &meName, DQMStore::IGetter &igetter)
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_