27 #include <TGraphErrors.h>
39 for (
int i = 1;
i <= htmp->GetNbinsX();
i++)
41 double c = htmp->GetBinContent(
i);
44 sum += c * htmp->GetBinCenter(
i);
46 err += TMath::Power(c * htmp->GetBinError(
i), 2);
49 double mean = sum / w;
50 err = TMath::Sqrt(err) / w;
61 bool print_plots =
true;
63 const char* ppFile =
"dibjet_imbalance_histos_pp.root";
64 const char* auauFile =
"dibjet_imbalance_histos_AuAu0-10.root";
67 const char* centlim[] = {
"0-10%",
"10-20%",
"20-40%",
"40-60%",
"60-92%"};
68 double ncoll[] = {962, 603, 296, 94, 15};
69 double lcent[] = {549, 344, 338, 107, 27};
77 TH1D* hxj_auau[NCENT];
79 TGraphErrors *gmxj =
new TGraphErrors();
80 gmxj->SetMarkerStyle(kFullCircle);
81 gmxj->SetMarkerColor(kBlack);
82 gmxj->SetLineColor(kBlack);
88 double mxj_auau[NCENT];
89 double mxj_e_auau[NCENT];
99 cout <<
"--> Reading results from file" << endl;
101 cout <<
"----> Reading pp from " << ppFile << endl;
102 fin = TFile::Open(ppFile);
105 cout <<
"ERROR!! Unable to read " << ppFile << endl;
109 sprintf(name,
"hdijet_xj_fix");
110 hxj_pp = (TH1D*) fin->Get(name);
113 cout <<
"ERRRO! Unable to find " << name <<
" in " << ppFile << endl;
116 hxj_pp->SetDirectory(0);
117 hxj_pp->SetName(
"hxj_pp");
124 cout <<
"----> Reading auau from " << auauFile << endl;
125 fin = TFile::Open(auauFile);
128 cout <<
"ERROR!! Unable to read " << auauFile << endl;
132 sprintf(name,
"hdijet_xj_fix");
133 hxj_auau[0] = (TH1D*) fin->Get(name);
136 cout <<
"ERRRO! Unable to find " << name <<
" in " << auauFile << endl;
139 hxj_auau[0]->SetDirectory(0);
140 hxj_auau[0]->SetName(
"hxj_auau_0");
149 cout <<
"--> Scaling AuAu centrality bins" << endl;
151 for (
int icent = 1; icent < NCENT; icent++)
153 sprintf(name,
"hxj_auau_%i", icent);
154 hxj_auau[icent] = (TH1D*) hxj_auau[0]->Clone(name);
156 double sf = 1./TMath::Sqrt(lcent[icent] / lcent[0]);
157 for (
int ix = 1; ix <= hxj_auau[icent]->GetNbinsX(); ix++)
159 double be = hxj_auau[icent]->GetBinError(ix);
161 hxj_auau[icent]->SetBinError(ix, be * sf);
170 cout <<
"--> Calculating <x_j>" << endl;
175 gmxj->SetPoint(0, 1, mxj_pp);
176 gmxj->SetPointError(0, 0, mxj_e_pp);
179 for (
int i = 0;
i < NCENT;
i++)
181 calc_mxj(hxj_auau[
i], mxj_auau[i], mxj_e_auau[i]);
183 gmxj->SetPoint(i + 1, ncoll[i], mxj_auau[i]);
184 gmxj->SetPointError(i + 1, 0, mxj_e_auau[i]);
193 TH1D* haxis =
new TH1D(
"haxis",
";N_{coll};#LTx_{j}#GT", 1200, -100, 1100);
196 haxis->SetMinimum(0.601);
197 haxis->SetMaximum(0.779);
200 lbl.SetTextAlign(22);
206 TCanvas *cxj =
new TCanvas(
"cxj",
"xj", 800, 600);
215 lbl.DrawLatex(1, mxj_pp + 0.02,
"p+p");
217 for (
int i = 0;
i < NCENT;
i++)
218 lbl.DrawLatex(ncoll[
i], mxj_auau[i] + 0.02 + 0.01*(i%2), centlim[i]);
220 TLegend *
leg =
new TLegend(0.10, 0.20, 0.70, 0.55);
221 leg->SetFillStyle(0);
222 leg->SetBorderSize(0);
223 leg->AddEntry(
"",
"#it{#bf{sPHENIX}} Simulation",
"");
224 leg->AddEntry(
"",
"#sqrt{s_{_{NN}}} = 200 GeV",
"");
225 leg->AddEntry(
"",
"Di b-jets (Pythia8, CTEQ6L)",
"");
226 leg->AddEntry(
"",
"anti-k_{T}, R = 0.4, |#eta|<0.7",
"");
227 leg->AddEntry(
"",
"p+p: 200 pb^{-1}, 60% Eff., 40% Pur.",
"");
228 leg->AddEntry(
"",
"Au+Au: 240B Events, 40% Eff., 40% Pur.",
"");
238 cout <<
"--> Printing results" << endl;
240 cout <<
"p+p <xj> = " << mxj_pp <<
" +/- " << mxj_e_pp << endl;
241 for (
int i = 0; i < NCENT; i++)
243 cout <<
"Au+Au " << centlim[
i] <<
" <xj> = " << mxj_auau[
i] <<
" +/- " << mxj_e_auau[
i] << endl;
246 cxj->Print(
"dibjet_imbalance_ncoll.pdf");
247 cxj->Print(
"dibjet_imbalance_ncoll.C");
248 cxj->Print(
"dibjet_imbalance_ncoll.root");