BOSS 7.1.0
BESIII Offline Software System
Loading...
Searching...
No Matches
Single_trkeff_p.cxx File Reference

Go to the source code of this file.

Functions

void Single_trkeff_p (char *filename="Single.root")
 

Function Documentation

◆ Single_trkeff_p()

void Single_trkeff_p ( char *  filename = "Single.root")

Definition at line 1 of file Single_trkeff_p.cxx.

1 {
2Double_t x[10]={.1,.2,.3,.4,.5,.6,.7,.8,.9,1.};
3Double_t errx[10]={0};
4
5Int_t kalp[10];
6Int_t kalpp[10];
7Int_t mcp[10];
8
9Double_t effp[10];
10Double_t effpp[10];
11
12Double_t errp[10];
13Double_t errpp[10];
14
15Double_t eventNo=5000.;
16Char_t cut[100];
17
18
19TFile f(filename);
20
21for (Int_t j=0; j<10; j++){
22 sprintf(cut,"kal_pxy>=0.05+%d*0.1&&kal_pxy<0.15+%d*0.1",j,j);
23 pid_kal->Draw("kal_pxy",cut);
24 kalp[j]=htemp->GetEntries();
25 sprintf(cut,"kal_n>=0.05+%d*0.1&&kal_n<0.15+%d*0.1",j,j);
26 pid_kal->Draw("kal_n",cut);
27 kalpp[j]=htemp->GetEntries();
28 sprintf(cut,"mcpart_pxy>=0.05+%d*0.1&&mcpart_pxy<0.15+%d*0.1",j,j );
29 mcpart->Draw("mcpart_pxy",cut);
30 mcp[j]=htemp->GetEntries();
31 }
32
33
34
35for (Int_t i=0;i<10;i++){
36 effp[i]=kalp[i]*.1/(mcp[i]*.1);
37 errp[i]=sqrt(effp[i]*(1.-effp[i])/mcp[i]);
38
39 effpp[i]=kalpp[i]*.1/(mcp[i]*.1);
40 errpp[i]=sqrt(effpp[i]*(1.-effpp[i])/mcp[i]);
41}
42
43
44TGraph *gr1 = new TGraphErrors(10,x,effp,errx,errp);
45TGraph *gr2 = new TGraphErrors(10,x,effpp,errx,errpp);
46
47
48TCanvas *c1 = new TCanvas ("c1","Singleeff",100,10,600,400);
49TMultiGraph *mg = new TMultiGraph();
50
51
52c1->SetGrid();
53
54mg->SetTitle("pioneff");
55
56gr1->SetLineColor(1);
57gr2->SetLineColor(2);
58
59mg->Add(gr1);
60mg->Add(gr2);
61
62mg->Draw("ALP");
63mg->GetYaxis()->SetRangeUser(0,1);
64mg->GetXaxis()->SetTitle("Pt/GeV");
65mg->GetYaxis()->SetTitle("Eff");
66
67
68TLegend *legend=new TLegend(0.7,0.65,0.85,0.75);
69legend->AddEntry(gr1,"Single_P","l");
70legend->AddEntry(gr2,"Single_P'","l");
71
72
73legend->Draw();
74}
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]
int eventNo