-
Notifications
You must be signed in to change notification settings - Fork 4.2k
/
DQMGenericClient.h
148 lines (124 loc) · 3.96 KB
/
DQMGenericClient.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
#ifndef DQMServices_ClientConfig_DQMGenericClient_H
#define DQMServices_ClientConfig_DQMGenericClient_H
/*
* Class:DQMGenericClient
*
* DQM histogram post processor
*
*
* \author Junghwan Goh - SungKyunKwan University
*/
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "DQMServices/Core/interface/DQMEDHarvester.h"
#include <set>
#include <string>
#include <vector>
#include <TH1.h>
#include <RVersion.h>
#if ROOT_VERSION_CODE >= ROOT_VERSION(5,27,0)
#include <TEfficiency.h>
#else
#include <TGraphAsymmErrors.h>
#endif
class MonitorElement;
class DQMGenericClient : public DQMEDHarvester
{
public:
DQMGenericClient(const edm::ParameterSet& pset);
~DQMGenericClient() {};
void dqmEndJob(DQMStore::IBooker &, DQMStore::IGetter &) override;
enum class EfficType {
none = 0,
efficiency,
fakerate,
simpleratio
};
struct EfficOption
{
std::string name, title;
std::string numerator, denominator;
EfficType type;
bool isProfile;
};
struct ResolOption
{
std::string namePrefix, titlePrefix;
std::string srcName;
};
struct ProfileOption
{
std::string name, title;
std::string srcName;
};
struct NormOption
{
std::string name, normHistName;
};
struct CDOption
{
std::string name;
bool ascending;
};
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);
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 computeProfile(DQMStore::IBooker& ibooker,
DQMStore::IGetter& igetter,
const std::string& startDir,
const std::string& profileMEName, const std::string& profileMETitle,
const std::string& srcMEName);
void normalizeToEntries(DQMStore::IBooker& ibooker,
DQMStore::IGetter& igetter,
const std::string& startDir,
const std::string& histName,
const std::string& normHistName);
void makeCumulativeDist(DQMStore::IBooker& ibooker,
DQMStore::IGetter& igetter,
const std::string& startDir,
const std::string& cdName,
bool ascending=true);
void limitedFit(MonitorElement * srcME, MonitorElement * meanME, MonitorElement * sigmaME);
private:
unsigned int verbose_;
bool isWildcardUsed_;
bool resLimitedFit_;
DQMStore* theDQM;
std::vector<std::string> subDirs_;
std::string outputFileName_;
std::vector<EfficOption> efficOptions_;
std::vector<ResolOption> resolOptions_;
std::vector<ProfileOption> profileOptions_;
std::vector<NormOption> normOptions_;
std::vector<CDOption> cdOptions_;
void generic_eff (TH1 * denom, TH1 * numer, MonitorElement * efficiencyHist, const EfficType type=EfficType::efficiency);
void findAllSubdirectories (DQMStore::IBooker& ibooker,
DQMStore::IGetter& igetter,
std::string dir,
std::set<std::string> * myList,
const TString& pattern);
#if ROOT_VERSION_CODE >= ROOT_VERSION(5,27,0)
#else
class TGraphAsymmErrorsWrapper : public TGraphAsymmErrors {
public:
std::pair<double, double> efficiency(int numerator, int denominator) {
double eff, low, high;
Efficiency(numerator, denominator, 0.683, eff, low, high);
double error = (eff - low > high - eff) ? eff - low : high - eff;
return std::pair<double, double>(eff, error);
}
};
#endif
};
#endif
/* vim:set ts=2 sts=2 sw=2 expandtab: */