forked from cms-sw/cmssw
-
Notifications
You must be signed in to change notification settings - Fork 0
/
DQMGenericClient.h
120 lines (97 loc) · 3.21 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
#ifndef DQMServices_ClientConfig_DQMGenericClient_H
#define DQMServices_ClientConfig_DQMGenericClient_H
/*
* Class:DQMGenericClient
*
* DQM histogram post processor
*
* $Date: 2013/05/23 16:16:28 $
* $Revision: 1.10 $
*
* \author Junghwan Goh - SungKyunKwan University
* \modified Cesare Calabria - Università & INFN Bari
*/
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/EDAnalyzer.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 DQMStore;
class MonitorElement;
class DQMGenericClient : public edm::EDAnalyzer
{
public:
DQMGenericClient(const edm::ParameterSet& pset);
~DQMGenericClient() {};
void analyze(const edm::Event& event, const edm::EventSetup& eventSetup) {};
void endJob();
/// EndRun
void endRun(const edm::Run& r, const edm::EventSetup& c);
struct EfficOption
{
std::string name, title;
std::string numerator, denominator;
int type;
bool isProfile;
};
struct ResolOption
{
std::string namePrefix, titlePrefix;
std::string srcName;
};
struct NormOption
{
std::string name, normHistName;
};
struct CDOption
{
std::string name;
};
void computeEfficiency(const std::string& startDir,
const std::string& efficMEName,
const std::string& efficMETitle,
const std::string& recoMEName,
const std::string& simMEName,
const int type=1,
const bool makeProfile = false);
void computeResolution(const std::string& startDir,
const std::string& fitMEPrefix, const std::string& fitMETitlePrefix,
const std::string& srcMEName);
void normalizeToEntries(const std::string& startDir, const std::string& histName, const std::string& normHistName);
void makeCumulativeDist(const std::string& startDir, const std::string& cdName);
void limitedFit(MonitorElement * srcME, MonitorElement * meanME, MonitorElement * sigmaME, MonitorElement * rmsME);
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<NormOption> normOptions_;
std::vector<CDOption> cdOptions_;
void generic_eff (TH1 * denom, TH1 * numer, MonitorElement * efficiencyHist, const int type=1);
void findAllSubdirectories (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: */