void inlist_p_peakfit()
{
//=========Macro generated from canvas: c1_n8/c1_n8
//=========  (Tue Apr  3 18:03:06 2018) by ROOT version6.06/02
   TCanvas *c1_n8 = new TCanvas("c1_n8", "c1_n8",10,37,700,500);
   gStyle->SetOptStat(0);
   gStyle->SetOptTitle(0);
   c1_n8->Range(-402.8707,-0.415807,2343.456,2.182987);
   c1_n8->SetFillColor(0);
   c1_n8->SetBorderMode(0);
   c1_n8->SetBorderSize(2);
   c1_n8->SetLogy();
   c1_n8->SetTickx(1);
   c1_n8->SetTicky(1);
   c1_n8->SetLeftMargin(0.14);
   c1_n8->SetRightMargin(0.08);
   c1_n8->SetTopMargin(0.05);
   c1_n8->SetBottomMargin(0.16);
   c1_n8->SetFrameLineWidth(2);
   c1_n8->SetFrameBorderMode(0);
   c1_n8->SetFrameLineWidth(2);
   c1_n8->SetFrameBorderMode(0);
   
   TMultiGraph *multigraph = new TMultiGraph();
   multigraph->SetName("");
   multigraph->SetTitle(" ");
   
   Double_t Graph_fx1019[9] = {
   78.9848,
   118.658,
   198.17,
   316.018,
   394.438,
   593.806,
   790.554,
   1188.03,
   1990.53};
   Double_t Graph_fy1019[9] = {
   3.35311,
   4.98191,
   8.32673,
   13.3299,
   16.6505,
   24.761,
   33.0787,
   49.4349,
   82.2093};
   Double_t Graph_fex1019[9] = {
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0};
   Double_t Graph_fey1019[9] = {
   0.976075,
   1.49193,
   2.55977,
   3.9322,
   4.91948,
   7.79587,
   10.1985,
   13.9961,
   25.4786};
   TGraphErrors *gre = new TGraphErrors(9,Graph_fx1019,Graph_fy1019,Graph_fex1019,Graph_fey1019);
   gre->SetName("Graph");
   gre->SetTitle("Graph");
   gre->SetFillColor(1);
   gre->SetLineWidth(2);
   gre->SetMarkerStyle(20);
   
   TH1F *Graph_Graph1019 = new TH1F("Graph_Graph1019","Graph",100,0,2181.685);
   Graph_Graph1019->SetMinimum(2.139332);
   Graph_Graph1019->SetMaximum(118.219);
   Graph_Graph1019->SetDirectory(0);
   Graph_Graph1019->SetStats(0);
   Graph_Graph1019->SetLineWidth(2);
   Graph_Graph1019->SetMarkerStyle(21);
   Graph_Graph1019->GetXaxis()->SetNdivisions(505);
   Graph_Graph1019->GetXaxis()->SetLabelFont(22);
   Graph_Graph1019->GetXaxis()->SetLabelOffset(0.015);
   Graph_Graph1019->GetXaxis()->SetLabelSize(0.05);
   Graph_Graph1019->GetXaxis()->SetTitleSize(0.06);
   Graph_Graph1019->GetXaxis()->SetTitleFont(22);
   Graph_Graph1019->GetYaxis()->SetLabelFont(22);
   Graph_Graph1019->GetYaxis()->SetLabelSize(0.05);
   Graph_Graph1019->GetYaxis()->SetTitleSize(0.06);
   Graph_Graph1019->GetYaxis()->SetTitleFont(22);
   Graph_Graph1019->GetZaxis()->SetLabelFont(22);
   Graph_Graph1019->GetZaxis()->SetLabelSize(0.05);
   Graph_Graph1019->GetZaxis()->SetTitleSize(0.06);
   Graph_Graph1019->GetZaxis()->SetTitleFont(22);
   gre->SetHistogram(Graph_Graph1019);
   
   multigraph->Add(gre,"pc");
   
   Double_t Graph_fx1020[9] = {
   79.0354,
   118.87,
   198.332,
   317.093,
   395.805,
   594.734,
   795.176,
   1194.73,
   2026.38};
   Double_t Graph_fy1020[9] = {
   2.92215,
   4.06457,
   6.59966,
   10.5596,
   13.2042,
   19.6867,
   26.1884,
   38.9097,
   64.764};
   Double_t Graph_fex1020[9] = {
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0,
   0};
   Double_t Graph_fey1020[9] = {
   1.31351,
   1.76885,
   2.64553,
   4.06413,
   5.04219,
   6.79918,
   9.19588,
   13.7219,
   21.7599};
   gre = new TGraphErrors(9,Graph_fx1020,Graph_fy1020,Graph_fex1020,Graph_fey1020);
   gre->SetName("Graph");
   gre->SetTitle("Graph");
   gre->SetFillColor(1);
   gre->SetLineWidth(2);
   gre->SetMarkerStyle(24);
   
   TH1F *Graph_Graph1020 = new TH1F("Graph_Graph1020","Graph",100,0,2221.114);
   Graph_Graph1020->SetMinimum(1.447776);
   Graph_Graph1020->SetMaximum(95.01543);
   Graph_Graph1020->SetDirectory(0);
   Graph_Graph1020->SetStats(0);
   Graph_Graph1020->SetLineWidth(2);
   Graph_Graph1020->SetMarkerStyle(21);
   Graph_Graph1020->GetXaxis()->SetNdivisions(505);
   Graph_Graph1020->GetXaxis()->SetLabelFont(22);
   Graph_Graph1020->GetXaxis()->SetLabelOffset(0.015);
   Graph_Graph1020->GetXaxis()->SetLabelSize(0.05);
   Graph_Graph1020->GetXaxis()->SetTitleSize(0.06);
   Graph_Graph1020->GetXaxis()->SetTitleFont(22);
   Graph_Graph1020->GetYaxis()->SetLabelFont(22);
   Graph_Graph1020->GetYaxis()->SetLabelSize(0.05);
   Graph_Graph1020->GetYaxis()->SetTitleSize(0.06);
   Graph_Graph1020->GetYaxis()->SetTitleFont(22);
   Graph_Graph1020->GetZaxis()->SetLabelFont(22);
   Graph_Graph1020->GetZaxis()->SetLabelSize(0.05);
   Graph_Graph1020->GetZaxis()->SetTitleSize(0.06);
   Graph_Graph1020->GetZaxis()->SetTitleFont(22);
   gre->SetHistogram(Graph_Graph1020);
   
   multigraph->Add(gre,"pc");
   multigraph->Draw("a");
   multigraph->GetXaxis()->SetTitle("Intensity / 10^{6}s^{-1}");
   multigraph->GetXaxis()->SetNdivisions(505);
   multigraph->GetXaxis()->SetLabelFont(22);
   multigraph->GetXaxis()->SetLabelOffset(0.015);
   multigraph->GetXaxis()->SetLabelSize(0.05);
   multigraph->GetXaxis()->SetTitleSize(0.06);
   multigraph->GetXaxis()->SetTitleFont(22);
   multigraph->GetYaxis()->SetTitle("SNR");
   multigraph->GetYaxis()->SetLabelFont(22);
   multigraph->GetYaxis()->SetLabelSize(0.05);
   multigraph->GetYaxis()->SetTitleSize(0.06);
   multigraph->GetYaxis()->SetTitleFont(22);
   
   TLegend *leg = new TLegend(0.6,0.2,0.9,0.5,NULL,"brNDC");
   leg->SetBorderSize(0);
   leg->SetTextFont(22);
   leg->SetTextSize(0.045);
   leg->SetLineColor(1);
   leg->SetLineStyle(1);
   leg->SetLineWidth(2);
   leg->SetFillColor(0);
   leg->SetFillStyle(0);
   TLegendEntry *entry=leg->AddEntry("Graph","BPM (221 MeV/u)","p");
   entry->SetLineColor(1);
   entry->SetLineStyle(1);
   entry->SetLineWidth(1);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(20);
   entry->SetMarkerSize(1);
   entry->SetTextFont(22);
   entry=leg->AddEntry("Graph","BPM (70 MeV/u)","p");
   entry->SetLineColor(1);
   entry->SetLineStyle(1);
   entry->SetLineWidth(1);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(24);
   entry->SetMarkerSize(1);
   entry->SetTextFont(22);
   leg->Draw();
   c1_n8->Modified();
   c1_n8->cd();
   c1_n8->SetSelected(c1_n8);
}
