void calc_2g_yields(){ double neta[45],dneta[45]; double netap[45],dnetap[45]; for (unsigned int i=1;i<46;i++){ unsigned int k=i-1; double yield[2]; double unc[2]; calc_2g_yield(i,yield,unc); neta[k]=yield[0]; dneta[k]=unc[0]; netap[k]=yield[1]; dnetap[k]=unc[1]; } ofstream fout2("eta_2g_yields.dat"); for (int j=0;j<45;j++){ fout2 << 2.9+0.2*j << " " << neta[j] << " " << dneta[j] << " " << netap[j] << " " << dnetap[j] <Draw(); TGraphErrors *g2=new TGraphErrors(45,egamma,netap,0,dnetap); g2->Draw("same"); }