-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdp_probtests_rdf.C
executable file
·378 lines (289 loc) · 17.1 KB
/
dp_probtests_rdf.C
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
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
{//begin
#include <TMath.h>
#include <math.h>
#include "scripts/fit1MeV_GaussianPlusCBWithExp_redo.C"
using namespace std;
using namespace ROOT;
EnableImplicitMT();
//create rdataframe for dp magdown data
RDataFrame dpdf("D2KKpi/DecayTree", "/share/lazy/D2KKpi/dp2kkpi_magdown.root");
RDataFrame dspdf("Dsp2KKpi/DecayTree", "/share/lazy/D2KKpi/dsp2kkpi_magdown.root");
const double phi_pm = 10;//nominally 12
const double phiupperbound = (1019.455+phi_pm)*(1019.455+phi_pm)/1000000;
const double philowerbound = (1019.455-phi_pm)*(1019.455-phi_pm)/1000000;
const int binmin = 1790;//1790 absolute minimum for dp
const int binmax = 2050;//max value for dsp is 2050
const int nbins = 100;
auto inv_m_func = [](double px1, double py1, double pz1, double pe1, double px2, double py2, double pz2, double pe2) {return TLorentzVector(TLorentzVector(px1, py1, pz1, pe1)+TLorentzVector(px2, py2, pz2, pe2)).Mag2()/1000000 ;};
auto prob_func = [](double prob1, double prob2) {return TMath::Log(prob1) - TMath::Log(prob2) ;};
auto probNNx_func = [](double prob1, double prob2, double prob3) {return prob1*prob2*prob3 ;};
auto cut_ipchi2 = [](double x) {return x < 4 ;};//nominally 5
auto cut_fdchi2 = [](double x) {return x > 200 ;};//nominally 175
auto cut_endvertexchi2 = [](double x) {return x < 3 ;};
auto cut_phi = [phiupperbound, philowerbound](double x) {return x > philowerbound && x < phiupperbound ;};
auto cut_prob_5 = [] (double x) {return x>5 ;};
auto cut_prob_0 = [] (double x) {return x>5 ;};
auto cut_probnn1 = [] (double x) {return x < 0.25 ;};
auto cut_probnn2 = [] (double x) {return (x >= 0.25 && x < 0.5) ;};
auto cut_probnn3 = [] (double x) {return (x >= 0.50 && x < 0.75) ;};
auto cut_probnn4 = [] (double x) {return x >= 0.75 ;};
auto dp_cut = dpdf.Filter(cut_ipchi2, {"Dplus_IPCHI2_OWNPV"})
.Filter(cut_fdchi2, {"Dplus_FDCHI2_OWNPV"})
.Filter(cut_endvertexchi2, {"Dplus_ENDVERTEX_CHI2"})
.Define("kminuslog", prob_func, {"Kminus_MC15TuneV1_ProbNNk", "Kminus_MC15TuneV1_ProbNNpi"})
.Define("kpluslog", prob_func, {"Kplus_MC15TuneV1_ProbNNk", "Kplus_MC15TuneV1_ProbNNpi"})
.Define("pipluslog", prob_func, {"Piplus_MC15TuneV1_ProbNNpi", "Piplus_MC15TuneV1_ProbNNk"})
.Filter(cut_prob_5, {"kminuslog"})
.Filter(cut_prob_5, {"kpluslog"})
.Filter(cut_prob_0, {"pipluslog"})
.Define("mkpkm", inv_m_func, {"Kplus_PX", "Kplus_PY", "Kplus_PZ", "Kplus_PE", "Kminus_PX", "Kminus_PY", "Kminus_PZ", "Kminus_PE"})
.Filter(cut_phi, {"mkpkm"})
.Define("ProbNNx", probNNx_func, {"Kminus_MC15TuneV1_ProbNNk", "Kplus_MC15TuneV1_ProbNNk", "Piplus_MC15TuneV1_ProbNNpi"});
auto dsp_cut = dspdf.Filter(cut_ipchi2, {"Dsplus_IPCHI2_OWNPV"})
.Filter(cut_fdchi2, {"Dsplus_FDCHI2_OWNPV"})
.Filter(cut_endvertexchi2, {"Dsplus_ENDVERTEX_CHI2"})
.Define("kminuslog", prob_func, {"Kminus_MC15TuneV1_ProbNNk", "Kminus_MC15TuneV1_ProbNNpi"})
.Define("kpluslog", prob_func, {"Kplus_MC15TuneV1_ProbNNk", "Kplus_MC15TuneV1_ProbNNpi"})
.Define("pipluslog", prob_func, {"Piplus_MC15TuneV1_ProbNNpi", "Piplus_MC15TuneV1_ProbNNk"})
.Filter(cut_prob_5, {"kminuslog"})
.Filter(cut_prob_5, {"kpluslog"})
.Filter(cut_prob_0, {"pipluslog"})
.Define("mkpkm", inv_m_func, {"Kplus_PX", "Kplus_PY", "Kplus_PZ", "Kplus_PE", "Kminus_PX", "Kminus_PY", "Kminus_PZ", "Kminus_PE"})
.Filter(cut_phi, {"mkpkm"})
.Define("ProbNNx", probNNx_func, {"Kminus_MC15TuneV1_ProbNNk", "Kplus_MC15TuneV1_ProbNNk", "Piplus_MC15TuneV1_ProbNNpi"});
auto dp_probnn1 = dp_cut.Filter(cut_probnn1, {"ProbNNx"});
auto dp_probnn2 = dp_cut.Filter(cut_probnn2, {"ProbNNx"});
auto dp_probnn3 = dp_cut.Filter(cut_probnn3, {"ProbNNx"});
auto dp_probnn4 = dp_cut.Filter(cut_probnn4, {"ProbNNx"});
auto dsp_probnn1 = dsp_cut.Filter(cut_probnn1, {"ProbNNx"});
auto dsp_probnn2 = dsp_cut.Filter(cut_probnn2, {"ProbNNx"});
auto dsp_probnn3 = dsp_cut.Filter(cut_probnn3, {"ProbNNx"});
auto dsp_probnn4 = dsp_cut.Filter(cut_probnn4, {"ProbNNx"});
/* This block is used to produce the distribution of ProbNnx for all dp
auto probNNxhist = dp_cut.Fill<double>(TH1D("probNNxhist","ProbNNx after all cuts",20, 0, 1), {"ProbNNx"});
probNNxhist->SetStats(0);
probNNxhist->SetTitleFont(43);
probNNxhist->SetTitleSize(35);
probNNxhist->GetYaxis()->SetTitle("events per 0.05");//Candidates/(1 MeV/c^{2})
probNNxhist->GetYaxis()->SetTitleFont(43);
probNNxhist->GetYaxis()->SetTitleSize(30);
probNNxhist->GetYaxis()->CenterTitle(true);
probNNxhist->GetXaxis()->SetTitle("ProbNNx");//Candidates/(1 MeV/c^{2})
probNNxhist->GetXaxis()->SetTitleFont(43);
probNNxhist->GetXaxis()->SetTitleSize(30);
probNNxhist->GetXaxis()->SetTitleOffset(1.2);
probNNxhist->GetXaxis()->CenterTitle(true);
auto probNNxhistROOT = probNNxhist->DrawCopy();//converts Rhist into ROOThist
auto probNNxcan = new TCanvas("probNNxcan", "probNNxcan", 1200, 800);
probNNxcan->cd();
probNNxhistROOT->Draw();
probNNxcan->SaveAs("image/dp_probnnx.png");
*/
/*This block is used to produce the big plot for mass distributions of both dp and dsp
separated into four sets based off of probnnx
auto dpprobnn1hist = dp_probnn1.Fill<double>(TH1D("dpprobnn1hist","D^{+}_{(s)} #rightarrow K^{+}K^{-}#pi^{+}",nbins, binmin, binmax), {"Dplus_MM"});//D^{+} #rightarrow K^{+}K^{-}#pi^{+} Cut and Fit
dpprobnn1hist->SetStats(0);
dpprobnn1hist->SetTitleFont(43);
dpprobnn1hist->SetTitleSize(33);
dpprobnn1hist->GetYaxis()->SetTitle("Candidates/(1 MeV/c^{2})");//Candidates/(1 MeV/c^{2})
dpprobnn1hist->SetMinimum(100);//make minimum 100 so logy doesnt break, make 100 or better viewing
dpprobnn1hist->GetYaxis()->SetTitleFont(43);
dpprobnn1hist->GetYaxis()->SetTitleSize(30);
dpprobnn1hist->GetYaxis()->CenterTitle(true);
dpprobnn1hist->GetXaxis()->SetTitle("Mass [MeV/c^{2}]");
dpprobnn1hist->GetXaxis()->SetTitleFont(43);
dpprobnn1hist->GetXaxis()->SetTitleSize(25);
dpprobnn1hist->GetXaxis()->CenterTitle(true);
dpprobnn1hist->GetXaxis()->SetTitleOffset(1.2);
dpprobnn1hist->SetLineColor(kRed);
auto dspprobnn1hist = dsp_probnn1.Fill<double>(TH1D("dspprobnn1hist","D^{+}_{(s)} #rightarrow K^{+}K^{-}#pi^{+}",nbins, binmin, binmax), {"Dsplus_MM"});//D^{+}_{s} #rightarrow K^{+}K^{-}#pi^{+} Cut and Fit
dspprobnn1hist->SetStats(0);
dspprobnn1hist->SetTitleFont(43);
dspprobnn1hist->SetTitleSize(33);
dspprobnn1hist->GetYaxis()->SetTitle("Candidates/(1 MeV/c^{2})");//Candidates/(1 MeV/c^{2})
dspprobnn1hist->SetMinimum(100);//make minimum 100 so logy doesnt break, make 100 or better viewing
dspprobnn1hist->GetYaxis()->SetTitleFont(43);
dspprobnn1hist->GetYaxis()->SetTitleSize(30);
dspprobnn1hist->GetYaxis()->CenterTitle(true);
dspprobnn1hist->GetXaxis()->SetTitle("Mass [MeV/c^{2}]");
dspprobnn1hist->GetXaxis()->SetTitleFont(43);
dspprobnn1hist->GetXaxis()->SetTitleSize(30);
dspprobnn1hist->GetXaxis()->CenterTitle(true);
dspprobnn1hist->GetXaxis()->SetTitleOffset(1.2);
dspprobnn1hist->SetLineColor(kRed);
auto dpprobnn2hist = dp_probnn2.Fill<double>(TH1D("dpprobnn2hist","D^{+}_{(s)} #rightarrow K^{+}K^{-}#pi^{+}",nbins, binmin, binmax), {"Dplus_MM"});//D^{+} #rightarrow K^{+}K^{-}#pi^{+} Cut and Fit
dpprobnn2hist->SetStats(0);
dpprobnn2hist->SetTitleFont(43);
dpprobnn2hist->SetTitleSize(33);
dpprobnn2hist->GetYaxis()->SetTitle("Candidates/(1 MeV/c^{2})");//Candidates/(1 MeV/c^{2})
dpprobnn2hist->SetMinimum(100);//make minimum 100 so logy doesnt break, make 100 or better viewing
dpprobnn2hist->GetYaxis()->SetTitleFont(43);
dpprobnn2hist->GetYaxis()->SetTitleSize(30);
dpprobnn2hist->GetYaxis()->CenterTitle(true);
dpprobnn2hist->GetXaxis()->SetTitle("Mass [MeV/c^{2}]");
dpprobnn2hist->GetXaxis()->SetTitleFont(43);
dpprobnn2hist->GetXaxis()->SetTitleSize(25);
dpprobnn2hist->GetXaxis()->CenterTitle(true);
dpprobnn2hist->GetXaxis()->SetTitleOffset(1.2);
dpprobnn2hist->SetLineColor(kBlue);
auto dspprobnn2hist = dsp_probnn2.Fill<double>(TH1D("dspprobnn2hist","D^{+}_{(s)} #rightarrow K^{+}K^{-}#pi^{+}",nbins, binmin, binmax), {"Dsplus_MM"});//D^{+}_{s} #rightarrow K^{+}K^{-}#pi^{+} Cut and Fit
dspprobnn2hist->SetStats(0);
dspprobnn2hist->SetTitleFont(43);
dspprobnn2hist->SetTitleSize(33);
dspprobnn2hist->GetYaxis()->SetTitle("Candidates/(1 MeV/c^{2})");//Candidates/(1 MeV/c^{2})
dspprobnn2hist->SetMinimum(100);//make minimum 100 so logy doesnt break, make 100 or better viewing
dspprobnn2hist->GetYaxis()->SetTitleFont(43);
dspprobnn2hist->GetYaxis()->SetTitleSize(30);
dspprobnn2hist->GetYaxis()->CenterTitle(true);
dspprobnn2hist->GetXaxis()->SetTitle("Mass [MeV/c^{2}]");
dspprobnn2hist->GetXaxis()->SetTitleFont(43);
dspprobnn2hist->GetXaxis()->SetTitleSize(30);
dspprobnn2hist->GetXaxis()->CenterTitle(true);
dspprobnn2hist->GetXaxis()->SetTitleOffset(1.2);
dspprobnn2hist->SetLineColor(kBlue);
auto dpprobnn3hist = dp_probnn3.Fill<double>(TH1D("dpprobnn3hist","D^{+}_{(s)} #rightarrow K^{+}K^{-}#pi^{+}",nbins, binmin, binmax), {"Dplus_MM"});//D^{+} #rightarrow K^{+}K^{-}#pi^{+} Cut and Fit
dpprobnn3hist->SetStats(0);
dpprobnn3hist->SetTitleFont(43);
dpprobnn3hist->SetTitleSize(33);
dpprobnn3hist->GetYaxis()->SetTitle("Candidates/(1 MeV/c^{2})");//Candidates/(1 MeV/c^{2})
dpprobnn3hist->SetMinimum(100);//make minimum 100 so logy doesnt break, make 100 or better viewing
dpprobnn3hist->GetYaxis()->SetTitleFont(43);
dpprobnn3hist->GetYaxis()->SetTitleSize(30);
dpprobnn3hist->GetYaxis()->CenterTitle(true);
dpprobnn3hist->GetXaxis()->SetTitle("Mass [MeV/c^{2}]");
dpprobnn3hist->GetXaxis()->SetTitleFont(43);
dpprobnn3hist->GetXaxis()->SetTitleSize(25);
dpprobnn3hist->GetXaxis()->CenterTitle(true);
dpprobnn3hist->GetXaxis()->SetTitleOffset(1.2);
dpprobnn3hist->SetLineColor(kGreen+2);
auto dspprobnn3hist = dsp_probnn3.Fill<double>(TH1D("dspprobnn3hist","D^{+}_{(s)} #rightarrow K^{+}K^{-}#pi^{+}",nbins, binmin, binmax), {"Dsplus_MM"});//D^{+}_{s} #rightarrow K^{+}K^{-}#pi^{+} Cut and Fit
dspprobnn3hist->SetStats(0);
dspprobnn3hist->SetTitleFont(43);
dspprobnn3hist->SetTitleSize(33);
dspprobnn3hist->GetYaxis()->SetTitle("Candidates/(1 MeV/c^{2})");//Candidates/(1 MeV/c^{2})
dspprobnn3hist->SetMinimum(100);//make minimum 100 so logy doesnt break, make 100 or better viewing
dspprobnn3hist->GetYaxis()->SetTitleFont(43);
dspprobnn3hist->GetYaxis()->SetTitleSize(30);
dspprobnn3hist->GetYaxis()->CenterTitle(true);
dspprobnn3hist->GetXaxis()->SetTitle("Mass [MeV/c^{2}]");
dspprobnn3hist->GetXaxis()->SetTitleFont(43);
dspprobnn3hist->GetXaxis()->SetTitleSize(30);
dspprobnn3hist->GetXaxis()->CenterTitle(true);
dspprobnn3hist->GetXaxis()->SetTitleOffset(1.2);
dspprobnn3hist->SetLineColor(kGreen+2);
auto dpprobnn4hist = dp_probnn4.Fill<double>(TH1D("dpprobnn4hist","D^{+}_{(s)} #rightarrow K^{+}K^{-}#pi^{+}",nbins, binmin, binmax), {"Dplus_MM"});//D^{+} #rightarrow K^{+}K^{-}#pi^{+} Cut and Fit
dpprobnn4hist->SetStats(0);
dpprobnn4hist->SetTitleFont(43);
dpprobnn4hist->SetTitleSize(33);
dpprobnn4hist->GetYaxis()->SetTitle("Candidates/(1 MeV/c^{2})");//Candidates/(1 MeV/c^{2})
dpprobnn4hist->SetMinimum(100);//make minimum 100 so logy doesnt break, make 100 or better viewing
dpprobnn4hist->GetYaxis()->SetTitleFont(43);
dpprobnn4hist->GetYaxis()->SetTitleSize(30);
dpprobnn4hist->GetYaxis()->CenterTitle(true);
dpprobnn4hist->GetXaxis()->SetTitle("Mass [MeV/c^{2}]");
dpprobnn4hist->GetXaxis()->SetTitleFont(43);
dpprobnn4hist->GetXaxis()->SetTitleSize(25);
dpprobnn4hist->GetXaxis()->CenterTitle(true);
dpprobnn4hist->GetXaxis()->SetTitleOffset(1.2);
dpprobnn4hist->SetLineColor(kBlack);
auto dspprobnn4hist = dsp_probnn4.Fill<double>(TH1D("dspprobnn4hist","D^{+}_{(s)} #rightarrow K^{+}K^{-}#pi^{+}",nbins, binmin, binmax), {"Dsplus_MM"});//D^{+}_{s} #rightarrow K^{+}K^{-}#pi^{+} Cut and Fit
dspprobnn4hist->SetStats(0);
dspprobnn4hist->SetTitleFont(43);
dspprobnn4hist->SetTitleSize(33);
dspprobnn4hist->GetYaxis()->SetTitle("Candidates/(1 MeV/c^{2})");//Candidates/(1 MeV/c^{2})
dspprobnn4hist->SetMinimum(100);//make minimum 100 so logy doesnt break, make 100 or better viewing
dspprobnn4hist->GetYaxis()->SetTitleFont(43);
dspprobnn4hist->GetYaxis()->SetTitleSize(30);
dspprobnn4hist->GetYaxis()->CenterTitle(true);
dspprobnn4hist->GetXaxis()->SetTitle("Mass [MeV/c^{2}]");
dspprobnn4hist->GetXaxis()->SetTitleFont(43);
dspprobnn4hist->GetXaxis()->SetTitleSize(30);
dspprobnn4hist->GetXaxis()->CenterTitle(true);
dspprobnn4hist->GetXaxis()->SetTitleOffset(1.2);
dspprobnn4hist->SetLineColor(kBlack);
auto dpdspprobnnlegend = new TLegend(0.65,0.8,0.9,0.9);
dpdspprobnnlegend->AddEntry(dpprobnn1hist.GetPtr(), "0 <= ProbNNx < 0.25", "l");
dpdspprobnnlegend->AddEntry(dpprobnn2hist.GetPtr(), "0.25 <= ProbNNx < 0.5", "l");
dpdspprobnnlegend->AddEntry(dpprobnn3hist.GetPtr(), "0.5 <= ProbNNx < 0.75", "l");
dpdspprobnnlegend->AddEntry(dpprobnn4hist.GetPtr(), "0.75 <= ProbNNx < 1", "l");
auto logyprobnncan = new TCanvas("logyprobnncan", "logyprobnncan", 1600, 1200);
logyprobnncan->cd();
TPad *pad1 = new TPad("pad1","pad1",0,0,1,1);
pad1->Draw();
pad1->cd();
pad1->SetLogy();
dspprobnn4hist->Draw();//draw this one first bc it is tallest
dpprobnn1hist->Draw("same");
dspprobnn1hist->Draw("same");
dpprobnn2hist->Draw("same");
dspprobnn2hist->Draw("same");
dpprobnn3hist->Draw("same");
dspprobnn3hist->Draw("same");
dpprobnn4hist->Draw("same");
dpdspprobnnlegend->Draw("same");
logyprobnncan->SaveAs("image/dp_dsp_ProbNN_tightcuts.png");
*/
auto cut_uppermass = [] (double x) {return x > 1885 ;};
auto cut_middlemass = [] (double x) {return (x >= 1855 && x <= 1885) ;};
auto cut_lowermass = [] (double x) {return x < 1855 ;};
auto dp_uppermass = dp_cut.Filter(cut_uppermass, {"Dplus_MM"});
auto dp_lowermass = dp_cut.Filter(cut_lowermass, {"Dplus_MM"});
auto dp_middlemass = dp_cut.Filter(cut_middlemass, {"Dplus_MM"});
auto dpprobnnkplushist = dp_uppermass.Fill<double>(TH1D("dpprobnnkplushist","ProbNNp for Kaons from D^{+} #rightarrow K^{+}K^{-}#pi^{+}",100,0,1), {"Kplus_MC15TuneV1_ProbNNp"});//D^{+} #rightarrow K^{+}K^{-}#pi^{+} Cut and Fit
dpprobnnkplushist->SetStats(0);
dpprobnnkplushist->SetTitleFont(43);
dpprobnnkplushist->SetTitleSize(33);
dpprobnnkplushist->GetYaxis()->SetTitle("events per 0.01");
dpprobnnkplushist->GetYaxis()->SetTitleFont(43);
dpprobnnkplushist->GetYaxis()->SetTitleSize(30);
dpprobnnkplushist->GetYaxis()->CenterTitle(true);
dpprobnnkplushist->GetXaxis()->SetTitle("ProbNNp");
dpprobnnkplushist->GetXaxis()->SetTitleFont(43);
dpprobnnkplushist->GetXaxis()->SetTitleSize(25);
dpprobnnkplushist->GetXaxis()->CenterTitle(true);
dpprobnnkplushist->GetXaxis()->SetTitleOffset(1.2);
dpprobnnkplushist->SetLineColor(kRed);
auto dpprobnnkplushist2 = dp_lowermass.Fill<double>(TH1D("dpprobnnkplushist2","ProbNNp for Kaons from D^{+} #rightarrow K^{+}K^{-}#pi^{+}",100,0,1), {"Kplus_MC15TuneV1_ProbNNp"});//D^{+} #rightarrow K^{+}K^{-}#pi^{+} Cut and Fit
dpprobnnkplushist2->SetStats(0);
dpprobnnkplushist2->SetTitleFont(43);
dpprobnnkplushist2->SetTitleSize(33);
dpprobnnkplushist2->GetYaxis()->SetTitle("events per 0.01");
dpprobnnkplushist2->GetYaxis()->SetTitleFont(43);
dpprobnnkplushist2->GetYaxis()->SetTitleSize(30);
dpprobnnkplushist2->GetYaxis()->CenterTitle(true);
dpprobnnkplushist2->GetXaxis()->SetTitle("ProbNNp");
dpprobnnkplushist2->GetXaxis()->SetTitleFont(43);
dpprobnnkplushist2->GetXaxis()->SetTitleSize(25);
dpprobnnkplushist2->GetXaxis()->CenterTitle(true);
dpprobnnkplushist2->GetXaxis()->SetTitleOffset(1.2);
dpprobnnkplushist2->SetLineColor(kBlue);
auto dpprobnnkplushist3 = dp_middlemass.Fill<double>(TH1D("dpprobnnkplushist3","ProbNNp for Kaons from D^{+} #rightarrow K^{+}K^{-}#pi^{+}",100,0,1), {"Kplus_MC15TuneV1_ProbNNp"});//D^{+} #rightarrow K^{+}K^{-}#pi^{+} Cut and Fit
dpprobnnkplushist3->SetStats(0);
dpprobnnkplushist3->SetTitleFont(43);
dpprobnnkplushist3->SetTitleSize(33);
dpprobnnkplushist3->GetYaxis()->SetTitle("events per 0.01");
dpprobnnkplushist3->GetYaxis()->SetTitleFont(43);
dpprobnnkplushist3->GetYaxis()->SetTitleSize(30);
dpprobnnkplushist3->GetYaxis()->CenterTitle(true);
dpprobnnkplushist3->GetXaxis()->SetTitle("ProbNNp");
dpprobnnkplushist3->GetXaxis()->SetTitleFont(43);
dpprobnnkplushist3->GetXaxis()->SetTitleSize(25);
dpprobnnkplushist3->GetXaxis()->CenterTitle(true);
dpprobnnkplushist3->GetXaxis()->SetTitleOffset(1.2);
dpprobnnkplushist3->SetLineColor(kBlack);
auto dpprobnnpkaonslegend = new TLegend(0.70,0.75,0.9,0.9);
dpprobnnpkaonslegend->AddEntry(dpprobnnkplushist2.GetPtr(), "K^{+}, m(D+) < 1855", "l");
dpprobnnpkaonslegend->AddEntry(dpprobnnkplushist3.GetPtr(), "K^{+}, 1855 <= m(D+)<= 1885", "l");
dpprobnnpkaonslegend->AddEntry(dpprobnnkplushist.GetPtr(), "K^{+}, 1885 < m(D+)", "l");
auto dpprobnnpkaonscan = new TCanvas("dpprobnnpkaonscan", "dpprobnnpkaonscan", 1200, 800);
dpprobnnpkaonscan->cd();
TPad *pad1 = new TPad("pad1","pad1",0,0,1,1);
pad1->Draw();
pad1->cd();
pad1->SetLogy();
dpprobnnkplushist3->Draw();
dpprobnnkplushist->Draw("same");
dpprobnnkplushist2->Draw("same");
dpprobnnpkaonslegend->Draw("same");
dpprobnnpkaonscan->SaveAs("image/dp_kaon_probnnp_masscut_logy.png");
}//end