Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
makeLcD0.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file makeLcD0.C
1 #include <stdio.h>
2 #include "iomanip.h"
3 
4 void makeLcD0()
5 {
6  gROOT->Reset();
7 
8  const Int_t NConfig = 4;
9  const Int_t NMax = 5;
10  const Int_t N[NConfig] = {3, 5, 4, 1}; // ALICE_pp, ALICE_pPb, STAR_AuAu
11  const Char_t *ExpName[NConfig] = {"STAR","ALICE","ALICE","ALICE"};
12  const Char_t *CollName[NConfig] = {"AuAu_10_80_200GeV","pp_7TeV","pPb_5p02TeV","PbPb_5p02TeV"};
13  double x[NConfig][NMax], y[NConfig][NMax], ye[NConfig][NMax], yes_u[NConfig][NMax], yes_d[NConfig][NMax];
14  TGraphErrors *gr[NConfig];
15 
16  // STAR data points
17  ifstream inData;
18  for(int i=0;i<NConfig;i++) {
19  inData.open(Form("dat/%s_LcD0_%s.txt",ExpName[i],CollName[i]));
20  for(int j=0;j<N[i];j++) {
21  inData >> x[i][j] >> y[i][j] >> ye[i][j] >> yes_u[i][j] >> yes_d[i][j];
22  }
23  inData.close();
24  gr[i] = new TGraphErrors(N[i], x[i], y[i], 0, ye[i]);
25  cout << Form("dat/%s_LcD0_%s.txt",ExpName[i],CollName[i]) << endl;
26  gr[i]->Print();
27  }
28 
29  // STAR Central data
30  double x_St[1] = {3.96};
31  double y_St[1] = {1.3935};
32  double ye_St[1] = {0.3112};
33  double yes_St[1] = {0.3446};
34  TGraphErrors *gr_St = new TGraphErrors(1, x_St, y_St, 0, ye_St);
35  gr_St->SetMarkerStyle(29);
36  gr_St->SetMarkerSize(2.5);
37  gr_St->SetMarkerColor(2);
38  gr_St->SetLineWidth(2);
39  gr_St->SetLineColor(2);
40 
41  // Theory calculations
42  // pythia6
43  TFile *fin = new TFile("root/pythia_D_ratio.root");
44  TGraphErrors *gr_pythia_tmp = (TGraphErrors *)fin->Get("Ratio_Lc_D0");
45  TGraph *gr_pythia = new TGraph(*gr_pythia_tmp);
46  gr_pythia->SetLineWidth(2);
47  gr_pythia->SetLineColor(16);
48  // pythia8
49  TFile *fin = new TFile("root/PYTHIA8_D_ratio_200GeV_20181029_0.root");
50  TDirectoryFile *fLc = (TDirectoryFile *)fin->Get("Lc");
51  TH1D *h_pythia8 = (TH1D *)fLc->Get("LctoD0_pt_whole_rebin");
52  TGraph *gr_pythia8 = new TGraph(h_pythia8);
53  gr_pythia8->SetLineWidth(2);
54  gr_pythia8->SetLineColor(1);
55  gr_pythia8->SetLineStyle(2);
56 
57  TFile *fin = new TFile("root/PYTHIA8_D_ratio_200GeV_20181029_CR.root");
58  TDirectoryFile *fLc = (TDirectoryFile *)fin->Get("Lc");
59  TH1D *h_pythia8_CR = (TH1D *)fLc->Get("LctoD0_pt_whole_rebin");
60  TGraph *gr_pythia8_CR = new TGraph(h_pythia8_CR);
61  gr_pythia8_CR->SetLineWidth(2);
62  gr_pythia8_CR->SetLineColor(1);
63  gr_pythia8_CR->SetLineStyle(4);
64 
65 
66  TGraph *gr_pythia_7TeV = new TGraph("dat/PYTHIA_Lc_D0_pp_7TeV.txt","%lg %lg");
67  TGraph *gr_pythia_7TeV_CR = new TGraph("dat/PYTHIACR_Lc_D0_pp_7TeV.txt","%lg %lg");
68  TGraph *gr_Greco_LHC_1 = new TGraph("dat/Greco_LcD0_1_PbPb5p02TeV.txt","%lg %lg");
69  TGraph *gr_Greco_LHC_2 = new TGraph("dat/Greco_LcD0_2_PbPb5p02TeV.txt","%lg %lg");
70  TGraph *gr_ShaoSong_LHC_1 = new TGraph("dat/ShaoSong_LcD0_1_PbPb5p02TeV.txt","%lg %lg");
71  TGraph *gr_ShaoSong_LHC_2 = new TGraph("dat/ShaoSong_LcD0_2_PbPb5p02TeV.txt","%lg %lg");
72  /*
73  const Int_t N_Greco = 14;
74  Double_t pt_Greco[N_Greco], y_Greco[N_Greco], ye_Greco[N_Greco];
75  inData.open("dat/LcD0_Greco_1407.5069.txt");
76  for(int i=0;i<N_Greco;i++) {
77  double a, b, c;
78  inData >> a >> b >> c;
79  pt_Greco[i] = a;
80  y_Greco[i] = (b+c)/2.;
81  ye_Greco[i] = fabs(b-c)/2.;
82  }
83  inData.close();
84  TGraphErrors *gr_Greco = new TGraphErrors(N_Greco, pt_Greco, y_Greco, 0, ye_Greco);
85  gr_Greco->SetFillColor(16);
86  gr_Greco->SetLineColor(16);
87  */
88  TGraph *gr_Greco_1 = new TGraph("dat/Greco_LcD0_1_AuAu200GeV_0_20.dat","%lg %lg");
89  gr_Greco_1->SetLineWidth(2);
90  gr_Greco_1->SetLineStyle(2);
91  gr_Greco_1->SetLineColor(4);
92  TGraph *gr_Greco_2 = new TGraph("dat/Greco_LcD0_2_AuAu200GeV_0_20.dat","%lg %lg");
93  gr_Greco_2->SetLineWidth(2);
94  gr_Greco_2->SetLineStyle(4);
95  gr_Greco_2->SetLineColor(4);
96  TGraph *gr_Tsinghua_1 = new TGraph("dat/Tsinghua_LcD0_1_AuAu200GeV_10_80.txt","%lg %lg");
97  gr_Tsinghua_1->SetLineWidth(2);
98  gr_Tsinghua_1->SetLineStyle(2);
99  gr_Tsinghua_1->SetLineColor(kGreen-6);
100  TGraph *gr_Tsinghua_2 = new TGraph("dat/Tsinghua_LcD0_2_AuAu200GeV_10_80.txt","%lg %lg");
101  gr_Tsinghua_2->SetLineWidth(2);
102  gr_Tsinghua_2->SetLineStyle(4);
103  gr_Tsinghua_2->SetLineColor(kGreen-6);
104 
105 
106  const Int_t N_Ko = 12;
107  Double_t pt_Ko[N_Ko], y1_Ko[N_Ko], y2_Ko[N_Ko], y3_Ko[N_Ko];
108  inData.open("dat/LcD0_Ko_0901.1382.txt");
109  for(int i=0;i<N_Ko;i++) {
110  inData >> pt_Ko[i] >> y1_Ko[i] >> y2_Ko[i] >> y3_Ko[i];
111  }
112  inData.close();
113  TGraph *gr_Ko_1 = new TGraph(N_Ko, pt_Ko, y1_Ko);
114  gr_Ko_1->SetLineWidth(2);
115  gr_Ko_1->SetLineColor(2);
116  gr_Ko_1->SetLineStyle(3);
117  TGraph *gr_Ko_2 = new TGraph(N_Ko, pt_Ko, y2_Ko);
118  gr_Ko_2->SetLineWidth(2);
119  gr_Ko_2->SetLineColor(2);
120  gr_Ko_2->SetLineStyle(2);
121  TGraph *gr_Ko_3 = new TGraph(N_Ko, pt_Ko, y3_Ko);
122  gr_Ko_3->SetLineWidth(2);
123  gr_Ko_3->SetLineColor(2);
124  gr_Ko_3->SetLineStyle(4);
125  // sPHENIX projection
126  const Int_t N_sPH = 20;
127  double pT_sPH[N_sPH], sig_sPH_noPID[N_sPH], sig_sPH_ideal[N_sPH];
128  double r_sPH[N_sPH], r_err_sPH_noPID[N_sPH], r_err_sPH_ideal[N_sPH];
129  double pT_sPH_noPID[N_sPH], pT_sPH_ideal[N_sPH];
130  const Double_t offset = 0.06;
131  // TFile *fin = new TFile("signi_0_10.root");
132  TFile *fin = new TFile("significance/signi_0.root");
133  TH1D *h1 = (TH1D *)fin->Get("NoPID_signi");
134  TH1D *h2 = (TH1D *)fin->Get("Cleanideal_signi");
135  // cout<<" ok "<<endl;
136  int n_sPH = 0;
137  for(int i=0;i<h1->GetNbinsX();i++) {
138  pT_sPH[i] = h1->GetBinCenter(i+1);
139  sig_sPH_noPID[i] = h1->GetBinContent(i+1);
140  sig_sPH_ideal[i] = h2->GetBinContent(i+1);
141 
142  pT_sPH_noPID[i] = pT_sPH[i]-offset;
143  pT_sPH_ideal[i] = pT_sPH[i]+offset;
144  r_sPH[i] = gr[0]->Eval(pT_sPH[i]);
145  r_err_sPH_noPID[i] = r_sPH[i]/sig_sPH_noPID[i];
146  r_err_sPH_ideal[i] = r_sPH[i]/sig_sPH_ideal[i];
147  n_sPH++;
148  }
149  TGraphErrors *gr_sPH_noPID = new TGraphErrors(n_sPH, pT_sPH_noPID, r_sPH, 0, r_err_sPH_noPID);
150  gr_sPH_noPID->SetMarkerStyle(24);
151  // gr_sPH_noPID->SetMarkerSize(1.8);
152  gr_sPH_noPID->SetMarkerSize(1.3);
153  gr_sPH_noPID->SetMarkerColor(1);
154  gr_sPH_noPID->SetLineColor(1);
155  gr_sPH_noPID->SetLineWidth(2);
156  TGraphErrors *gr_sPH_ideal = new TGraphErrors(n_sPH, pT_sPH_ideal, r_sPH, 0, r_err_sPH_ideal);
157  gr_sPH_ideal->SetMarkerStyle(20);
158  // gr_sPH_ideal->SetMarkerSize(1.8);
159  gr_sPH_ideal->SetMarkerSize(1.3);
160  gr_sPH_ideal->SetMarkerColor(1);
161  gr_sPH_ideal->SetLineColor(1);
162  gr_sPH_ideal->SetLineWidth(2);
163 
164 
165  TCanvas *c1 = new TCanvas("c1", "c1",0,0,800,600);
166  gStyle->SetOptFit(0);
167  gStyle->SetOptStat(0);
168  gStyle->SetEndErrorSize(0);
169 
170  c1->SetFillColor(10);
171  c1->SetFillStyle(0);
172  c1->SetBorderMode(0);
173  c1->SetBorderSize(0);
174  c1->SetFrameFillColor(10);
175  c1->SetFrameFillStyle(0);
176  c1->SetFrameBorderMode(0);
177  c1->SetLeftMargin(0.11);
178  c1->SetRightMargin(0.03);
179  c1->SetTopMargin(0.03);
180  c1->SetBottomMargin(0.14);
181  // c1->SetLogy();
182  // c1->SetTickx();
183  // c1->SetTicky();
184  c1->Draw();
185  c1->cd();
186 
187 
188  double x1 = 0.01;
189  double x2 = 8.99;
190  double y1 = 0.001;
191  double y2 = 4;
192  TH1 *h0 = new TH1D("h0","",1,x1, x2);
193  h0->SetMinimum(y1);
194  h0->SetMaximum(y2);
195  h0->GetXaxis()->SetNdivisions(208);
196  h0->GetXaxis()->CenterTitle();
197  h0->GetXaxis()->SetTitle("Transverse Momentum p_{T} (GeV/c)");
198  h0->GetXaxis()->SetTitleOffset(0.95);
199  h0->GetXaxis()->SetTitleSize(0.06);
200  h0->GetXaxis()->SetLabelOffset(0.01);
201  h0->GetXaxis()->SetLabelSize(0.045);
202  h0->GetXaxis()->SetLabelFont(42);
203  h0->GetXaxis()->SetTitleFont(42);
204  h0->GetYaxis()->SetNdivisions(505);
205  h0->GetYaxis()->SetTitle("(#Lambda_{c}^{+}+#bar{#Lambda_{c}}^{-})/(D^{0}+#bar{D}^{0})");
206  h0->GetYaxis()->SetTitleOffset(0.8);
207  h0->GetYaxis()->SetTitleSize(0.06);
208  h0->GetYaxis()->SetLabelOffset(0.018);
209  h0->GetYaxis()->SetLabelSize(0.045);
210  h0->GetYaxis()->SetLabelFont(42);
211  h0->GetYaxis()->SetTitleFont(42);
212  h0->Draw("c");
213 
214  TLine *l1 = new TLine(x1,y1,x2,y1);
215  l1->SetLineWidth(3);
216  l1->Draw("same");
217  TLine *l2 = new TLine(x1,y2,x2,y2);
218  l2->SetLineWidth(3);
219  l2->Draw("same");
220  TLine *l3 = new TLine(x1,y1,x1,y2);
221  l3->SetLineWidth(3);
222  l3->Draw("same");
223  TLine *l4 = new TLine(x2,y1,x2,y2);
224  l4->SetLineWidth(3);
225  l4->Draw("same");
226 
227 
228  // gr_pythia->SetFillColor(16);
229  // gr_pythia->SetLineWidth(2);
230  // gr_pythia->SetLineStyle(2);
231  // gr_pythia->SetLineColor(1);
232  // gr_pythia->Draw("c");
233 
234  gr_pythia8->Draw("c");
235  gr_pythia8_CR->Draw("c");
236 
237  gr_Greco_1->Draw("c");
238  gr_Greco_2->Draw("c");
239  // gr_Ko_1->Draw("c");
240  gr_Ko_2->Draw("c");
241  gr_Ko_3->Draw("c"); // pythia
242  gr_Tsinghua_1->Draw("c");
243  gr_Tsinghua_2->Draw("c");
244 
245 
246  TLine *la = new TLine(0.2, 0.24, 1.5, 0.24);
247  la->SetLineWidth(5);
248  la->SetLineColor(18);
249  // la->Draw("same");
250 
251  TLatex *tex = new TLatex(0.5, 0.26, "SHM");
252  tex->SetTextFont(12);
253  tex->SetTextSize(0.06);
254  // tex->Draw("same");
255 
256  /*
257  // plotting the data points
258  const Int_t kStyle[NConfig] = {20, 20, 24, 20};
259  const Int_t kColor[NConfig] = {1, 2, 4, 1};
260  const double xo = fabs(x2-x1)/80.;
261  const double yo = fabs(y2-y1)/80.;
262  for(int i=0;i<1;i++) { // STAR
263 
264  for(int j=0;j<N[i];j++) {
265  double x1 = x[i][j] - xo;
266  double x2 = x[i][j] + xo;
267  double y1 = y[i][j] - yes_d[i][j];
268  double y2 = y[i][j] + yes_u[i][j];
269 
270  TLine *la = new TLine(x1, y1, x1, y1+yo);
271  la->SetLineColor(kColor[i]);
272  la->SetLineWidth(1);
273  la->Draw("same");
274  TLine *lb = new TLine(x2, y1, x2, y1+yo);
275  lb->SetLineColor(kColor[i]);
276  lb->SetLineWidth(1);
277  lb->Draw("same");
278  TLine *lc = new TLine(x1, y2, x1, y2-yo);
279  lc->SetLineColor(kColor[i]);
280  lc->SetLineWidth(1);
281  lc->Draw("same");
282  TLine *ld = new TLine(x2, y2, x2, y2-yo);
283  ld->SetLineColor(kColor[i]);
284  ld->SetLineWidth(1);
285  ld->Draw("same");
286  TLine *le = new TLine(x1, y1, x2, y1);
287  le->SetLineColor(kColor[i]);
288  le->SetLineWidth(2);
289  le->Draw("same");
290  TLine *lf = new TLine(x1, y2, x2, y2);
291  lf->SetLineColor(kColor[i]);
292  lf->SetLineWidth(2);
293  lf->Draw("same");
294  }
295  gr[i]->SetMarkerStyle(kStyle[i]);
296  gr[i]->SetMarkerColor(kColor[i]);
297  gr[i]->SetMarkerSize(1.8);
298  gr[i]->SetLineColor(kColor[i]);
299  gr[i]->SetLineWidth(2);
300  gr[i]->Draw("p");
301  }
302  */
303  gr_St->Draw("p");
304  gr_sPH_noPID->Draw("p");
305  gr_sPH_ideal->Draw("p");
306 
307  TLatex *tex = new TLatex(x1+0.2, y2*0.9, "Au+Au, #sqrt{s_{NN}}=200GeV");
308  tex->SetTextFont(42);
309  tex->SetTextSize(0.05);
310  tex->Draw("same");
311  TLatex *tex = new TLatex(x1+0.2, y2*0.9, "#sqrt{s_{NN}}=200GeV");
312  tex->SetTextFont(42);
313  tex->SetTextSize(0.055);
314  // tex->Draw("same");
315 
316 
317  TLegend *leg = new TLegend(0.52, 0.82, 0.94, 0.94);
318  leg->SetFillColor(10);
319  leg->SetFillStyle(10);
320  leg->SetLineStyle(4000);
321  leg->SetLineColor(10);
322  leg->SetLineWidth(0.);
323  leg->SetTextFont(42);
324  leg->SetTextSize(0.035);
325  leg->AddEntry(gr_sPH_ideal, "sPHENIX proj: ideal TOF, 0-10%", "pl");
326  leg->AddEntry(gr_sPH_noPID, "sPHENIX proj: noPID, 0-10%", "pl");
327  leg->AddEntry(gr_St, "STAR prel., 0-20%", "pl");
328  leg->Draw();
329 
330  TLegend *leg = new TLegend(0.56, 0.64, 0.94, 0.8);
331  leg->SetFillColor(10);
332  leg->SetFillStyle(10);
333  leg->SetLineStyle(4000);
334  leg->SetLineColor(10);
335  leg->SetLineWidth(0.);
336  leg->SetTextFont(42);
337  leg->SetTextSize(0.035);
338  leg->AddEntry(gr_Tsinghua_2,"Tsinghua: seq. coal, 10-80%","l");
339  leg->AddEntry(gr_Tsinghua_1,"Tsinghua: simul. coal, 10-80%","l");
340  leg->AddEntry(gr_Greco_2,"Catania: coal only, 0-20%","l");
341  leg->AddEntry(gr_Greco_1,"Catania: coal+frag, 0-20%","l");
342  leg->Draw();
343 
344  TLegend *leg = new TLegend(0.68, 0.48, 0.94, 0.64);
345  leg->SetFillColor(10);
346  leg->SetFillStyle(10);
347  leg->SetLineStyle(4000);
348  leg->SetLineColor(10);
349  leg->SetLineWidth(0.);
350  leg->SetTextFont(42);
351  leg->SetTextSize(0.035);
352  leg->AddEntry(gr_Ko_3,"TAMU: di-quark 0-5%","l");
353  leg->AddEntry(gr_Ko_2,"TAMU: 3-quark 0-5%","l");
354  leg->AddEntry(gr_pythia8_CR,"PYTHIA8 (CR)","l");
355  leg->AddEntry(gr_pythia8,"PYTHIA8 (Monash)","l");
356  leg->Draw();
357 
358  c1->Update();
359 
360  c1->SaveAs("fig/LcD0_proj_0_10_24B.pdf");
361  c1->SaveAs("fig/LcD0_proj_0_10_24B.png");
362 
363 
364 }