forked from ltikvica/WZanalysis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
UnfoldingAnalysis.h
200 lines (114 loc) · 3.12 KB
/
UnfoldingAnalysis.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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
#ifndef UnfoldingAnalysis_h
#define UnfoldingAnalysis_h
#include "RooUnfoldResponse.h"
#include "WZEvent.h"
#include "TTree.h"
#include "TFile.h"
#include "TH1D.h"
#include <string>
#include <fstream>
class UnfoldingAnalysis {
public:
UnfoldingAnalysis(std::string k, WZEvent * e);
virtual void Init() {};
void CreateBaseHistos();
void FillEvent(bool controlSample=false);
virtual void EventAnalysis(bool controlSample=false)=0;
virtual void Finish(TFile * fout=0);
void FillPurityStability();
void ApplyLuminosityNormalization(double norm);
void UseModifiedShape(bool use=true);
protected:
virtual TH1D * createHistogram(std::string s, std::string title)=0;
double GetRecoWeight();
double GetGenWeight();
virtual double GetShapeWeight(double var); // { return 1.;}
WZEvent * wzevt;
TH1D * genHistos[5];
TH1D * recoHistos[5];
TH1D * genXSHistos[5];
TH1D * controlRecoHistos[5];
TH1D * controlGenHistos[5];
// TH1D * stabilityHistos[4];
// TH1D * purityHistos[4];
TH1D * purityPlot[5];
TH1D * purityPlotDenominator[5];
TH1D * stabilityPlot[5];
TH1D * stabilityPlotDenominator[5];
RooUnfoldResponse *response[5];
std::string key;
double * trueValue;
double * recoValue;
bool normalizeToLumi;
bool useNormalizedWeights;
bool useModifiedShape;
TTree * resolutionTree;
double * shapeWeights;
double missYield;
double fakeYield;
double fillYield;
};
class UnfoldingLeadingJetPt : public UnfoldingAnalysis {
public:
UnfoldingLeadingJetPt(WZEvent * e);
// UnfoldingAnalysis("LeadJetPt", e)
// {
// trueValue = &leadingGenJetPt;
// recoValue = &leadingRecoJetPt;
// };
void EventAnalysis(bool controlSample=false);
void Finish(TFile * fout=0);
void Init();
protected:
// double GetShapeWeight(double var);
double leadingRecoJetPt;
double leadingGenJetPt;
double leadingRecoJetPhi;
double leadingGenJetPhi;;
double leadingRecoJetEta;
double leadingGenJetEta;
double leadingRecoJetDRZl;
double leadingRecoJetDRWl;
TH1D * createHistogram(std::string s, std::string title);
TH1D * hnGenJets[5];
TH1D * hnRecoJets[5];
};
class UnfoldingNjets : public UnfoldingAnalysis {
public:
UnfoldingNjets(WZEvent * e);
void EventAnalysis(bool controlSample=false);
// void Finish(TFile * fout=0);
void Init();
protected:
/*
double leadingRecoJetPt;
double leadingGenJetPt;
double leadingRecoJetPhi;
double leadingGenJetPhi;;
double leadingRecoJetEta;
double leadingGenJetEta;
double leadingRecoJetDRZl;
double leadingRecoJetDRWl;
*/
double nGenJets;
double nRecoJets;
TH1D * createHistogram(std::string s, std::string title);
TH1D * hnGenJets[5];
TH1D * hnRecoJets[5];
};
class UnfoldingZPt : public UnfoldingAnalysis {
public:
UnfoldingZPt(WZEvent * e);
void EventAnalysis(bool controlSample=false);
// void Finish(TFile * fout=0);
void Init();
protected:
double recoZPt;
double genZPt;
double recoZPhi;
double genZPhi;
double recoZEta;
double genZEta;
TH1D * createHistogram(std::string s, std::string title);
};
#endif