BOSS 7.1.1
BESIII Offline Software System
Loading...
Searching...
No Matches
Single_trkeff_pt.cxx
Go to the documentation of this file.
1void Single_trkeff_pt(char *file="Single"){
2Double_t x[10]={.1,.2,.3,.4,.5,.6,.7,.8,.9,1.};
3Double_t errx[10]={0};
4Double_t effpt[10];
5Double_t errpt[10];
6Double_t eventNo=5000.;
7Char_t filename[100];
8Char_t name[100];
9
10for(Int_t i=0;i<10;i++){
11 sprintf(name,"%d.root",i);
12 strcpy(filename,file);
13 strcat(filename,name);
14
15 TFile f(filename);
16 runinfo->Draw("runinfo_ngood","runinfo_ngood>0.5");
17 effpt[i]=htemp->GetEntries()/eventNo;
18}
19
20
21
22for (Int_t i=0;i<10;i++){
23 errpt[i]=sqrt(effpt[i]*(1.-effpt[i])/eventNo);
24}
25
26
27
28TGraph *gr1 = new TGraphErrors(10,x,effpt,errx,errpt);
29
30TCanvas *c1 = new TCanvas ("c1","pioneff",100,10,600,400);
31TMultiGraph *mg = new TMultiGraph();
32
33
34c1->SetGrid();
35mg->SetTitle("pioneff");
36gr1->SetLineColor(2);
37
38mg->Add(gr1);
39mg->Draw("ALP");
40mg->GetYaxis()->SetRangeUser(0,1);
41mg->GetXaxis()->SetTitle("Pt/GeV");
42mg->GetYaxis()->SetTitle("Eff");
43
44TLegend *legend=new TLegend(0.7,0.65,0.85,0.75);
45legend->AddEntry(gr1,"pion_Pt","l");
46legend->Draw();
47}
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")
char * file
Definition DQA_TO_DB.cxx:15
Double_t x[10]
int eventNo
void Single_trkeff_pt(char *file="Single")