{ #include c1=new TCanvas("c1","c1",200,100,700,500); double x1[200], xf1[200], x2[200], xf2[200], q2; // double ndata[2],x[2][1000],Q2[2][1000]; double up[2][1000], down[2][1000],upbar[2][1000],downbar[2][1000], strange[2][1000], charm[2][1000], bottom[2][1000], gluon[2][1000]; for(int i=0; i<2; i++) { int n = 0; ifstream fin("MSTW_100.txt"); if(i==0) ifstream fin("MSTW_10000.txt"); char line[255]; fin.getline(line,sizeof(line)); // skip the 1st dummy line while (fin >> x[i][n]>>Q2[i][n]>>up[i][n]>>down[i][n]>>upbar[i][n] >>downbar[i][n]>>strange[i][n]>>charm[i][n]>>bottom[i][n]>>gluon[i][n]){ n++; } ndata[i] = n; fin.close(); } // gPad->SetLogx(); gPad->SetLogy(); leg = new TLegend(0.73 ,0.6 ,0.92,0.93,"MSTW/MRSTMcal"); for(int i=0; i<2; i++) { ggluon = new TGraph(ndata[i],x[i],gluon[i]); gup = new TGraph(ndata[i],x[i],up[i]); gdown = new TGraph(ndata[i],x[i],down[i]); gstrange = new TGraph(ndata[i],x[i],strange[i]); gcharm = new TGraph(ndata[i],x[i],charm[i]); gbottom = new TGraph(ndata[i],x[i],bottom[i]); ggluon -> GetXaxis()->SetTitle("x"); ggluon -> GetYaxis()->SetTitle("xf(x)"); ggluon -> SetLineColor(1); gup -> SetLineColor(2); gdown -> SetLineColor(3); gstrange -> SetLineColor(4); gcharm -> SetLineColor(5); gbottom -> SetLineColor(6); ggluon -> SetLineStyle(2-i); gup-> SetLineStyle(2-i); gdown->SetLineStyle(2-i); gstrange ->SetLineStyle(2-i);gcharm-> SetLineStyle(2-i);gbottom-> SetLineStyle(2-i); ggluon -> SetMaximum(40.); ggluon -> SetMinimum(0.01); if(i==0) ggluon->Draw("AL"); else ggluon -> Draw("SAME L"); gup -> Draw("SAME L"); gdown -> Draw("SAME L"); gstrange -> Draw("SAME L"); gcharm -> Draw("SAME L"); gbottom -> Draw("SAME L"); if(i==0){ leg->AddEntry(ggluon, "gluon 100 GeV^{2}","l"); leg->AddEntry(gup, "up 100 GeV^{2}","l"); leg->AddEntry(gdown, "down 100 GeV^{2}","l"); leg->AddEntry(gstrange,"strange 100 GeV^{2}","l"); leg->AddEntry(gcharm, "charm 100 GeV^{2}","l"); leg->AddEntry(gbottom, "bottom 100 GeV^{2}","l"); } else { leg->AddEntry(ggluon, "gluon 10000 GeV^{2}","l"); leg->AddEntry(gup, "up 10000 GeV^{2}","l"); leg->AddEntry(gdown, "down 10000 GeV^{2}","l"); leg->AddEntry(gstrange,"strange 10000 GeV^{2}","l"); leg->AddEntry(gcharm, "charm 10000 GeV^{2}","l"); leg->AddEntry(gbottom, "bottom 10000 GeV^{2}","l"); } } leg->SetFillColor(10); leg->SetBorderSize(0); leg->Draw(); // c1->Print("pdf_100vs10000.png"); }