void canvas3() { gStyle->SetOptStat(0); TCanvas *C = new TCanvas(); C->Divide(1,6); //------------------------------------------elastic 7Be + d data --------------------------------------------- Int_t n1; Double_t x1[50], y1[50], ey1[50]; ifstream f1; f1.open("elastic_7Bedd.txt"); Int_t i=0; while (i<20){ f1>>x1[i]>>y1[i]>>ey1[i]; i++; } n1=i; TGraphErrors graph1(n1,x1,y1,NULL,ey1); //graph1.SetTitle("^{7}Be + ^{12}C elastic; #theta_{cm} (deg) ; #frac{d#sigma}{d#Omega} (mb/sr)"); // Make the plot looks better graph1.SetMarkerStyle(4); graph1.SetMarkerSize(1); graph1.SetMarkerColor(kBlue); //graph1.SetLineColor(kRed); //------------------------------------------Ex=0.092 MeV --------------------------------------------- Int_t n2; Double_t x2[50], y2[50], ey2[50]; ifstream f2; f2.open("gs.txt"); Int_t j=0; while (j<18){ f2>>x2[j]>>y2[j]>>ey2[j]; j++; } n2=j; TGraphErrors graph2(n2,x2,y2,NULL,ey2); graph2.SetMarkerStyle(4); graph2.SetMarkerSize(1); graph2.SetMarkerColor(kBlue); graph2.SetLineColor(kBlue); //------------------------------------------Ex=3.03 MeV--------------------------------------------- Int_t n3; Double_t x3[50], y3[50], ey3[50]; ifstream f3; f3.open("Ex3MeV.txt"); Int_t k1=0; while (k1<19){ f3>>x3[k1]>>y3[k1]>>ey3[k1]; k1++; } n3=k1; TGraphErrors graph3(n3,x3,y3,NULL,ey3); graph3.SetMarkerStyle(4); graph3.SetMarkerSize(1); graph3.SetMarkerColor(kBlue); graph3.SetLineColor(kBlue); //------------------------------------------Ex=11.3 MeV--------------------------------------------- Int_t n4; Double_t x4[50], y4[50], ey4[50]; ifstream f4; f4.open("Ex11MeV.txt"); Int_t l1=0; while (l1<18){ f4>>x4[l1]>>y4[l1]>>ey4[l1]; l1++; } n4=l1; TGraphErrors graph4(n4,x4,y4,NULL,ey4); graph4.SetMarkerStyle(4); graph4.SetMarkerSize(1); graph4.SetMarkerColor(kBlue); graph4.SetLineColor(kBlue); //------------------------------------------Ex=16.6 MeV--------------------------------------------- Int_t n5; Double_t x5[80], y5[80], ey5[80]; ifstream f5; f5.open("Ex16MeV.txt"); Int_t k2=0; while (k2<56){ f5>>x5[k2]>>y5[k2]>>ey5[k2]; k2++; } n5=k2; TGraphErrors graph5(n5,x5,y5,NULL,ey5); graph5.SetMarkerStyle(4); graph5.SetMarkerSize(1); graph5.SetMarkerColor(kBlue); graph5.SetLineColor(kBlue); //------------------------------------------Ex=19 MeV--------------------------------------------- Int_t n6; Double_t x6[80], y6[80], ey6[80]; ifstream f6; f6.open("Ex16MeV.txt"); Int_t k3=0; while (k3<56){ f6>>x6[k3]>>y6[k3]>>ey6[k3]; k3++; } n6=k3; TGraphErrors graph6(n6,x6,y6,NULL,ey6); graph6.SetMarkerStyle(4); graph6.SetMarkerSize(1); graph6.SetMarkerColor(kBlue); graph6.SetLineColor(kBlue); //-----------------------------------------//-----------------------------------------//----------------------------------------- C->cd(1); //elastic C->cd(1)->SetLogy(); C->cd(1)->SetTicks(1,1); C->cd(1)->SetLeftMargin(0.1); // Format for x axis //graph1.GetXaxis()->SetTitle("#theta_{cm} (deg)"); graph1.GetXaxis()->SetRangeUser(70.,180.); graph1.GetXaxis()->SetLabelFont(43); graph1.GetXaxis()->SetLabelSize(25); graph1.GetXaxis()->SetTitleFont(43); graph1.GetXaxis()->SetTitleSize(25); //graph1.GetXaxis()->CenterTitle(); graph1.GetXaxis()->SetNdivisions(505); // Format for y axis // graph1.GetYaxis()->SetTitle("#frac{d#sigma}{d#Omega} (mb/sr)"); graph1.GetYaxis()->SetRangeUser(0.01,1000); graph1.GetYaxis()->SetLabelFont(43); graph1.GetYaxis()->SetLabelSize(25); graph1.GetYaxis()->SetTitleFont(43); graph1.GetYaxis()->SetTitleSize(25); // graph1.GetYaxis()->CenterTitle(); // graph1.GetYaxis()->SetNdivisions(505); // Draw the graph ! graph1.DrawClone("APE"); // graph3.DrawClone("same"); // graph5.DrawClone("same"); //TLegend leg(.65,.65,.86,.86); TLegend leg1(.50,.65); leg1.SetFillColor(0); leg1.SetTextSize(0.1); leg1.SetBorderSize(0); leg1.AddEntry(&graph1,"7Be + d elastic"); // leg1.AddEntry(&graph3,"Set I"); // leg1.AddEntry(&graph4,"Set II"); leg1.DrawClone("Same"); // TLatex text1(72.0,1.8,"^{12}C(^{7}Be,^{7}Be)^{12}C at 35 MeV"); // text1.SetTextSize(0.04); // text1.DrawClone("same"); //-----------------------------------------//-----------------------------------------//----------------------------------------- C->cd(2); //inelastic C->cd(2)->SetLogy(); C->cd(2)->SetTicks(1,1); // Format for x axis graph2.GetXaxis()->SetRangeUser(145.,175.); // graph2.GetXaxis()->SetTitle("#theta_{cm} (deg)"); graph2.GetXaxis()->SetLabelFont(43); graph2.GetXaxis()->SetLabelSize(25); graph2.GetXaxis()->SetTitleFont(43); graph2.GetXaxis()->SetTitleSize(25); // graph2.GetXaxis()->CenterTitle(); graph2.GetXaxis()->SetNdivisions(505); // Format for y axis //graph2.GetYaxis()->SetTitle("#frac{d#sigma}{d#Omega} (mb/sr)"); graph2.GetYaxis()->SetRangeUser(0.1,10); graph2.GetYaxis()->SetLabelFont(43); graph2.GetYaxis()->SetLabelSize(25); graph2.GetYaxis()->SetTitleFont(43); graph2.GetYaxis()->SetTitleSize(25); //graph2.GetYaxis()->CenterTitle(); // graph2.GetYaxis()->SetNdivisions(505); // Draw the graph ! graph2.DrawClone("APE"); // graph4.DrawClone("same"); // graph6.DrawClone("same"); //TLegend leg(.65,.65,.86,.86); TLegend leg2(.50,.65); leg2.SetFillColor(0); leg2.SetTextSize(0.1); leg2.SetBorderSize(0); leg2.AddEntry(&graph2,"Ex=0.092 MeV"); // leg2.AddEntry(&graph4,"Set I"); // leg2.AddEntry(&graph6,"Set II"); leg2.DrawClone("Same"); // TLatex text2(72.0,0.8,"^{12}C(^{7}Be,^{7}Be)^{12}C* (4.43 MeV) at 35 MeV"); // text2.SetTextSize(0.03); // text2.DrawClone("same"); //-----------------------------------------//-----------------------------------------//----------------------------------------- C->cd(3); //elastic C->cd(3)->SetLogy(); C->cd(3)->SetTicks(1,1); C->cd(3)->SetLeftMargin(0.1); // Format for x axis //graph1.GetXaxis()->SetTitle("#theta_{cm} (deg)"); graph3.GetXaxis()->SetRangeUser(145.,175.); graph3.GetXaxis()->SetLabelFont(43); graph3.GetXaxis()->SetLabelSize(25); graph3.GetXaxis()->SetTitleFont(43); graph3.GetXaxis()->SetTitleSize(25); //graph1.GetXaxis()->CenterTitle(); graph3.GetXaxis()->SetNdivisions(505); // Format for y axis // graph1.GetYaxis()->SetTitle("#frac{d#sigma}{d#Omega} (mb/sr)"); graph3.GetYaxis()->SetRangeUser(0.1,50); graph3.GetYaxis()->SetLabelFont(43); graph3.GetYaxis()->SetLabelSize(25); graph3.GetYaxis()->SetTitleFont(43); graph3.GetYaxis()->SetTitleSize(25); // graph3.GetYaxis()->CenterTitle(); // graph1.GetYaxis()->SetNdivisions(505); // Draw the graph ! graph3.DrawClone("APE"); // graph3.DrawClone("same"); // graph5.DrawClone("same"); //TLegend leg(.65,.65,.86,.86); TLegend leg3(.50,.65); leg3.SetFillColor(0); leg3.SetTextSize(0.1); leg3.SetBorderSize(0); leg3.AddEntry(&graph3,"Ex=3.03 MeV"); // leg3.AddEntry(&graph3,"Set I"); // leg3.AddEntry(&graph4,"Set II"); leg3.DrawClone("Same"); // TLatex text3(72.0,1.8,"^{12}C(^{7}Be,^{7}Be)^{12}C at 35 MeV"); // text3.SetTextSize(0.04); // text3.DrawClone("same"); //-----------------------------------------//-----------------------------------------//----------------------------------------- C->cd(4); //inelastic C->cd(4)->SetLogy(); C->cd(4)->SetTicks(1,1); // Format for x axis graph4.GetXaxis()->SetRangeUser(50.,120.); // graph4.GetXaxis()->SetTitle("#theta_{cm} (deg)"); graph4.GetXaxis()->SetLabelFont(43); graph4.GetXaxis()->SetLabelSize(25); graph4.GetXaxis()->SetTitleFont(43); graph4.GetXaxis()->SetTitleSize(25); // graph4.GetXaxis()->CenterTitle(); graph4.GetXaxis()->SetNdivisions(505); // Format for y axis //graph2.GetYaxis()->SetTitle("#frac{d#sigma}{d#Omega} (mb/sr)"); graph4.GetYaxis()->SetRangeUser(0.1,100); graph4.GetYaxis()->SetLabelFont(43); graph4.GetYaxis()->SetLabelSize(25); graph4.GetYaxis()->SetTitleFont(43); graph4.GetYaxis()->SetTitleSize(25); //graph2.GetYaxis()->CenterTitle(); // graph2.GetYaxis()->SetNdivisions(505); // Draw the graph ! graph4.DrawClone("APE"); // graph4.DrawClone("same"); // graph6.DrawClone("same"); //TLegend leg(.65,.65,.86,.86); TLegend leg4(.50,.65); leg4.SetFillColor(0); leg4.SetTextSize(0.1); leg4.SetBorderSize(0); leg4.AddEntry(&graph4,"Ex=11.35 MeV"); // leg4.AddEntry(&graph4,"Set I"); // leg4.AddEntry(&graph6,"Set II"); leg4.DrawClone("Same"); // TLatex text4(72.0,0.8,"^{12}C(^{7}Be,^{7}Be)^{12}C* (4.43 MeV) at 35 MeV"); // text4.SetTextSize(0.03); // text4.DrawClone("same"); //-----------------------------------------//-----------------------------------------//----------------------------------------- C->cd(5); //elastic C->cd(5)->SetLogy(); C->cd(5)->SetTicks(1,1); C->cd(5)->SetLeftMargin(0.1); C->cd(5)->SetBottomMargin(0.1); // Format for x axis //graph1.GetXaxis()->SetTitle("#theta_{cm} (deg)"); graph5.GetXaxis()->SetRangeUser(0.,180.); graph5.GetXaxis()->SetLabelFont(43); graph5.GetXaxis()->SetLabelSize(25); graph5.GetXaxis()->SetTitleFont(43); graph5.GetXaxis()->SetTitleSize(25); //graph1.GetXaxis()->CenterTitle(); graph5.GetXaxis()->SetNdivisions(505); // Format for y axis // graph5.GetYaxis()->SetTitle("#frac{d#sigma}{d#Omega} (mb/sr)"); graph5.GetYaxis()->SetRangeUser(0.1,100); graph5.GetYaxis()->SetLabelFont(43); graph5.GetYaxis()->SetLabelSize(25); graph5.GetYaxis()->SetTitleFont(43); graph5.GetYaxis()->SetTitleSize(25); // graph5.GetYaxis()->CenterTitle(); // graph5.GetYaxis()->SetNdivisions(505); // Draw the graph ! graph5.DrawClone("APE"); // graph3.DrawClone("same"); // graph5.DrawClone("same"); //TLegend leg(.65,.65,.86,.86); TLegend leg5(.50,.65); leg5.SetFillColor(0); leg5.SetTextSize(0.1); leg5.SetBorderSize(0); leg5.AddEntry(&graph5,"Ex=16.6 MeV"); // leg5.AddEntry(&graph3,"Set I"); // leg5.AddEntry(&graph4,"Set II"); leg5.DrawClone("Same"); // TLatex text5(72.0,1.8,"^{12}C(^{7}Be,^{7}Be)^{12}C at 35 MeV"); // text5.SetTextSize(0.04); // text5.DrawClone("same"); //-----------------------------------------//-----------------------------------------//----------------------------------------- C->cd(6); //inelastic C->cd(6)->SetLogy(); C->cd(6)->SetTicks(1,1); // Format for x axis graph6.GetXaxis()->SetRangeUser(0.,180.); // graph6.GetXaxis()->SetTitle("#theta_{cm} (deg)"); graph6.GetXaxis()->SetLabelFont(43); graph6.GetXaxis()->SetLabelSize(25); graph6.GetXaxis()->SetTitleFont(43); graph6.GetXaxis()->SetTitleSize(25); // graph6.GetXaxis()->CenterTitle(); graph6.GetXaxis()->SetNdivisions(505); // Format for y axis //graph2.GetYaxis()->SetTitle("#frac{d#sigma}{d#Omega} (mb/sr)"); graph6.GetYaxis()->SetRangeUser(0.1,100); graph6.GetYaxis()->SetLabelFont(43); graph6.GetYaxis()->SetLabelSize(25); graph6.GetYaxis()->SetTitleFont(43); graph6.GetYaxis()->SetTitleSize(25); //graph2.GetYaxis()->CenterTitle(); // graph6.GetYaxis()->SetNdivisions(505); // Draw the graph ! graph6.DrawClone("APE"); // graph4.DrawClone("same"); // graph6.DrawClone("same"); //TLegend leg(.65,.65,.86,.86); TLegend leg6(.50,.65); leg6.SetFillColor(0); leg6.SetTextSize(0.1); leg6.SetBorderSize(0); leg6.AddEntry(&graph6,"Ex=16 MeV"); // leg6.AddEntry(&graph4,"Set I"); // leg6.AddEntry(&graph6,"Set II"); leg6.DrawClone("Same"); }