2Double_t
x[10]={.1,.2,.3,.4,.5,.6,.7,.8,.9,1.};
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();
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]);
39 effpp[i]=kalpp[i]*.1/(mcp[i]*.1);
40 errpp[i]=sqrt(effpp[i]*(1.-effpp[i])/mcp[i]);
44TGraph *gr1 =
new TGraphErrors(10,
x,effp,
errx,errp);
45TGraph *gr2 =
new TGraphErrors(10,
x,effpp,
errx,errpp);
48TCanvas *c1 =
new TCanvas (
"c1",
"Singleeff",100,10,600,400);
49TMultiGraph *mg =
new TMultiGraph();
54mg->SetTitle(
"pioneff");
63mg->GetYaxis()->SetRangeUser(0,1);
64mg->GetXaxis()->SetTitle(
"Pt/GeV");
65mg->GetYaxis()->SetTitle(
"Eff");
68TLegend *
legend=
new TLegend(0.7,0.65,0.85,0.75);
69legend->AddEntry(gr1,
"Single_P",
"l");
70legend->AddEntry(gr2,
"Single_P'",
"l");
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")
void Single_trkeff_p(char *filename="Single.root")