9 double A = pow(n/fabs(alpha),n)*TMath::Exp(-pow(fabs(alpha),2)/2.);
10 double B = n/fabs(alpha) - fabs(alpha);
11 double k = (x[0]-
mu)/sigma;
15 val = norm*TMath::Exp(-0.5*pow(k,2));
17 val = norm*A*pow(B-k,-n);
19 if( TMath::IsNaN(val) ) val = 0.0;
33 double mu2 = mu1*1.0595;
34 double mu3 = mu1*1.0946;
36 double A = pow(n/fabs(alpha),n)*TMath::Exp(-pow(fabs(alpha),2)/2.);
37 double B = n/fabs(alpha) - fabs(alpha);
38 double k1 = (x[0]-mu1)/sigma;
39 double k2 = (x[0]-mu2)/sigma;
40 double k3 = (x[0]-mu3)/sigma;
42 double val,val1,val2,val3;
44 if( k1 > -alpha ) { val1 = norm1*TMath::Exp(-0.5*pow(k1,2)); }
45 else { val1 = norm1*A*pow(B-k1,-n); }
46 if( k2 > -alpha ) { val2 = norm2*TMath::Exp(-0.5*pow(k2,2)); }
47 else { val2 = norm2*A*pow(B-k2,-n); }
48 if( k3 > -alpha ) { val3 = norm3*TMath::Exp(-0.5*pow(k3,2)); }
49 else { val3 = norm3*A*pow(B-k3,-n); }
51 val = val1 + val2 + val3;
53 if( TMath::IsNaN(val) ) val = 0.0;
67 double mu2 = mu1*1.0595;
68 double mu3 = mu1*1.0946;
70 double A = pow(n/fabs(alpha),n)*TMath::Exp(-pow(fabs(alpha),2)/2.);
71 double B = n/fabs(alpha) - fabs(alpha);
72 double k1 = (x[0]-mu1)/sigma;
73 double k2 = (x[0]-mu2)/sigma;
74 double k3 = (x[0]-mu3)/sigma;
76 double val,val1,val2,val3;
78 if( k1 > -alpha ) { val1 = norm1*TMath::Exp(-0.5*pow(k1,2)); }
79 else { val1 = norm1*A*pow(B-k1,-n); }
80 if( k2 > -alpha ) { val2 = norm2*TMath::Exp(-0.5*pow(k2,2)); }
81 else { val2 = norm2*A*pow(B-k2,-n); }
82 if( k3 > -alpha ) { val3 = norm3*TMath::Exp(-0.5*pow(k3,2)); }
83 else { val3 = norm3*A*pow(B-k3,-n); }
85 double bgnorm1 = p[7];
86 double bgslope1 = p[8];
88 double bg = exp(bgnorm1+x[0]*bgslope1);
90 val = val1 + val2 + val3 + bg;
91 if( TMath::IsNaN(val) ) val = 0.0;
105 gStyle->SetOptStat(0);
106 gStyle->SetOptFit(0);
108 TRandom* myrandom =
new TRandom3();
109 const int nbins = 15;
115 double statscale = 1.4;
116 double statscale_lowlim = 7.0;
117 double statscale_uplim = 14.0;
119 double ppcorr = (2400./14.)/962.;
121 TF1* fCBpp =
new TF1(
"fCBpp",
CBFunction,5.,14.,5);
122 TF1* fCBauau =
new TF1(
"fCBauau",
CBFunction,5.,14.,5);
123 TF1* fCB1s =
new TF1(
"fCB1s",
CBFunction,5.,14.,5);
124 TF1* fCB2s =
new TF1(
"fCB2s",
CBFunction,5.,14.,5);
125 TF1* fCB3s =
new TF1(
"fCB3s",
CBFunction,5.,14.,5);
138 int whichsuppression = 1;
144 if(whichsuppression==0) {npts3_rebin=4;}
146 string str_UpsilonPt =
"(2.0*3.14159*x*[0]*pow((1 + x*x/(4*[1]) ),-[2]))";
147 string str_UpsilonXPt =
"(2.0*3.14159*x*x*[0]*pow((1 + x*x/(4*[1]) ),-[2]))";
148 TF1* fUpsilonPt =
new TF1(
"fUpsilonPt",str_UpsilonPt.c_str(),0.,20.);
149 TF1* fUpsilonXPt =
new TF1(
"fUpsilonXPt",str_UpsilonXPt.c_str(),0.,20.);
150 fUpsilonPt->SetParameters(72.1, 26.516, 10.6834);
151 fUpsilonXPt->SetParameters(72.1, 26.516, 10.6834);
152 double upsnorm = fUpsilonPt->Integral(0.,20.);
154 double xx1[nbins+1];
for(
int i=0;
i<nbins+1;
i++) {xx1[
i] = 0.5 +
double(
i);}
155 double xx2[nbins+1];
for(
int i=0;
i<nbins+1;
i++) {xx2[
i] = 0.5 +
double(
i);}
156 double xx3[nbins+1];
for(
int i=0;
i<nbins+1;
i++) {xx3[
i] = 0.5 +
double(
i);}
157 double xx3_rebin[nbins+1];
159 xx3_rebin[0] = fUpsilonXPt->Integral(0.,4.)/fUpsilonPt->Integral(0.,4.);
160 xx3_rebin[1] = fUpsilonXPt->Integral(4.,10.)/fUpsilonPt->Integral(4.,10.);
161 }
else if(npts3_rebin==4) {
162 xx3_rebin[0] = fUpsilonXPt->Integral(0.,2.)/fUpsilonPt->Integral(0.,2.);
163 xx3_rebin[1] = fUpsilonXPt->Integral(2.,4.)/fUpsilonPt->Integral(2.,4.);
164 xx3_rebin[2] = fUpsilonXPt->Integral(4.,6.)/fUpsilonPt->Integral(4.,6.);
165 xx3_rebin[3] = fUpsilonXPt->Integral(6.,10.)/fUpsilonPt->Integral(6.,10.);
166 }
else if(npts3_rebin==1) {
167 xx3_rebin[0] = fUpsilonXPt->Integral(0.,10.)/fUpsilonPt->Integral(0.,10.);
168 }
else {cerr <<
"ERROR: Wrong Y(3S) binning." << endl;
return;}
172 double raa1s[nbins+1];
173 double raa2s[nbins+1];
174 double raa3s[nbins+1];
175 for(
int i=0;
i<nbins+1;
i++) {raa1s[
i]=0.654; raa2s[
i]=0.277; raa3s[
i]=0.075;}
176 if(whichsuppression==0) {
for(
int i=0;
i<nbins+1;
i++) {raa3s[
i]=0.138;}}
178 TGraph* grRAA1S =
new TGraph(nbins,xx1,raa1s);
179 TGraph* grRAA2S =
new TGraph(nbins,xx2,raa2s);
180 TGraph* grRAA3S =
new TGraph(nbins,xx3,raa3s);
200 double combbg_corr_60pct = 0.406667 * 6.;
201 double corrbg_corr_60pct = 388.8/955. * 6.;
209 if(whichsuppression==1) {Nups3 = 549*(3.5/8.5);}
210 int Nups23 = Nups2+Nups3;
211 int Nups1pp = 2.86e+03;
212 int Nups2pp = 7.16e+02;
213 int Nups3pp = 3.98e+02;
214 int Nups23pp = Nups2pp+Nups3pp;
227 double tonypar1 = 0.98;
228 double tonypar2 = 0.93;
230 double tonypar3 = 9.448;
231 double tonypar4 = 0.100;
232 double tonypar4pp = 0.089;
233 fCBpp->SetParameter(0,1000.);
234 fCBpp->SetParameter(1,tonypar1);
235 fCBpp->SetParameter(2,tonypar2);
236 fCBpp->SetParameter(3,tonypar3);
237 fCBpp->SetParameter(4,tonypar4pp);
238 fCBauau->SetParameter(0,1000.);
239 fCBauau->SetParameter(1,tonypar1);
240 fCBauau->SetParameter(2,tonypar2);
241 fCBauau->SetParameter(3,tonypar3);
242 fCBauau->SetParameter(4,tonypar4);
246 TH1D* hhups[nbins+1];
247 TH1D* hhups1[nbins+1];
248 TH1D* hhups2[nbins+1];
249 TH1D* hhups3[nbins+1];
250 TH1D* hhupspp[nbins+1];
251 TH1D* hhups1pp[nbins+1];
252 TH1D* hhups2pp[nbins+1];
253 TH1D* hhups3pp[nbins+1];
254 for(
int i=0;
i<nbins+1;
i++) {
255 sprintf(hhname,
"hhups_%d",
i);
256 hhups[
i] =
new TH1D(hhname,
"",nchan,start,stop);
258 sprintf(hhname,
"hhups1_%d",
i);
259 hhups1[
i] =
new TH1D(hhname,
"",nchan,start,stop);
261 sprintf(hhname,
"hhups2_%d",
i);
262 hhups2[
i] =
new TH1D(hhname,
"",nchan,start,stop);
264 sprintf(hhname,
"hhups3_%d",
i);
265 hhups3[
i] =
new TH1D(hhname,
"",nchan,start,stop);
267 hhups[
i]->SetLineWidth(2);
268 hhups1[
i]->SetLineWidth(2);
269 hhups2[
i]->SetLineWidth(2);
270 hhups3[
i]->SetLineWidth(2);
271 sprintf(hhname,
"hhupspp_%d",
i);
272 hhupspp[
i] =
new TH1D(hhname,
"",nchan,start,stop);
274 sprintf(hhname,
"hhups1pp_%d",
i);
275 hhups1pp[
i] =
new TH1D(hhname,
"",nchan,start,stop);
276 hhups1pp[
i]->Sumw2();
277 sprintf(hhname,
"hhups2pp_%d",
i);
278 hhups2pp[
i] =
new TH1D(hhname,
"",nchan,start,stop);
279 hhups2pp[
i]->Sumw2();
280 sprintf(hhname,
"hhups3pp_%d",
i);
281 hhups3pp[
i] =
new TH1D(hhname,
"",nchan,start,stop);
282 hhups3pp[
i]->Sumw2();
283 hhupspp[
i]->SetLineWidth(2);
284 hhups1pp[
i]->SetLineWidth(2);
285 hhups2pp[
i]->SetLineWidth(2);
286 hhups3pp[
i]->SetLineWidth(2);
292 double s2 = s1 + 1.0;
293 double tmpnups1 = Nups1*fUpsilonPt->Integral(s1,s2)/upsnorm;
294 double tmpnups2 = Nups2*fUpsilonPt->Integral(s1,s2)/upsnorm;
295 double tmpnups3 = Nups3*fUpsilonPt->Integral(s1,s2)/upsnorm;
296 fCBauau->SetParameter(3,tonypar3);
297 for(
int i=0;
i<int(tmpnups1+0.5);
i++) {
double myrnd = fCBauau->GetRandom(); hhups1[
j]->Fill(myrnd); hhups[
j]->Fill(myrnd); }
298 fCBauau->SetParameter(3,tonypar3*scale[1]);
299 for(
int i=0;
i<int(tmpnups2+0.5);
i++) {
double myrnd = fCBauau->GetRandom(); hhups2[
j]->Fill(myrnd); hhups[
j]->Fill(myrnd); }
300 fCBauau->SetParameter(3,tonypar3*scale[2]);
301 for(
int i=0;
i<int(tmpnups3+0.5);
i++) {
double myrnd = fCBauau->GetRandom(); hhups3[
j]->Fill(myrnd); hhups[
j]->Fill(myrnd); }
303 double tmpnups1pp = Nups1pp*fUpsilonPt->Integral(s1,s2)/upsnorm;
304 double tmpnups2pp = Nups2pp*fUpsilonPt->Integral(s1,s2)/upsnorm;
305 double tmpnups3pp = Nups3pp*fUpsilonPt->Integral(s1,s2)/upsnorm;
306 fCBpp->SetParameter(3,tonypar3);
307 for(
int i=0;
i<int(tmpnups1pp+0.5);
i++) {
double myrnd = fCBpp->GetRandom(); hhups1pp[
j]->Fill(myrnd); hhupspp[
j]->Fill(myrnd); }
308 fCBpp->SetParameter(3,tonypar3*scale[1]);
309 for(
int i=0;
i<int(tmpnups2pp+0.5);
i++) {
double myrnd = fCBpp->GetRandom(); hhups2pp[
j]->Fill(myrnd); hhupspp[
j]->Fill(myrnd); }
310 fCBpp->SetParameter(3,tonypar3*scale[2]);
311 for(
int i=0;
i<int(tmpnups3pp+0.5);
i++) {
double myrnd = fCBpp->GetRandom(); hhups3pp[
j]->Fill(myrnd); hhupspp[
j]->Fill(myrnd); }
317 fCBpp->SetParameter(3,tonypar3);
318 fCBauau->SetParameter(3,tonypar3);
319 for(
int i=0;
i<int(Nups1+0.5);
i++) {
double myrnd = fCBauau->GetRandom(); hhups1[
nbins]->Fill(myrnd); hhups[
nbins]->Fill(myrnd); }
320 for(
int i=0;
i<int(Nups1pp+0.5);
i++) {
double myrnd = fCBpp->GetRandom(); hhups1pp[
nbins]->Fill(myrnd); hhupspp[
nbins]->Fill(myrnd); }
321 fCBpp->SetParameter(3,tonypar3*scale[1]);
322 fCBauau->SetParameter(3,tonypar3*scale[1]);
323 for(
int i=0;
i<int(Nups2+0.5);
i++) {
double myrnd = fCBauau->GetRandom(); hhups2[
nbins]->Fill(myrnd); hhups[
nbins]->Fill(myrnd); }
324 for(
int i=0;
i<int(Nups2pp+0.5);
i++) {
double myrnd = fCBpp->GetRandom(); hhups2pp[
nbins]->Fill(myrnd); hhupspp[
nbins]->Fill(myrnd); }
325 fCBpp->SetParameter(3,tonypar3*scale[2]);
326 fCBauau->SetParameter(3,tonypar3*scale[2]);
327 for(
int i=0;
i<int(Nups3+0.5);
i++) {
double myrnd = fCBauau->GetRandom(); hhups3[
nbins]->Fill(myrnd); hhups[
nbins]->Fill(myrnd); }
328 for(
int i=0;
i<int(Nups3pp+0.5);
i++) {
double myrnd = fCBpp->GetRandom(); hhups3pp[
nbins]->Fill(myrnd); hhupspp[
nbins]->Fill(myrnd); }
332 TCanvas* cupspp =
new TCanvas(
"cupspp",
"Upsilons in p+p",100,100,600,600);
333 fTCBpp->SetParameter(0,2000.);
334 fTCBpp->FixParameter(1,tonypar1);
335 fTCBpp->FixParameter(2,tonypar2);
336 fTCBpp->SetParameter(3,tonypar3);
337 fTCBpp->FixParameter(4,tonypar4);
338 fTCBpp->SetParameter(5,500.);
339 fTCBpp->SetParameter(6,100.);
340 hhupspp[
nbins]->Fit(fTCBpp,
"rl",
"",7.,11.);
341 hhupspp[
nbins]->SetAxisRange(7.,11.);
342 hhupspp[
nbins]->SetMarkerSize(1.0);
343 hhupspp[
nbins]->GetXaxis()->SetTitle(
"Invariant mass [GeV/c^{2}]");
344 hhupspp[
nbins]->GetXaxis()->SetTitleOffset(1.0);
345 double tmpamp1 = hhupspp[
nbins]->GetFunction(
"fTCBpp")->GetParameter(0);
346 double tmpamp5 = tmpamp1*frac[1]/frac[0];
347 double tmpamp6 = tmpamp1*frac[2]/frac[0];
348 hhupspp[
nbins]->Draw();
350 fCB1s->SetLineColor(kBlue);
351 fCB1s->SetLineWidth(1);
352 fCB1s->SetParameter(0,fTCBpp->GetParameter(0));
353 fCB1s->SetParameter(1,fTCBpp->GetParameter(1));
354 fCB1s->SetParameter(2,fTCBpp->GetParameter(2));
355 fCB1s->SetParameter(3,fTCBpp->GetParameter(3)*scale[0]);
356 fCB1s->SetParameter(4,fTCBpp->GetParameter(4));
357 fCB2s->SetLineColor(kRed);
358 fCB2s->SetLineWidth(1);
359 fCB2s->SetParameter(0,tmpamp5);
360 fCB2s->SetParameter(1,fTCBpp->GetParameter(1));
361 fCB2s->SetParameter(2,fTCBpp->GetParameter(2));
362 fCB2s->SetParameter(3,fTCBpp->GetParameter(3)*scale[1]);
363 fCB2s->SetParameter(4,fTCBpp->GetParameter(4));
364 fCB3s->SetLineColor(kGreen+2);
365 fCB3s->SetLineWidth(1);
366 fCB3s->SetParameter(0,tmpamp6);
367 fCB3s->SetParameter(1,fTCBpp->GetParameter(1));
368 fCB3s->SetParameter(2,fTCBpp->GetParameter(2));
369 fCB3s->SetParameter(3,fTCBpp->GetParameter(3)*scale[2]);
370 fCB3s->SetParameter(4,fTCBpp->GetParameter(4));
377 TCanvas* cupsauau =
new TCanvas(
"cupsauau",
"Upsilons in Au+Au",100,100,600,600);
378 fTCBauau->SetParameter(0,2000.);
379 fTCBauau->FixParameter(1,tonypar1);
380 fTCBauau->FixParameter(2,tonypar2);
381 fTCBauau->SetParameter(3,tonypar3);
382 fTCBauau->FixParameter(4,tonypar4);
383 fTCBauau->SetParameter(5,500.);
384 fTCBauau->SetParameter(6,100.);
385 hhups[
nbins]->Fit(fTCBauau,
"rl",
"",7.,11.);
386 hhups[
nbins]->SetAxisRange(7.,11.);
387 hhups[
nbins]->SetMarkerSize(1.0);
388 hhups[
nbins]->GetXaxis()->SetTitle(
"Invariant mass [GeV/c^{2}]");
389 hhups[
nbins]->GetXaxis()->SetTitleOffset(1.0);
390 tmpamp1 = hhups[
nbins]->GetFunction(
"fTCBauau")->GetParameter(0);
391 tmpamp5 = tmpamp1*frac[1]/frac[0];
392 tmpamp6 = tmpamp1*frac[2]/frac[0];
393 hhups[
nbins]->Draw();
395 TCanvas* cupsvspt =
new TCanvas(
"cupsvspt",
"Upsilons vs. p_{T}",100,100,1200,900);
396 cupsvspt->Divide(4,3);
397 for(
int i=0;
i<12;
i++) {
399 hhups[
i]->SetAxisRange(7.0,11.0); hhups[
i]->Draw();
400 sprintf(tlchar,
"%d-%d GeV",
i,
i+1); tl[
i] =
new TLatex(8.0,hhups[
i]->GetMaximum()*0.95,tlchar); tl[
i]->Draw();
407 TH1D* hhall[nbins+1];
408 TH1D* hhall_scaled[nbins+1];
410 TH1D* hhtotbg[nbins+1];
411 TH1D* hhtotbg_scaled[nbins+1];
412 TH1D* hhcombbg[nbins+1];
413 TH1D* hhcombbg_scaled[nbins+1];
414 TH1D* hhfakefake[nbins+1];
415 TH1D* hhfakehf[nbins+1];
416 TH1D* hhbottom[nbins+1];
417 TH1D* hhcharm[nbins+1];
419 TH1D* hhcorrbg[nbins+1];
420 TH1D* hhcorrbg_scaled[nbins+1];
421 TH1D* hhfit[nbins+1];
428 double corrbgfitpar0;
429 double corrbgfitpar1;
431 TFile*
f=
new TFile(
"ccbb_eideff09.root");
432 for(
int i=0;
i<nbins+1;
i++) {
433 sprintf(tmpname,
"hhbottom_%d",
i);
434 hhbottom[
i] = (TH1D*)f->Get(tmpname);
435 hhbottom[
i]->SetDirectory(gROOT);
436 sprintf(tmpname,
"hhcharm_%d",
i);
437 hhcharm[
i] = (TH1D*)f->Get(tmpname);
438 hhcharm[
i]->SetDirectory(gROOT);
439 sprintf(tmpname,
"hhdy_%d",
i);
440 hhdy[
i] = (TH1D*)f->Get(tmpname);
441 hhdy[
i]->SetDirectory(gROOT);
442 sprintf(tmpname,
"hhcorrbg_%d",
i);
443 hhcorrbg[
i] = (TH1D*)hhbottom[
i]->Clone(tmpname);
444 hhcorrbg[
i]->Add(hhcharm[
i]);
445 hhcorrbg[
i]->Add(hhdy[i]);
446 sprintf(tmpname,
"hhcorrbg_scaled_%d",i);
447 hhcorrbg_scaled[
i] = (TH1D*)hhcorrbg[i]->Clone(tmpname);
448 hhcorrbg[
i]->Fit(
"expo",
"rql",
"",statscale_lowlim,statscale_uplim);
449 hhbottom[
i]->Fit(
"expo",
"rql",
"",statscale_lowlim,statscale_uplim);
450 hhdy[
i]->Fit(
"expo",
"rql",
"",statscale_lowlim,statscale_uplim);
452 corrbgfitpar0 = hhcorrbg[
i]->GetFunction(
"expo")->GetParameter(0);
453 corrbgfitpar1 = hhcorrbg[
i]->GetFunction(
"expo")->GetParameter(1);
455 for(
int k=1;
k<=hhcorrbg[
i]->GetNbinsX();
k++) {
456 if(hhcorrbg[i]->GetBinLowEdge(
k)<statscale_lowlim || (hhcorrbg[
i]->GetBinLowEdge(
k)+hhcorrbg[
i]->GetBinWidth(
k))>statscale_uplim) {
457 hhcorrbg_scaled[
i]->SetBinContent(
k,0.);
458 hhcorrbg_scaled[
i]->SetBinError(
k,0.);
461 double tmp = corrbg_corr_60pct * statscale * hhcorrbg[
i]->GetFunction(
"expo")->Eval(hhcorrbg[i]->GetBinCenter(
k));
462 double tmprnd = myrandom->Poisson(tmp);
463 if(tmprnd<0.) { tmprnd=0.; }
464 hhcorrbg_scaled[
i]->SetBinContent(
k,tmprnd);
465 hhcorrbg_scaled[
i]->SetBinError(
k,sqrt(tmprnd));
468 hhcorrbg_scaled[
i]->Fit(
"expo",
"rql",
"",statscale_lowlim,statscale_uplim);
469 hhcorrbg[
i]->SetDirectory(gROOT);
470 hhcorrbg_scaled[
i]->SetDirectory(gROOT);
474 TCanvas*
c2 =
new TCanvas(
"c2",
"Correlated BG (all p_{T})",100,100,600,600);
476 hhbottom[
nbins]->SetAxisRange(7.0,14.0);
477 hhbottom[
nbins]->SetLineColor(kBlue);
478 hhbottom[
nbins]->SetLineWidth(2);
480 hhbottom[
nbins]->GetXaxis()->SetTitle(
"Invariant mass [GeV/c^{2}]");
481 hhbottom[
nbins]->GetXaxis()->SetTitleOffset(1.0);
482 hhbottom[
nbins]->GetXaxis()->SetTitleColor(1);
483 hhbottom[
nbins]->GetXaxis()->SetTitleSize(0.040);
484 hhbottom[
nbins]->GetXaxis()->SetLabelSize(0.040);
486 hhbottom[
nbins]->GetYaxis()->SetTitleOffset(1.3);
487 hhbottom[
nbins]->GetYaxis()->SetTitleSize(0.040);
488 hhbottom[
nbins]->GetYaxis()->SetLabelSize(0.040);
490 hhcorrbg[
nbins]->SetAxisRange(7.0,14.0);
491 hhcorrbg[
nbins]->SetMinimum(0.1);
492 hhcorrbg[
nbins]->SetLineColor(kBlack);
493 hhcorrbg[
nbins]->SetLineWidth(2);
494 hhcorrbg[
nbins]->Draw(
"hist");
496 hhbottom[
nbins]->SetMarkerColor(kBlue);
497 hhbottom[
nbins]->SetLineColor(kBlue);
498 hhbottom[
nbins]->Draw(
"same");
500 hhdy[
nbins]->SetMarkerColor(kGreen+2);
501 hhdy[
nbins]->SetLineColor(kGreen+2);
502 hhdy[
nbins]->SetLineWidth(2);
503 hhdy[
nbins]->Draw(
"same");
505 hhcharm[
nbins]->SetMarkerColor(kRed);
506 hhcharm[
nbins]->SetLineColor(kRed);
507 hhcharm[
nbins]->SetLineWidth(2);
508 hhcharm[
nbins]->Draw(
"same");
510 TCanvas* c0 =
new TCanvas(
"c0",
"Correlated BG vs. p_{T} 10B events",100,100,1200,900);
514 hhcorrbg[
i]->SetAxisRange(7.,14.);
515 hhcorrbg[
i]->GetFunction(
"expo")->SetLineColor(kBlack);
516 hhbottom[
i]->GetFunction(
"expo")->SetLineColor(kBlue);
517 hhdy[
i]->GetFunction(
"expo")->SetLineColor(kGreen+2);
518 hhcorrbg[
i]->SetLineColor(kBlack);
519 hhbottom[
i]->SetLineColor(kBlue);
520 hhdy[
i]->SetLineColor(kGreen+2);
522 hhbottom[
i]->Draw(
"same");
523 hhdy[
i]->Draw(
"same");
524 sprintf(tlchar,
"%d-%d GeV",
i,
i+1); tl[
i] =
new TLatex(8.0,hhcorrbg[
i]->GetMaximum()*0.95,tlchar); tl[
i]->Draw();
527 TCanvas* c0scaled =
new TCanvas(
"c0scaled",
"SCALED Correlated BG vs. p_{T}",100,100,1200,900);
528 c0scaled->Divide(4,3);
531 hhcorrbg_scaled[
i]->SetAxisRange(7.0,14.0); hhcorrbg_scaled[
i]->Draw();
532 sprintf(tlchar,
"%d-%d GeV",
i,
i+1); tl[
i] =
new TLatex(8.0,hhcorrbg_scaled[
i]->GetMaximum()*0.95,tlchar); tl[
i]->Draw();
539 TH1D* hhbottom_pp[nbins+1];
540 TH1D* hhdy_pp[nbins+1];
541 TH1D* hhcorrbg_pp[nbins+1];
542 TH1D* hhall_pp[nbins+1];
544 TF1* fbottom_nosup_corr =
new TF1(
"fbottom_nosup_corr",
"[0]+[1]*x",5.,14.);
545 fbottom_nosup_corr->SetParameters(-2.13861, 0.683323);
547 for(
int i=0;
i<nbins+1;
i++) {
549 sprintf(tmpname,
"hhbottom_pp_%d",
i);
550 hhbottom_pp[
i] = (TH1D*)hhbottom[
i]->Clone(tmpname);
551 for(
int k=1;
k<=hhbottom_pp[
i]->GetNbinsX();
k++) {
552 if(hhbottom_pp[
i]->GetBinLowEdge(
k)<statscale_lowlim || (hhbottom_pp[
i]->GetBinLowEdge(
k)+hhbottom_pp[
i]->GetBinWidth(
k))>statscale_uplim) {
553 hhbottom_pp[
i]->SetBinContent(
k,0.);
554 hhbottom_pp[
i]->SetBinError(
k,0.);
557 double tmp = corrbg_corr_60pct * ppcorr * fbottom_nosup_corr->Eval(hhbottom[
i]->GetBinCenter(
k)) * hhbottom[
i]->GetFunction(
"expo")->Eval(hhbottom[
i]->GetBinCenter(
k));
558 double tmprnd = myrandom->Poisson(tmp);
559 if(tmprnd<0.) { tmprnd=0.; }
560 hhbottom_pp[
i]->SetBinContent(
k,tmprnd);
561 hhbottom_pp[
i]->SetBinError(
k,sqrt(tmprnd));
565 sprintf(tmpname,
"hhdy_pp_%d",
i);
566 hhdy_pp[
i] = (TH1D*)hhdy[
i]->Clone(tmpname);
567 for(
int k=1;
k<=hhdy_pp[
i]->GetNbinsX();
k++) {
568 if(hhdy_pp[
i]->GetBinLowEdge(
k)<statscale_lowlim || (hhdy_pp[
i]->GetBinLowEdge(
k)+hhdy_pp[
i]->GetBinWidth(
k))>statscale_uplim) {
569 hhdy_pp[
i]->SetBinContent(
k,0.);
570 hhdy_pp[
i]->SetBinError(
k,0.);
573 double tmp = ppcorr * hhdy[
i]->GetFunction(
"expo")->Eval(hhdy[
i]->GetBinCenter(
k));
574 double tmprnd = myrandom->Poisson(tmp);
575 if(tmprnd<0.) { tmprnd=0.; }
576 hhdy_pp[
i]->SetBinContent(
k,tmprnd);
577 hhdy_pp[
i]->SetBinError(
k,sqrt(tmprnd));
581 sprintf(tmpname,
"hhcorrbg_pp_%d",
i);
582 hhcorrbg_pp[
i] = (TH1D*)hhbottom_pp[
i]->Clone(tmpname);
583 hhcorrbg_pp[
i]->Add(hhdy_pp[
i]);
584 hhcorrbg_pp[
i]->SetMarkerColor(kBlack);
585 hhcorrbg_pp[
i]->SetLineColor(kBlack);
586 hhbottom_pp[
i]->SetLineColor(kBlue);
587 hhdy_pp[
i]->SetLineColor(kGreen+2);
588 sprintf(tmpname,
"hhall_pp_%d",i);
589 hhall_pp[
i] = (TH1D*)hhcorrbg_pp[i]->Clone(tmpname);
590 hhall_pp[
i]->Add(hhupspp[i]);
591 hhall_pp[
i]->SetLineColor(kMagenta);
592 hhall_pp[
i]->SetMarkerColor(kMagenta);
594 hhcorrbg_pp[
i]->Fit(
"expo",
"rql",
"",statscale_lowlim,statscale_uplim);
595 hhcorrbg_pp[
i]->GetFunction(
"expo")->SetLineColor(kBlack);
596 hhbottom_pp[
i]->Fit(
"expo",
"rql",
"",statscale_lowlim,statscale_uplim);
597 hhbottom_pp[
i]->GetFunction(
"expo")->SetLineColor(kBlue);
598 hhdy_pp[
i]->Fit(
"expo",
"rql",
"",statscale_lowlim,statscale_uplim);
599 hhdy_pp[
i]->GetFunction(
"expo")->SetLineColor(kGreen+2);
603 TCanvas* cbginpp =
new TCanvas(
"cbginpp",
"corr bg in pp",10,10,700,700);
604 hhall_pp[
nbins]->SetAxisRange(7.,12.);
605 hhcorrbg_pp[
nbins]->Draw(
"pehist");
606 hhbottom_pp[
nbins]->Draw(
"histsame");
607 hhdy_pp[
nbins]->Draw(
"histsame");
610 TCanvas* cpp =
new TCanvas(
"cpp",
"corr bg + sig in pp",100,100,700,700);
611 hhall_pp[
nbins]->SetAxisRange(7.,12.);
612 hhall_pp[
nbins]->Draw(
"pehist");
613 hhcorrbg_pp[
nbins]->Draw(
"pesame");
614 hhbottom_pp[
nbins]->Draw(
"same");
615 hhdy_pp[
nbins]->Draw(
"same");
617 TCanvas* cpp_vspt =
new TCanvas(
"cpp_vspt",
"corr bg + sig vs pt in pp",50,50,1200,900);
618 cpp_vspt->Divide(4,3);
621 hhall_pp[
i]->SetAxisRange(7.0,12.0); hhall_pp[
i]->Draw(
"hist"); hhcorrbg_pp[
i]->Draw(
"histsame");
622 sprintf(tlchar,
"%d-%d GeV",
i,
i+1); tl[
i] =
new TLatex(8.0,hhcorrbg_pp[
i]->GetMaximum()*0.95,tlchar); tl[
i]->Draw();
628 TCanvas* cdummy =
new TCanvas(
"cdummy",
"cdummy",0,0,500,500);
630 f =
new TFile(
"fakee_eideff09.root");
631 for(
int i=0;
i<nbins+1;
i++) {
632 sprintf(tmpname,
"hhfakefake_%d",
i);
633 hhfakefake[
i] = (TH1D*)f->Get(tmpname);
634 hhfakefake[
i]->SetDirectory(gROOT);
638 f =
new TFile(
"crossterms_eideff09.root");
639 for(
int i=0;
i<nbins+1;
i++) {
640 sprintf(tmpname,
"hhfakehf_%d",
i);
641 hhfakehf[
i] = (TH1D*)f->Get(tmpname);
642 hhfakehf[
i]->SetDirectory(gROOT);
646 TF1* fbg =
new TF1(
"fbg",
"exp([0]+[1]*x)+exp([2]+[3]*x)",8.,11.);
647 fbg->SetParameters(10., -1.0, 4., -0.1);
648 fbg->SetParLimits(1.,-999.,0.);
649 fbg->SetParLimits(3.,-999.,0.);
651 for(
int i=0;
i<nbins+1;
i++) {
652 sprintf(tmpname,
"hhcombbg_%d",
i);
653 hhcombbg[
i] = (TH1D*)hhfakefake[
i]->Clone(tmpname);
654 hhcombbg[
i]->Add(hhfakehf[
i]);
655 sprintf(tmpname,
"hhcombbg_scaled_%d",i);
656 hhcombbg_scaled[
i] = (TH1D*)hhcombbg[i]->Clone(tmpname);
657 if(i==nbins) { fbg->SetParameters(10., -1.0, 4., -0.1); }
658 hhcombbg[
i]->Fit(fbg,
"qrl",
"",statscale_lowlim,statscale_uplim);
660 for(
int k=1;
k<=hhcombbg[
i]->GetNbinsX();
k++) {
661 if(hhcombbg[i]->GetBinLowEdge(
k)<statscale_lowlim || (hhcombbg[
i]->GetBinLowEdge(
k)+hhcombbg[
i]->GetBinWidth(
k))>statscale_uplim) {
662 hhcombbg_scaled[
i]->SetBinContent(
k,0.);
663 hhcombbg_scaled[
i]->SetBinError(
k,0.);
666 double tmp = combbg_corr_60pct * statscale * hhcombbg[
i]->GetFunction(
"fbg")->Eval(hhcombbg[i]->GetBinCenter(
k));
667 double tmprnd = myrandom->Poisson(tmp);
668 if(tmprnd<0.) { tmprnd=0.; }
669 hhcombbg_scaled[
i]->SetBinContent(
k,tmprnd);
670 hhcombbg_scaled[
i]->SetBinError(
k,sqrt(tmprnd));
673 hhcombbg_scaled[
i]->Fit(fbg,
"qrl",
"",statscale_lowlim,statscale_uplim);
678 TCanvas* C1 =
new TCanvas(
"C1",
"Combinatorial BG (ALL p_{T})",100,100,600,600);
680 hhfakefake[
nbins]->SetAxisRange(7.0,14.0);
681 hhfakefake[
nbins]->SetMinimum(0.1);
682 hhfakefake[
nbins]->SetMaximum(5000.);
683 hhfakefake[
nbins]->SetLineColor(kGreen+2);
684 hhfakefake[
nbins]->SetLineWidth(2);
685 hhfakefake[
nbins]->GetXaxis()->SetTitle(
"Transverse momentum [GeV/c]");
686 hhfakefake[
nbins]->GetXaxis()->SetTitleOffset(1.0);
687 hhfakefake[
nbins]->GetXaxis()->SetTitleColor(1);
688 hhfakefake[
nbins]->GetXaxis()->SetTitleSize(0.040);
689 hhfakefake[
nbins]->GetXaxis()->SetLabelSize(0.040);
690 hhfakefake[
nbins]->GetYaxis()->SetTitle(
"Combinatorial background");
691 hhfakefake[
nbins]->GetYaxis()->SetTitleOffset(1.3);
692 hhfakefake[
nbins]->GetYaxis()->SetTitleSize(0.040);
693 hhfakefake[
nbins]->GetYaxis()->SetLabelSize(0.040);
694 hhfakefake[
nbins]->Draw(
"e");
696 hhfakehf[
nbins]->SetLineColor(kOrange+4);
697 hhfakehf[
nbins]->SetLineWidth(2);
698 hhfakehf[
nbins]->Draw(
"esame");
700 hhcombbg[
nbins]->SetLineColor(kBlack);
701 hhcombbg[
nbins]->SetLineWidth(2);
702 hhcombbg[
nbins]->Draw(
"esame");
704 TCanvas* C1sc =
new TCanvas(
"C1sc",
"SCALED Combinatorial BG (ALL p_{T})",100,100,600,600);
706 hhcombbg_scaled[
nbins]->SetAxisRange(7.,14.);
707 hhcombbg_scaled[
nbins]->Draw(
"esame");
709 TCanvas* c00 =
new TCanvas(
"c00",
"Combinatorial BG vs. p_{T}",150,150,1200,900);
714 hhcombbg[
i]->SetAxisRange(7.0,14.0); hhcombbg[
i]->Draw();
715 sprintf(tlchar,
"%d-%d GeV",
i,
i+1); tl[
i] =
new TLatex(8.0,hhcombbg[
i]->GetMaximum()*0.95,tlchar); tl[
i]->Draw();
718 TCanvas* c00scaled =
new TCanvas(
"c00scaled",
"SCALED Combinatorial BG vs. p_{T}",150,150,1200,900);
719 c00scaled->Divide(4,3);
723 hhcombbg_scaled[
i]->SetAxisRange(statscale_lowlim,statscale_uplim); hhcombbg_scaled[
i]->Draw();
724 sprintf(tlchar,
"%d-%d GeV",
i,
i+1); tl[
i] =
new TLatex(8.0,hhcombbg_scaled[
i]->GetMaximum()*0.95,tlchar); tl[
i]->Draw();
731 for(
int i=0;
i<nbins+1;
i++) {
732 sprintf(tmpname,
"hhtotbg_scaled_%d",
i);
733 hhtotbg_scaled[
i] = (TH1D*)hhcombbg_scaled[
i]->Clone(tmpname);
734 hhtotbg_scaled[
i]->Add(hhcorrbg_scaled[
i]);
737 for(
int i=0;
i<nbins+1;
i++) {
738 sprintf(tmpname,
"hhall_scaled_%d",
i);
739 hhall_scaled[
i] = (TH1D*)hhtotbg_scaled[
i]->Clone(tmpname);
740 hhall_scaled[
i]->Add(hhups[
i]);
743 TCanvas* c000 =
new TCanvas(
"c000",
"Signal + Background vs. p_{T}",200,200,1200,900);
747 hhall_scaled[
i]->SetAxisRange(7.0,14.0); hhall_scaled[
i]->SetMarkerStyle(1); hhall_scaled[
i]->Draw(
"pehist");
748 sprintf(tlchar,
"%d-%d GeV",
i,
i+1); tl[
i] =
new TLatex(8.0,hhall_scaled[
i]->GetMaximum()*0.9,tlchar); tl[
i]->Draw();
754 for(
int i=0;
i<nbins+1;
i++) {
755 sprintf(tmpname,
"hhfit_%d",
i);
756 hhfit[
i] = (TH1D*)hhall_scaled[
i]->Clone(tmpname);
757 for(
int j=1;
j<=hhall_scaled[
i]->GetNbinsX();
j++) {
758 hhfit[
i]->SetBinContent(
j,hhfit[
i]->GetBinContent(
j) - hhcombbg_scaled[
i]->GetFunction(
"fbg")->Eval(hhcombbg_scaled[
i]->GetBinCenter(
j)));
759 hhfit[
i]->SetBinError(
j,sqrt(pow(hhfit[
i]->GetBinError(
j),2)+hhcombbg_scaled[
i]->GetFunction(
"fbg")->Eval(hhcombbg_scaled[
i]->GetBinCenter(
j))));
767 double tmppar0 = corrbgfitpar0+
TMath::Log(statscale);
768 double tmppar1 = corrbgfitpar1;
771 double ppauauscale = fTCBauau->GetParameter(0)/fTCBpp->GetParameter(0)*0.9783;
772 fSandBpp->SetParameter(0,fTCBpp->GetParameter(0)*ppauauscale);
773 fSandBpp->SetParameter(1,fTCBpp->GetParameter(1));
774 fSandBpp->SetParameter(2,fTCBpp->GetParameter(2));
775 fSandBpp->SetParameter(3,fTCBpp->GetParameter(3));
776 fSandBpp->SetParameter(4,fTCBpp->GetParameter(4));
777 fSandBpp->SetParameter(5,fTCBpp->GetParameter(5)*ppauauscale);
778 fSandBpp->SetParameter(6,fTCBpp->GetParameter(6)*ppauauscale);
779 fSandBpp->SetParameter(7,tmppar0);
780 fSandBpp->SetParameter(8,tmppar1);
781 fSandBpp->SetLineColor(kBlue);
782 fSandBpp->SetLineStyle(2);
785 fSandBauau->SetParameter(0,fTCBauau->GetParameter(0));
786 fSandBauau->SetParameter(1,fTCBauau->GetParameter(1));
787 fSandBauau->SetParameter(2,fTCBauau->GetParameter(2));
788 fSandBauau->SetParameter(3,fTCBauau->GetParameter(3));
789 fSandBauau->SetParameter(4,fTCBauau->GetParameter(4));
790 fSandBauau->SetParameter(5,fTCBauau->GetParameter(5));
791 fSandBauau->SetParameter(6,fTCBauau->GetParameter(6));
792 fSandBauau->SetParameter(7,tmppar0);
793 fSandBauau->SetParameter(8,tmppar1);
794 fSandBauau->SetLineColor(kRed);
797 TCanvas*
cfitall =
new TCanvas(
"cfitall",
"FIT all pT",270,270,600,600);
798 hhfit[
nbins]->SetAxisRange(7.0,14.);
799 hhfit[
nbins]->GetXaxis()->CenterTitle();
800 hhfit[
nbins]->GetXaxis()->SetTitle(
"Mass(e^{+}e^{-}) [GeV/c^2]");
801 hhfit[
nbins]->GetXaxis()->SetTitleOffset(1.1);
802 hhfit[
nbins]->GetXaxis()->SetLabelSize(0.045);
803 hhfit[
nbins]->GetYaxis()->CenterTitle();
804 hhfit[
nbins]->GetYaxis()->SetLabelSize(0.045);
805 hhfit[
nbins]->GetYaxis()->SetTitle(
"Events / (50 MeV/c^{2})");
806 hhfit[
nbins]->GetYaxis()->SetTitleOffset(1.5);
807 hhfit[
nbins]->Draw(
"pehist");
808 fSandBpp->Draw(
"same");
809 fSandBauau->Draw(
"same");
815 TF1*
fmycorrbg =
new TF1(
"fmycorrbg",
"exp([0]+[1]*x)",7.,14.);
816 fmycorrbg->SetParameters(tmppar0,tmppar1);
817 fmycorrbg->SetLineStyle(2);
818 fmycorrbg->SetLineColor(kRed);
819 fmycorrbg->Draw(
"same");
822 double myheight = fTCBauau->GetParameter(0);
823 TLatex* ld1 =
new TLatex(10.1,myheight,
"sPHENIX Simulation");
824 ld1->SetTextSize(0.035);
826 TLatex* ld2 =
new TLatex(10.1,myheight-100.,
"0-10% Au+Au #sqrt{s} = 200 GeV");
827 ld2->SetTextSize(0.035);
830 TCanvas* cfitall2 =
new TCanvas(
"cfitall2",
"FIT all pT",270,270,600,600);
831 TH1D* hhfit_tmp = (TH1D*)hhfit[nbins]->Clone(
"hhfit_tmp");
832 hhfit_tmp->SetAxisRange(8.0,11.);
833 hhfit_tmp->Draw(
"pehist");
834 fSandBauau->Draw(
"same");
835 fmycorrbg->Draw(
"same");
842 TCanvas* callpt =
new TCanvas(
"callpt",
"Signal+BG (all p_{T})",300,300,600,600);
844 hhall_scaled[
nbins]->GetXaxis()->SetTitle(
"Invariant mass GeV/c");
845 hhall_scaled[
nbins]->SetLineColor(kBlack);
846 hhall_scaled[
nbins]->SetMarkerColor(kBlack);
847 hhall_scaled[
nbins]->SetMarkerStyle(20);
848 hhall_scaled[
nbins]->SetAxisRange(8.0,10.8);
849 hhall_scaled[
nbins]->Draw(
"pehist");
850 hhcombbg_scaled[
nbins]->SetLineColor(kBlue);
851 hhcombbg_scaled[
nbins]->Draw(
"histsame");
852 hhcorrbg_scaled[
nbins]->SetLineColor(kRed);
853 hhcorrbg_scaled[
nbins]->Draw(
"histsame");
859 double u1start = 9.25;
860 double u1stop = 9.65;
861 double u2start = 9.80;
862 double u2stop = 10.20;
863 double u3start = 10.20;
864 double u3stop = 10.55;
866 double raa1[nbins+1],raa2[nbins+1],raa3[nbins+1],erraa1[nbins+1],erraa2[nbins+1],erraa3[nbins+1];
868 raa1[
i] = grRAA1S->Eval(0.5+
i*1.0);
869 raa2[
i] = grRAA2S->Eval(0.5+
i*1.0);
870 raa3[
i] = grRAA3S->Eval(0.5+
i*1.0);
872 int fbin1 = hhall_scaled[
nbins]->FindBin(u1start + 0.001);
873 int lbin1 = hhall_scaled[
nbins]->FindBin(u1stop - 0.001);
874 int fbin2 = hhall_scaled[
nbins]->FindBin(u2start + 0.001);
875 int lbin2 = hhall_scaled[
nbins]->FindBin(u2stop - 0.001);
876 int fbin3 = hhall_scaled[
nbins]->FindBin(u3start + 0.001);
877 int lbin3 = hhall_scaled[
nbins]->FindBin(u3stop - 0.001);
878 cout <<
"Y(1S) bin range: " << fbin1 <<
" - " << lbin1 << endl;
879 cout <<
"Y(1S) inv. mass range: " << u1start <<
" - " << u1stop << endl;
880 cout <<
"Y(2S) bin range: " << fbin2 <<
" - " << lbin2 << endl;
881 cout <<
"Y(2S) inv. mass range: " << u2start <<
" - " << u2stop << endl;
882 cout <<
"Y(3S) bin range: " << fbin3 <<
" - " << lbin3 << endl;
883 cout <<
"Y(3S) inv. mass range: " << u3start <<
" - " << u3stop << endl;
885 double sum1[99] = {0.};
886 double truesum1[99] = {0.};
887 double ersum1[99] = {0.};
888 double sumpp1[99] = {0.};
889 double ersumpp1[99] = {0.};
890 double sum2[99] = {0.};
891 double truesum2[99] = {0.};
892 double ersum2[99] = {0.};
893 double sumpp2[99] = {0.};
894 double ersumpp2[99] = {0.};
895 double sum3[99] = {0.};
896 double truesum3[99] = {0.};
897 double ersum3[99] = {0.};
898 double sumpp3[99] = {0.};
899 double ersumpp3[99] = {0.};
901 double sumsum1[99] = {0.};
902 double sumsum2[99] = {0.};
903 double sumsum3[99] = {0.};
904 double sumsum1pp[99] = {0.};
905 double sumsum2pp[99] = {0.};
906 double sumsum3pp[99] = {0.};
908 for(
int i=0;
i<nbins+1;
i++) {
910 double s1 =
double(
i);
double s2 =
double(
i+1);
if(
i==nbins) {s1 = 0.;}
912 for(
int j=fbin1;
j<=lbin1;
j++) {
913 sum1[
i] += (hhall_scaled[
i]->GetBinContent(
j) - hhcombbg_scaled[
i]->GetFunction(
"fbg")->Eval(hhall_scaled[
i]->GetBinCenter(
j)) - hhcorrbg_scaled[
i]->GetFunction(
"expo")->Eval(hhall_scaled[
i]->GetBinCenter(
j)));
914 truesum1[
i] += hhups1[
i]->GetBinContent(
j);
915 ersum1[
i] += hhall_scaled[
i]->GetBinError(
j)*hhall_scaled[
i]->GetBinError(
j);
916 sumpp1[
i] += hhups1pp[
i]->GetBinContent(
j);
917 ersumpp1[
i] += hhupspp[
i]->GetBinError(
j)*hhupspp[
i]->GetBinError(
j);
919 sumsum1[
i] = truesum1[
i];
920 sumsum1pp[
i] = sumpp1[
i];
926 if(sumsum1[
i]>0. && sumsum1pp[
i]>0.) {
927 erraa1[
i] = raa1[
i]*sqrt(ersum1[
i]/sumsum1[
i]/sumsum1[
i] + ersumpp1[
i]/sumsum1pp[
i]/sumsum1pp[
i]);
928 }
else {raa1[
i]=-1.0; erraa1[
i] = 999.; }
930 for(
int j=fbin2;
j<=lbin2;
j++) {
931 sum2[
i] += (hhall_scaled[
i]->GetBinContent(
j) - hhcombbg_scaled[
i]->GetFunction(
"fbg")->Eval(hhall_scaled[
i]->GetBinCenter(
j)) - hhcorrbg_scaled[
i]->GetFunction(
"expo")->Eval(hhall_scaled[
i]->GetBinCenter(
j)));
932 truesum2[
i] += hhups2[
i]->GetBinContent(
j);
933 ersum2[
i] += hhall_scaled[
i]->GetBinError(
j)*hhall_scaled[
i]->GetBinError(
j);
934 sumpp2[
i] += hhups2pp[
i]->GetBinContent(
j);
935 ersumpp2[
i] += hhupspp[
i]->GetBinError(
j)*hhupspp[
i]->GetBinError(
j);
937 sumsum2[
i] = truesum2[
i];
938 sumsum2pp[
i] = sumpp2[
i];
944 if(sumsum2[
i]>0. && sumsum2pp[
i]>0.) {
945 erraa2[
i] = raa2[
i]*sqrt(ersum2[
i]/sumsum2[
i]/sumsum2[
i] + ersumpp2[
i]/sumsum2pp[
i]/sumsum2pp[
i]);
946 }
else {raa2[
i]=-1.0; erraa2[
i] = 999.; }
948 for(
int j=fbin3;
j<=lbin3;
j++) {
949 sum3[
i] += (hhall_scaled[
i]->GetBinContent(
j) - hhcombbg_scaled[
i]->GetFunction(
"fbg")->Eval(hhall_scaled[
i]->GetBinCenter(
j)) - hhcorrbg_scaled[
i]->GetFunction(
"expo")->Eval(hhall_scaled[
i]->GetBinCenter(
j)));
950 truesum3[
i] += hhups3[
i]->GetBinContent(
j);
951 ersum3[
i] += hhall_scaled[
i]->GetBinError(
j)*hhall_scaled[
i]->GetBinError(
j);
952 sumpp3[
i] += hhups3pp[
i]->GetBinContent(
j);
953 ersumpp3[
i] += hhupspp[
i]->GetBinError(
j)*hhupspp[
i]->GetBinError(
j);
955 sumsum3[
i] = truesum3[
i];
956 sumsum3pp[
i] = sumpp3[
i];
962 if(truesum3[
i]>0. && sumpp3[
i]>0.) {
963 erraa3[
i] = raa3[
i]*sqrt(ersum3[
i]/sumsum3[
i]/sumsum3[
i] + ersumpp3[
i]/sumsum3pp[
i]/sumsum3pp[
i]);
964 }
else {raa3[
i]=-1.0; erraa3[
i] = 999.; }
968 double raa2_rebin[9],raapt_rebin2[9],erraa2_rebin[9];
969 double raa3_rebin[9],raapt_rebin3[9],erraa3_rebin[9];
970 double sum2_rebin[9],ersum2_rebin[9],sum2pp_rebin[9],ersumpp2_rebin[9];
971 double sum3_rebin[9],ersum3_rebin[9],sum3pp_rebin[9],ersumpp3_rebin[9];
975 raapt_rebin3[0] = 1.;
976 raapt_rebin3[1] = 3.;
977 raapt_rebin3[2] = 5.;
978 raapt_rebin3[3] = 7.;
979 raa3_rebin[0] = grRAA3S->Eval(raapt_rebin2[0]);
980 raa3_rebin[1] = grRAA3S->Eval(raapt_rebin2[1]);
981 raa3_rebin[2] = grRAA3S->Eval(raapt_rebin2[2]);
982 raa3_rebin[3] = grRAA3S->Eval(raapt_rebin2[3]);
983 sum3_rebin[0] = truesum3[0]+truesum3[1];
984 sum3_rebin[1] = truesum3[2]+truesum3[3];
985 sum3_rebin[2] = truesum3[4]+truesum3[5];
986 sum3_rebin[3] = truesum3[6]+truesum3[7]+truesum3[8]+truesum3[9];
987 ersum3_rebin[0] = ersum3[0]+ersum3[1];
988 ersum3_rebin[1] = ersum3[2]+ersum3[3];
989 ersum3_rebin[2] = ersum3[4]+ersum3[5];
990 ersum3_rebin[3] = ersum3[6]+ersum3[7]+ersum3[8]+ersum3[9];
991 sum3pp_rebin[0] = sumpp3[0]+sumpp3[1];
992 sum3pp_rebin[1] = sumpp3[2]+sumpp3[3];
993 sum3pp_rebin[2] = sumpp3[4]+sumpp3[5];
994 sum3pp_rebin[3] = sumpp3[6]+sumpp3[7]+sumpp3[8]+sumpp3[9];
995 ersumpp3_rebin[0] = ersumpp3[0]+ersumpp3[1];
996 ersumpp3_rebin[1] = ersumpp3[2]+ersumpp3[3];
997 ersumpp3_rebin[2] = ersumpp3[4]+ersumpp3[5];
998 ersumpp3_rebin[3] = ersumpp3[6]+ersumpp3[7]+ersumpp3[8]+ersumpp3[9];
999 erraa3_rebin[0] = raa3[0]*sqrt(ersum3_rebin[0]/sum3_rebin[0]/sum3_rebin[0] + ersumpp3_rebin[0]/sum3pp_rebin[0]/sum3pp_rebin[0]);
1000 erraa3_rebin[1] = raa3[1]*sqrt(ersum3_rebin[1]/sum3_rebin[1]/sum3_rebin[1] + ersumpp3_rebin[1]/sum3pp_rebin[1]/sum3pp_rebin[1]);
1001 erraa3_rebin[2] = raa3[2]*sqrt(ersum3_rebin[2]/sum3_rebin[2]/sum3_rebin[2] + ersumpp3_rebin[2]/sum3pp_rebin[2]/sum3pp_rebin[2]);
1002 erraa3_rebin[3] = raa3[3]*sqrt(ersum3_rebin[3]/sum3_rebin[3]/sum3_rebin[3] + ersumpp3_rebin[3]/sum3pp_rebin[3]/sum3pp_rebin[3]);
1004 else if(npts3_rebin==2) {
1006 raapt_rebin3[0] = 2.;
1007 raapt_rebin3[1] = 6.;
1008 raa3_rebin[0] = grRAA3S->Eval(raapt_rebin3[0]);
1009 raa3_rebin[1] = grRAA3S->Eval(raapt_rebin3[1]);
1010 sum3_rebin[0] = truesum3[0]+truesum3[1]+truesum3[2]+truesum3[3];
1011 sum3_rebin[1] = truesum3[4]+truesum3[5]+truesum3[6]+truesum3[7]+truesum3[8]+truesum3[9];
1012 ersum3_rebin[0] = ersum3[0]+ersum3[1]+ersum3[2]+ersum3[3];
1013 ersum3_rebin[1] = ersum3[4]+ersum3[5]+ersum3[6]+ersum3[7]+ersum3[8]+ersum3[9];
1014 sum3pp_rebin[0] = sumpp3[0]+sumpp3[1]+sumpp3[3]+sumpp3[3];
1015 sum3pp_rebin[1] = sumpp3[4]+sumpp3[5]+sumpp3[6]+sumpp3[7]+sumpp3[8]+sumpp3[9];
1016 ersumpp3_rebin[0] = ersumpp3[0]+ersumpp3[1]+ersumpp3[2]+ersumpp3[3];
1017 ersumpp3_rebin[1] = ersumpp3[4]+ersumpp3[5]+ersumpp3[6]+ersumpp3[7]+ersumpp3[8]+ersumpp3[9];
1018 erraa3_rebin[0] = raa3[0]*sqrt(ersum3_rebin[0]/sum3_rebin[0]/sum3_rebin[0] + ersumpp3_rebin[0]/sum3pp_rebin[0]/sum3pp_rebin[0]);
1019 erraa3_rebin[1] = raa3[1]*sqrt(ersum3_rebin[1]/sum3_rebin[1]/sum3_rebin[1] + ersumpp3_rebin[1]/sum3pp_rebin[1]/sum3pp_rebin[1]);
1021 else if(npts3_rebin==1) {
1023 raa3_rebin[0] = grRAA3S->Eval(raapt_rebin3[0]);
1024 sum3_rebin[0] = truesum3[0]+truesum3[1]+truesum3[2]+truesum3[3]+
1025 truesum3[4]+truesum3[5]+truesum3[6]+truesum3[7]+truesum3[8]+truesum3[9];
1026 ersum3_rebin[0] = ersum3[0]+ersum3[1]+ersum3[2]+ersum3[3]+
1027 ersum3[4]+ersum3[5]+ersum3[6]+ersum3[7]+ersum3[8]+ersum3[9];
1028 sum3pp_rebin[0] = sumpp3[0]+sumpp3[1]+sumpp3[3]+sumpp3[3]+
1029 sumpp3[4]+sumpp3[5]+sumpp3[6]+sumpp3[7]+sumpp3[8]+sumpp3[9];
1030 ersumpp3_rebin[0] = ersumpp3[0]+ersumpp3[1]+ersumpp3[2]+ersumpp3[3]+
1031 ersumpp3[4]+ersumpp3[5]+ersumpp3[6]+ersumpp3[7]+ersumpp3[8]+ersumpp3[9];
1032 erraa3_rebin[0] = raa3[0]*sqrt(ersum3_rebin[0]/sum3_rebin[0]/sum3_rebin[0] + ersumpp3_rebin[0]/sum3pp_rebin[0]/sum3pp_rebin[0]);
1033 }
else {cerr <<
"ERROR: Wring Y(3S) binning." << endl;
return;}
1035 cout <<
"====== Y(1S):" << endl;
1036 for(
int i=0;
i<nbins+1;
i++) {
1037 double s1 =
double(
i);
double s2 =
double(
i+1);
if(
i==nbins) {s1 = 0.;}
1038 cout <<
" " <<
i <<
" " << truesum1[
i] <<
"(" << Nups1*fUpsilonPt->Integral(s1,s2)/upsnorm <<
")" <<
" +- "
1039 << sqrt(ersum1[
i]) <<
" \t\t pp: " << sumpp1[
i] <<
" +- " << sqrt(ersumpp1[i]) << endl;
1041 cout <<
"====== Y(2S):" << endl;
1042 for(
int i=0;
i<nbins+1;
i++) {
1043 double s1 =
double(
i);
double s2 =
double(
i+1);
if(
i==nbins) {s1 = 0.;}
1044 cout <<
" " <<
i <<
" " << truesum2[
i] <<
"(" << Nups2*fUpsilonPt->Integral(s1,s2)/upsnorm <<
")" <<
" +- "
1045 << sqrt(ersum2[
i]) <<
" \t\t pp: " << sumpp2[
i] <<
" +- " << sqrt(ersumpp2[i]) << endl;
1047 cout <<
"====== Y(3S):" << endl;
1048 for(
int i=0;
i<nbins+1;
i++) {
1050 double s1 =
double(
i);
double s2 =
double(
i+1);
if(
i==nbins) {s1 = 0.;}
1051 cout <<
" " <<
i <<
" " << truesum3[
i] <<
"(" << Nups3*fUpsilonPt->Integral(s1,s2)/upsnorm <<
")" <<
" +- "
1052 << sqrt(ersum3[
i]) <<
" \t\t pp: " << sumpp3[
i] <<
" +- " << sqrt(ersumpp3[i]) << endl;
1059 TCanvas* craa =
new TCanvas(
"craa",
"R_{AA}",120,120,850,600);
1060 TH2F* hh2 =
new TH2F(
"hh2",
" ",10,0.,
float(npts1),10,0.,1.1);
1061 hh2->GetXaxis()->SetTitle(
"Transverse momentum [GeV/c]");
1062 hh2->GetXaxis()->SetTitleOffset(1.0);
1063 hh2->GetXaxis()->SetTitleColor(1);
1064 hh2->GetXaxis()->SetTitleSize(0.040);
1065 hh2->GetXaxis()->SetLabelSize(0.040);
1066 hh2->GetYaxis()->SetTitle(
"R_{AA}");
1067 hh2->GetYaxis()->SetTitleOffset(0.7);
1068 hh2->GetYaxis()->SetTitleSize(0.050);
1069 hh2->GetYaxis()->SetLabelSize(0.040);
1072 TGraphErrors* gr1 =
new TGraphErrors(npts1-1,xx1,raa1,0,erraa1);
1073 gr1->SetMarkerStyle(20);
1074 gr1->SetMarkerColor(kBlack);
1075 gr1->SetLineColor(kBlack);
1076 gr1->SetLineWidth(2);
1077 gr1->SetMarkerSize(1.5);
1078 gr1->SetName(
"gr1");
1081 TGraphErrors* gr2 =
new TGraphErrors(npts2-1,xx2,raa2,0,erraa2);
1082 gr2->SetMarkerStyle(20);
1083 gr2->SetMarkerColor(kRed);
1084 gr2->SetLineColor(kRed);
1085 gr2->SetLineWidth(2);
1086 gr2->SetMarkerSize(1.5);
1087 gr2->SetName(
"gr2");
1091 TGraphErrors* gr3_rebin;
1092 if(npts3_rebin==4) {
1093 gr3_rebin =
new TGraphErrors(npts3_rebin-1,xx3_rebin,raa3_rebin,0,erraa3_rebin);
1095 gr3_rebin =
new TGraphErrors(npts3_rebin,xx3_rebin,raa3_rebin,0,erraa3_rebin);
1097 gr3_rebin->SetMarkerStyle(20);
1098 gr3_rebin->SetMarkerColor(kBlue);
1099 gr3_rebin->SetLineColor(kBlue);
1100 gr3_rebin->SetLineWidth(2);
1101 gr3_rebin->SetMarkerSize(1.5);
1102 gr3_rebin->SetName(
"gr3");
1103 gr3_rebin->Draw(
"p");
1126 TLegend *
leg =
new TLegend(0.72,0.70,0.88,0.88);
1127 leg->SetBorderSize(0);
1128 leg->SetFillColor(10);
1129 leg->SetFillStyle(1001);
1130 TLegendEntry *entry1=leg->AddEntry(
"gr1",
"Y(1S)",
"p");
1131 TLegendEntry *entry2=leg->AddEntry(
"gr2",
"Y(2S)",
"p");
1133 TLegendEntry *entry3=leg->AddEntry(
"gr3",
"Y(3S)",
"p");
1136 TLatex*
l1 =
new TLatex(0.5,1.02,
"#font[72]{sPHENIX} Projection"); l1->SetTextSize(0.045); l1->SetTextFont(42); l1->Draw();
1137 TLatex* l11 =
new TLatex(0.5,0.93,
"0-60% cent. Au+Au, Years 1-3"); l11->SetTextSize(0.045); l11->SetTextFont(42); l11->Draw();
1138 TLatex*
l2 =
new TLatex(0.5,0.84,
"21 nb^{-1} rec. Au+Au, 62 pb^{-1} samp. #it{p+p}"); l2->SetTextSize(0.045); l2->SetTextFont(42); l2->Draw();
1139 TLatex* l3 =
new TLatex(1.8,0.48,
"STAR Prelim. 0-60% Y(2S+3S)"); l3->SetTextColor(kGreen+2); l3->SetTextSize(0.045); l3->SetTextFont(42); l3->Draw();
1140 TMarker* m1 =
new TMarker(1.55,0.50,29); m1->SetMarkerSize(2); m1->SetMarkerColor(kGreen+2); m1->Draw();
1142 TLine* lll =
new TLine(0.6,0.64,1.3,0.64);
1143 lll->SetLineColor(kBlue);
1144 lll->SetLineWidth(2);
1150 double star_x[3],star_erx[3],star[3],star_stater[3],star_syser[3];
1160 star_stater[0] = 0.147;
1161 star_stater[1] = 0.113;
1162 star_stater[2] = 0.164;
1163 star_syser[0] = 0.130;
1164 star_syser[1] = 0.086;
1165 star_syser[2] = 0.128;
1167 TGraphErrors* gr_star =
new TGraphErrors(3,star_x,star,0,star_stater);
1168 gr_star->SetMarkerStyle(kFullStar);
1169 gr_star->SetMarkerColor(kGreen+2);
1170 gr_star->SetLineColor(kGreen+2);
1171 gr_star->SetLineWidth(2);
1172 gr_star->SetMarkerSize(2);
1173 gr_star->SetName(
"gr_star");
1175 TGraphErrors* grsys_star =
new TGraphErrors(3,star_x,star,star_erx,star_syser);
1176 grsys_star->SetMarkerStyle(kFullStar);
1177 grsys_star->SetMarkerColor(kGreen+2);
1178 grsys_star->SetLineColor(kGreen+2);
1179 grsys_star->SetLineWidth(2);
1180 grsys_star->SetMarkerSize(2);
1181 grsys_star->SetName(
"gr_star");
1182 grsys_star->Draw(
"5");
1184 gr3_rebin->Draw(
"p");