BOSS 7.0.9
BESIII Offline Software System
Loading...
Searching...
No Matches
DQA/DQASelBhabha/DQASelBhabha-00-00-11/share/eff.cxx
Go to the documentation of this file.
1{
2Double_t x[18]={.1,.2,.3,.4,.5,.6,.7,.8,.9,1.,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8};
3Double_t errx[18]={0};
4
5Int_t pxy_ep1[18];
6Int_t pxy_ep2[18];
7Int_t pxy_ep3[18];
8Int_t pxy_ep4[18];
9Int_t pxy_ep5[18];
10Int_t pxy_ep6[18];
11Int_t pxy_ep7[18];
12Int_t pxy_ep8[18];
13Int_t pxy_ep9[18];
14Int_t pxy_ep10[18];
15Int_t pxy_ep11[18];
16Int_t pxy_ep12[18];
17
18Int_t pxy_em1[18];
19Int_t pxy_em2[18];
20Int_t pxy_em3[18];
21Int_t pxy_em4[18];
22Int_t pxy_em5[18];
23Int_t pxy_em6[18];
24Int_t pxy_em7[18];
25Int_t pxy_em8[18];
26Int_t pxy_em9[18];
27Int_t pxy_em10[18];
28Int_t pxy_em11[18];
29Int_t pxy_em12[18];
30
31Double_t eff_ep[18];
32Double_t eff_em[18];
33Double_t err_ep[18];
34Double_t err_em[18];
35
36Double_t eff_ep2[18];
37Double_t eff_em2[18];
38Double_t err_ep2[18];
39Double_t err_em2[18];
40
41Double_t eff_ep3[18];
42Double_t eff_em3[18];
43Double_t err_ep3[18];
44Double_t err_em3[18];
45
46Double_t eff_ep4[18];
47Double_t eff_em4[18];
48Double_t err_ep4[18];
49Double_t err_em4[18];
50
51Double_t eff_ep5[18];
52Double_t eff_em5[18];
53Double_t err_ep5[18];
54Double_t err_em5[18];
55
56Double_t eff_ep6[18];
57Double_t eff_em6[18];
58Double_t err_ep6[18];
59Double_t err_em6[18];
60
61
62
63Char_t cut[200];
64
65
66//TFile f("./ana_bhabha660_dqa_mc.root");
67//TFile f("ana_bhabha660a_dqa_dataPat.root");
68TFile f("ana_bhabha660a_dqa_mcPat_zy_old.root");
69for (Int_t j=5; j<15; j++){
70 sprintf(cut,"kal_costheta0_em>-0.93&&kal_costheta0_em<0.93&&kal_pxy0_em>=0.05+%d*0.1&&kal_pxy0_em<0.15+%d*0.1&&NGch>=1",j,j);
71 Bhabha->Draw("kal_pxy0_em",cut);
72 pxy_ep1[j]=htemp->GetEntries();
73 sprintf(cut,"kal_costheta0_em>-0.93&&kal_costheta0_em<0.93&&kal_pxy0_em>=0.05+%d*0.1&&kal_pxy0_em<0.15+%d*0.1&&NGch>=2",j,j);
74 Bhabha->Draw("kal_pxy0_em",cut);
75 pxy_ep2[j]=htemp->GetEntries();
76 sprintf(cut,"kal_costheta0_ep>-0.93&&kal_costheta0_ep<0.93&&kal_pxy0_ep>=0.05+%d*0.1&&kal_pxy0_ep<0.15+%d*0.1&&NGch>=1",j,j);
77 Bhabha->Draw("kal_pxy0_ep",cut);
78 pxy_em1[j]=htemp->GetEntries();
79 sprintf(cut,"kal_costheta0_ep>-0.93&&kal_costheta0_ep<0.93&&kal_pxy0_ep>=0.05+%d*0.1&&kal_pxy0_ep<0.15+%d*0.1&&NGch>=2",j,j);
80 Bhabha->Draw("kal_pxy0_ep",cut);
81 pxy_em2[j]=htemp->GetEntries();
82}
83
84
85for (Int_t i=5;i<15;i++){
86 eff_ep[i]=pxy_ep2[i]*.1/(pxy_ep1[i]*.1);
87 err_ep[i]=sqrt(eff_ep[i]*(1.-eff_ep[i])/pxy_ep1[i]);
88
89 eff_em[i]=pxy_em2[i]*.1/(pxy_em1[i]*.1);
90 err_em[i]=sqrt(eff_em[i]*(1.-eff_em[i])/pxy_em1[i]);
91}
92
93cout<<"end eff1"<<endl;
94//////////////////////////////////////////////////////////////////////////////////
95//TFile f("./ana_bhabha660a_dqa_mc_newPat.root");
96//TFile f("ana_bhabha660a_dqa_dataTsf.root");
97TFile f("ana_bhabha660a_dqa_dataPat_zy_old.root");
98for (Int_t j=5; j<15; j++){
99 sprintf(cut,"kal_costheta0_em>-0.93&&kal_costheta0_em<0.93&&kal_pxy0_em>=0.05+%d*0.1&&kal_pxy0_em<0.15+%d*0.1&&NGch>=1",j,j);
100 Bhabha->Draw("kal_pxy0_em",cut);
101 pxy_ep3[j]=htemp->GetEntries();
102 sprintf(cut,"kal_costheta0_em>-0.93&&kal_costheta0_em<0.93&&kal_pxy0_em>=0.05+%d*0.1&&kal_pxy0_em<0.15+%d*0.1&&NGch>=2",j,j);
103 Bhabha->Draw("kal_pxy0_em",cut);
104 pxy_ep4[j]=htemp->GetEntries();
105
106 sprintf(cut,"kal_costheta0_ep>-0.93&&kal_costheta0_ep<0.93&&kal_pxy0_ep>=0.05+%d*0.1&&kal_pxy0_ep<0.15+%d*0.1&&NGch>=1",j,j);
107 Bhabha->Draw("kal_pxy0_ep",cut);
108 pxy_em3[j]=htemp->GetEntries();
109 sprintf(cut,"kal_costheta0_ep>-0.93&&kal_costheta0_ep<0.93&&kal_pxy0_ep>=0.05+%d*0.1&&kal_pxy0_ep<0.15+%d*0.1&&NGch>=2",j,j);
110 Bhabha->Draw("kal_pxy0_ep",cut);
111 pxy_em4[j]=htemp->GetEntries();
112
113}
114
115
116for (Int_t i=5;i<15;i++){
117 eff_ep2[i]=pxy_ep4[i]*.1/(pxy_ep3[i]*.1);
118 err_ep2[i]=sqrt(eff_ep2[i]*(1.-eff_ep2[i])/pxy_ep3[i]);
119
120 eff_em2[i]=pxy_em4[i]*.1/(pxy_em3[i]*.1);
121 err_em2[i]=sqrt(eff_em2[i]*(1.-eff_em2[i])/pxy_em3[i]);
122}
123cout<<"end eff2"<<endl;
124///////////////////////////////////////////////////////////////////////////////////////
125//TFile f("./ana_bhabha660a_dqa_mc_Pat.root");
126//TFile f("ana_bhabha660a_dqa_mc_Pat.root");
127//TFile f("ana_bhabha660a_dqa_mcTsf_zy.root");
128TFile f("ana_bhabha660a_dqa_mcPat_zy_new.root");
129for (Int_t j=5; j<15; j++){
130 cout<<"j="<<j<<endl;
131 sprintf(cut,"kal_costheta0_em>-0.93&&kal_costheta0_em<0.93&&kal_pxy0_em>=0.05+%d*0.1&&kal_pxy0_em<0.15+%d*0.1&&NGch>=1",j,j);
132 Bhabha->Draw("kal_pxy0_em",cut);
133 pxy_ep5[j]=htemp->GetEntries();
134 sprintf(cut,"kal_costheta0_em>-0.93&&kal_costheta0_em<0.93&&kal_pxy0_em>=0.05+%d*0.1&&kal_pxy0_em<0.15+%d*0.1&&NGch>=2",j,j);
135 Bhabha->Draw("kal_pxy0_em",cut);
136 pxy_ep6[j]=htemp->GetEntries();
137
138 sprintf(cut,"kal_costheta0_ep>-0.93&&kal_costheta0_ep<0.93&&kal_pxy0_ep>=0.05+%d*0.1&&kal_pxy0_ep<0.15+%d*0.1&&NGch>=1",j,j);
139 Bhabha->Draw("kal_pxy0_ep",cut);
140 pxy_em5[j]=htemp->GetEntries();
141 sprintf(cut,"kal_costheta0_ep>-0.93&&kal_costheta0_ep<0.93&&kal_pxy0_ep>=0.05+%d*0.1&&kal_pxy0_ep<0.15+%d*0.1&&NGch>=2",j,j);
142 Bhabha->Draw("kal_pxy0_ep",cut);
143 pxy_em6[j]=htemp->GetEntries();
144
145}
146
147for (Int_t i=5;i<15;i++){
148 eff_ep3[i]=pxy_ep6[i]*.1/(pxy_ep5[i]*.1);
149 err_ep3[i]=sqrt(eff_ep3[i]*(1.-eff_ep3[i])/pxy_ep5[i]);
150
151 eff_em3[i]=pxy_em6[i]*.1/(pxy_em5[i]*.1);
152 err_em3[i]=sqrt(eff_em3[i]*(1.-eff_em3[i])/pxy_em5[i]);
153}
154
155cout<<"end eff3"<<endl;
156/////////////////////////////////////////////////////////////////////////////////////
157
158
159//TFile f("./ana_bhabha660a_dqa_mc_newPat_newKal.root");
160//TFile f("ana_bhabha660a_dqa_mcTsf.root");
161//TFile f("ana_bhabha660a_dqa_dataTsf_zy.root");
162TFile f("ana_bhabha660a_dqa_dataPat_zy_new.root");
163for (Int_t j=5; j<15; j++){
164 sprintf(cut,"kal_costheta0_em>-0.93&&kal_costheta0_em<0.93&&kal_pxy0_em>=0.05+%d*0.1&&kal_pxy0_em<0.15+%d*0.1&&NGch>=1",j,j);
165 Bhabha->Draw("kal_pxy0_em",cut);
166 pxy_ep7[j]=htemp->GetEntries();
167 sprintf(cut,"kal_costheta0_em>-0.93&&kal_costheta0_em<0.93&&kal_pxy0_em>=0.05+%d*0.1&&kal_pxy0_em<0.15+%d*0.1&&NGch>=2",j,j);
168 Bhabha->Draw("kal_pxy0_em",cut);
169 pxy_ep8[j]=htemp->GetEntries();
170
171 sprintf(cut,"kal_costheta0_ep>-0.93&&kal_costheta0_ep<0.93&&kal_pxy0_ep>=0.05+%d*0.1&&kal_pxy0_ep<0.15+%d*0.1&&NGch>=1",j,j);
172 Bhabha->Draw("kal_pxy0_ep",cut);
173 pxy_em7[j]=htemp->GetEntries();
174 sprintf(cut,"kal_costheta0_ep>-0.93&&kal_costheta0_ep<0.93&&kal_pxy0_ep>=0.05+%d*0.1&&kal_pxy0_ep<0.15+%d*0.1&&NGch>=2",j,j);
175 Bhabha->Draw("kal_pxy0_ep",cut);
176 pxy_em8[j]=htemp->GetEntries();
177
178}
179
180for (Int_t i=5;i<15;i++){
181 eff_ep4[i]=pxy_ep8[i]*.1/(pxy_ep7[i]*.1);
182 err_ep4[i]=sqrt(eff_ep4[i]*(1.-eff_ep4[i])/pxy_ep7[i]);
183
184 eff_em4[i]=pxy_em8[i]*.1/(pxy_em7[i]*.1);
185 err_em4[i]=sqrt(eff_em4[i]*(1.-eff_em4[i])/pxy_em7[i]);
186}
187
188cout<<"end eff4"<<endl;
189// /////////////////////////////////////////////////////////////////////////////////////
190
191cout<<pxy_em2[6]<<" "<<pxy_em2[7]<<endl;
192cout<<pxy_em8[6]<<" "<<pxy_em8[7]<<endl;
193
194
195//TFile f("./ana_data653_mc_eff_nocut.root");
196TFile f("./ana_bhabha660a_dqa_mc_Pat_newKal.root");
197for (Int_t j=5; j<15; j++){
198 sprintf(cut,"kal_costheta0_em>-0.93&&kal_costheta0_em<0.93&&kal_pxy0_em>=0.05+%d*0.1&&kal_pxy0_em<0.15+%d*0.1&&NGch>=1",j,j);
199 Bhabha->Draw("kal_pxy0_em",cut);
200 pxy_ep9[j]=htemp->GetEntries();
201 sprintf(cut,"kal_costheta0_em>-0.93&&kal_costheta0_em<0.93&&kal_pxy0_em>=0.05+%d*0.1&&kal_pxy0_em<0.15+%d*0.1&&NGch>=2",j,j);
202 Bhabha->Draw("kal_pxy0_em",cut);
203 pxy_ep10[j]=htemp->GetEntries();
204
205 sprintf(cut,"kal_costheta0_ep>-0.93&&kal_costheta0_ep<0.93&&kal_pxy0_ep>=0.05+%d*0.1&&kal_pxy0_ep<0.15+%d*0.1&&NGch>=1",j,j);
206 Bhabha->Draw("kal_pxy0_ep",cut);
207 pxy_em9[j]=htemp->GetEntries();
208 sprintf(cut,"kal_costheta0_ep>-0.93&&kal_costheta0_ep<0.93&&kal_pxy0_ep>=0.05+%d*0.1&&kal_pxy0_ep<0.15+%d*0.1&&NGch>=2",j,j);
209 Bhabha->Draw("kal_pxy0_ep",cut);
210 pxy_em10[j]=htemp->GetEntries();
211
212}
213
214for (Int_t i=5;i<15;i++){
215 eff_ep5[i]=pxy_ep10[i]*.1/(pxy_ep9[i]*.1);
216 err_ep5[i]=sqrt(eff_ep5[i]*(1.-eff_ep5[i])/pxy_ep9[i]);
217
218 eff_em5[i]=pxy_em10[i]*.1/(pxy_em9[i]*.1);
219 err_em5[i]=sqrt(eff_em5[i]*(1.-eff_em5[i])/pxy_em9[i]);
220}
221
222cout<<"end eff5"<<endl;
223// /////////////////////////////////////////////////////////////////////////////////////
224
225
226
227// //TFile f("./ana_data653_mc_eff_nomix.root");
228// TFile f("./ana_data653_mc_eff_mdctest.root");
229// for (Int_t j=5; j<15; j++){
230// sprintf(cut,"kal_costheta0_em>-0.93&&kal_costheta0_em<0.93&&kal_pxy0_em>=0.05+%d*0.1&&kal_pxy0_em<0.15+%d*0.1&&NGch>=1",j,j);
231// Bhabha->Draw("kal_pxy0_em",cut);
232// pxy_ep11[j]=htemp->GetEntries();
233// sprintf(cut,"kal_costheta0_em>-0.93&&kal_costheta0_em<0.93&&kal_pxy0_em>=0.05+%d*0.1&&kal_pxy0_em<0.15+%d*0.1&&NGch>=2",j,j);
234// Bhabha->Draw("kal_pxy0_em",cut);
235// pxy_ep12[j]=htemp->GetEntries();
236
237// sprintf(cut,"kal_costheta0_ep>-0.93&&kal_costheta0_ep<0.93&&kal_pxy0_ep>=0.05+%d*0.1&&kal_pxy0_ep<0.15+%d*0.1&&NGch>=1",j,j);
238// Bhabha->Draw("kal_pxy0_ep",cut);
239// pxy_em11[j]=htemp->GetEntries();
240// sprintf(cut,"kal_costheta0_ep>-0.93&&kal_costheta0_ep<0.93&&kal_pxy0_ep>=0.05+%d*0.1&&kal_pxy0_ep<0.15+%d*0.1&&NGch>=2",j,j);
241// Bhabha->Draw("kal_pxy0_ep",cut);
242// pxy_em12[j]=htemp->GetEntries();
243
244// }
245
246// for (Int_t i=5;i<15;i++){
247// eff_ep6[i]=pxy_ep12[i]*.1/(pxy_ep11[i]*.1);
248// err_ep6[i]=sqrt(eff_ep6[i]*(1.-eff_ep6[i])/pxy_ep11[i]);
249
250// eff_em6[i]=pxy_em12[i]*.1/(pxy_em11[i]*.1);
251// err_em6[i]=sqrt(eff_em6[i]*(1.-eff_em6[i])/pxy_em11[i]);
252// }
253
254// cout<<"end eff6"<<endl;
255/////////////////////////////////////////////////////////////////////////////////////
256
257
258
259
260
261
262
263
264
265
266
267
268TGraph *gr1 = new TGraphErrors(15,x,eff_ep,errx,err_ep);
269TGraph *gr2 = new TGraphErrors(15,x,eff_em,errx,err_em);
270TGraph *gr3 = new TGraphErrors(15,x,eff_ep2,errx,err_ep2);
271TGraph *gr4 = new TGraphErrors(15,x,eff_em2,errx,err_em2);
272TGraph *gr5 = new TGraphErrors(15,x,eff_ep3,errx,err_ep3);
273TGraph *gr6 = new TGraphErrors(15,x,eff_em3,errx,err_em3);
274TGraph *gr7 = new TGraphErrors(15,x,eff_ep4,errx,err_ep4);
275TGraph *gr8 = new TGraphErrors(15,x,eff_em4,errx,err_em4);
276TGraph *gr9 = new TGraphErrors(15,x,eff_ep5,errx,err_ep5);
277TGraph *gr10 = new TGraphErrors(15,x,eff_em5,errx,err_em5);
278// TGraph *gr11 = new TGraphErrors(15,x,eff_ep6,errx,err_ep6);
279// TGraph *gr12 = new TGraphErrors(15,x,eff_em6,errx,err_em6);
280
281
282
283
284
285TCanvas *c1 = new TCanvas ("c1","bhabha_eff",100,10,600,400);
286TMultiGraph *mg = new TMultiGraph();
287
288
289//c1->SetGrid();
290
291mg->SetTitle("bhabha_eff");
292
293gr1->SetLineColor(1);
294gr2->SetLineColor(2);
295gr3->SetLineColor(1);
296gr4->SetLineColor(2);
297gr5->SetLineColor(1);
298gr6->SetLineColor(1);
299gr7->SetLineColor(2);
300gr8->SetLineColor(2);
301gr9->SetLineColor(5);
302gr10->SetLineColor(5);
303// gr11->SetLineColor(2);
304// gr12->SetLineColor(2);
305
306gr1->SetMarkerColor(1);
307gr2->SetMarkerColor(2);
308gr3->SetMarkerColor(1);
309gr4->SetMarkerColor(1);
310gr5->SetMarkerColor(1);
311gr6->SetMarkerColor(1);
312gr7->SetMarkerColor(2);
313gr8->SetMarkerColor(2);
314gr9->SetMarkerColor(5);
315gr10->SetMarkerColor(5);
316// gr11->SetMarkerColor(2);
317// gr12->SetMarkerColor(2);
318
319gr1->SetMarkerStyle(8);
320gr2->SetMarkerStyle(8);
321gr3->SetMarkerStyle(20);
322gr4->SetMarkerStyle(20);
323gr5->SetMarkerStyle(8);
324gr6->SetMarkerStyle(8);
325gr7->SetMarkerStyle(20);
326gr8->SetMarkerStyle(20);
327gr9->SetMarkerStyle(28);
328gr10->SetMarkerStyle(28);
329// gr11->SetMarkerStyle(28);
330// gr12->SetMarkerStyle(28);
331
332
333//mg->Add(gr1);
334//mg->Add(gr2);
335mg->Add(gr3);
336//mg->Add(gr4);
337//mg->Add(gr5);
338//mg->Add(gr6);
339mg->Add(gr7);
340//mg->Add(gr8);
341//mg->Add(gr9);
342//mg->Add(gr10);
343//mg->Add(gr11);
344//mg->Add(gr12);
345
346
347mg->Draw("AP");
348mg->GetYaxis()->SetRangeUser(0.8,1.02);
349mg->GetXaxis()->SetRangeUser(0.5,1.9);
350mg->GetXaxis()->SetTitle("Pt/GeV");
351mg->GetYaxis()->SetTitle("Eff");
352
353
354TLegend *legend=new TLegend(0.7,0.65,0.85,0.75);
355//legend->AddEntry(gr1,"e+ 660","p");
356//legend->AddEntry(gr2,"e- 660","p");
357//legend->AddEntry(gr3,"e+ 660a newPat","p");
358//legend->AddEntry(gr4,"e- 660a newPat","p");
359//legend->AddEntry(gr5,"e+ 660a Pat","p");
360//legend->AddEntry(gr6,"e- 660a Pat","p");
361//legend->AddEntry(gr7,"e+ 660a newPat","p");
362//legend->AddEntry(gr8,"e- 660a newPat","p");
363//legend->AddEntry(gr9,"e+ 660a Pat_newKal","p");
364//legend->AddEntry(gr10,"e- 660a Pat_newKal","p");
365//legend->AddEntry(gr11,"e+ 653_MC_NoMix","p");
366//legend->AddEntry(gr12,"e- 653_MC_NoMix","p");
367
368//legend->AddEntry(gr1,"e+ Data PAT+TSF","p");
369//legend->AddEntry(gr2,"e- Data PAT+TSF","p");
370//legend->AddEntry(gr3,"e+ Data TSF","p");
371//legend->AddEntry(gr4,"e- Data TSF","p");
372//legend->AddEntry(gr5,"e+ MC PAT+TSF","p");
373//legend->AddEntry(gr6,"e- MC PAT+TSF","p");
374//legend->AddEntry(gr7,"e+ MC TSF","p");
375//legend->AddEntry(gr8,"e- MC TSF","p");
376
377//legend->AddEntry(gr1,"e+ MC oldPat","p");
378//legend->AddEntry(gr2,"e- MC oldPat","p");
379legend->AddEntry(gr3,"e+ Data oldPat","p");
380//legend->AddEntry(gr4,"e- Data oldPat","p");
381//legend->AddEntry(gr5,"e+ MC Tsf","p");
382//legend->AddEntry(gr6,"e- MC Tsf","p");
383//legend->AddEntry(gr7,"e+ Data Tsf","p");
384//legend->AddEntry(gr8,"e- Data Tsf","p");
385
386//legend->AddEntry(gr5,"e+ MC newPat","p");
387//legend->AddEntry(gr6,"e- MC newPat","p");
388legend->AddEntry(gr7,"e+ Data newPat","p");
389//legend->AddEntry(gr8,"e- Data newPat","p");
390
391
392legend->Draw();
393
394//c1->Print("all_comp.eps");
395
396}
sprintf(cut,"kal_costheta0_em>-0.93&&kal_costheta0_em<0.93&&kal_pxy0_em>=0.05+%d*0.1&&kal_pxy0_em<0.15+%d*0.1&&NGch>=2", j, j)
TFile f("ana_bhabha660a_dqa_mcPat_zy_old.root")
Double_t x[10]