7 #include <TGraphAsymmErrors.h>
8 #include <TGraphErrors.h>
17 #include <TVirtualFitter.h>
22 #include "SaveCanvas.C"
23 #include "sPhenixStyle.C"
27 Double_t
v1_err(Double_t sig, Double_t
v1, Double_t Res)
29 const Double_t Pi = 3.1415927;
30 return 2.3 / sig * sqrt(1 - 16 * v1 * v1 / Pi / Pi) / Res;
33 TGraphErrors *
GraphShiftScaling(TGraphErrors *gr_src,
const double x_shift,
const double err_scaling)
37 const int npoint = gr_src->GetN();
45 for (
int i = 0;
i < npoint; ++
i)
47 const double &
x = gr_src->GetX()[
i];
50 vx[nfilled] = x + x_shift;
51 vy[nfilled] = gr_src->GetY()[
i];
52 vex[nfilled] = gr_src->GetEX()[
i];
53 vey[nfilled] = gr_src->GetEY()[
i] * err_scaling;
58 TGraphErrors *
gr =
new TGraphErrors(nfilled, vx.GetMatrixArray(), vy.GetMatrixArray(),
59 vex.GetMatrixArray(), vey.GetMatrixArray());
61 gr->SetMarkerColor(gr_src->GetMarkerColor());
62 gr->SetMarkerStyle(gr_src->GetMarkerStyle());
63 gr->SetMarkerSize(gr_src->GetMarkerSize());
64 gr->SetLineWidth(gr_src->GetLineWidth());
65 gr->SetLineColor(gr_src->GetLineColor());
75 const Double_t MassD = 1.86484;
79 const Double_t
offset = 0.02;
80 Double_t yp[NS], v1p[NS], v1pe[NS], v1pes[NS];
81 Double_t
yn[NS], v1n[NS], v1ne[NS], v1nes[NS];
83 inData.open(
"D0v1_STAR_final.txt");
84 for (
int i = 0;
i < NS;
i++)
86 inData >> yp[
i] >> v1p[
i] >> v1pe[
i] >> v1pes[
i];
90 inData.open(
"D0barv1_STAR_final.txt");
91 for (
int i = 0;
i < NS;
i++)
93 inData >> yn[
i] >> v1n[
i] >> v1ne[
i] >> v1nes[
i];
99 TGraphErrors *gr_D_STAR =
new TGraphErrors(NS, yp, v1p, 0, v1pe);
100 gr_D_STAR->SetMarkerColor(kRed - 6);
101 gr_D_STAR->SetMarkerStyle(kFullStar);
102 gr_D_STAR->SetMarkerSize(2);
103 gr_D_STAR->SetLineWidth(4);
104 gr_D_STAR->SetLineColor(kRed - 6);
107 TGraphErrors *gr_Dbar_STAR =
new TGraphErrors(NS, yn, v1n, 0, v1ne);
108 gr_Dbar_STAR->SetMarkerColor(kRed - 6);
109 gr_Dbar_STAR->SetMarkerStyle(kOpenStar);
110 gr_Dbar_STAR->SetMarkerSize(2);
111 gr_Dbar_STAR->SetLineWidth(4);
112 gr_Dbar_STAR->SetLineColor(kRed - 6);
114 TFile *fin =
new TFile(
"D0_significance.root");
115 TGraph *gr_sig_D = (TGraph *) fin->Get(
"gProD0_0_80_noPid");
116 double sig2_tot = 0.;
117 for (
int i = 0;
i < gr_sig_D->GetN();
i++)
119 sig2_tot += TMath::Power(gr_sig_D->GetY()[
i], 2.0);
121 double sig_tot = sqrt(sig2_tot);
122 cout <<
" Total D/Dbar significance in |y|<1 = " << sig_tot << endl;
123 double sig_tot_D = sig_tot / sqrt(2.);
125 const Double_t EPRes = 0.37;
129 TGraph *gr_D_Greco =
new TGraph(
"D0v1_RHIC_Greco.txt",
"%lg %lg");
130 TGraph *gr_Dbar_Greco =
new TGraph(
"D0barv1_RHIC_Greco.txt",
"%lg %lg");
131 TGraph *gr_DDbar_Bozek_tmp =
new TGraph(
"DDbarv1_eta_1712.01180.txt",
"%lg %lg");
132 double x[100],
y[100];
133 for (
int i = 0;
i < gr_DDbar_Bozek_tmp->GetN();
i++)
135 double eta = gr_DDbar_Bozek_tmp->GetX()[
i];
137 y[
i] = gr_DDbar_Bozek_tmp->GetY()[
i] / 100.;
139 TGraph *gr_DDbar_Bozek =
new TGraph(gr_DDbar_Bozek_tmp->GetN(),
x,
y);
140 cout <<
" AAAA " << endl;
144 double y_D[N_D], v1_D[N_D], v1_Dbar[N_D], v1_err_D[N_D], v1_err_Dbar[N_D];
146 for (
int i = 0;
i < N_D;
i++)
148 y_D[
i] = (
i + 0.5) * 2.0 / N_D - 1.0;
149 v1_D[
i] = -1.0 * gr_D_Greco->Eval(y_D[
i]) + gr_DDbar_Bozek->Eval(y_D[i]);
150 v1_Dbar[
i] = -1.0 * gr_Dbar_Greco->Eval(y_D[i]) + gr_DDbar_Bozek->Eval(y_D[i]);
152 double sig_per_bin = sig_tot_D / sqrt((
double) N_D);
153 v1_err_D[
i] =
v1_err(sig_per_bin, v1_D[i], EPRes);
154 v1_err_Dbar[
i] =
v1_err(sig_per_bin, v1_Dbar[i], EPRes);
155 cout << y_D[
i] <<
" " << v1_D[
i] <<
"+/-" << v1_err_D[
i] << endl;
158 TGraph *gr_D =
new TGraph(N_D, y_D, v1_D);
159 gr_D->SetMarkerSize(2);
160 gr_D->SetMarkerColor(1);
161 gr_D->SetMarkerStyle(20);
162 gr_D->SetLineWidth(2.);
163 gr_D->SetLineStyle(1);
164 gr_D->SetLineColor(1);
166 TGraph *gr_Dbar =
new TGraph(N_D, y_D, v1_Dbar);
167 gr_Dbar->SetMarkerSize(2);
168 gr_Dbar->SetMarkerColor(4);
169 gr_Dbar->SetMarkerStyle(24);
170 gr_Dbar->SetLineWidth(2.);
171 gr_Dbar->SetLineStyle(1);
172 gr_Dbar->SetLineColor(4);
174 TGraphErrors *gr_D_proj =
new TGraphErrors(N_D / 2, y_D + 4, v1_D + 4, 0, v1_err_D + 4);
175 gr_D_proj->SetMarkerSize(2);
176 gr_D_proj->SetMarkerColor(1);
177 gr_D_proj->SetMarkerStyle(20);
178 gr_D_proj->SetLineWidth(4.);
179 gr_D_proj->SetLineStyle(1);
180 gr_D_proj->SetLineColor(1);
182 TGraphErrors *gr_D_proj_2 =
new TGraphErrors(N_D / 2, y_D, v1_D, 0, v1_err_D);
183 gr_D_proj_2->SetMarkerSize(2);
184 gr_D_proj_2->SetMarkerColor(1);
185 gr_D_proj_2->SetMarkerStyle(20);
186 gr_D_proj_2->SetLineWidth(4.);
187 gr_D_proj_2->SetLineStyle(1);
188 gr_D_proj_2->SetLineColor(1);
190 TGraphErrors *gr_Dbar_proj =
new TGraphErrors(N_D / 2, y_D + 4, v1_Dbar + 4, 0, v1_err_Dbar + 4);
191 gr_Dbar_proj->SetMarkerSize(2);
192 gr_Dbar_proj->SetMarkerColor(4);
193 gr_Dbar_proj->SetMarkerStyle(20);
194 gr_Dbar_proj->SetLineWidth(4.);
195 gr_Dbar_proj->SetLineStyle(1);
196 gr_Dbar_proj->SetLineColor(4);
198 TGraphErrors *gr_Dbar_proj_2 =
new TGraphErrors(N_D / 2, y_D, v1_Dbar, 0, v1_err_Dbar);
199 gr_Dbar_proj_2->SetMarkerSize(2);
200 gr_Dbar_proj_2->SetMarkerColor(4);
201 gr_Dbar_proj_2->SetMarkerStyle(20);
202 gr_Dbar_proj_2->SetLineWidth(4.);
203 gr_Dbar_proj_2->SetLineStyle(1);
204 gr_Dbar_proj_2->SetLineColor(4);
223 const double error_scale_3yr = sqrt((refAuAuMB) / (AuAu_rec_3year * refAuAuXSec));
224 const double error_scale_5yr = sqrt((refAuAuMB) / (AuAu_rec_5year * refAuAuXSec));
226 TGraphErrors *gr_D_proj_3yr =
GraphShiftScaling(gr_D_proj, 0.05, error_scale_3yr);
227 TGraphErrors *gr_D_proj_2_3yr =
GraphShiftScaling(gr_D_proj_2, 0.05, error_scale_3yr);
228 TGraphErrors *gr_Dbar_proj_3yr =
GraphShiftScaling(gr_Dbar_proj, 0.05, error_scale_3yr);
229 TGraphErrors *gr_Dbar_proj_2_3yr =
GraphShiftScaling(gr_Dbar_proj_2, 0.05, error_scale_3yr);
232 TGraphErrors *gr_D_proj_2_5yr =
GraphShiftScaling(gr_D_proj_2, 0., error_scale_5yr);
233 TGraphErrors *gr_Dbar_proj_5yr =
GraphShiftScaling(gr_Dbar_proj, 0., error_scale_5yr);
234 TGraphErrors *gr_Dbar_proj_2_5yr =
GraphShiftScaling(gr_Dbar_proj_2, 0., error_scale_5yr);
236 gr_D_proj_3yr->SetMarkerStyle(kOpenCircle);
237 gr_D_proj_2_3yr->SetMarkerStyle(kOpenCircle);
238 gr_Dbar_proj_3yr->SetMarkerStyle(kOpenCircle);
239 gr_Dbar_proj_2_3yr->SetMarkerStyle(kOpenCircle);
241 gr_D_proj_3yr->SetMarkerColor(kGray + 2);
242 gr_D_proj_2_3yr->SetMarkerColor(kGray + 2);
243 gr_Dbar_proj_3yr->SetMarkerColor(kBlue - 6);
244 gr_Dbar_proj_2_3yr->SetMarkerColor(kBlue - 6);
246 gr_D_proj_3yr->SetLineColor(kGray + 2);
247 gr_D_proj_2_3yr->SetLineColor(kGray + 2);
248 gr_Dbar_proj_3yr->SetLineColor(kBlue - 6);
249 gr_Dbar_proj_2_3yr->SetLineColor(kBlue - 6);
253 TCanvas *c1 =
new TCanvas(
"D0_BUP2020_AuAu_v1_5y_compare",
"D0_BUP2020_AuAu_v1_5y_compare", 1100, 800);
258 p = (TPad *) c1->cd(idx++);
287 TH1D *d0 =
new TH1D(
"d0",
"", 1, x1, x2);
292 d0->GetXaxis()->SetTitle(
"Rapidity");
301 d0->GetYaxis()->SetTitle(
"v_{1}");
311 TLine *l0 =
new TLine(x1, 0, x2, 0);
313 l0->SetLineColor(kBlack);
317 gr_D_STAR->Draw(
"p");
318 gr_Dbar_STAR->Draw(
"p");
325 gr_D_proj_2_3yr->Draw(
"p");
326 gr_Dbar_proj_2_3yr->Draw(
"p");
328 gr_D_proj_3yr->Draw(
"p");
329 gr_Dbar_proj_3yr->Draw(
"p");
331 gr_D_proj_2_5yr->Draw(
"p");
332 gr_Dbar_proj_2_5yr->Draw(
"p");
334 gr_D_proj_5yr->Draw(
"p");
335 gr_Dbar_proj_5yr->Draw(
"p");
338 TLegend *
leg =
new TLegend(.3, .77, .9, .9);
339 leg->SetFillStyle(0);
340 leg->AddEntry(
"",
"#it{#bf{sPHENIX}} Projection, Years 1-5",
"");
341 leg->AddEntry(
"", (
"0-80% Au+Au, Res(#Psi_{1})=0.37"),
"");
346 leg =
new TLegend(.2, .18, .4, .4,
"D^{0}");
347 leg->SetFillStyle(0);
348 leg->AddEntry(gr_D_proj_3yr,
" ",
"pe");
349 leg->AddEntry(gr_D_proj_5yr,
" ",
"pe");
350 leg->AddEntry(gr_D_STAR,
" ",
"pe");
353 leg =
new TLegend(.25, .18, .5, .4,
" #bar{D}^{0}");
354 leg->SetFillStyle(0);
355 leg->AddEntry(gr_Dbar_proj_3yr, Form(
"sPHENIX, Year 1-3, %.0fnb^{-1} rec. Au+Au", AuAu_rec_3year / 1e9),
"pe");
356 leg->AddEntry(gr_Dbar_proj_5yr, Form(
"sPHENIX, Year 1-5, %.0fnb^{-1} rec.+str. Au+Au", AuAu_rec_5year / 1e9),
"pe");
357 leg->AddEntry(gr_Dbar_STAR,
"STAR, 10-80% Au+Au, PRL#bf{123}, 162301",
"pe");
399 SaveCanvas(c1,
"fig_BUP2020/" + TString(c1->GetName()), kTRUE);