12 #include <TGraphAsymmErrors.h>
13 #include <TGraphErrors.h>
20 #include "SaveCanvas.C"
21 #include "sPhenixStyle.C"
30 "/sphenix/user/jinhuang/HF-jet/event_gen/200pp_pythia8_CTEQ6L_7GeV/200pp_pythia8_CTEQ6L_7GeV_ALL.cfg_eneg_DSTReader.root",
31 double int_lumi = 891093 / 3.332
e-02 / 1e9,
const double dy = 0.6 * 2)
45 gStyle->SetOptStat(0);
46 gStyle->SetOptFit(1111);
47 TVirtualFitter::SetDefaultFitter(
"Minuit2");
49 gSystem->Load(
"libg4eval.so");
50 gSystem->Load(
"libg4dst.so");
54 TString chian_str =
infile;
55 chian_str.ReplaceAll(
"ALL",
"*");
57 TChain *
t =
new TChain(
"T");
58 const int n = t->Add(chian_str);
62 cout <<
"int_lumi = " << int_lumi <<
" pb^-1 from " << n <<
" root files with " << chian_str << endl;
79 const double acceptance1 = 2. * (1.1 - .4);
92 TCut basicDijetEventQA(
"(AntiKt_Truth_r04[n_AntiKt_Truth_r04-1].get_pt())>15 && (AntiKt_Truth_r04[n_AntiKt_Truth_r04-2].get_pt())>10 && abs(AntiKt_Truth_r04[n_AntiKt_Truth_r04-1].get_eta())<.6 && abs(AntiKt_Truth_r04[n_AntiKt_Truth_r04-2].get_eta())<.6 && cos(AntiKt_Truth_r04[n_AntiKt_Truth_r04-1].get_phi() - AntiKt_Truth_r04[n_AntiKt_Truth_r04-2].get_phi())<-.5");
94 cout <<
"Build event selection of " << (
const char *) basicDijetEventQA << endl;
96 T->Draw(
">>EventList", basicDijetEventQA);
97 TEventList *elist = gDirectory->GetObjectChecked(
"EventList",
"TEventList");
99 cout << elist->GetN() <<
" / " <<
T->GetEntriesFast() <<
" events selected" << endl;
100 T->SetEventList(elist);
102 T->SetAlias(
"DiJetInvMass",
"sqrt( (AntiKt_Truth_r04[n_AntiKt_Truth_r04-1].get_e() + AntiKt_Truth_r04[n_AntiKt_Truth_r04-2].get_e())**2 - (AntiKt_Truth_r04[n_AntiKt_Truth_r04-1].get_px() + AntiKt_Truth_r04[n_AntiKt_Truth_r04-2].get_px())**2 - (AntiKt_Truth_r04[n_AntiKt_Truth_r04-1].get_py() + AntiKt_Truth_r04[n_AntiKt_Truth_r04-2].get_py())**2 - (AntiKt_Truth_r04[n_AntiKt_Truth_r04-1].get_pz() + AntiKt_Truth_r04[n_AntiKt_Truth_r04-2].get_pz())**2 )");
104 TH1 *
hall =
new TH1F(
"hall",
";m_{12} [GeV]", 200, 0, 200);
105 TH1 *
h_b =
new TH1F(
"h_b",
";m_{12} [GeV]", 200, 0, 200);
106 TH1 *h_bq =
new TH1F(
"h_bq",
";m_{12} [GeV]", 200, 0, 200);
107 TH1 *h_bh =
new TH1F(
"h_bh",
";m_{12} [GeV]", 200, 0, 200);
108 TH1 *h_bh5 =
new TH1F(
"h_bh5",
";m_{12} [GeV]", 200, 0, 200);
109 TH1 *h_ch5 =
new TH1F(
"h_ch5",
";m_{12} [GeV]", 200, 0, 200);
110 TH1 *h_c =
new TH1F(
"h_c",
";m_{12} [GeV]", 200, 0, 200);
112 cout <<
"DiJetInvMass>>hall" << endl;
113 T->Draw(
"DiJetInvMass>>hall",
117 cout <<
"DiJetInvMass>>h_b" << endl;
118 T->Draw(
"DiJetInvMass>>h_b",
119 "abs(AntiKt_Truth_r04[n_AntiKt_Truth_r04-1].get_property(1000))==5 && abs(AntiKt_Truth_r04[n_AntiKt_Truth_r04-2].get_property(1000))==5",
148 h_b->SetLineColor(kBlue);
149 h_b->SetMarkerColor(kBlue);
151 h_bq->SetLineColor(kBlue + 3);
152 h_bq->SetMarkerColor(kBlue + 3);
154 h_bh5->SetLineColor(kBlue + 3);
155 h_bh5->SetMarkerColor(kBlue + 3);
156 h_bh5->SetMarkerStyle(kStar);
158 h_c->SetLineColor(kRed);
159 h_c->SetMarkerColor(kRed);
161 h_ch5->SetLineColor(kRed + 3);
162 h_ch5->SetMarkerColor(kRed + 3);
163 h_ch5->SetMarkerStyle(kStar);
176 TCanvas *c1 =
new TCanvas(
"Draw_HFJetTruth_InvMass_DrawCrossSection",
"Draw_HFJetTruth_InvMass_DrawCrossSection", 1000, 860);
181 p = (TPad *) c1->cd(idx++);
196 hall->GetYaxis()->SetTitle(
197 "d^{3}#sigma/(d#eta_{1}d#eta_{2}dm_{12}) [pb/(GeV)]");
199 TLegend *
leg =
new TLegend(0.45, 0.6, 0.95, 0.93);
200 leg->SetFillColor(kWhite);
201 leg->SetFillStyle(1001);
202 leg->SetHeader(
"#splitline{#it{#bf{sPHENIX}} fast simulation, #it{p}+#it{p} #sqrt{s} = 200 GeV}{|#eta_{1,2}|<0.6, |#Delta#phi_{1,2}|>2#pi/3, p_{T,1}>15 GeV/c, p_{T,2}>10 GeV/c}");
203 leg->AddEntry(hall,
"Inclusive jet, PYTHIA8, Truth, anti-k_{t}, R=0.4",
206 leg->AddEntry(h_b,
"b-quark jet, PYTHIA8, Truth, anti-k_{t}, R=0.4",
"lpe");
221 TFile *
f = TFile::Open(infile +
"Draw_HFJetTruth_InvMass_DrawCrossSection.root");
224 TH1F *
hall = (TH1F *) f->GetObjectChecked(
"hall",
"TH1F");
226 TH1F *
h_b = (TH1F *) f->GetObjectChecked(
"h_b",
"TH1F");
229 hall->SetMarkerColor(kBlack);
230 hall->SetLineColor(kBlack);
231 hall->SetMarkerStyle(kFullCircle);
233 h_b->SetMarkerColor(kBlue + 2);
234 h_b->SetLineColor(kBlue + 2);
235 h_b->SetMarkerStyle(kFullCircle);
238 gr_star->SetLineColor(kGray + 2);
239 gr_star->SetLineWidth(3);
240 gr_star->SetMarkerColor(kGray + 2);
241 gr_star->SetMarkerSize(2);
242 gr_star->SetMarkerStyle(kFullSquare);
244 TCanvas *c1 =
new TCanvas(
"Draw_HFJetTruth_InvMass_DrawCrossSection_PR",
"Draw_HFJetTruth_InvMass_DrawCrossSection_PR", 1000, 860);
249 p = (TPad *) c1->cd(idx++);
253 TH1 *hframe = p->DrawFrame(35, 1
e-2, 140, 1e6);
254 hframe->SetTitle(
";m_{12} [GeV/c^{2}];d^{3}#sigma/(d#eta_{1}d#eta_{2}dm_{12}) [pb/(GeV/c^{2})]");
261 TLegend *
leg =
new TLegend(0.2, 0.7, 0.95, 0.92);
262 leg->SetFillColor(kWhite);
263 leg->SetFillStyle(1001);
265 leg->SetHeader(
"#splitline{#it{#bf{sPHENIX}} fast simulation, #it{p}+#it{p} #sqrt{s} = 200 GeV}{|#eta_{1,2}|<0.6, |#Delta#phi_{1,2}|>2#pi/3, p_{T,1}>15 GeV/c, p_{T,2}>10 GeV/c}");
266 leg->AddEntry(
"",
"",
268 leg->AddEntry(hall,
"Inclusive jet, PYTHIA8 + CTEQ6L, anti-k_{T} R=0.4",
270 leg->AddEntry(gr_star,
"STAR, PRD95 (2017) no.7, 071103, R=0.6",
"ple");
271 leg->AddEntry(h_b,
"#it{b}-quark jet, PYTHIA8 + CTEQ6L, anti-k_{T} R=0.4",
"lpe");
278 void CrossSection2RAA(
const TString
infile,
const bool use_AA_jet_trigger =
true,
const double dy = .7 * 2,
const bool b3yr =
false)
280 TFile *
f = TFile::Open(infile +
"Draw_HFJetTruth_InvMass_DrawCrossSection.root");
283 TH1F *
hall = (TH1F *) f->GetObjectChecked(
"hall",
"TH1F");
285 TH1F *
h_b = (TH1F *) f->GetObjectChecked(
"h_b",
"TH1F");
288 TString s_suffix(use_AA_jet_trigger ?
"_AAJetTriggered" :
"");
289 s_suffix += b3yr ?
"_3yr" :
"";
290 s_suffix += Form(
"_deta%.2f",
dy / 2);
292 const double b_jet_RAA = 0.4;
293 const double target_RAA_ratio = 4;;
295 const double pp_eff = 0.6;
296 const double pp_purity = 0.4;
297 const double AuAu_eff = 0.4;
298 const double AuAu_purity = 0.4;
304 const double pp_lumi = b3yr ? 62 : 200;
307 const double AuAu_MB_Evt = use_AA_jet_trigger ? (b3yr ? 320e9 : 550e9) : (b3yr ? 142e9 : 240e9);
308 const double pAu_MB_Evt = 600e9;
321 cout <<
"CrossSection2RAA integrated luminosity assumptions in pb^-1: " << endl;
323 <<
"pp_lumi = " << pp_lumi << endl;
325 <<
"AuAu_eq_lumi_C0_10 = " << AuAu_eq_lumi_C0_10 << endl;
327 <<
"AuAu_eq_lumi_C0_20 = " << AuAu_eq_lumi_C0_20 << endl;
329 <<
"AuAu_eq_lumi_C0_100 = " << AuAu_eq_lumi_C0_100 << endl;
331 <<
"pAu_eq_lumi_C0_100 = " << pAu_eq_lumi_C0_100 << endl;
333 TCanvas *c1 =
new TCanvas(
"Draw_HFJetTruth_InvMass_CrossSection2RAA_Ratio" + s_suffix,
"Draw_HFJetTruth_InvMass_CrossSection2RAA_Ratio" + s_suffix, 1100, 800);
338 p = (TPad *) c1->cd(idx++);
347 TH1 *g_AA =
CrossSection2RelUncert(h_b, b_jet_RAA,
dy, AuAu_eq_lumi_C0_10 * AuAu_eff * AuAu_purity * AuAu_eff * AuAu_purity);
349 g_pp->SetLineColor(kRed);
350 g_AA->SetLineColor(kBlue);
354 SaveCanvas(c1, infile +
"_" + TString(c1->GetName()), kTRUE);
356 TCanvas *c1 =
new TCanvas(
"Draw_HFJetTruth_InvMass_CrossSection2RAA" + s_suffix,
"Draw_HFJetTruth_InvMass_CrossSection2RAA" + s_suffix, 1100, 800);
361 p = (TPad *) c1->cd(idx++);
364 p->DrawFrame(30, 0, 75, 1.3)->SetTitle(
";Di-jet invariant mass [GeV/#it{c}^{2}];#it{R}^{bb}_{AA}");
366 TGraphErrors *ge_RAA =
GetRAA(g_pp, g_AA);
368 ge_RAA->SetLineWidth(4);
369 ge_RAA->SetMarkerStyle(kFullCircle);
370 ge_RAA->SetMarkerSize(3);
375 TLegend *
leg =
new TLegend(.0, .7, .85, .93);
376 leg->SetFillStyle(0);
377 leg->AddEntry(
"",
"#it{#bf{sPHENIX}} Projection, #it{b}-jet, 0-10% Au+Au, Year 1-3",
"");
378 leg->AddEntry(
"", Form(
"|#eta_{1,2}|<%.1f, |#Delta#phi_{1,2}|>2#pi/3, p_{T,1}>15 GeV/c, p_{T,2}>10 GeV/c",
dy / 2),
"");
379 leg->AddEntry(
"", Form(
"#it{p}+#it{p}: %.0f pb^{-1} samp., %.0f%% Eff., %.0f%% Pur.", pp_lumi, pp_eff * 100, pp_purity * 100),
"");
380 leg->AddEntry(
"", Form(
"Au+Au: %.0fnb^{-1} rec., %.0f%% Eff., %.0f%% Pur.",
'%', AuAu_MB_Evt/6.8252 / 1e9, AuAu_eff * 100, AuAu_purity * 100),
"");
387 SaveCanvas(c1, infile +
"_" + TString(c1->GetName()), kTRUE);
389 TCanvas *c1 =
new TCanvas(
"Draw_HFJetTruth_InvMass_CrossSection2RAA_Theory" + s_suffix,
"Draw_HFJetTruth_InvMass_CrossSection2RAA_Theory" + s_suffix, 1100, 800);
394 p = (TPad *) c1->cd(idx++);
397 p->DrawFrame(35, 0, 75, 1.4)->SetTitle(
";Di-jet invariant mass [GeV];#it{R}^{bb}_{AA}");
404 g18->SetLineColor(kBlue + 3);
405 g20->SetLineColor(kGreen + 3);
406 g22->SetLineColor(kRed + 3);
407 g18->SetLineWidth(3);
408 g20->SetLineWidth(3);
409 g22->SetLineWidth(3);
415 ge_RAA->DrawClone(
"pe");
419 TLegend *leg1 =
new TLegend(.19, .6, .92, .7);
421 leg1->SetHeader(
"Kang et al, PRD #bf{99}, 034006 (2019), m=m_{b}, rad.+col.");
423 TLegend *leg11 =
new TLegend(.35, .5, .55, .62);
424 leg11->AddEntry(g18,
"g_{med} = 1.8",
"l");
425 leg11->AddEntry(g20,
"g_{med} = 2.0",
"l");
426 leg11->AddEntry(g22,
"g_{med} = 2.2",
"l");
429 SaveCanvas(c1, infile +
"_" + TString(c1->GetName()), kTRUE);
432 TCanvas *c1 =
new TCanvas(
"Draw_HFJetTruth_InvMass_CrossSection2RAARatio_Theory" + s_suffix,
"Draw_HFJetTruth_InvMass_CrossSection2RAARatio_Theory" + s_suffix, 1100, 800);
437 p = (TPad *) c1->cd(idx++);
440 p->DrawFrame(35, 0, 75, 15)->SetTitle(
";Di-jet invariant mass [GeV];#it{R}^{bb}_{AA}/#it{R}^{jj}_{AA}");
441 TLine * l =
new TLine(35, 1, 75, 1);
450 g18->SetLineColor(kBlue + 3);
451 g20->SetLineColor(kGreen + 3);
452 g22->SetLineColor(kRed + 3);
453 g18->SetLineWidth(3);
454 g20->SetLineWidth(3);
455 g22->SetLineWidth(3);
461 TGraphErrors * ge_RAARatio = (TGraphErrors *) ge_RAA->DrawClone(
"pe");
463 for (
int bin = 0; bin<ge_RAARatio->GetN();++bin)
465 ge_RAARatio->GetY()[bin] *= target_RAA_ratio/b_jet_RAA;
466 ge_RAARatio->GetEY()[bin] *= target_RAA_ratio/b_jet_RAA;
472 TLegend *leg1 =
new TLegend(.2, .6, .92, .70);
474 leg1->SetHeader(
"Kang et al, PRD #bf{99}, 034006 (2019), m=m_{b}, rad.+col.");
476 TLegend *leg11 =
new TLegend(.35, .5, .55, .62);
477 leg11->AddEntry(g18,
"g_{med} = 1.8",
"l");
478 leg11->AddEntry(g20,
"g_{med} = 2.0",
"l");
479 leg11->AddEntry(g22,
"g_{med} = 2.2",
"l");
482 SaveCanvas(c1, infile +
"_" + TString(c1->GetName()), kTRUE);
487 TGraphErrors *
GetRAA(TH1 *h_pp, TH1 *h_AA)
491 double xs[1000] = {0};
492 double ys[1000] = {0};
493 double eys[1000] = {0};
497 assert(h_pp->GetNbinsX() == h_AA->GetNbinsX());
499 for (
int i = 1;
i <= h_pp->GetNbinsX(); ++
i)
501 if (h_pp->GetBinError(
i) > 0 && h_pp->GetBinError(
i) < 1 && h_AA->GetBinError(
i) > 0 && h_AA->GetBinError(
i) < 1)
503 xs[n_bin] = h_pp->GetXaxis()->GetBinCenter(
i);
505 ys[n_bin] = h_AA->GetBinContent(
i) / h_pp->GetBinContent(
i);
507 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));
515 TGraphErrors *ge =
new TGraphErrors(n_bin, xs, ys, NULL, eys);
516 ge->SetName(TString(
"RAA_") + h_AA->GetName());
522 const double suppression,
524 const double pp_quiv_int_lum)
529 h_cross->Clone(TString(h_cross->GetName()) + Form(
"_copy%d", rand()));
532 h_ratio->Scale(deta * deta * h_ratio->GetXaxis()->GetBinWidth(0) * pp_quiv_int_lum * suppression);
537 for (
int i = 1;
i <= h_ratio->GetNbinsX(); ++
i)
539 const double yield = h_ratio->GetBinContent(
i);
543 h_ratio->SetBinContent(
i, suppression);
545 h_ratio->SetBinError(
i, suppression / sqrt(yield));
549 h_ratio->SetBinContent(
i, 0);
551 h_ratio->SetBinError(
i, 0);
555 h_ratio->GetYaxis()->SetTitle(
"Relative Cross Section and Uncertainty");
564 for (
int i = 1;
i <= h->GetXaxis()->GetNbins(); ++
i)
566 const double m1 = h->GetXaxis()->GetBinLowEdge(
i);
567 const double m2 = h->GetXaxis()->GetBinUpEdge(
i);
570 const double dm = m2 - m1;
573 const double count2sigma = 1. / dm / int_lumi / dy /
dy;
575 h->SetBinContent(
i, h->GetBinContent(
i) * count2sigma);
576 h->SetBinError(
i, h->GetBinError(
i) * count2sigma);
581 h->SetMarkerStyle(kFullCircle);
584 TGraphAsymmErrors *
GetSTAR2019(
const TString hepdata =
"/sphenix/user/jinhuang/HF-jet/event_gen/HEPData-ins1493842-v1-Table_4.root")
594 TFile *
_file0 = TFile::Open(hepdata);
595 _file0->cd(
"Table 4");
596 TGraphAsymmErrors *gae = (TGraphAsymmErrors *)
597 gDirectory->GetObjectChecked(
"Graph1D_y1",
"TGraphAsymmErrors");
600 for (
int bin = 0; bin < gae->GetN(); ++bin)
602 (gae->GetY())[bin] *= 1e6;
603 gae->SetPointEYhigh(bin, gae->GetErrorYhigh(bin) * 1e6);
604 gae->SetPointEYlow(bin, gae->GetErrorYlow(bin) * 1e6);
606 gae->SetName(
"gaeSTARDiJetMass");
659 const int n_Data = 44;
661 const double m12[] = {
707 const double RAA_2mb_g18[] = {
753 const double RAA_1mb_g_18[] = {
799 const double RAA_2mb_g_20[] = {
845 const double RAA_1mb_g_20[] = {
891 const double RAA_2mb_g_22[] = {
937 const double RAA_1mb_g_22[] = {
983 TGraph *gRAAKang2019(NULL);
989 gRAAKang2019 =
new TGraph(n_Data, m12, RAA_1mb_g_18);
993 gRAAKang2019 =
new TGraph(n_Data, m12, RAA_1mb_g_20);
997 gRAAKang2019 =
new TGraph(n_Data, m12, RAA_1mb_g_22);
1004 gRAAKang2019 =
new TGraph(n_Data, m12, RAA_2mb_g_18);
1008 gRAAKang2019 =
new TGraph(n_Data, m12, RAA_2mb_g_20);
1012 gRAAKang2019 =
new TGraph(n_Data, m12, RAA_2mb_g_22);
1016 cout <<
"mass = "<<
mass<<
", g="<<
g<<endl;
1018 gRAAKang2019->Print();
1020 return gRAAKang2019;
1071 const int n_Data = 44;
1073 const double m12[] = {
1119 const double RAA_1mb_g_18[] = {
1165 const double RAA_1mb_g_20[] = {
1211 const double RAA_1mb_g_22[] = {
1257 TGraph *gRAARatioKang2019(NULL);
1263 gRAARatioKang2019 =
new TGraph(n_Data, m12, RAA_1mb_g_18);
1267 gRAARatioKang2019 =
new TGraph(n_Data, m12, RAA_1mb_g_20);
1271 gRAARatioKang2019 =
new TGraph(n_Data, m12, RAA_1mb_g_22);
1275 assert(gRAARatioKang2019);
1277 return gRAARatioKang2019;