void plot_xsec_from_exp(){ double Eg[14],dEg[14]; for (int i=0;i<14;i++){ Eg[i]=2.9+0.2*i; dEg[i]=0.1; } double scale[14]; double dscale[14]; double tslope[14]; double dtslope[14]; ifstream in_file("phi_parms.dat"); for (int i=0;i<14;i++){ double dummy; in_file >> dummy; in_file >> scale[i]; in_file >> dscale[i]; in_file >> tslope[i]; in_file >> dtslope[i]; } double dsdt[14],ddsdt[14]; double xsec[14]; double dxsec[14]; double m_p_sq=0.9837*0.93827; double m_phi_sq=1.0195*1.0195; for (int i=0;i<14;i++){ dsdt[i]=exp(scale[i]); ddsdt[i]=dsdt[i]*dscale[i]; double s=m_p_sq+2.*0.93827*Eg[i]; double t0=(m_phi_sq*m_phi_sq-pow(s-m_p_sq-sqrt(pow(s-m_p_sq,2)-2*m_phi_sq*(s+m_p_sq)+m_phi_sq*m_phi_sq),2))/(4.*s); double t1=(m_phi_sq*m_phi_sq-pow(s-m_p_sq+sqrt(pow(s-m_p_sq,2)-2*m_phi_sq*(s+m_p_sq)+m_phi_sq*m_phi_sq),2))/(4.*s); double mytslope=fabs(tslope[i]); xsec[i]=dsdt[i]/mytslope*(exp(mytslope*t0)-exp(mytslope*t1)); double sigB=ddsdt[i]/dsdt[i]*xsec[i]; double sigA=dsdt[i]/mytslope*((t0-1./mytslope)*exp(mytslope*t0) -(t1-1./mytslope)*exp(mytslope*t1))*dtslope[i]; dxsec[i]=fabs(sigB)+fabs(sigA); cout << t0 << " " << t1 << " " << xsec[i] << " " << dxsec[i] << endl; } TH2F *h=new TH2F("h","cross section",15,2.6,5.6,10,0,1); h->SetXTitle("E_{#gamma} [GeV]"); h->SetYTitle("#sigma [#mub]"); h->Draw(); TGraphErrors *g1=new TGraphErrors(14,Eg,xsec,0,dxsec); g1->SetMarkerColor(2); g1->SetMarkerStyle(20); g1->SetLineColor(2); g1->Draw("p"); double ballamE[2]={2.8,4.7}; double ballamdE[2]={0.5,0.6}; double ballamx[2]={0.40,0.41}; double ballamdx[2]={0.1,0.09}; TGraphErrors *g2=new TGraphErrors(2,ballamE,ballamx,ballamdE,ballamdx); g2->SetLineColor(8); g2->SetMarkerColor(8); g2->SetMarkerStyle(22); g2->Draw("p"); TLegend *legend =new TLegend(0.15,0.65,0.45,0.85); legend->AddEntry(g1,"our measurements","p"); legend->AddEntry(g2,"Ballam 1973","p"); legend->Draw(); }