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 dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &) override;
35 
36  enum class EfficType {
37  none = 0,
38  efficiency,
39  fakerate,
41  };
42 
43  struct EfficOption
44  {
48  bool isProfile;
49  };
50 
51  struct ResolOption
52  {
55  };
56 
58  {
61  };
62 
63  struct NormOption
64  {
66  };
67 
68  struct CDOption
69  {
71  bool ascending;
72  };
73 
75  DQMStore::IGetter& igetter,
76  const std::string& startDir,
77  const std::string& efficMEName,
78  const std::string& efficMETitle,
79  const std::string& recoMEName,
80  const std::string& simMEName,
82  const bool makeProfile = false);
84  DQMStore::IGetter& igetter,
85  const std::string& startDir,
86  const std::string& fitMEPrefix, const std::string& fitMETitlePrefix,
87  const std::string& srcMEName);
88  void computeProfile(DQMStore::IBooker& ibooker,
89  DQMStore::IGetter& igetter,
90  const std::string& startDir,
91  const std::string& profileMEName, const std::string& profileMETitle,
92  const std::string& srcMEName);
93 
95  DQMStore::IGetter& igetter,
96  const std::string& startDir,
97  const std::string& histName,
98  const std::string& normHistName);
100  DQMStore::IGetter& igetter,
101  const std::string& startDir,
102  const std::string& cdName,
103  bool ascending=true);
104 
105  void limitedFit(MonitorElement * srcME, MonitorElement * meanME, MonitorElement * sigmaME);
106 
107  private:
108  unsigned int verbose_;
111 
113  std::vector<std::string> subDirs_;
115 
116  std::vector<EfficOption> efficOptions_;
117  std::vector<ResolOption> resolOptions_;
118  std::vector<ProfileOption> profileOptions_;
119  std::vector<NormOption> normOptions_;
120  std::vector<CDOption> cdOptions_;
121 
122  void generic_eff (TH1 * denom, TH1 * numer, MonitorElement * efficiencyHist, const EfficType type=EfficType::efficiency);
123 
125  DQMStore::IGetter& igetter,
127  std::set<std::string> * myList,
128  const TString& pattern);
129 
130 #if ROOT_VERSION_CODE >= ROOT_VERSION(5,27,0)
131 
132 #else
133  class TGraphAsymmErrorsWrapper : public TGraphAsymmErrors {
134  public:
135  std::pair<double, double> efficiency(int numerator, int denominator) {
136  double eff, low, high;
137  Efficiency(numerator, denominator, 0.683, eff, low, high);
138  double error = (eff - low > high - eff) ? eff - low : high - eff;
139  return std::pair<double, double>(eff, error);
140  }
141  };
142 #endif
143 
144 };
145 
146 #endif
147 
148 /* 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 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)
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_
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)
~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 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_