void calc_6g_yields(){ double eta_6g[45],deta_6g[45]; double etap_6g[45],detap_6g[45]; for (unsigned int i=1;i<46;i++){ unsigned int k=i-1; double yield[2]; double unc[2]; calc_6g_yield(i,yield,unc); eta_6g[k]=yield[0]; deta_6g[k]=unc[0]; etap_6g[k]=yield[1]; detap_6g[k]=unc[1]; } ofstream fout2("eta_6g_yields.dat"); for (int j=0;j<45;j++){ fout2 << 2.9+0.2*j << " " << eta_6g[j] << " " << deta_6g[j] << " " << etap_6g[j] << " " << detap_6g[j] << endl; } fout2.close(); double egamma[45]; for (int j=0;j<45;j++) egamma[j]=2.9+0.2*j; TGraphErrors *g1=new TGraphErrors(45,egamma,eta_6g,0,deta_6g); g1->Draw(); TGraphErrors *g2=new TGraphErrors(45,egamma,etap_6g,0,detap_6g); g2->Draw("same"); }