Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Draw_HFJetTruth3yr.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file Draw_HFJetTruth3yr.C
1 // $Id: $
2 
11 #include <TChain.h>
12 #include <TFile.h>
13 #include <TGraphAsymmErrors.h>
14 #include <TGraphErrors.h>
15 #include <TLatex.h>
16 #include <TLegend.h>
17 #include <TLine.h>
18 #include <TString.h>
19 #include <TTree.h>
20 #include <TVirtualFitter.h>
21 #include <cassert>
22 #include <cmath>
23 #include <vector>
24 #include "SaveCanvas.C"
25 #include "sPhenixStyle.C"
26 
27 using namespace std;
28 
29 TGraphAsymmErrors *
30 GetFONLL_C();
31 TGraphAsymmErrors *
32 GetFONLL_B();
33 TGraph *pQCDModel_HuangKangVitev(const double g);
34 TGraph *LIDO_Ke();
35 TGraph *
37 
38 TFile *_file0 = NULL;
39 TTree *T = NULL;
40 
41 TH1 *CrossSection2RelUncert(const TH1F *h_cross,
42  const double suppression,
43  const double deta,
44  const double pp_quiv_int_lum)
45 {
46  assert(h_cross);
47  TH1 *
48  h_ratio = (TH1 *)
49  h_cross->Clone(TString(h_cross->GetName()) + Form("_copy%d", rand()));
50 
51  //convert to count per bin
52  h_ratio->Scale(deta * h_ratio->GetXaxis()->GetBinWidth(0) * pp_quiv_int_lum * suppression);
53  h_ratio->Rebin(5);
54 
55  for (int i = 1; i <= h_ratio->GetNbinsX(); ++i)
56  {
57  const double yield = h_ratio->GetBinContent(i);
58 
59  if (yield > 0)
60  {
61  h_ratio->SetBinContent(i, suppression);
62 
63  h_ratio->SetBinError(i, suppression / sqrt(yield));
64  }
65  else
66  {
67  h_ratio->SetBinContent(i, 0);
68 
69  h_ratio->SetBinError(i, 0);
70  }
71  }
72 
73  h_ratio->GetYaxis()->SetTitle("Relative Cross Section and Uncertainty");
74 
75  return h_ratio;
76 }
77 
78 TGraphErrors *GetRAA(TH1 *h_pp, TH1 *h_AA)
79 {
80  int n_bin = 0;
81 
82  double xs[1000] = {0};
83  double ys[1000] = {0};
84  double eys[1000] = {0};
85 
86  assert(h_pp);
87  assert(h_AA);
88  assert(h_pp->GetNbinsX() == h_AA->GetNbinsX());
89 
90  for (int i = 1; i <= h_pp->GetNbinsX(); ++i)
91  {
92  if (h_pp->GetBinError(i) > 0 && h_pp->GetBinError(i) < 1 && h_AA->GetBinError(i) > 0 && h_AA->GetBinError(i) < 1)
93  {
94  xs[n_bin] = h_pp->GetXaxis()->GetBinCenter(i);
95 
96  ys[n_bin] = h_AA->GetBinContent(i) / h_pp->GetBinContent(i);
97 
98  eys[n_bin] = ys[n_bin] * sqrt(pow(h_AA->GetBinError(i) / h_AA->GetBinContent(i), 2) + pow(h_pp->GetBinError(i) / h_pp->GetBinContent(i), 2));
99 
100  n_bin += 1;
101  }
102  }
103 
104  TGraphErrors *ge = new TGraphErrors(n_bin, xs, ys, NULL, eys);
105  ge->SetName(TString("RAA_") + h_AA->GetName());
106 
107  return ge;
108 }
109 
110 void CrossSection2RAA(const TString infile, const bool use_AA_jet_trigger = true, const double dy = .7 * 2)
111 {
112  TFile *f = TFile::Open(infile + "Draw_HFJetTruth_DrawCrossSection.root");
113  assert(f);
114 
115  TH1F *hall = (TH1F *) f->GetObjectChecked("hall", "TH1F");
116  assert(hall);
117  TH1F *h_b = (TH1F *) f->GetObjectChecked("h_b", "TH1F");
118  assert(h_b);
119 
120  TString s_suffix(use_AA_jet_trigger ? "_AAJetTriggered" : "_3yr");
121  s_suffix += TString(Form("_deta%.2f", dy / 2));
122 
123  const double b_jet_RAA = 0.6;
124 
125  const double pp_eff = 0.6;
126  const double pp_purity = 0.4;
127  const double AuAu_eff = 0.4;
128  const double AuAu_purity = 0.4;
129 
131  // 5-year lumi in [sPH-TRG-000]
133 
134  const double pp_lumi = 62; // pb^-1 [sPH-TRG-000], rounded up from 197 pb^-1
135  const double pp_inelastic_crosssec = 42e-3 / 1e-12; // 42 mb in pb [sPH-TRG-000]
136 
137  const double AuAu_MB_Evt = use_AA_jet_trigger ? 218e9 : 142e9; // [sPH-TRG-000], depending on whether jet trigger applied in AA collisions
138  const double pAu_MB_Evt = 600e9; // [sPH-TRG-000]
139 
140  const double AuAu_Ncoll_C0_10 = 960.2; // [DOI:?10.1103/PhysRevC.87.034911?]
141  const double AuAu_Ncoll_C0_20 = 770.6; // [DOI:?10.1103/PhysRevC.91.064904?]
142  const double AuAu_Ncoll_C0_100 = 250; // pb^-1 [sPH-TRG-000]
143  const double pAu_Ncoll_C0_100 = 4.7; // pb^-1 [sPH-TRG-000]
144 
145  const double AuAu_eq_lumi_C0_10 = AuAu_MB_Evt * 0.1 * AuAu_Ncoll_C0_10 / pp_inelastic_crosssec; //
146  const double AuAu_eq_lumi_C0_20 = AuAu_MB_Evt * 0.2 * AuAu_Ncoll_C0_20 / pp_inelastic_crosssec; //
147  const double AuAu_eq_lumi_C0_100 = AuAu_MB_Evt * 1 * AuAu_Ncoll_C0_100 / pp_inelastic_crosssec; //
148 
149  const double pAu_eq_lumi_C0_100 = pAu_MB_Evt * 1 * pAu_Ncoll_C0_100 / pp_inelastic_crosssec; //
150 
151  cout << "CrossSection2RAA integrated luminosity assumptions in pb^-1: " << endl;
152  cout << "\t"
153  << "pp_lumi = " << pp_lumi << endl;
154  cout << "\t"
155  << "AuAu_eq_lumi_C0_10 = " << AuAu_eq_lumi_C0_10 << endl;
156  cout << "\t"
157  << "AuAu_eq_lumi_C0_20 = " << AuAu_eq_lumi_C0_20 << endl;
158  cout << "\t"
159  << "AuAu_eq_lumi_C0_100 = " << AuAu_eq_lumi_C0_100 << endl;
160  cout << "\t"
161  << "pAu_eq_lumi_C0_100 = " << pAu_eq_lumi_C0_100 << endl;
162 
163  TCanvas *c1 = new TCanvas("Draw_HFJetTruth_CrossSection2RAA_Ratio" + s_suffix, "Draw_HFJetTruth_CrossSection2RAA_Ratio" + s_suffix, 700, 600);
164  c1->Divide(1, 1);
165  int idx = 1;
166  TPad *p;
167 
168  p = (TPad *) c1->cd(idx++);
169  c1->Update();
170  // p->SetGridx(0);
171  // p->SetGridy(0);
172  // p->SetLogy();
173 
174  TH1 *g_pp = CrossSection2RelUncert(h_b, 1., dy, pp_lumi * pp_eff * pp_purity);
175  TH1 *g_AA = CrossSection2RelUncert(h_b, b_jet_RAA, dy, AuAu_eq_lumi_C0_10 * AuAu_eff * AuAu_purity);
176 
177  g_pp->SetLineColor(kRed);
178  g_AA->SetLineColor(kBlue);
179 
180  g_pp->Draw();
181  g_AA->Draw("same");
182  SaveCanvas(c1, infile + "_" + TString(c1->GetName()), kTRUE);
183 
184  c1 = new TCanvas("Draw_HFJetTruth_CrossSection2RAA" + s_suffix, "Draw_HFJetTruth_CrossSection2RAA" + s_suffix, 1100, 800);
185  c1->Divide(1, 1);
186  idx = 1;
187 
188  p = (TPad *) c1->cd(idx++);
189  c1->Update();
190 
191  p->DrawFrame(11, 0, 45, 1.2)
192  ->SetTitle(";Transverse Momentum [GeV/#it{c}];#it{R}_{AA}");
193 
194  TGraphErrors *ge_RAA = GetRAA(g_pp, g_AA);
195 
196  ge_RAA->SetLineWidth(4);
197  ge_RAA->SetMarkerStyle(kFullCircle);
198  ge_RAA->SetMarkerSize(3);
199 
200  ge_RAA->Draw("pe");
201  ge_RAA->Print();
202 
203  TLegend *leg = new TLegend(.0, .67, .85, .91);
204  leg->SetFillStyle(0);
205  leg->AddEntry("", "#it{#bf{sPHENIX}} Projection", "");
206  // leg->AddEntry("", Form("PYTHIA-8 #it{b}-jet, Anti-k_{T} R=0.4, |#eta|<%.2f, CTEQ6L", dy / 2), "");
207  leg->AddEntry("", Form("#it{b}-jet Anti-k_{T} R=0.4, 0-10%% Au+Au, Year 1-3"), "");
208  leg->AddEntry("", Form("#it{p}+#it{p}: %.0fpb^{-1} samp., %.0f%% Eff., %.0f%% Pur.", pp_lumi, pp_eff * 100, pp_purity * 100), "");
209  leg->AddEntry("", Form("Au+Au: %.0fnb^{-1} rec., %.0f%% Eff., %.0f%% Pur.", AuAu_MB_Evt / 6.8252 / 1e9, AuAu_eff * 100, AuAu_purity * 100), "");
210  leg->Draw();
211 
212  TLegend *leg2 = new TLegend(.17, .70, .88, .77);
213  leg2->AddEntry(ge_RAA, "#it{b}-jet #it{R}_{AA}, Au+Au 0-10%C, #sqrt{s_{NN}}=200 GeV", "pl");
214  // leg2->Draw();
215 
216  SaveCanvas(c1, infile + "_" + TString(c1->GetName()), kTRUE);
217 
218  c1 = new TCanvas("Draw_HFJetTruth_CrossSection2RAA_Theory" + s_suffix, "Draw_HFJetTruth_CrossSection2RAA_Theory" + s_suffix, 1100, 800);
219  c1->Divide(1, 1);
220  idx = 1;
221  *p;
222 
223  p = (TPad *) c1->cd(idx++);
224  c1->Update();
225 
226  p->DrawFrame(11, 0, 45, 1.2)
227  ->SetTitle(";p_{T} [GeV];#it{R}_{AA}");
228 
229  TGraph *gLIDO = LIDO_Ke();
230  gLIDO->SetFillColor(kAzure - 9);
231  gLIDO->Draw("3");
232 
233  TGraph *g20 = pQCDModel_HuangKangVitev(2.0);
234  TGraph *g22 = pQCDModel_HuangKangVitev(2.2);
235 
236  g20->SetLineColor(kGreen + 3);
237  g22->SetLineColor(kRed + 3);
238  g20->SetLineWidth(3);
239  g22->SetLineWidth(3);
240 
241  g20->Draw("l");
242  g22->Draw("l");
243 
244  ge_RAA->DrawClone("pe");
245  leg->DrawClone();
246  // leg2->DrawClone();
247 
248  TLegend *leg1 = new TLegend(.195, .17, .7, .3);
249  // leg1->SetHeader("#splitline{pQCD, Phys.Lett. B726 (2013) 251-256}{#sqrt{s_{NN}}=200 GeV, #it{b}-jet R=0.4}");
250  leg1->SetHeader("pQCD, Phys.Lett. B726 (2013) 251-256");
251  leg1->AddEntry(g20, "g^{med} = 2.0", "l");
252  leg1->AddEntry(g22, "g^{med} = 2.2", "l");
253  leg1->Draw();
254 
255  TLegend *leg_lido = new TLegend(.2, .32, .55, .37);
256  leg_lido->AddEntry(gLIDO, "LIDO, arXiv:2008.07622 [nucl-th]", "f");
257  leg_lido->Draw();
258 
259  SaveCanvas(c1, infile + "_" + TString(c1->GetName()), kTRUE);
260 }
261 
262 TGraphErrors *GetZgPrediction(const TString data_config = "me_bbg")
263 {
264  // Inverting the mass hierarchy of jet quenching effects with prompt bb-jet substructure, Hai Tao Li(Los Alamos Natl. Lab., Theor. Div.), Ivan Vitev(Los Alamos Natl. Lab., Theor. Div.)
265  // DOI: 10.1016/j.physletb.2019.04.052 (publication)
266  // Li, Haitao <haitaoli@lanl.gov>
267  // Here are the data for the predicted zg distributions. For all the files the first column is zg value. The second and third columns are the higher and lower limits of the uncertainty bands.
268 
269  std::vector<double> zgs;
270  std::vector<double> ymaxs;
271  std::vector<double> ymins;
272 
273  std::vector<double> ys;
274  std::vector<double> eys;
275 
276  if (data_config == "me_bbg")
277  {
278  zgs = {0.1,
279  0.11,
280  0.12,
281  0.13,
282  0.14,
283  0.15,
284  0.16,
285  0.17,
286  0.18,
287  0.19,
288  0.2,
289  0.21,
290  0.22,
291  0.23,
292  0.24,
293  0.25,
294  0.26,
295  0.27,
296  0.28,
297  0.29,
298  0.3,
299  0.31,
300  0.32,
301  0.33,
302  0.34,
303  0.35,
304  0.36,
305  0.37,
306  0.38,
307  0.39,
308  0.4,
309  0.41,
310  0.42,
311  0.43,
312  0.44,
313  0.45,
314  0.46,
315  0.47,
316  0.48,
317  0.49,
318  0.5};
319 
320  ymaxs = {11.564966612100944,
321  10.228774883485626,
322  9.040211253937503,
323  8.00426321286891,
324  7.085316588030289,
325  6.304057794111209,
326  5.620901023346734,
327  5.020252217399414,
328  4.471418358587862,
329  4.006557331982638,
330  3.6029776961294937,
331  3.2746530582558067,
332  2.979082995195153,
333  2.717548121923332,
334  2.484039405367637,
335  2.2743520629543212,
336  2.0857993148942358,
337  1.916461379592078,
338  1.7644938665497385,
339  1.6282027691535934,
340  1.5063707131889736,
341  1.3971555437989853,
342  1.2987288248009365,
343  1.2107212053236827,
344  1.131621650833046,
345  1.0605838573254032,
346  0.9969458228908805,
347  0.941899699579719,
348  0.8934983992713553,
349  0.8508943534347049,
350  0.8130937637364388,
351  0.7797214265194943,
352  0.7506054526040817,
353  0.7255735799970017,
354  0.7043026708717507,
355  0.6866658867399881,
356  0.6724855329238311,
357  0.6615441971815835,
358  0.6538330585599965,
359  0.6493379751029307,
360  0.6477595200387519};
361  ymins = {8.872885875265245,
362  8.111748205961844,
363  7.432473620102464,
364  6.797408173274767,
365  6.186769713061456,
366  5.608088106815033,
367  5.084027720317393,
368  4.610111938188973,
369  4.187760399167046,
370  3.7940340683954212,
371  3.43117457064948,
372  3.093119987479635,
373  2.7861576826055696,
374  2.5128579366528596,
375  2.270447062142767,
376  2.055432334380884,
377  1.8652346826114092,
378  1.6966233161676936,
379  1.5473576814988068,
380  1.4149243923530526,
381  1.2976881530156943,
382  1.1933534033076159,
383  1.1006617243222991,
384  1.018247797082035,
385  0.9450088178795155,
386  0.8800255813710026,
387  0.8223509153369435,
388  0.7710124745428798,
389  0.7244026618659434,
390  0.6749851216252735,
391  0.6388960527749336,
392  0.6074597301268359,
393  0.5801575320223376,
394  0.5567239908569284,
395  0.5368940589741338,
396  0.5204904428643295,
397  0.5073303543085547,
398  0.4972605201973995,
399  0.4901298441121407,
400  0.4859016247798608,
401  0.4844717994196453};
402  }
403  else if (data_config == "bbg_zg")
404  {
405  zgs = {0.1,
406  0.11,
407  0.12,
408  0.13,
409  0.14,
410  0.15,
411  0.16,
412  0.17,
413  0.18,
414  0.19,
415  0.2,
416  0.21,
417  0.22,
418  0.23,
419  0.24,
420  0.25,
421  0.26,
422  0.27,
423  0.28,
424  0.29,
425  0.3,
426  0.31,
427  0.32,
428  0.33,
429  0.34,
430  0.35,
431  0.36,
432  0.37,
433  0.38,
434  0.39,
435  0.4,
436  0.41,
437  0.42,
438  0.43,
439  0.44,
440  0.45,
441  0.46,
442  0.47,
443  0.48,
444  0.49,
445  0.5};
446 
447  ymaxs = {9.762434858721084,
448  8.47616359817982,
449  7.492676243945642,
450  6.654010010935872,
451  5.913925919575108,
452  5.27028638644749,
453  4.713862130785145,
454  4.2338140867044,
455  3.8359176524435012,
456  3.5411710604457696,
457  3.2780402997684046,
458  3.0428481843445376,
459  2.8313528228811093,
460  2.64115838360015,
461  2.4819574262280666,
462  2.338567310713753,
463  2.2090001831145045,
464  2.091727244023134,
465  1.9854179724262009,
466  1.888790011179277,
467  1.8008939425055928,
468  1.7209392536426298,
469  1.6482358047754673,
470  1.582167173395633,
471  1.5221883540849073,
472  1.467818836564728,
473  1.4186285882228657,
474  1.3742395815301207,
475  1.3343146951863025,
476  1.2985549222721922,
477  1.266698029272377,
478  1.2385132145874334,
479  1.2137978220476016,
480  1.1923789991503813,
481  1.1741068974344762,
482  1.1588532760513377,
483  1.1465131698787123,
484  1.1370016290107832,
485  1.1302536619705346,
486  1.1262226895802339,
487  1.124882446490406};
488  ymins = {7.5042886917903475,
489  6.698904277963574,
490  6.13325229167674,
491  5.642204967225616,
492  5.184676746368783,
493  4.767489013960836,
494  4.391074470600173,
495  4.0530921099573165,
496  3.747687167866155,
497  3.4368852671586723,
498  3.1391359733756863,
499  2.872328619918876,
500  2.637262134930488,
501  2.430875459603178,
502  2.24954656566354,
503  2.090040255967163,
504  1.9492781360305134,
505  1.8247013582708238,
506  1.7141703670450044,
507  1.61589253533197,
508  1.528349666705045,
509  1.4502575139246554,
510  1.3805229398832255,
511  1.318209032398018,
512  1.2625160741157493,
513  1.2127547858323617,
514  1.1683292385783044,
515  1.1287292083339666,
516  1.0935097910299434,
517  1.0622884717784657,
518  1.034734064269136,
519  1.0105633112172412,
520  0.9895286076610499,
521  0.9714187985395711,
522  0.9560602609384745,
523  0.9433012733218156,
524  0.9330225001525349,
525  0.9251255015159976,
526  0.9195356933679992,
527  0.9162028180740642,
528  0.9150954615243209};
529  }
530  else if (data_config == "bbg_zg_ratio")
531  {
532  zgs = {0.1,
533  0.11,
534  0.12,
535  0.13,
536  0.14,
537  0.15,
538  0.16,
539  0.17,
540  0.18,
541  0.19,
542  0.2,
543  0.21,
544  0.22,
545  0.23,
546  0.24,
547  0.25,
548  0.26,
549  0.27,
550  0.28,
551  0.29,
552  0.3,
553  0.31,
554  0.32,
555  0.33,
556  0.34,
557  0.35,
558  0.36,
559  0.37,
560  0.38,
561  0.39,
562  0.4,
563  0.41,
564  0.42,
565  0.43,
566  0.44,
567  0.45,
568  0.46,
569  0.47,
570  0.48,
571  0.49,
572  0.5};
573 
574  ymaxs = {1.151982890151877,
575  1.1664826852504495,
576  1.172251389758727,
577  1.1741255109207875,
578  1.1714608638124098,
579  1.1681087817987694,
580  1.1632495306605235,
581  1.155513671471374,
582  1.1397719364148045,
583  1.127051000823432,
584  1.1119535300939027,
585  1.0948424254600155,
586  1.0760601346878573,
587  1.055878624941244,
588  1.0345055306535231,
589  1.0120360659743335,
590  0.9890362761525937,
591  0.9655962994186251,
592  0.9421308194393136,
593  0.9186226313722144,
594  0.895503201582456,
595  0.8725753749800488,
596  0.8501317891243333,
597  0.8282275629034408,
598  0.8069766690984213,
599  0.7865577997621885,
600  0.7669973631487963,
601  0.7481674017140337,
602  0.7304488459867333,
603  0.7015931864543251,
604  0.688687461757641,
605  0.6766716415600889,
606  0.6657247620008147,
607  0.6559757617778346,
608  0.6474142123454508,
609  0.6401392451833807,
610  0.6341568146936112,
611  0.6294320803863227,
612  0.6260810257194698,
613  0.6241574732399557,
614  0.6234333158108032};
615  ymins = {1.096464697907084,
616  1.1148057864579233,
617  1.1277713781468222,
618  1.136191604396884,
619  1.1385826379515291,
620  1.135722028529819,
621  1.1284916532508826,
622  1.1169591429988097,
623  1.103666045140106,
624  1.0854505401169579,
625  1.0654328782085087,
626  1.0442210459999413,
627  1.0223533047937827,
628  1.0001575721016631,
629  0.9777309842954044,
630  0.9550386037145693,
631  0.9325222701437524,
632  0.9101431388163338,
633  0.8882340053200084,
634  0.8667312777949217,
635  0.8459583146041589,
636  0.8256251575966925,
637  0.8059969846816892,
638  0.7869325271199851,
639  0.7684747631437073,
640  0.750777564978232,
641  0.733824152526011,
642  0.7174732270599817,
643  0.7020666530820847,
644  0.6931802179916633,
645  0.6795859695799639,
646  0.6666218950521552,
647  0.6546221226148139,
648  0.6438152297250573,
649  0.6342654764486364,
650  0.6261010548445681,
651  0.6193616959253557,
652  0.6140461556406446,
653  0.6102701796326937,
654  0.6080839713862733,
655  0.6072750596686409};
656  }
657  else
658  {
659  cout << __PRETTY_FUNCTION__ << "Invalid configuration : " << data_config << endl;
660  exit(1);
661  }
662 
663  double integral = 0;
664  for (int i = 0; i < zgs.size(); ++i)
665  {
666  assert(i < ymaxs.size());
667  assert(i < ymins.size());
668 
669  ys.push_back(0.5 * (ymaxs[i] + ymins[i]));
670  eys.push_back(0.5 * fabs(ymaxs[i] - ymins[i]));
671 
672  integral += (zgs[1] - zgs[0]) * ys[i];
673  }
674  cout << __PRETTY_FUNCTION__ << " configuration : " << data_config << " integral = " << integral << endl;
675 
676  TGraphErrors *ge = new TGraphErrors(zgs.size(), zgs.data(), ys.data(), NULL, eys.data());
677  ge->SetName(TString("zg_") + data_config);
678 
679  return ge;
680 }
681 
682 TH1 *CrossSection2zg_HistogramMaker(const TH1F *h_cross,
683  const double suppression,
684  const double deta, const double pt_max,
685  const double pp_quiv_int_lum, const TString data_config)
686 {
687  assert(h_cross);
688  TH1 *
689  h_yield = (TH1 *)
690  h_cross->Clone(TString(h_cross->GetName()) + Form("_copy%d", rand()));
691 
692  //convert to count per bin
693  h_yield->Scale(deta * h_yield->GetXaxis()->GetBinWidth(0) * pp_quiv_int_lum * suppression);
694  // h_ratio->Rebin(5);
695 
696  double sum_yield = 0;
697  for (int i = 1; i <= h_yield->GetNbinsX(); ++i)
698  {
699  const double yield = h_yield->GetBinContent(i);
700  if (h_yield->GetXaxis()->GetBinCenter(i) < pt_max) sum_yield += yield;
701  }
702 
703  TGraphErrors *ge_prediction = GetZgPrediction(data_config);
704  const double bin_width = 0.05;
705  TH1 *h_zg = new TH1F("hzg_" + data_config, "z_{g}", 0.4 / bin_width, 0.1, 0.5);
706 
707  for (int i = 1; i <= h_zg->GetNbinsX(); ++i)
708  {
709  const double x_center = h_zg->GetBinCenter(i);
710 
711  const double prediction = ge_prediction->Eval(x_center);
712 
713  h_zg->SetBinContent(i, prediction);
714 
715  const double bin_yield = bin_width * prediction * sum_yield;
716 
717  h_zg->SetBinError(i, prediction / sqrt(bin_yield));
718  }
719 
720  return h_zg;
721 }
722 
723 void CrossSection2zg(const TString infile, const bool use_AA_jet_trigger = true, const double dy = .7 * 2)
724 {
725  TFile *f = TFile::Open(infile + "Draw_HFJetTruth_DrawCrossSection.root");
726  assert(f);
727 
728  TH1F *hall = (TH1F *) f->GetObjectChecked("hall", "TH1F");
729  assert(hall);
730  TH1F *h_b = (TH1F *) f->GetObjectChecked("h_b", "TH1F");
731  assert(h_b);
732 
733  TString s_suffix(use_AA_jet_trigger ? "_AAJetTriggered" : "_3yr");
734  s_suffix += TString(Form("_deta%.2f", dy / 2));
735 
736  const double pt_max = 30; // max pT to be consistent with DOI: 10.1016/j.physletb.2019.04.052 (publication)
737 
738  const double b_jet_RAA = 0.6;
739 
740  const double pp_eff = 0.6;
741  const double pp_purity = 0.4;
742  const double AuAu_eff = 0.4;
743  const double AuAu_purity = 0.4;
744 
746  // 5-year lumi in [sPH-TRG-000]
748 
749  const double pp_lumi = 62; // pb^-1 [sPH-TRG-000], rounded up from 197 pb^-1
750  const double pp_inelastic_crosssec = 42e-3 / 1e-12; // 42 mb in pb [sPH-TRG-000]
751 
752  const double AuAu_MB_Evt = use_AA_jet_trigger ? 218e9 : 142e9; // [sPH-TRG-000], depending on whether jet trigger applied in AA collisions
753  const double pAu_MB_Evt = 600e9; // [sPH-TRG-000]
754 
755  const double AuAu_Ncoll_C0_10 = 960.2; // [DOI:?10.1103/PhysRevC.87.034911?]
756  const double AuAu_Ncoll_C0_20 = 770.6; // [DOI:?10.1103/PhysRevC.91.064904?]
757  const double AuAu_Ncoll_C0_100 = 250; // pb^-1 [sPH-TRG-000]
758  const double pAu_Ncoll_C0_100 = 4.7; // pb^-1 [sPH-TRG-000]
759 
760  const double AuAu_eq_lumi_C0_10 = AuAu_MB_Evt * 0.1 * AuAu_Ncoll_C0_10 / pp_inelastic_crosssec; //
761  const double AuAu_eq_lumi_C0_20 = AuAu_MB_Evt * 0.2 * AuAu_Ncoll_C0_20 / pp_inelastic_crosssec; //
762  const double AuAu_eq_lumi_C0_100 = AuAu_MB_Evt * 1 * AuAu_Ncoll_C0_100 / pp_inelastic_crosssec; //
763 
764  const double pAu_eq_lumi_C0_100 = pAu_MB_Evt * 1 * pAu_Ncoll_C0_100 / pp_inelastic_crosssec; //
765 
766  cout << "CrossSection2zg integrated luminosity assumptions in pb^-1: " << endl;
767  cout << "\t"
768  << "pp_lumi = " << pp_lumi << endl;
769  cout << "\t"
770  << "AuAu_eq_lumi_C0_10 = " << AuAu_eq_lumi_C0_10 << endl;
771  cout << "\t"
772  << "AuAu_eq_lumi_C0_20 = " << AuAu_eq_lumi_C0_20 << endl;
773  cout << "\t"
774  << "AuAu_eq_lumi_C0_100 = " << AuAu_eq_lumi_C0_100 << endl;
775  cout << "\t"
776  << "pAu_eq_lumi_C0_100 = " << pAu_eq_lumi_C0_100 << endl;
777 
778  TGraphErrors *bbg_zg_prediction = GetZgPrediction("bbg_zg");
779  TGraphErrors *me_bbg_prediction = GetZgPrediction("me_bbg");
780  TGraphErrors *bbg_zg_ratio_prediction = GetZgPrediction("bbg_zg_ratio");
781 
782  TCanvas *c1 = new TCanvas("Draw_HFJetTruth_CrossSection2zg_check" + s_suffix, "Draw_HFJetTruth_CrossSection2zg_check" + s_suffix, 700, 600);
783  c1->Divide(1, 1);
784  int idx = 1;
785  TPad *p;
786 
787  p = (TPad *) c1->cd(idx++);
788  c1->Update();
789  // p->SetGridx(0);
790  // p->SetGridy(0);
791  // p->SetLogy();
792 
793  TH1 *g_pp = CrossSection2zg_HistogramMaker(h_b, 1., dy, pt_max, pp_lumi * pp_eff * pp_purity, "bbg_zg");
794  TH1 *g_AA = CrossSection2zg_HistogramMaker(h_b, b_jet_RAA, dy, pt_max, AuAu_eq_lumi_C0_10 * AuAu_eff * AuAu_purity, "me_bbg");
795 
796  g_pp->SetLineColor(kRed);
797  g_AA->SetLineColor(kBlue);
798 
799  g_pp->Draw();
800  g_AA->Draw("same");
801  SaveCanvas(c1, infile + "_" + TString(c1->GetName()), kTRUE);
802  //
803  //
804  c1 = new TCanvas("Draw_HFJetTruth_CrossSection2zg" + s_suffix, "Draw_HFJetTruth_CrossSection2RAA" + s_suffix, 1100, 800);
805  c1->Divide(1, 1);
806  idx = 1;
807 
808  p = (TPad *) c1->cd(idx++);
809  c1->Update();
810 
811  p->DrawFrame(0.1, 0, .5, 13)
812  ->SetTitle(";Jet z_{g};1/N_{jet} dN/dz_{g}");
813 
814  // me_bbg_prediction->SetFillColor(kBlack - 4);
815  // me_bbg_prediction->Draw("pe");
816 
817  g_AA->SetLineColor(kBlack);
818  g_AA->SetMarkerColor(kBlack);
819  g_AA->SetLineWidth(4);
820  g_AA->SetMarkerStyle(kFullCircle);
821  g_AA->SetMarkerSize(3);
822 
823  g_AA->Draw("pe same");
824  g_AA->Print();
825 
826  g_pp->SetLineColor(kRed + 2);
827  g_pp->SetMarkerColor(kRed + 2);
828  g_pp->SetLineWidth(4);
829  g_pp->SetMarkerStyle(kFullCircle);
830  g_pp->SetMarkerSize(3);
831 
832  g_pp->Draw("pe same");
833  g_pp->Print();
834 
835  TLegend *leg = new TLegend(.0, .77, .85, .91);
836  leg->SetFillStyle(0);
837  leg->AddEntry("", "#it{#bf{sPHENIX}} Projection, Year 1-3", "");
838  // leg->AddEntry("", Form("PYTHIA-8 #it{b}-jet, Anti-k_{T} R=0.4, |#eta|<%.2f, CTEQ6L", dy / 2), "");
839  leg->AddEntry("", Form("#it{b}-jet Anti-k_{T} R=0.4, 15<p_{T}<%.0f GeV, z_{cut}>0.1, #beta=0", pt_max), "");
840  leg->Draw();
841 
842  TLegend *leg2 = new TLegend(.2, .6, .85, .75);
843  leg2->AddEntry(g_pp, Form("#it{p}+#it{p}: %.0fpb^{-1} samp., %.0f%% Eff., %.0f%% Pur.", pp_lumi, pp_eff * 100, pp_purity * 100), "pe");
844  leg2->AddEntry(g_AA, Form("Au+Au: %.0fnb^{-1} rec., %.0f%% Eff., %.0f%% Pur.", AuAu_MB_Evt / 6.8252 / 1e9, AuAu_eff * 100, AuAu_purity * 100), "pe");
845  leg2->SetFillStyle(0);
846  leg2->Draw();
847 
848  SaveCanvas(c1, infile + "_" + TString(c1->GetName()), kTRUE);
849 
850  c1 = new TCanvas("Draw_HFJetTruth_CrossSection2zg_ratio" + s_suffix, "Draw_HFJetTruth_CrossSection2zg_ratio" + s_suffix, 1100, 800);
851  c1->Divide(1, 1);
852  idx = 1;
853 
854  p = (TPad *) c1->cd(idx++);
855  c1->Update();
856 
857  p->DrawFrame(0.1, .55, .5, 1.5)
858  ->SetTitle(";Jet z_{g};P_{AA}(z_{g})/P_{pp}(z_{g})");
859 
860  bbg_zg_ratio_prediction->SetFillColor(kBlue - 5);
861  bbg_zg_ratio_prediction->Draw("3");
862 
863  TH1 *g_AA_ratio = (TH1 *) g_AA->Clone("g_AA_ratio");
864  g_AA_ratio->Divide(g_pp);
865 
866  for (int i = 0; i <= g_AA_ratio->GetNbinsX(); ++i)
867  {
868  g_AA_ratio->SetBinContent(i, 1.); // set projection to center onto 1.0
869  }
870 
871  g_AA_ratio->Draw("pe same X0");
872  g_AA_ratio->Print();
873 
874  leg = new TLegend(.0, .67, .85, .91);
875  leg->SetFillStyle(0);
876  leg->AddEntry("", "#it{#bf{sPHENIX}} Projection, Year 1-3", "");
877  // leg->AddEntry("", Form("PYTHIA-8 #it{b}-jet, Anti-k_{T} R=0.4, |#eta|<%.2f, CTEQ6L", dy / 2), "");
878  leg->AddEntry("", Form("#it{b}-jet Anti-k_{T} R=0.4, 15<p_{T}<%.0f GeV, z_{cut}>0.1, #beta=0", pt_max), "");
879  leg->AddEntry("", Form("#it{p}+#it{p}: %.0fpb^{-1} samp., %.0f%% Eff., %.0f%% Pur.", pp_lumi, pp_eff * 100, pp_purity * 100), "");
880  leg->AddEntry("", Form("Au+Au: %.0fnb^{-1} rec., %.0f%% Eff., %.0f%% Pur.", AuAu_MB_Evt / 6.8252 / 1e9, AuAu_eff * 100, AuAu_purity * 100), "");
881  leg->Draw();
882 
883  leg2 = new TLegend(.2, .2, .75, .3);
884  leg2->AddEntry(bbg_zg_ratio_prediction, Form("Li, Vitev, PLB 793 (2019)"), "f");
885  leg2->AddEntry("", Form("b#rightarrowbg, g=2.0#pm0.1 MLL"), "");
886  leg2->SetFillStyle(0);
887  leg2->Draw();
888 
889  SaveCanvas(c1, infile + "_" + TString(c1->GetName()), kTRUE);
890 }
891 
892 TGraph *CrossSection2v2Uncert(const TH1F *h_cross,
893  const double suppression,
894  const double deta,
895  const double pp_quiv_int_lum,
896  const double ep_resolution = 1,
897  const double pt_shift = 0)
898 {
899  assert(h_cross);
900  TH1 *
901  h_ratio = (TH1 *)
902  h_cross->Clone(TString(h_cross->GetName()) + Form("_copyv2%d", rand()));
903 
904  //convert to count per bin
905  h_ratio->Scale(deta * h_ratio->GetXaxis()->GetBinWidth(0) * pp_quiv_int_lum * suppression);
906  h_ratio->Rebin(5);
907 
908  vector<double> pts;
909  vector<double> v2s;
910  vector<double> v2es;
911 
912  for (int i = 1; i <= h_ratio->GetNbinsX(); ++i)
913  {
914  const double yield = h_ratio->GetBinContent(i);
915 
916  if (yield > 100)
917  {
918  h_ratio->SetBinContent(i, 0);
919 
920  h_ratio->SetBinError(i, 1. / sqrt(2 * yield) / ep_resolution); // err(v2) = 1/ (sqrt(2) *Significance * Resolution)
921 
922  pts.push_back(h_ratio->GetBinCenter(i) + pt_shift);
923  v2s.push_back(h_ratio->GetBinContent(i));
924  v2es.push_back(h_ratio->GetBinError(i));
925  }
926  else
927  {
928  h_ratio->SetBinContent(i, 0);
929 
930  h_ratio->SetBinError(i, 0);
931  }
932  }
933 
934  h_ratio->GetYaxis()->SetTitle("v2 and uncertainty");
935 
936  TGraph *gr = new TGraphErrors(pts.size(), &pts[0], &v2s[0], 0, &v2es[0]);
937  gr->SetName(TString("ge_") + h_ratio->GetName());
938 
939  gr->SetLineWidth(3);
940  gr->SetMarkerStyle(kFullCircle);
941  gr->SetMarkerSize(2);
942 
943  return gr;
944 }
945 
946 void CrossSection2v2(const TString infile, const bool use_AA_jet_trigger = true, const double ep_resolution = 0.5, const double dy = .7 * 2)
947 {
948  TFile *f = TFile::Open(infile + "Draw_HFJetTruth_DrawCrossSection.root");
949  assert(f);
950 
951  TH1F *hall = (TH1F *) f->GetObjectChecked("hall", "TH1F");
952  assert(hall);
953  TH1F *h_b = (TH1F *) f->GetObjectChecked("h_b", "TH1F");
954  assert(h_b);
955 
956  const double b_jet_RAA = 0.6;
957 
958  const double pp_eff = 0.6;
959  const double pp_purity = 0.4;
960  const double AuAu_eff = 0.4;
961  const double AuAu_purity = 0.4;
962 
964  // 5-year lumi in [sPH-TRG-000]
966 
967  const double pp_lumi = 62; // pb^-1 [sPH-TRG-000], rounded up from 197 pb^-1
968  const double pp_inelastic_crosssec = 42e-3 / 1e-12; // 42 mb in pb [sPH-TRG-000]
969 
970  const double AuAu_MB_Evt = use_AA_jet_trigger ? 550e9 : 142e9; // [sPH-TRG-000], depending on whether jet trigger applied in AA collisions
971  const double pAu_MB_Evt = 600e9; // [sPH-TRG-000]
972 
973  const double AuAu_Ncoll_C0_10 = 960.2; // [DOI:?10.1103/PhysRevC.87.034911?]
974  const double AuAu_Ncoll_C0_20 = 770.6; // [DOI:?10.1103/PhysRevC.91.064904?]
975  const double AuAu_Ncoll_C10_20 = 603; // [sPH-HF-2017-001-v1]
976  const double AuAu_Ncoll_C20_40 = 296; // [sPH-HF-2017-001-v1]
977  const double AuAu_Ncoll_C10_40 = (AuAu_Ncoll_C10_20 * 10 + AuAu_Ncoll_C20_40 * 20) / 30;
978  const double AuAu_Ncoll_C40_60 = 94; // [sPH-HF-2017-001-v1]
979  const double AuAu_Ncoll_C60_92 = 15; // [sPH-HF-2017-001-v1]
980  const double AuAu_Ncoll_C0_100 = 250; // pb^-1 [sPH-TRG-000]
981  const double pAu_Ncoll_C0_100 = 4.7; // pb^-1 [sPH-TRG-000]
982 
983  const double AuAu_eq_lumi_C0_10 = AuAu_MB_Evt * 0.1 * AuAu_Ncoll_C0_10 / pp_inelastic_crosssec; //
984  const double AuAu_eq_lumi_C0_20 = AuAu_MB_Evt * 0.2 * AuAu_Ncoll_C0_20 / pp_inelastic_crosssec; //
985  const double AuAu_eq_lumi_C0_100 = AuAu_MB_Evt * 1 * AuAu_Ncoll_C0_100 / pp_inelastic_crosssec; //
986 
987  const double AuAu_eq_lumi_C10_20 = AuAu_MB_Evt * .1 * AuAu_Ncoll_C10_20 / pp_inelastic_crosssec; //
988  const double AuAu_eq_lumi_C20_40 = AuAu_MB_Evt * .2 * AuAu_Ncoll_C20_40 / pp_inelastic_crosssec; //
989  const double AuAu_eq_lumi_C10_40 = AuAu_MB_Evt * .3 * AuAu_Ncoll_C10_40 / pp_inelastic_crosssec; //
990  const double AuAu_eq_lumi_C40_60 = AuAu_MB_Evt * .2 * AuAu_Ncoll_C40_60 / pp_inelastic_crosssec; //
991  const double AuAu_eq_lumi_C60_92 = AuAu_MB_Evt * (.92 - .6) * AuAu_Ncoll_C60_92 / pp_inelastic_crosssec; //
992 
993  const double pAu_eq_lumi_C0_100 = pAu_MB_Evt * 1 * pAu_Ncoll_C0_100 / pp_inelastic_crosssec; //
994 
995  ;
996 
997  TString s_suffix(use_AA_jet_trigger ? "_AAJetTriggered" : "_3yr");
998  s_suffix += Form("_EPR%.1f", ep_resolution);
999  s_suffix += Form("_deta%.2f", dy / 2);
1000 
1001  cout << "CrossSection2v2 integrated luminosity assumptions in pb^-1: " << endl;
1002  cout << "\t"
1003  << "pp_lumi = " << pp_lumi << endl;
1004  cout << "\t"
1005  << "AuAu_eq_lumi_C0_10 = " << AuAu_eq_lumi_C0_10 << endl;
1006  cout << "\t"
1007  << "AuAu_eq_lumi_C0_20 = " << AuAu_eq_lumi_C0_20 << endl;
1008  cout << "\t"
1009  << "AuAu_eq_lumi_C0_100 = " << AuAu_eq_lumi_C0_100 << endl;
1010  cout << "\t"
1011  << "AuAu_eq_lumi_C10_20 = " << AuAu_eq_lumi_C10_20 << endl;
1012  cout << "\t"
1013  << "AuAu_eq_lumi_C20_40 = " << AuAu_eq_lumi_C20_40 << endl;
1014  cout << "\t"
1015  << "AuAu_eq_lumi_C10_40 = " << AuAu_eq_lumi_C10_40 << endl;
1016  cout << "\t"
1017  << "AuAu_eq_lumi_C40_60 = " << AuAu_eq_lumi_C40_60 << endl;
1018  cout << "\t"
1019  << "AuAu_eq_lumi_C60_92 = " << AuAu_eq_lumi_C60_92 << endl;
1020  cout << "\t"
1021  << "pAu_eq_lumi_C0_100 = " << pAu_eq_lumi_C0_100 << endl;
1022 
1023  TGraph *g_AA_C0_10 = CrossSection2v2Uncert(h_b, b_jet_RAA, dy, AuAu_eq_lumi_C0_10 * AuAu_eff * AuAu_purity, ep_resolution, -1 * .7);
1024  TGraph *g_AA_C0_20 = CrossSection2v2Uncert(h_b, b_jet_RAA, dy, AuAu_eq_lumi_C0_20 * AuAu_eff * AuAu_purity, ep_resolution, 0);
1025  TGraph *g_AA_C10_20 = CrossSection2v2Uncert(h_b, b_jet_RAA, dy, AuAu_eq_lumi_C10_20 * AuAu_eff * AuAu_purity, ep_resolution, 0);
1026  TGraph *g_AA_C20_40 = CrossSection2v2Uncert(h_b, b_jet_RAA, dy, AuAu_eq_lumi_C20_40 * AuAu_eff * AuAu_purity, ep_resolution, 1 * .7);
1027  TGraph *g_AA_C10_40 = CrossSection2v2Uncert(h_b, b_jet_RAA, dy, AuAu_eq_lumi_C10_40 * AuAu_eff * AuAu_purity, ep_resolution, 1 * .7);
1028  TGraph *g_AA_C40_60 = CrossSection2v2Uncert(h_b, b_jet_RAA, dy, AuAu_eq_lumi_C40_60 * AuAu_eff * AuAu_purity, ep_resolution, 2 * .7);
1029  TGraph *g_AA_C60_92 = CrossSection2v2Uncert(h_b, b_jet_RAA, dy, AuAu_eq_lumi_C60_92 * AuAu_eff * AuAu_purity, ep_resolution, 3 * .7);
1030  //
1031  g_AA_C0_10->SetLineColor(kBlue + 3);
1032  g_AA_C10_20->SetLineColor(kAzure + 3);
1033  g_AA_C20_40->SetLineColor(kTeal + 3);
1034  g_AA_C10_40->SetLineColor(kTeal + 3);
1035  g_AA_C40_60->SetLineColor(kSpring + 3);
1036 
1037  g_AA_C0_10->SetMarkerColor(kBlue + 3);
1038  g_AA_C10_20->SetMarkerColor(kAzure + 3);
1039  g_AA_C20_40->SetMarkerColor(kTeal + 3);
1040  g_AA_C10_40->SetMarkerColor(kTeal + 3);
1041  g_AA_C40_60->SetMarkerColor(kSpring + 3);
1042 
1043  g_AA_C0_10->SetMarkerStyle(kFullCircle);
1044  g_AA_C10_20->SetMarkerStyle(kFullSquare);
1045  g_AA_C20_40->SetMarkerStyle(kFullDiamond);
1046  g_AA_C10_40->SetMarkerStyle(kFullDiamond);
1047  g_AA_C40_60->SetMarkerStyle(kFullCross);
1048 
1049  g_AA_C0_10->SetLineWidth(4);
1050  g_AA_C0_10->SetMarkerSize(3);
1051  g_AA_C10_40->SetLineWidth(4);
1052  g_AA_C10_40->SetMarkerSize(3);
1053  g_AA_C40_60->SetLineWidth(4);
1054  g_AA_C40_60->SetMarkerSize(3);
1055  //
1056  TCanvas *c1 = new TCanvas("Draw_HFJetTruth_CrossSection2v2" + s_suffix, "Draw_HFJetTruth_CrossSection2v2" + s_suffix, 1100, 800);
1057  c1->Divide(1, 1);
1058  int idx = 1;
1059  TPad *p;
1060 
1061  p = (TPad *) c1->cd(idx++);
1062  c1->Update();
1063 
1064  p->DrawFrame(15, -.1, 40, .3)
1065  ->SetTitle(";p_{T} [GeV];v_{2}");
1066  //
1067  g_AA_C0_10->Draw("pe");
1068  // g_AA_C10_20->Draw("pe");
1069  // g_AA_C20_40->Draw("pe");
1070  g_AA_C10_40->Draw("pe");
1071  // g_AA_C40_60->Draw("pe");
1072 
1073  // g_AA_C20_40->Draw("same");
1074  //
1075  // ge_RAA->SetLineWidth(3);
1076  // ge_RAA->SetMarkerStyle(kFullCircle);
1077  // ge_RAA->SetMarkerSize(2);
1078  //
1079  // ge_RAA->Draw("pe");
1080  // ge_RAA->Print();
1081  //
1082  TLegend *leg = new TLegend(.0, .67, .85, .91);
1083  leg->SetFillStyle(0);
1084  leg->AddEntry("", "#it{#bf{sPHENIX}} Projection, Au+Au, Year 1-3", "");
1085  leg->AddEntry("", Form("#it{b}-jet, Anti-k_{T} R=0.4, |#eta|<%.2f,Res(#Psi_{2})=%.1f", dy / 2, ep_resolution), "");
1086  leg->AddEntry("", Form("%.0fnb^{-1} rec. Au+Au, %.0f%% Eff., %.0f%% Pur.", AuAu_MB_Evt / 6.8252 / 1e9, AuAu_eff * 100, AuAu_purity * 100), "");
1087  leg->Draw();
1088  //
1089  TLegend *leg2 = new TLegend(.19, .5, 1, .67);
1090  // leg2->SetHeader(Form("#it{b}-jet v_{2} Projection, #it{R}_{AA, #it{b}-jet}=%.1f, Res(#Psi_{2})=%.1f", b_jet_RAA, ep_resolution));
1091  leg2->AddEntry(g_AA_C0_10, "0-10% Au+Au", "pl");
1092  // leg2->AddEntry(g_AA_C10_20, "Au+Au 10-20%C", "pl");
1093  // leg2->AddEntry(g_AA_C20_40, "Au+Au 20-40%C", "pl");
1094  leg2->AddEntry(g_AA_C10_40, "10-40% Au+Au ", "pl");
1095  // leg2->AddEntry(g_AA_C40_60, "Au+Au 40-60%C", "pl");
1096  leg2->SetFillStyle(0);
1097  leg2->Draw();
1098 
1099  SaveCanvas(c1, infile + "_" + TString(c1->GetName()), kTRUE);
1100 }
1101 
1102 void Convert2CrossSection(TH1 *h, const double int_lumi, const double dy)
1103 {
1104  h->Sumw2();
1105 
1106  for (int i = 1; i <= h->GetXaxis()->GetNbins(); ++i)
1107  {
1108  const double pT1 = h->GetXaxis()->GetBinLowEdge(i);
1109  const double pT2 = h->GetXaxis()->GetBinUpEdge(i);
1110 
1111  // const double dpT2 = pT2*pT2 - pT1*pT1;
1112  const double dpT = pT2 - pT1;
1113 
1114  // const double count2sigma = 1./dpT2/dy/int_lumi;
1115  const double count2sigma = 1. / dpT / dy / int_lumi;
1116 
1117  h->SetBinContent(i, h->GetBinContent(i) * count2sigma);
1118  h->SetBinError(i, h->GetBinError(i) * count2sigma);
1119  }
1120 
1121  // h->GetYaxis()->SetTitle("#sigma/(dp_{T}^{2} dy) (pb/(GeV/c)^{2})");
1122 
1123  h->SetMarkerStyle(kFullCircle);
1124 }
1125 
1126 TGraphAsymmErrors *
1127 GetFONLL_B()
1128 {
1129  //# Job started on: Wed Aug 24 04:28:34 CEST 2016 .
1130  //# FONLL heavy quark hadroproduction cross section, calculated on Wed Aug 24 04:28:42 CEST 2016
1131  //# FONLL version and perturbative order: ## FONLL v1.3.2 fonll [ds/dpt^2dy (pb/GeV^2)]
1132  //# quark = bottom
1133  //# final state = quark
1134  //# ebeam1 = 100, ebeam2 = 100
1135  //# PDF set = CTEQ6.6
1136  //# ptmin = 10
1137  //# ptmax = 30
1138  //# etamin = -.6
1139  //# etamax = .6
1140  //# Uncertainties from scales, masses combined quadratically
1141  //# cross section is ds/dpt (pb/GeV)
1142  //# pt central min max min_sc max_sc min_mass max_mass
1143  // 10.0000 4.1645e+03 2.9134e+03 6.0916e+03 2.9634e+03 6.0553e+03 3.8146e+03 4.5365e+03
1144  // 11.0526 2.4830e+03 1.7438e+03 3.6234e+03 1.7667e+03 3.6072e+03 2.3005e+03 2.6743e+03
1145  // 12.1053 1.5046e+03 1.0602e+03 2.1900e+03 1.0710e+03 2.1826e+03 1.4071e+03 1.6056e+03
1146  // 13.1579 9.2707e+02 6.5506e+02 1.3454e+03 6.6029e+02 1.3418e+03 8.7394e+02 9.8137e+02
1147  // 14.2105 5.8027e+02 4.1098e+02 8.3990e+02 4.1358e+02 8.3817e+02 5.5067e+02 6.1015e+02
1148  // 15.2632 3.6865e+02 2.6159e+02 5.3224e+02 2.6290e+02 5.3139e+02 3.5193e+02 3.8532e+02
1149  // 16.3158 2.3744e+02 1.6874e+02 3.4198e+02 1.6941e+02 3.4156e+02 2.2785e+02 2.4686e+02
1150  // 17.3684 1.5484e+02 1.1016e+02 2.2257e+02 1.1051e+02 2.2236e+02 1.4930e+02 1.6021e+02
1151  // 18.4211 1.0215e+02 7.2725e+01 1.4657e+02 7.2904e+01 1.4646e+02 9.8911e+01 1.0522e+02
1152  // 19.4737 6.8101e+01 4.8502e+01 9.7587e+01 4.8594e+01 9.7535e+01 6.6205e+01 6.9866e+01
1153  // 20.5263 4.5818e+01 3.2631e+01 6.5588e+01 3.2678e+01 6.5562e+01 4.4707e+01 4.6827e+01
1154  // 21.5789 3.1111e+01 2.2148e+01 4.4506e+01 2.2171e+01 4.4494e+01 3.0461e+01 3.1684e+01
1155  // 22.6316 2.1287e+01 1.5142e+01 3.0444e+01 1.5153e+01 3.0439e+01 2.0909e+01 2.1607e+01
1156  // 23.6842 1.4663e+01 1.0419e+01 2.0974e+01 1.0424e+01 2.0972e+01 1.4446e+01 1.4838e+01
1157  // 24.7368 1.0175e+01 7.2188e+00 1.4562e+01 7.2214e+00 1.4562e+01 1.0053e+01 1.0266e+01
1158  // 25.7895 7.1026e+00 5.0296e+00 1.0176e+01 5.0307e+00 1.0175e+01 7.0360e+00 7.1470e+00
1159  // 26.8421 4.9796e+00 3.5183e+00 7.1439e+00 3.5187e+00 7.1438e+00 4.9454e+00 4.9976e+00
1160  // 27.8947 3.5103e+00 2.4738e+00 5.0451e+00 2.4739e+00 5.0451e+00 3.4945e+00 3.5143e+00
1161  // 28.9474 2.4892e+00 1.7492e+00 3.5856e+00 1.7493e+00 3.5856e+00 2.4835e+00 2.4892e+00
1162  // 30.0000 1.7693e+00 1.2394e+00 2.5556e+00 1.2394e+00 2.5556e+00 1.7633e+00 1.7693e+00
1163 
1164  const double deta = 0.6 * 2;
1165 
1166  const double pts[] =
1167  {
1168 
1169  10.0000, 11.0526, 12.1053, 13.1579, 14.2105, 15.2632, 16.3158, 17.3684,
1170  18.4211, 19.4737, 20.5263, 21.5789, 22.6316, 23.6842, 24.7368, 25.7895,
1171  26.8421, 27.8947, 28.9474, 30.0000
1172 
1173  };
1174 
1175  const double centrals[] =
1176  {4.1645e+03, 2.4830e+03, 1.5046e+03, 9.2707e+02, 5.8027e+02, 3.6865e+02,
1177  2.3744e+02, 1.5484e+02, 1.0215e+02, 6.8101e+01, 4.5818e+01, 3.1111e+01,
1178  2.1287e+01, 1.4663e+01, 1.0175e+01, 7.1026e+00, 4.9796e+00, 3.5103e+00,
1179  2.4892e+00, 1.7693e+00};
1180  const double min[] =
1181  {4.1645e+03 - 2.9134e+03, 2.4830e+03 - 1.7438e+03, 1.5046e+03 - 1.0602e+03,
1182  9.2707e+02 - 6.5506e+02, 5.8027e+02 - 4.1098e+02, 3.6865e+02 - 2.6159e+02, 2.3744e+02 - 1.6874e+02, 1.5484e+02 - 1.1016e+02,
1183  1.0215e+02 - 7.2725e+01, 6.8101e+01 - 4.8502e+01, 4.5818e+01 - 3.2631e+01, 3.1111e+01 - 2.2148e+01, 2.1287e+01 - 1.5142e+01,
1184  1.4663e+01 - 1.0419e+01, 1.0175e+01 - 7.2188e+00, 7.1026e+00 - 5.0296e+00, 4.9796e+00 - 3.5183e+00, 3.5103e+00 - 2.4738e+00,
1185  2.4892e+00 - 1.7492e+00, 1.7693e+00 - 1.2394e+00};
1186 
1187  const double max[] =
1188  {6.0916e+03 - 4.1645e+03, 3.6234e+03 - 2.4830e+03, 2.1900e+03 - 1.5046e+03,
1189  1.3454e+03 - 9.2707e+02, 8.3990e+02 - 5.8027e+02, 5.3224e+02 - 3.6865e+02, 3.4198e+02 - 2.3744e+02, 2.2257e+02 - 1.5484e+02,
1190  1.4657e+02 - 1.0215e+02, 9.7587e+01 - 6.8101e+01, 6.5588e+01 - 4.5818e+01, 4.4506e+01 - 3.1111e+01, 3.0444e+01 - 2.1287e+01,
1191  2.0974e+01 - 1.4663e+01, 1.4562e+01 - 1.0175e+01, 1.0176e+01 - 7.1026e+00, 7.1439e+00 - 4.9796e+00, 5.0451e+00 - 3.5103e+00,
1192  3.5856e+00 - 2.4892e+00, 2.5556e+00 - 1.7693e+00};
1193 
1194  TGraphAsymmErrors *gr = new TGraphAsymmErrors(20, pts, centrals, 0, 0, min,
1195  max);
1196 
1197  for (int i = 0; i < gr->GetN(); ++i)
1198  {
1199  (gr->GetY())[i] /= deta;
1200  (gr->GetEYhigh())[i] /= deta;
1201  (gr->GetEYlow())[i] /= deta;
1202  }
1203 
1204  return gr;
1205 }
1206 
1207 TGraphAsymmErrors *
1208 GetFONLL_C()
1209 {
1210  //# Job started on: Thu Aug 25 05:08:57 CEST 2016 .
1211  //# FONLL heavy quark hadroproduction cross section, calculated on Thu Aug 25 05:09:06 CEST 2016
1212  //# FONLL version and perturbative order: ## FONLL v1.3.2 fonll [ds/dpt^2dy (pb/GeV^2)]
1213  //# quark = charm
1214  //# final state = quark
1215  //# ebeam1 = 100, ebeam2 = 100
1216  //# PDF set = CTEQ6.6
1217  //# ptmin = 10
1218  //# ptmax = 30
1219  //# etamin = -.6
1220  //# etamax = .6
1221  //# Uncertainties from scales, masses combined quadratically
1222  //# cross section is ds/dpt (pb/GeV)
1223  //# pt central min max min_sc max_sc min_mass max_mass
1224  // 10.0000 9.7368e+03 6.5051e+03 1.5528e+04 6.5641e+03 1.5522e+04 9.1225e+03 1.0006e+04
1225  // 11.0526 4.9069e+03 3.2787e+03 7.7308e+03 3.3256e+03 7.7226e+03 4.5190e+03 5.1221e+03
1226  // 12.1053 2.5743e+03 1.7187e+03 4.0147e+03 1.7525e+03 4.0069e+03 2.3363e+03 2.7237e+03
1227  // 13.1579 1.3990e+03 9.3274e+02 2.1641e+03 9.5597e+02 2.1578e+03 1.2537e+03 1.4976e+03
1228  // 14.2105 7.8344e+02 5.2138e+02 1.2037e+03 5.3701e+02 1.1989e+03 6.9430e+02 8.4730e+02
1229  // 15.2632 4.5087e+02 2.9938e+02 6.8902e+02 3.0978e+02 6.8543e+02 3.9570e+02 4.9204e+02
1230  // 16.3158 2.6550e+02 1.7584e+02 4.0398e+02 1.8275e+02 4.0140e+02 2.3098e+02 2.9210e+02
1231  // 17.3684 1.5978e+02 1.0551e+02 2.4232e+02 1.1011e+02 2.4049e+02 1.3793e+02 1.7705e+02
1232  // 18.4211 9.7903e+01 6.4459e+01 1.4811e+02 6.7524e+01 1.4682e+02 8.3915e+01 1.0919e+02
1233  // 19.4737 6.0993e+01 4.0030e+01 9.2103e+01 4.2085e+01 9.1200e+01 5.1941e+01 6.8435e+01
1234  // 20.5263 3.8605e+01 2.5248e+01 5.8239e+01 2.6631e+01 5.7606e+01 3.2685e+01 4.3550e+01
1235  // 21.5789 2.4727e+01 1.6108e+01 3.7286e+01 1.7044e+01 3.6842e+01 2.0821e+01 2.8038e+01
1236  // 22.6316 1.6036e+01 1.0402e+01 2.4185e+01 1.1040e+01 2.3872e+01 1.3433e+01 1.8271e+01
1237  // 23.6842 1.0532e+01 6.8006e+00 1.5898e+01 7.2389e+00 1.5678e+01 8.7774e+00 1.2053e+01
1238  // 24.7368 6.9729e+00 4.4803e+00 1.0540e+01 4.7838e+00 1.0385e+01 5.7809e+00 8.0136e+00
1239  // 25.7895 4.6560e+00 2.9760e+00 7.0510e+00 3.1876e+00 6.9411e+00 3.8397e+00 5.3729e+00
1240  // 26.8421 3.1409e+00 1.9970e+00 4.7681e+00 2.1454e+00 4.6902e+00 2.5775e+00 3.6384e+00
1241  // 27.8947 2.1346e+00 1.3500e+00 3.2500e+00 1.4543e+00 3.1946e+00 1.7438e+00 2.4816e+00
1242  // 28.9474 1.4557e+00 9.1535e-01 2.2239e+00 9.8868e-01 2.1845e+00 1.1839e+00 1.6985e+00
1243  // 30.0000 9.9826e-01 6.2400e-01 1.5310e+00 6.7571e-01 1.5029e+00 8.0844e-01 1.1690e+00
1244 
1245  const double deta = 0.6 * 2;
1246 
1247  const double pts[] =
1248  {
1249  // pt
1250  10.0000, 11.0526, 12.1053, 13.1579, 14.2105, 15.2632, 16.3158, 17.3684,
1251  18.4211, 19.4737, 20.5263, 21.5789, 22.6316, 23.6842, 24.7368, 25.7895,
1252  26.8421, 27.8947, 28.9474, 30.0000
1253 
1254  };
1255 
1256  const double centrals[] =
1257  {
1258 
1259  // central
1260  9.7368e+03, 4.9069e+03, 2.5743e+03, 1.3990e+03, 7.8344e+02, 4.5087e+02,
1261  2.6550e+02, 1.5978e+02, 9.7903e+01, 6.0993e+01, 3.8605e+01, 2.4727e+01,
1262  1.6036e+01, 1.0532e+01, 6.9729e+00, 4.6560e+00, 3.1409e+00, 2.1346e+00,
1263  1.4557e+00, 9.9826e-01
1264 
1265  };
1266  const double min[] =
1267  {
1268 
1269  // central min
1270  9.7368e+03 - 6.5051e+03, 4.9069e+03 - 3.2787e+03, 2.5743e+03 - 1.7187e+03, 1.3990e+03 - 9.3274e+02, 7.8344e+02 - 5.2138e+02,
1271  4.5087e+02 - 2.9938e+02, 2.6550e+02 - 1.7584e+02, 1.5978e+02 - 1.0551e+02, 9.7903e+01 - 6.4459e+01, 6.0993e+01 - 4.0030e+01,
1272  3.8605e+01 - 2.5248e+01, 2.4727e+01 - 1.6108e+01, 1.6036e+01 - 1.0402e+01, 1.0532e+01 - 6.8006e+00, 6.9729e+00 - 4.4803e+00,
1273  4.6560e+00 - 2.9760e+00, 3.1409e+00 - 1.9970e+00, 2.1346e+00 - 1.3500e+00, 1.4557e+00 - 9.1535e-01, 9.9826e-01 - 6.2400e-01
1274 
1275  };
1276 
1277  const double max[] =
1278  {
1279 
1280  // max central
1281  1.5528e+04 - 9.7368e+03, 7.7308e+03 - 4.9069e+03, 4.0147e+03 - 2.5743e+03, 2.1641e+03 - 1.3990e+03, 1.2037e+03 - 7.8344e+02,
1282  6.8902e+02 - 4.5087e+02, 4.0398e+02 - 2.6550e+02, 2.4232e+02 - 1.5978e+02, 1.4811e+02 - 9.7903e+01, 9.2103e+01 - 6.0993e+01,
1283  5.8239e+01 - 3.8605e+01, 3.7286e+01 - 2.4727e+01, 2.4185e+01 - 1.6036e+01, 1.5898e+01 - 1.0532e+01, 1.0540e+01 - 6.9729e+00,
1284  7.0510e+00 - 4.6560e+00, 4.7681e+00 - 3.1409e+00, 3.2500e+00 - 2.1346e+00, 2.2239e+00 - 1.4557e+00, 1.5310e+00 - 9.9826e-01
1285 
1286  };
1287 
1288  TGraphAsymmErrors *gr = new TGraphAsymmErrors(20, pts, centrals, 0, 0, min,
1289  max);
1290 
1291  for (int i = 0; i < gr->GetN(); ++i)
1292  {
1293  (gr->GetY())[i] /= deta;
1294  (gr->GetEYhigh())[i] /= deta;
1295  (gr->GetEYlow())[i] /= deta;
1296  }
1297 
1298  return gr;
1299 }
1300 
1301 TGraph *pQCDModel_HuangKangVitev(const double g)
1302 {
1303  // arXiv:1306.0909v2 [hep-ph]
1304  // Preliminary for sPHENIX energy
1305 
1306  // R = 0.4;
1307  if (g == 2.0)
1308  {
1309  // g=2.0
1310  // 10.130739 0.8087402
1311  // 13.8755 0.7102165
1312  // 17.915709 0.64113617
1313  // 19.950817 0.62270004
1314  // 21.838287 0.59506375
1315  // 24.758118 0.5618901
1316  // 28.149998 0.53331053
1317  // 30.303171 0.5194738
1318  // 35.701473 0.52399224
1319  // 40.21508 0.54508865
1320  // 49.182514 0.53758913
1321  // 54.492188 0.5338267
1322  // 59.890347 0.52914274
1323 
1324  const double pT[] =
1325  {
1326  10.130739,
1327  13.8755,
1328  17.915709,
1329  19.950817,
1330  21.838287,
1331  24.758118,
1332  28.149998,
1333  30.303171,
1334  35.701473,
1335  40.21508,
1336  49.182514,
1337  54.492188,
1338  59.890347};
1339 
1340  const double RAA[] =
1341  {
1342  0.8087402,
1343  0.7102165,
1344  0.64113617,
1345  0.62270004,
1346  0.59506375,
1347  0.5618901,
1348  0.53331053,
1349  0.5194738,
1350  0.52399224,
1351  0.54508865,
1352  0.53758913,
1353  0.5338267,
1354  0.52914274};
1355 
1356  return new TGraph(13, pT, RAA);
1357  }
1358  else if (g == 2.2)
1359  {
1360  // g=2.2
1361  // 10.040924 0.72499925
1362  // 11.750852 0.6623964
1363  // 15.820038 0.56018674
1364  // 18.946156 0.51412654
1365  // 19.860464 0.50491005
1366  // 21.010588 0.484647
1367  // 24.343283 0.44410512
1368  // 29.888279 0.39800778
1369  // 35.876522 0.4006767
1370  // 40.154125 0.42085648
1371  // 47.941647 0.41521555
1372  // 55.64066 0.40865576
1373  // 59.91793 0.4076699
1374 
1375  const double pT[] =
1376  {
1377  10.040924,
1378  11.750852,
1379  15.820038,
1380  18.946156,
1381  19.860464,
1382  21.010588,
1383  24.343283,
1384  29.888279,
1385  35.876522,
1386  40.154125,
1387  47.941647,
1388  55.64066,
1389  59.91793};
1390 
1391  const double RAA[] =
1392  {
1393  0.72499925,
1394  0.6623964,
1395  0.56018674,
1396  0.51412654,
1397  0.50491005,
1398  0.484647,
1399  0.44410512,
1400  0.39800778,
1401  0.4006767,
1402  0.42085648,
1403  0.41521555,
1404  0.40865576,
1405  0.4076699};
1406 
1407  return new TGraph(13, pT, RAA);
1408  }
1409  else
1410  {
1411  assert(0);
1412  }
1413 
1414  return nullptr;
1415 }
1416 
1417 TGraph *LIDO_Ke()
1418 {
1419  //# pT [GeV] pT-lower pT-upper Raa[mu=2*pi*T] Raa[mu=1.5*pi*T]
1420  //9.0 8.0 10.0 0.704 0.586
1421  //12.0 10.0 14.0 0.632 0.552
1422  //16.0 14.0 18.0 0.544 0.469
1423  //21.5 18.0 25.0 0.519 0.368
1424  //30.0 25.0 35.0 0.417 0.341
1425  //40.0 35.0 45.0 0.355 0.282
1426  //52.5 45.0 60.0 0.317 0.186
1427  //70.0 60.0 80.0 0.286 0.143
1428 
1429  // Once you unzip the LIDO-heavy-jets.tar.gz file, you will find data files for inclusive, D-jet and B-jet Raa for R=0.2, 0.3, and 0.4. Each file's format has been commented at the first line:
1430  // # pT pT-lower pT-upper Raa[mu=2*pi*T] Raa[mu=1.5*pi*T]
1431  // These five columns are: the jet pT, lower and upper bounds of the jet pT bins. And the two Raa values obtained with two choices of the coupling strength parameters in our model.
1432  //
1433  // The Raa range enclosed by these two choices of coupling parameter only shows the sensitivity of the calculation to the variation of this single parameter in our model. We are working on a more systematic understanding of our theoretical uncertainty recently.
1434  // 2008.07622 [nucl-th]
1435 
1436  const vector<double> pT{
1437  9.0,
1438  12.0,
1439  16.0,
1440  21.5,
1441  30.0,
1442  40.0,
1443  52.5,
1444  70.0};
1445 
1446  const vector<double> Raa_2piT{
1447  0.704,
1448  0.632,
1449  0.544,
1450  0.519,
1451  0.417,
1452  0.355,
1453  0.317,
1454  0.286};
1455 
1456  const vector<double> Raa_1p5piT{
1457  0.586,
1458  0.552,
1459  0.469,
1460  0.368,
1461  0.341,
1462  0.282,
1463  0.186,
1464  0.143};
1465 
1466  vector<double> Raa(pT.size());
1467  vector<double> Raa_Error(pT.size());
1468 
1469  for (int i = 0; i < pT.size(); ++i)
1470  {
1471  Raa[i] = 0.5 * (Raa_2piT[i] + Raa_1p5piT[i]);
1472  Raa_Error[i] = 0.5 * fabs(Raa_2piT[i] - Raa_1p5piT[i]);
1473  }
1474 
1475  return new TGraphErrors(pT.size(), pT.data(), Raa.data(), nullptr, Raa_Error.data());
1476 }
1477 
1478 TGraph *
1479 GetPHENIX_jet()
1480 {
1481  // PPG184
1482  // p+p d^2sigma/dpT deta [mb / GeV]
1483  //
1484  // pT low pT high yval ystat[%] ysyst[%]
1485  //
1486  // 12.2 14.5 0.0001145 1.0 15.6
1487  // 14.5 17.3 3.774e-05 1.3 16.3
1488  // 17.3 20.7 1.263e-05 1.7 15.6
1489  // 20.7 24.7 4.230e-06 2.3 17.3
1490  // 24.7 29.4 1.224e-06 3.6 19.3
1491  // 29.4 35.1 2.962e-07 6.1 21.0
1492  // 35.1 41.9 5.837e-08 8.9 24.3
1493  // 41.9 50.0 8.882e-09 11 32.3
1494 
1495  const double pt_l[] =
1496  {
1497 
1498  // pT low
1499 
1500  12.2, 14.5, 17.3, 20.7, 24.7, 29.4, 35.1, 41.9
1501 
1502  };
1503 
1504  const double pt_h[] =
1505  {
1506 
1507  // pT high
1508 
1509  14.5, 17.3, 20.7, 24.7, 29.4, 35.1, 41.9, 50.0
1510 
1511  };
1512  double yval[] =
1513  {
1514 
1515  // yval
1516 
1517  0.0001145, 3.774e-05, 1.263e-05, 4.230e-06, 1.224e-06, 2.962e-07,
1518  5.837e-08, 8.882e-09
1519 
1520  };
1521  const double ystat[] =
1522  {
1523 
1524  // ystat[%]
1525 
1526  1.0, 1.3, 1.7, 2.3, 3.6, 6.1, 8.9, 11
1527 
1528  };
1529 
1530  const double ysyst[] =
1531  {
1532 
1533  // ysyst[%]
1534 
1535  15.6, 16.3, 15.6, 17.3, 19.3, 21.0, 24.3, 32.3
1536 
1537  };
1538 
1539  double pT_c[100] =
1540  {0};
1541  double pT_e[100] =
1542  {0};
1543  double y_e[100] =
1544  {0};
1545 
1546  for (int i = 0; i < 8; ++i)
1547  {
1548  pT_c[i] = 0.5 * (pt_l[i] + pt_h[i]);
1549  pT_e[i] = 0.5 * (pt_h[i] - pt_l[i]);
1550  yval[i] *= 1e9; // mb -> pb
1551  y_e[i] = yval[i] * sqrt(ystat[i] * ystat[i] + ysyst[i] * ysyst[i]) / 100;
1552  }
1553 
1554  TGraphErrors *gr = new TGraphErrors(8, pT_c, yval, pT_e, y_e);
1555 
1556  return gr;
1557 }
1558 
1559 void DrawCrossSection(double int_lumi, const double dy)
1560 {
1561  TH1 *hall = new TH1F("hall", ";p_{T} [GeV/c]", 100, 0, 100);
1562  TH1 *h_b = new TH1F("h_b", ";p_{T} [GeV/c]", 100, 0, 100);
1563  TH1 *h_bq = new TH1F("h_bq", ";p_{T} [GeV/c]", 100, 0, 100);
1564  TH1 *h_bh = new TH1F("h_bh", ";p_{T} [GeV/c]", 100, 0, 100);
1565  TH1 *h_bh5 = new TH1F("h_bh5", ";p_{T} [GeV/c]", 100, 0, 100);
1566  TH1 *h_ch5 = new TH1F("h_ch5", ";p_{T} [GeV/c]", 100, 0, 100);
1567  TH1 *h_c = new TH1F("h_c", ";p_{T} [GeV/c]", 100, 0, 100);
1568 
1569  T->Draw("AntiKt_Truth_r04.get_pt()>>hall",
1570  "AntiKt_Truth_r04.get_pt()>15 && abs(AntiKt_Truth_r04.get_eta())<0.6",
1571  "goff");
1572 
1573  T->Draw("AntiKt_Truth_r04.get_pt()>>h_b",
1574  "AntiKt_Truth_r04.get_pt()>15 && abs(AntiKt_Truth_r04.get_eta())<0.6 && abs(AntiKt_Truth_r04.get_property(1000))==5",
1575  "goff");
1576  T->Draw(
1577  "AntiKt_Truth_r04.get_pt()* AntiKt_Truth_r04.get_property(1001) >>h_bq",
1578  "AntiKt_Truth_r04.get_pt()>15 && abs(AntiKt_Truth_r04.get_eta())<0.6 && abs(AntiKt_Truth_r04.get_property(1000))==5",
1579  "goff");
1580 
1581  // T->Draw("AntiKt_Truth_r04.get_pt()>>h_bh",
1582  // "AntiKt_Truth_r04.get_pt()>15 && abs(AntiKt_Truth_r04.get_eta())<0.6 && AntiKt_Truth_r04.get_property(1010)==5",
1583  // "goff");
1584 
1585  T->Draw("AntiKt_Truth_r04.get_pt()>>h_bh5",
1586  "AntiKt_Truth_r04.get_pt()>15 && abs(AntiKt_Truth_r04.get_eta())<0.6 && abs(AntiKt_Truth_r04.get_property(1010))==5 && AntiKt_Truth_r04.get_property(1011) * AntiKt_Truth_r04.get_pt() > 5",
1587  "goff");
1588  //
1589  T->Draw("AntiKt_Truth_r04.get_pt()>>h_c",
1590  "AntiKt_Truth_r04.get_pt()>15 && abs(AntiKt_Truth_r04.get_eta())<0.6 && abs(AntiKt_Truth_r04.get_property(1000))==4",
1591  "goff");
1592  T->Draw("AntiKt_Truth_r04.get_pt()>>h_ch5",
1593  "AntiKt_Truth_r04.get_pt()>15 && abs(AntiKt_Truth_r04.get_eta())<0.6 && abs(AntiKt_Truth_r04.get_property(1010))==4 && AntiKt_Truth_r04.get_property(1011) * AntiKt_Truth_r04.get_pt() > 5",
1594  "goff");
1595 
1596  Convert2CrossSection(hall, int_lumi, dy);
1597  Convert2CrossSection(h_b, int_lumi, dy);
1598  Convert2CrossSection(h_bq, int_lumi, dy);
1599  Convert2CrossSection(h_bh5, int_lumi, dy);
1600  Convert2CrossSection(h_ch5, int_lumi, dy);
1601  Convert2CrossSection(h_c, int_lumi, dy);
1602 
1603  h_b->SetLineColor(kBlue);
1604  h_b->SetMarkerColor(kBlue);
1605 
1606  h_bq->SetLineColor(kBlue + 3);
1607  h_bq->SetMarkerColor(kBlue + 3);
1608 
1609  h_bh5->SetLineColor(kBlue + 3);
1610  h_bh5->SetMarkerColor(kBlue + 3);
1611  h_bh5->SetMarkerStyle(kStar);
1612 
1613  h_c->SetLineColor(kRed);
1614  h_c->SetMarkerColor(kRed);
1615 
1616  h_ch5->SetLineColor(kRed + 3);
1617  h_ch5->SetMarkerColor(kRed + 3);
1618  h_ch5->SetMarkerStyle(kStar);
1619 
1620  TGraphAsymmErrors *gr_fonll_b = GetFONLL_B();
1621  gr_fonll_b->SetFillColor(kBlue - 7);
1622  gr_fonll_b->SetFillStyle(3002);
1623  TGraphAsymmErrors *gr_fonll_c = GetFONLL_C();
1624  gr_fonll_c->SetFillColor(kRed - 7);
1625  gr_fonll_c->SetFillStyle(3003);
1626  TGraph *gr_phenix = GetPHENIX_jet();
1627  gr_phenix->SetLineColor(kGray + 2);
1628  gr_phenix->SetMarkerColor(kBlack);
1629  gr_phenix->SetMarkerStyle(kOpenCross);
1630 
1631  TCanvas *c1 = new TCanvas("Draw_HFJetTruth_DrawCrossSection", "Draw_HFJetTruth_DrawCrossSection", 1000, 860);
1632  // c1->Divide(2, 2);
1633  int idx = 1;
1634  TPad *p;
1635 
1636  p = (TPad *) c1->cd(idx++);
1637  c1->Update();
1638  p->SetGridx(0);
1639  p->SetGridy(0);
1640  p->SetLogy();
1641 
1642  hall->Draw();
1643 
1644  gr_fonll_b->Draw("3");
1645  gr_fonll_c->Draw("3");
1646  gr_phenix->Draw("pe");
1647 
1648  h_b->Draw("same");
1649  h_bh5->Draw("same");
1650  h_bq->Draw("same");
1651  h_c->Draw("same");
1652  h_ch5->Draw("same");
1653 
1654  hall->GetXaxis()->SetRangeUser(12, 60);
1655  hall->GetYaxis()->SetTitle(
1656  "d^{2}#sigma/(dp_{T}dy), d^{2}#sigma/(dp_{T}d#eta) [pb/(GeV/c)]");
1657 
1658  TLegend *leg = new TLegend(0.45, 0.6, 0.99, 0.95);
1659  leg->SetFillColor(kWhite);
1660  leg->SetFillStyle(1001);
1661  leg->SetHeader("#it{p}+#it{p} collisions @ sPHENIX, #sqrt{s} = 200 GeV, |#eta|<0.6");
1662  leg->AddEntry(hall, "Inclusive jet, Pythia8, Truth, anti-k_{t}, R=0.4",
1663  "lpe");
1664  leg->AddEntry(h_c, "c-quark jet, Pythia8, Truth, anti-k_{t}, R=0.4", "lpe");
1665  leg->AddEntry(h_b, "b-quark jet, Pythia8, Truth, anti-k_{t}, R=0.4", "lpe");
1666  leg->AddEntry(h_bq, "Leading b-quark in jet, Pythia8, anti-k_{t}, R=0.4", "lpe");
1667  leg->AddEntry(h_bh5,
1668  "b-hadron jet, Pythia8, Truth, anti-k_{t}, R=0.4, p_{T, b-hadron}>5 GeV/c",
1669  "lpe");
1670  leg->AddEntry(gr_phenix, "PHENIX inclusive jet, PRL 116, 122301 (2016)", "ple");
1671  leg->AddEntry(gr_fonll_c, "c-quark, FONLL v1.3.2, CTEQ6.6, |y|<0.6", "f");
1672  leg->AddEntry(gr_fonll_b, "b-quark, FONLL v1.3.2, CTEQ6.6, |y|<0.6", "f");
1673  leg->Draw();
1674 
1675  SaveCanvas(c1, TString(_file0->GetName()) + TString(c1->GetName()), kTRUE);
1676 }
1677 
1679 {
1680  TFile *f = TFile::Open(infile + "Draw_HFJetTruth_DrawCrossSection.root");
1681  assert(f);
1682 
1683  TH1F *hall = (TH1F *) f->GetObjectChecked("hall", "TH1F");
1684  assert(hall);
1685  TH1F *h_b = (TH1F *) f->GetObjectChecked("h_b", "TH1F");
1686  assert(h_b);
1687 
1688  hall->SetMarkerColor(kBlack);
1689  hall->SetLineColor(kBlack);
1690  hall->SetMarkerStyle(kFullCircle);
1691 
1692  h_b->SetMarkerColor(kBlue + 2);
1693  h_b->SetLineColor(kBlue + 2);
1694  h_b->SetMarkerStyle(kFullCircle);
1695 
1696  TGraphAsymmErrors *gr_fonll_b = GetFONLL_B();
1697  gr_fonll_b->SetFillColor(kBlue - 7);
1698  gr_fonll_b->SetFillStyle(1001);
1699  TGraphAsymmErrors *gr_fonll_c = GetFONLL_C();
1700  gr_fonll_c->SetFillColor(kRed - 7);
1701  gr_fonll_c->SetFillStyle(3003);
1702  TGraph *gr_phenix = GetPHENIX_jet();
1703  gr_phenix->SetLineColor(kGray + 2);
1704  gr_phenix->SetLineWidth(3);
1705  gr_phenix->SetMarkerColor(kGray + 2);
1706  gr_phenix->SetMarkerSize(2);
1707  gr_phenix->SetMarkerStyle(kFullSquare);
1708 
1709  TCanvas *c1 = new TCanvas("Draw_HFJetTruth_DrawCrossSection_PR", "Draw_HFJetTruth_DrawCrossSection_PR", 1000, 860);
1710  // c1->Divide(2, 2);
1711  int idx = 1;
1712  TPad *p;
1713 
1714  p = (TPad *) c1->cd(idx++);
1715  c1->Update();
1716  p->SetLogy();
1717 
1718  TH1 *hframe = p->DrawFrame(12, 0.1, 70, 1e8);
1719  hframe->SetTitle(";p_{T} [GeV/c];d^{2}#sigma/(dp_{T}d#eta) [pb/(GeV/c)]");
1720 
1721  gr_fonll_b->Draw("3");
1722  gr_phenix->Draw("pe");
1723 
1724  hall->Draw("same");
1725  h_b->Draw("same");
1726 
1727  TLegend *leg = new TLegend(0.2, 0.7, 0.95, 0.92);
1728  leg->SetFillColor(kWhite);
1729  leg->SetFillStyle(1001);
1730  // leg->SetHeader("#splitline{#it{#bf{sPHENIX }} Simulation}{#it{p}+#it{p}, #sqrt{s} = 200 GeV, |#eta|<0.6}");
1731  leg->SetHeader("#it{#bf{sPHENIX }} Simulation, #it{p}+#it{p} #sqrt{s} = 200 GeV, |#eta|<0.6");
1732  leg->AddEntry(hall, "Inclusive jet, PYTHIA8 + CTEQ6L, anti-k_{T} R=0.4",
1733  "lpe");
1734  leg->AddEntry(h_b, "#it{b}-quark jet, PYTHIA8 + CTEQ6L, anti-k_{T} R=0.4", "lpe");
1735  leg->AddEntry(gr_phenix, "PHENIX inclusive jet, PRL 116, 122301 (2016)", "ple");
1736  leg->AddEntry(gr_fonll_b, "#it{b}-quark, FONLL v1.3.2, CTEQ6.6", "f");
1737  leg->Draw();
1738 
1739  SaveCanvas(c1, TString(_file0->GetName()) + TString(c1->GetName()), kTRUE);
1740 }
1741 
1743 {
1744  const double b_jet_RAA = 0.6;
1745 
1747  // 5-year lumi in [sPH-TRG-000]
1749 
1750  const double pp_inelastic_crosssec = 42e-3 / 1e-12; // 42 mb in pb [sPH-TRG-000]
1751  const double AuAu_Ncoll_C0_10 = 960.2; // [DOI:?10.1103/PhysRevC.87.034911?]
1752  const double AuAu_Ncoll_C0_20 = 770.6; // [DOI:?10.1103/PhysRevC.91.064904?]
1753  const double AuAu_Ncoll_C0_100 = 250; // pb^-1 [sPH-TRG-000]
1754  const double pAu_Ncoll_C0_100 = 4.7; // pb^-1 [sPH-TRG-000]
1755 
1757  // 2-year lumi in sPHENIX proposal
1759 
1760  // const double pp_lumi_proposal = 630; // Figure 4.36:
1761  // const double AuAu_eq_lumi_C0_20_proposal = 0.6e12 * 0.2 * AuAu_Ncoll_C0_20 / pp_inelastic_crosssec; //
1762  const double pp_lumi_proposal = 175; // Table 4.1
1763  const double AuAu_eq_lumi_C0_20_proposal = 0.1e12 * 0.2 * AuAu_Ncoll_C0_20 / pp_inelastic_crosssec; //
1764  const double dy_proposal = 2.;
1765  const double eff_proposal = 0.5;
1766 
1767  cout << "CrossSection2RAA_Proposal integrated luminosity assumptions in pb^-1: " << endl;
1768  cout << "\t"
1769  << "pp_lumi_proposal = " << pp_lumi_proposal << endl;
1770  cout << "\t"
1771  << "AuAu_eq_lumi_C0_20_proposal = " << AuAu_eq_lumi_C0_20_proposal << endl;
1772 
1773  TFile *f = TFile::Open(infile + "Draw_HFJetTruth_DrawCrossSection.root");
1774  assert(f);
1775 
1776  TH1F *h_b = (TH1F *) f->GetObjectChecked("h_b", "TH1F");
1777 
1778  assert(h_b);
1779 
1780  TCanvas *c1 = new TCanvas("Draw_HFJetTruth_CrossSection2RAA_Proposal", "Draw_HFJetTruth_CrossSection2RAA_Proposal", 1000, 860);
1781  c1->Divide(2, 2);
1782  int idx = 1;
1783  TPad *p;
1784 
1785  p = (TPad *) c1->cd(idx++);
1786  c1->Update();
1787  // p->SetGridx(0);
1788  // p->SetGridy(0);
1789  p->SetLogy();
1790 
1791  h_b->GetYaxis()->SetTitle(
1792  "d^{2}#sigma/(dp_{T}d#eta) [pb/(GeV/c)]");
1793  h_b->Draw();
1794 
1795  p = (TPad *) c1->cd(idx++);
1796  c1->Update();
1797  // p->SetGridx(0);
1798  // p->SetGridy(0);
1799  p->SetLogy();
1800 
1801  TH1 *h_b_int = (TH1 *) h_b->Clone(TString(h_b->GetName()) + "_IntrgratedCount");
1802  double integral = 0;
1803  for (int i = h_b_int->GetNbinsX(); i >= 1; --i)
1804  {
1805  const double cs = h_b_int->GetBinContent(i);
1806 
1807  integral += cs * h_b_int->GetXaxis()->GetBinWidth(i) * dy_proposal * 0.2 * AuAu_Ncoll_C0_20 / pp_inelastic_crosssec;
1808 
1809  h_b_int->SetBinContent(i, integral);
1810  h_b_int->SetBinError(i, 0);
1811  }
1812 
1813  h_b_int->GetYaxis()->SetTitle(
1814  "(Count > p_{T} cut)/Event 0-20% AuAu");
1815  h_b_int->Draw();
1816 
1817  p = (TPad *) c1->cd(idx++);
1818  c1->Update();
1819  // p->SetGridx(0);
1820  // p->SetGridy(0);
1821  // p->SetLogy();
1822 
1823  TH1 *g_pp = CrossSection2RelUncert(h_b, 1., dy_proposal, pp_lumi_proposal * eff_proposal);
1824  TH1 *g_AA = CrossSection2RelUncert(h_b, b_jet_RAA, dy_proposal, AuAu_eq_lumi_C0_20_proposal * eff_proposal);
1825 
1826  g_pp->Draw();
1827  g_AA->Draw("same");
1828 
1829  p = (TPad *) c1->cd(idx++);
1830  c1->Update();
1831  // p->SetGridx(0);
1832  // p->SetGridy(0);
1833  // p->SetLogy();
1834 
1835  p->DrawFrame(0, 0, 100, 1.2)
1836  ->SetTitle(";Transverse Momentum [GeV/#it{c}];#it{R}_{AA}");
1837  TLatex t;
1838  t.DrawLatex(10, 1, Form("#splitline{pp lumi %.0f pb^{-1}}{#splitline{AuAu 0-20 in 100B MB}{eff %.1f }}", pp_lumi_proposal, eff_proposal));
1839 
1840  TGraphErrors *ge_RAA = GetRAA(g_pp, g_AA);
1841  ge_RAA->Draw("pe*");
1842 
1843  SaveCanvas(c1, infile + "_" + TString(c1->GetName()), kTRUE);
1844 }
1845 
1846 void Draw_HFJetTruth3yr(const TString infile =
1847  // "/sphenix/user/jinhuang/HF-jet/event_gen/200pp_pythia8_CTEQ6L_20GeV/200pp_pythia8_CTEQ6L_20GeV_ALL.cfg_eneg_DSTReader.root",
1848  // double int_lumi = 210715 / 5.533e-05 / 1e9, const double dy = 0.6 * 2)
1849  "/sphenix/user/jinhuang/HF-jet/event_gen/200pp_pythia8_CTEQ6L_7GeV/200pp_pythia8_CTEQ6L_7GeV_ALL.cfg_eneg_DSTReader.root",
1850  double int_lumi = 891093 / 3.332e-02 / 1e9, const double dy = 0.6 * 2)
1851 //"/sphenix/user/jinhuang/HF-jet/event_gen/200pp_pythia8_CTEQ6L/200pp_pythia8_CTEQ6L_111ALL.cfg_eneg_DSTReader.root",
1852 //double int_lumi = 789908/4.631e-03 / 1e9, const double dy = 0.6*2)
1853 //Draw_HFJetTruth(const TString infile =
1854 // "../macros3/G4sPHENIXCells.root_DSTReader.root",
1855 // double int_lumi = 789908/4.631e-03 / 1e9, const double dy = 0.6*2)
1856 //Draw_HFJetTruth(const TString infile =
1857 // "../macros2/G4sPHENIXCells.root_DSTReader.root",
1858 // const double int_lumi = 1842152 / 5.801e-03 / 1e9,
1859 // const double dy = 0.6 * 2)
1860 {
1861  SetsPhenixStyle();
1862  gStyle->SetOptStat(0);
1863  gStyle->SetOptFit(1111);
1864  TVirtualFitter::SetDefaultFitter("Minuit2");
1865 
1866  gSystem->Load("libg4eval.so");
1867 
1868  if (!_file0)
1869  {
1870  TString chian_str = infile;
1871  chian_str.ReplaceAll("ALL", "*");
1872 
1873  TChain *t = new TChain("T");
1874  const int n = t->Add(chian_str);
1875 
1876  int_lumi *= n;
1877  // cout << "Loaded " << n << " root files with " << chian_str << endl;
1878  cout << "int_lumi = " << int_lumi << " pb^-1 from " << n << " root files with " << chian_str << endl;
1879  assert(n > 0);
1880 
1881  T = t;
1882 
1883  _file0 = new TFile;
1884  _file0->SetName(infile);
1885  }
1886 
1887  // DrawCrossSection(int_lumi, dy);
1888  // Draw_HFJetTruth_DrawCrossSection_PR(infile);
1889  // CrossSection2RAA_Proposal(infile);
1890  // CrossSection2RAA(infile);
1891  const double acceptance1 = 2. * (1.1 - .4);
1892 
1893  CrossSection2zg(infile, false, acceptance1);
1894 
1895  // CrossSection2RAA(infile, false, acceptance1);
1896 
1897  // const double acceptance2 = 2.* (0.85 - .4);
1898  // CrossSection2RAA(infile, false, acceptance2);
1899 
1900  // CrossSection2v2(infile, false, .5, acceptance1);
1901  // CrossSection2v2(infile, false, .4, acceptance);
1902 }