8 #include <TGraphAsymmErrors.h>
9 #include <TGraphErrors.h>
18 #include <TVirtualFitter.h>
23 #include "SaveCanvas.C"
24 #include "sPhenixStyle.C"
31 TGraphErrors *
GraphShiftScaling(TGraphErrors *gr_src,
const double x_shift,
const double err_scaling)
35 const int npoint = gr_src->GetN();
43 for (
int i = 0;
i < npoint; ++
i)
45 const double &
x = gr_src->GetX()[
i];
48 vx[nfilled] = x + x_shift;
49 vy[nfilled] = gr_src->GetY()[
i];
50 vex[nfilled] = gr_src->GetEX()[
i];
51 vey[nfilled] = gr_src->GetEY()[
i] * err_scaling;
56 TGraphErrors *
gr =
new TGraphErrors(nfilled, vx.GetMatrixArray(), vy.GetMatrixArray(),
57 vex.GetMatrixArray(), vey.GetMatrixArray());
59 gr->SetMarkerColor(gr_src->GetMarkerColor());
60 gr->SetMarkerStyle(gr_src->GetMarkerStyle());
61 gr->SetMarkerSize(gr_src->GetMarkerSize());
62 gr->SetLineWidth(gr_src->GetLineWidth());
63 gr->SetLineColor(gr_src->GetLineColor());
73 float yy[nn] = {3.14e-2};
75 float sy[nn] = {0.37e-2};
79 TGraphErrors *
gr =
new TGraphErrors(nn, xx, yy, sx, sy);
81 gr->SetFillStyle(3001);
88 TArrow *arx =
new TArrow(xx[0] - sx[0], yy[0], xx[0] + sx[0], yy[0], wa,
"<|>");
89 arx->SetLineWidth(iw);
90 arx->SetLineColor(icol);
91 arx->SetFillColor(icol);
94 TArrow *ary =
new TArrow(xx[0], yy[0] - sy[0], xx[0], yy[0] + sy[0], wa,
"<|>");
95 ary->SetLineWidth(iw);
96 ary->SetLineColor(icol);
97 ary->SetFillColor(icol);
105 const double ref_Lum = 10e12;
109 TFile *
f =
new TFile(
"han.root");
110 TGraphErrors *gan[nxf];
112 const float dy = 0.01;
115 for (
int ix = 0; ix < nxf; ix++)
117 sprintf(hname,
"gan%d", ix);
123 TCanvas *c1 =
new TCanvas(
"sphenix_han",
"sphenix_han", 1100, 800);
131 p = (TPad *) c1->cd(idx++);
134 p->DrawFrame(0, -0., 12, 0.065)->SetTitle(
";#it{p}_{T} [GeV];A_{N}");
146 TLatex *
tex =
new TLatex();
147 tex->SetTextSize(0.035);
149 float xfbin = 1. / float(nxf);
150 for (
int i = 1;
i <= 4;
i++)
152 gan[
i]->SetMarkerStyle(20);
153 gan[
i]->SetMarkerColor(kRed + 1);
154 gan[
i]->SetLineColor(kRed + 1);
155 gan[
i]->SetMarkerSize(2);
156 gan[
i]->SetLineWidth(4);
159 sprintf(str,
"x_{F}=%4.2f-%4.2f", xfbin *
i, xfbin * (i + 1));
160 tex->DrawLatex(9.5, dy * i - 0.0003, str);
167 tex->DrawLatex(0.4, 0.0025,
"Shown only points with #delta(A_{N}) <~ 1%");
169 TLegend *
leg =
new TLegend(.0, .75, .83, .9);
170 leg->SetFillStyle(0);
172 leg->AddEntry(
"", Form(
"#it{#bf{sPHENIX}} Projection, Years 1-3"),
"");
173 leg->AddEntry(
"", Form(
"%.1f pb^{-1} str. #it{p}^{#uparrow}+#it{p}#rightarrow h^{+} + X, P=%.2f",
pp_rec_3year / 1e12,
pp_beam_pol),
"");
176 SaveCanvas(c1, TString(c1->GetName()), kTRUE);