void plot_yields(){ ifstream in("omega_yields.dat"); double Ebeam[24]; double threepi[24],dthreepi[24],threeg[24],dthreeg[24]; for (int i=0;i<24;i++) Ebeam[i]=7.1+0.2*i; for (int i=0;i<24;i++){ in >> threeg[i]; in >> dthreeg[i]; in >> threepi[i]; in >> dthreepi[i]; } in.close(); TCanvas *c1=new TCanvas(); TH2F *h=new TH2F("h","h",2,7,11.8,10,0,200); h->Draw(); TGraphErrors *g1=new TGraphErrors(24,Ebeam,0,threeg,dthreeg); g1->Draw(); }