void plot_t_slope_dep_comp(){ double Eg[15],dEg[15]; for (int i=0;i<15;i++){ Eg[i]=2.9+0.2*i; dEg[i]=0.1; } double tslope[15]; double dtslope[15]; ifstream in_file("phi_parms.dat"); for (int i=0;i<15;i++){ double dummy; in_file >> dummy; in_file >> dummy; in_file >> dummy; in_file >> tslope[i]; in_file >> dtslope[i]; } for (int i=0;i<15;i++) tslope[i]*=-1.; double tslope1[15]; double dtslope1[15]; ifstream in_file1("phi_parms_method1.dat"); for (int i=0;i<15;i++){ double dummy; in_file1 >> dummy; in_file1 >> dummy; in_file1 >> dummy; in_file1 >> tslope1[i]; in_file1 >> dtslope1[i]; } for (int i=0;i<15;i++) tslope1[i]*=-1.; TH2F *h=new TH2F("h","t-slope dependence",15,2.6,5.8,10,0,6); h->SetXTitle("E_{#gamma} [GeV]"); h->SetYTitle("t-slope parameter A [GeV^{-2}]"); h->Draw(); TGraphErrors *g1=new TGraphErrors(15,Eg,tslope,0,dtslope); g1->SetMarkerColor(4); g1->SetMarkerStyle(21); g1->SetLineColor(4); g1->Draw("p"); TGraphErrors *g3=new TGraphErrors(15,Eg,tslope1,0,dtslope1); g3->SetMarkerColor(2); g3->SetMarkerStyle(20); g3->SetLineColor(2); g3->Draw("p"); double ballamE[2]={2.8,4.7}; double ballamdE[2]={0.5,0.6}; double ballamA[2]={3.7,3.7}; double ballamdA[2]={1.2,1.0}; TGraphErrors *g2=new TGraphErrors(2,ballamE,ballamA,ballamdE,ballamdA); g2->SetLineColor(8); g2->SetMarkerColor(8); g2->SetMarkerStyle(22); g2->Draw("p"); TLegend *legend =new TLegend(0.5,0.15,0.8,0.35); legend->AddEntry(g3,"Method 1","p"); legend->AddEntry(g1,"Method 2","p"); legend->AddEntry(g2,"Ballam 1973","p"); legend->Draw(); }