-
Notifications
You must be signed in to change notification settings - Fork 0
/
acceptance_split.h
335 lines (306 loc) · 8.35 KB
/
acceptance_split.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
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
#include <iostream>
#include <iomanip>
#include <fstream>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <utility>
#include <TFile.h>
#include <TH1F.h>
#include <TH2F.h>
#include <TCanvas.h>
#include <TMatrixD.h>
#include <TMatrixTUtils.h>
#include <TTree.h>
#include <TBranch.h>
#include <TLeaf.h>
#include <TLine.h>
// COLORS
#define RST "\x1B[0m"
#define KRED "\x1B[31m"
#define KGRN "\x1B[32m"
#define KYEL "\x1B[33m"
#define KBLU "\x1B[34m"
#define KMAG "\x1B[35m"
#define KCYN "\x1B[36m"
#define KWHT "\x1B[37m"
#define FRED(x) KRED x RST
#define FGRN(x) KGRN x RST
#define FYEL(x) KYEL x RST
#define FBLU(x) KBLU x RST
#define FMAG(x) KMAG x RST
#define FCYN(x) KCYN x RST
#define FWHT(x) KWHT x RST
#define BOLD(x) "\x1B[1m" x RST
#define UNDL(x) "\x1B[4m" x RST
using namespace std;
//Structs
struct Wrapper { Double_t tab[2][2][5]; };
struct Pvsz { vector<Double_t> vec[2][5]; };
struct hadiden { vector<Double_t> vec; };
struct studyxy { vector<Double_t> vec[2]; };
//Qty containers
vector<Double_t> fQ2;
vector<Double_t> fQ2kin;
vector<Double_t> fQ2local;
vector<Double_t> fXBj;
vector<Double_t> fXBjkin;
vector<Double_t> fYBj;
vector<Double_t> fYBjkin;
vector<Double_t> fWBj;
vector<Double_t> fWBjkin;
vector<Double_t> fNu;
vector<Double_t> fMu;
vector<Double_t> fMu0Cov;
vector<Double_t> fNukin;
vector<Double_t> fQ2_MC;
vector<Double_t> fQ2kinMC;
vector<Double_t> fXBj_MC;
vector<Double_t> fXBjkinMC;
vector<Double_t> fYBj_MC;
vector<Double_t> fYBjkinMC;
vector<Double_t> fWBj_MC;
vector<Double_t> fWBjkinMC;
vector<Double_t> fNu_MC;
vector<Double_t> fMuMC;
vector<Double_t> fNukinMC;
vector<Double_t> fX;
vector<Double_t> fY;
vector<Double_t> fZ;
vector<Double_t> fXMC;
vector<Double_t> fYMC;
vector<Double_t> fZMC;
vector<Double_t> fHM04x;
vector<Double_t> fHM04y;
vector<Double_t> fHM05x;
vector<Double_t> fHM05y;
vector<Double_t> fHL04x;
vector<Double_t> fHL04y;
vector<Double_t> fHL05x;
vector<Double_t> fHL05y;
vector<Double_t> fHO03x;
vector<Double_t> fHO03y;
vector<Double_t> fHO04x;
vector<Double_t> fHO04y;
vector<Double_t> fHG01x;
vector<Double_t> fHG01y;
vector<Double_t> fHG021x;
vector<Double_t> fHG022x;
vector<Double_t> fHG021y;
vector<Double_t> fHG022y;
vector<Double_t> fHM04MCx;
vector<Double_t> fHM04MCy;
vector<Double_t> fHM05MCx;
vector<Double_t> fHM05MCy;
vector<Double_t> fHL04MCx;
vector<Double_t> fHL04MCy;
vector<Double_t> fHL05MCx;
vector<Double_t> fHL05MCy;
vector<Double_t> fHO03MCx;
vector<Double_t> fHO03MCy;
vector<Double_t> fHO04MCx;
vector<Double_t> fHO04MCy;
vector<Double_t> fHG01MCx;
vector<Double_t> fHG01MCy;
vector<Double_t> fHG021MCx;
vector<Double_t> fHG022MCx;
vector<Double_t> fHG021MCy;
vector<Double_t> fHG022MCy;
vector<Double_t> fTCx;
vector<Double_t> fTCy;
//Misc
set<Double_t> fLHsec_set;
Double_t* fLHsec_tab;
Double_t fLHsec;
int fId;
int fId_loose;
int fId_severe;
Double_t fNu_max[3][12];
Double_t fNu_min[3][12];
vector<Double_t> fXv;
vector<Double_t> fYv;
vector<Double_t> fZv;
vector<Double_t> fRv;
bool fAllDISflag;
bool fAllDISflag_MC;
//Counting
Double_t fBP = 0;
Double_t fRmu = 0;
Double_t fBMS = 0;
Double_t fMuchi2 = 0;
Double_t fBEC = 0;
Double_t fVtx = 0;
Double_t fTarg = 0;
Double_t fCell = 0;
Double_t fTrig = 0;
Double_t fMupchi2 = 0;
Double_t fMZfirst = 0;
Double_t fQ2test = 0;
Double_t fYBjtest = 0;
Double_t fXBjtest = 0;
Double_t fBPMC = 0;
Double_t fBECMC = 0;
Double_t fTargMC = 0;
Double_t fCellMC = 0;
Double_t fQ2MCtest = 0;
Double_t fYBjMCtest = 0;
Double_t fWBjMCtest = 0;
Double_t fXBjMCtest = 0;
Double_t fMCDIS = 0;
Double_t fWBjtest = 0;
Double_t fHadrons = 0;
Double_t fXX0test = 0;
Double_t fChi2Hadron = 0;
Double_t fHZfirst = 0;
Double_t fHZlast = 0;
Double_t fMom = 0;
Double_t fTRICH = 0;
Double_t fPosRICH = 0;
Double_t fZtest = 0;
Double_t fHadronsMC = 0;
Double_t fZMCtest = 0;
Double_t fHplus = 0;
Double_t fHminus = 0;
Double_t fPiplus = 0;
Double_t fPiminus = 0;
Double_t fKplus = 0;
Double_t fKminus = 0;
Double_t fPplus = 0;
Double_t fPminus = 0;
Double_t fMCHplus = 0;
Double_t fMCHminus = 0;
Double_t fMCPiplus = 0;
Double_t fMCPiminus = 0;
Double_t fMCKplus = 0;
Double_t fMCKminus = 0;
Double_t fMCPplus = 0;
Double_t fMCPminus = 0;
Double_t fPiplus_true = 0;
Double_t fPiminus_true = 0;
Double_t fKplus_true = 0;
Double_t fKminus_true = 0;
Double_t fPplus_true = 0;
Double_t fPminus_true = 0;
Double_t fPiplus_err = 0;
Double_t fPiminus_err = 0;
Double_t fKplus_err = 0;
Double_t fKminus_err = 0;
Double_t fPplus_err = 0;
Double_t fPminus_err = 0;
//Binning
Wrapper fRcstr[9][6][12];
Wrapper fGnrt[9][6][12];
Wrapper fRcstr_c[9][6][12];
Wrapper fRcstr_zvtx[9][6][12][4];
Wrapper fGnrt_zvtx[9][6][12][4];
Wrapper fRcstr_theta[9][6][12][8];
Wrapper fGnrt_theta[9][6][12][8];
Wrapper fRcstr_pt[9][6][12][10];
Wrapper fGnrt_pt[9][6][12][10];
Double_t fNDIS_evt[3][9][6][12];
Double_t fNDIS_evt_c[3][9][6][12];
Double_t fNDIS_evt_MC[3][9][6][12];
Double_t fNDIS_evt_zvtx[3][9][6][12][4];
Double_t fNDIS_evt_MC_zvtx[3][9][6][12][4];
int xbin, ybin, zbin, xbin_MC, ybin_MC, zbin_u;
Double_t fZrange[13] = {.20,.25,.30,.35,.40,.45,.50,.55,.60,.65,.70,.75,.85};
Double_t fXrange[10] = {.004,.01,.02,.03,.04,.06,.1,.14,.18,.4};
Double_t fYrange[7] = {.1,.15,.2,.3,.5,.7,.9};
Double_t fRcutval[24] = {1.68812,1.6915,1.69572,1.69733,1.71178,1.74735,1.74682,1.7846,1.80058,1.81382,1.83367,1.84183,1.84587,1.8423,1.8376,1.8368,1.84023,1.84309,1.85645,1.86316,1.85021,1.84775,1.84463,1.84185};
int fFlag[3][9][6][12];
int fFlag_MC[3][9][6][12];
Double_t fZ_bin_width[12] = {.05,.05,.05,.05,.05,.05,.05,.05,.05,.05,.05,.1};
//Draw
TH1F* fKinematics[7];
TH2F* fKinematics2D;
TH2F* fBeamCovariance;
TH2F* fHM04;
TH2F* fHM05;
TH2F* fHL04;
TH1F* fHL04x1D;
TH1F* fHL04MCx1D;
TH2F* fHL05;
TH1F* fHL05x1D;
TH1F* fHL05MCx1D;
TH2F* fHLx2D;
TH2F* fHO03;
TH2F* fHO04;
TH2F* fHG01;
TH2F* fHG021;
TH2F* fHG022;
TH2F* fHM04MC;
TH2F* fHM05MC;
TH2F* fHL04MC;
TH2F* fHL04MCx2D;
TH2F* fHL05MC;
TH2F* fHL05MCx2D;
TH2F* fHO03MC;
TH2F* fHO04MC;
TH2F* fHG01MC;
TH2F* fHG021MC;
TH2F* fHG022MC;
TH2F* fTarget2D;
TH2F* fTrigCov;
TH1F* fVertexHadron[3];
TH1F* fVertexHadronMC[3];
TCanvas c1("Kin_Q^{2}","Kin_Q^{2}");
TCanvas c2("Kin_x^{Bj}","Kin_x^{Bj}");
TCanvas c3("Kin_y","Kin_y");
TCanvas c4("Kin_z","Kin_z");
TCanvas c5("Kin_w","Kin_w");
TCanvas c6("Kin_#nu","Kin_#nu");
TCanvas c7("Kin_xy","Kin_xy");
TCanvas c8("target_xy","target_xy");
TCanvas c9("HM04X1","HM04X1");
TCanvas c10("HM05X1","HM05X1");
TCanvas c11("HL04Y1","HL04Y1");
TCanvas c12("HL05Y1","HL05Y1");
TCanvas c13("HO03Y1","HO03Y1");
TCanvas c14("HO04Y1","HO04Y1");
TCanvas c15("HG01Y1","HG01Y1");
TCanvas c16("HG02Y1","HG02Y1");
TCanvas c17("HG02Y2","HG02Y2");
TCanvas c26("HL04Y1y","HL04Y1y");
TCanvas c27("HL05Y1y","HL05Y1y");
TCanvas c28("HLx","HLx");
TCanvas c29("HM04MCX1","HM04MCX1");
TCanvas c30("HM05MCX1","HM05MCX1");
TCanvas c31("HL04MCY1","HL04MCY1");
TCanvas c32("HL05MCY1","HL05MCY1");
TCanvas c33("HO03MCY1","HO03MCY1");
TCanvas c34("HO04MCY1","HO04MCY1");
TCanvas c35("HG01MCY1","HG01MCY1");
TCanvas c36("HG02MCY1","HG02MCY1");
TCanvas c37("HG02MCY2","HG02MCY2");
TCanvas c38("HL04MCY1x","HL04MCY1x");
TCanvas c39("HL05MCY1x","HL05MCY1x");
TCanvas c40("E_{#mu}","E_{#mu}");
TCanvas c41("Trigger_Coverage","Trigger_Coverage");
TCanvas c42("Vertex Hadron+e","Vertex Hadron+e");
TCanvas c43("Vertex MC","Vertex MC",1200,1200);
TCanvas c44("Beam Covariance","Beam Covariance",1200,1200);
TH1F* fKinematicsMC[7];
TH2F* fKinematics2DMC;
TH2F* fTarget2DMC;
TH1F* fVertexStudyMC[4];
TH2F* fVertexStudyMC2D[3];
TCanvas c18("KinMC_Q^{2}","KinMC_Q^{2}");
TCanvas c19("KinMC_x^{Bj}","KinMC_x^{Bj}");
TCanvas c20("KinMC_y","KinMC_y");
TCanvas c21("KinMC_z","KinMC_z");
TCanvas c22("KinMC_w","KinMC_w");
TCanvas c23("KinMC_#nu","KinMC_#nu");
TCanvas c24("KinMC_xy","KinMC_xy");
TCanvas c25("targetMC_xy","targetMC_xy");
//Graphic Style
Int_t fMarkerColor[2] = {4,2};
Int_t fMarkerStyle[2] = {24,20};
//Constants
static const Double_t fM_p = 938.272046/(1e3);
static const Double_t fM_mu = 105.6583715/(1e3);
static const Double_t fM_K = 493.677/(1e3);
static const Double_t fM_pi = 139.57018/(1e3);
// Reweighting
Double_t Cth[2][31] = {{1.70, 1.45, 1.32, 1.25, 1.23, 1.20, 1.12, 1.01, 0.99, 0.96, 0.97, 0.88, 0.87, 0.83, 0.82, 0.73, 0.70, 0.69, 0.69, 0.65, 0.68, 0.62, 0.61, 0.64, 0.62, 0.65, 0.60, 0.58, 0.70, 0.68, 0.69},
{1.66, 1.40, 1.32, 1.32, 1.31, 1.23, 1.15, 1.08, 1.05, 1.03, 0.98, 0.95, 0.89, 0.85, 0.80, 0.77, 0.72, 0.71, 0.64, 0.62, 0.64, 0.55, 0.55, 0.56, 0.50, 0.56, 0.58, 0.51, 0.51, 0.54, 0.53}};