void plot_links(){ double p[7]={0.5,1.0,1.5,2.0,2.5,3.0,3.5}; double links4[7]={1472,1507,1098,953,942,805,712}; double links3[7]={1734,510,589,643,671,671,706}; double links2[7]={286,78,138,171,217,231,276}; double links1[7]={21,5,14,28,29,26,40}; double events[7],bevents[7]; double frac1[7],frac2[7],frac3[7],frac4[7]; double bfrac1[7],bfrac2[7],bfrac3[7],bfrac4[7]; double blinks4[7]={1575,1749,1428,1336,1364,1290,1214}; double blinks3[7]={1661,320,354,399,421,385,437}; double blinks2[7]={248,24,55,47,66,54,77}; double blinks1[7]={19,3,4,5,8,5,8}; for (int i=0;i<7;i++){ events[i]=links4[i]+links3[i]+links2[i]+links1[i]; frac1[i]=links1[i]/events[i]; frac2[i]=links2[i]/events[i]; frac3[i]=links3[i]/events[i]; frac4[i]=links4[i]/events[i]; bevents[i]=blinks4[i]+blinks3[i]+blinks2[i]+blinks1[i]; bfrac1[i]=blinks1[i]/bevents[i]; bfrac2[i]=blinks2[i]/bevents[i]; bfrac3[i]=blinks3[i]/bevents[i]; bfrac4[i]=blinks4[i]/bevents[i]; } TH2F *hr13 = new TH2F("hr13","Track linking efficiency", 2,0,4.,2,0,1.0); hr13->SetXTitle("p (GeV/c)"); hr13->SetYTitle("Efficiency"); hr13->Draw(); TGraph *g0=new TGraph(7,p,frac4); g0->SetMarkerStyle(kFullCircle); g0->SetMarkerColor(1); g0->SetLineColor(1); // g0->Draw("p"); TGraph *g1=new TGraph(7,p,frac3); g1->SetMarkerStyle(kOpenCircle); g1->SetMarkerColor(1); g1->SetLineColor(1); //g1->Draw("p"); TGraph *g2=new TGraph(7,p,frac2); g2->SetMarkerStyle(kFullSquare); g2->SetMarkerColor(1); g2->SetLineColor(1); //g2->Draw("p"); TGraph *g3=new TGraph(7,p,frac1); g3->SetMarkerStyle(kOpenSquare); g3->SetMarkerColor(1); g3->SetLineColor(1); //g3->Draw("p"); TGraph *g4=new TGraph(7,p,bfrac4); g4->SetMarkerStyle(kFullCircle); g4->SetMarkerColor(2); g4->SetLineColor(2); g4->Draw("p"); TGraph *g5=new TGraph(7,p,bfrac3); g5->SetMarkerStyle(kOpenCircle); g5->SetMarkerColor(2); g5->SetLineColor(2); g5->Draw("p"); TGraph *g6=new TGraph(7,p,bfrac2); g6->SetMarkerStyle(kFullSquare); g6->SetMarkerColor(2); g6->SetLineColor(2); g6->Draw("p"); TGraph *g7=new TGraph(7,p,bfrac1); g7->SetMarkerStyle(kOpenSquare); g7->SetMarkerColor(2); g7->SetLineColor(2); g7->Draw("p"); TLegend *legend=new TLegend(0.35,0.75,0.85,0.95); legend->AddEntry(g4,"4/4 segments linked","p"); legend->AddEntry(g5,"3/4 segments linked","p"); legend->AddEntry(g6,"2/4 segments linked","p"); legend->AddEntry(g7,"No segments linked","p"); legend->Draw(); }