3TFile *
f =
new TFile(filename);
4TTree *pid_kal = (TTree*)
f->Get(
"pid_kal");
11pid_kal->SetBranchAddress(
"kal_p",&kal_p);
12pid_kal->SetBranchAddress(
"prob_pion",&prob_pion);
13pid_kal->SetBranchAddress(
"prob_kaon",&prob_kaon);
14pid_kal->SetBranchAddress(
"prob_proton",&prob_proton);
17Int_t nevent = pid_kal->GetEntries();
19Double_t
x[10]={.1,.2,.3,.4,.5,.6,.7,.8,.9,1.0};
52for (Int_t i=0; i<nevent; i++){
55 for(Int_t j=0; j<10; j++){
56 if(kal_p>0.05+0.1*j&&kal_p<0.15+0.1*j){
58 if(prob_pion>0) pid1[j]++;
59 if(prob_pion>0.001) pid2[j]++;
60 if(prob_pion>prob_kaon) pid3[j]++;
61 if(prob_pion>prob_kaon&&prob_pion>prob_proton) pid4[j]++;
62 if(prob_pion>0&&prob_pion>prob_kaon) pid5[j]++;
63 if(prob_pion>0&&prob_pion>prob_kaon&&prob_pion>prob_proton) pid6[j]++;
64 if(prob_pion>0.001&&prob_pion>prob_kaon) pid7[j]++;
65 if(prob_pion>0.001&&prob_pion>prob_kaon&&prob_pion>prob_proton) pid8[j]++;
71for(Int_t i=0;i<10;i++){
72 eff1[i]=(pid1[i]*.1)/(kal[i]*.1);
73 err1[i]=sqrt(eff1[i]*(1-eff1[i])/kal[i]);
75 eff2[i]=(pid2[i]*.1)/(kal[i]*.1);
76 err2[i]=sqrt(eff2[i]*(1-eff2[i])/kal[i]);
78 eff3[i]=(pid3[i]*.1)/(kal[i]*.1);
79 err3[i]=sqrt(eff3[i]*(1-eff3[i])/kal[i]);
81 eff4[i]=(pid4[i]*.1)/(kal[i]*.1);
82 err4[i]=sqrt(eff4[i]*(1-eff4[i])/kal[i]);
84 eff5[i]=(pid5[i]*.1)/(kal[i]*.1);
85 err5[i]=sqrt(eff5[i]*(1-eff5[i])/kal[i]);
87 eff6[i]=(pid6[i]*.1)/(kal[i]*.1);
88 err6[i]=sqrt(eff6[i]*(1-eff6[i])/kal[i]);
90 eff7[i]=(pid7[i]*.1)/(kal[i]*.1);
91 err7[i]=sqrt(eff7[i]*(1-eff7[i])/kal[i]);
93 eff8[i]=(pid8[i]*.1)/(kal[i]*.1);
94 err8[i]=sqrt(eff8[i]*(1-eff8[i])/kal[i]);
98TGraph *gr1 =
new TGraphErrors(10,
x,eff1,ex,err1);
99TGraph *gr2 =
new TGraphErrors(10,
x,eff2,ex,err2);
100TGraph *gr3 =
new TGraphErrors(10,
x,eff3,ex,err3);
101TGraph *gr4 =
new TGraphErrors(10,
x,eff4,ex,err4);
102TGraph *gr5 =
new TGraphErrors(10,
x,eff5,ex,err5);
103TGraph *gr6 =
new TGraphErrors(10,
x,eff6,ex,err6);
104TGraph *gr7 =
new TGraphErrors(10,
x,eff7,ex,err7);
105TGraph *gr8 =
new TGraphErrors(10,
x,eff8,ex,err8);
107TCanvas *c1 =
new TCanvas (
"c1",
"pion_eff_pid",100,10,600,400);
108TMultiGraph *mg =
new TMultiGraph();
113mg->SetTitle(
"pion_eff_pid");
137mg->GetYaxis()->SetRangeUser(0.9,1.0);
138mg->GetXaxis()->SetTitle(
"Pt/GeV");
139mg->GetYaxis()->SetTitle(
"Eff");
141TLegend *
legend=
new TLegend(0.55,0.15,0.85,0.35);
143legend->AddEntry(gr2,
"prob(\\pi)>0.001",
"l");
145legend->AddEntry(gr4,
"prob(\\pi)>prob(K)&&prob(\\pi)>prob(p)",
"l");
149legend->AddEntry(gr8,
"prob(\\pi)>0.001&&prob(\\pi)>prob(K)&&prob(\\pi)>prob(p)",
"l");
TFile f("ana_bhabha660a_dqa_mcPat_zy_old.root")
void Single_pideff(char *filename="Single_pid.root")