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;
66 double mu2 = mu1*1.0595;
67 double mu3 = mu1*1.0946;
69 double A = pow(n/fabs(alpha),n)*TMath::Exp(-pow(fabs(alpha),2)/2.);
70 double B = n/fabs(alpha) - fabs(alpha);
71 double k1 = (x[0]-mu1)/sigma;
72 double k2 = (x[0]-mu2)/sigma;
73 double k3 = (x[0]-mu3)/sigma;
75 double val,val1,val2,val3;
77 if( k1 > -alpha ) { val1 = norm1*TMath::Exp(-0.5*pow(k1,2)); }
78 else { val1 = norm1*A*pow(B-k1,-n); }
79 if( k2 > -alpha ) { val2 = norm2*TMath::Exp(-0.5*pow(k2,2)); }
80 else { val2 = norm2*A*pow(B-k2,-n); }
81 if( k3 > -alpha ) { val3 = norm3*TMath::Exp(-0.5*pow(k3,2)); }
82 else { val3 = norm3*A*pow(B-k3,-n); }
84 double bgnorm1 = p[7];
85 double bgslope1 = p[8];
87 double bg = exp(bgnorm1+x[0]*bgslope1);
89 val = val1 + val2 + val3 + bg;
90 if( TMath::IsNaN(val) ) val = 0.0;
104 double Nups1[nbins+1],Nups2[nbins+1],Nups3[nbins+1];
146 Nups3[13]=0.00650204;
149 Nups3[14]=0.00259174;
151 double Nups1pp[nbins+1],Nups2pp[nbins+1],Nups3pp[nbins+1];
186 Nups2pp[11]=0.969323;
187 Nups3pp[11]=0.540253;
189 Nups2pp[12]=0.377933;
190 Nups3pp[12]=0.210641;
191 Nups1pp[13]=0.571418;
193 Nups3pp[13]=0.0828277;
194 Nups1pp[14]=0.227769;
195 Nups2pp[14]=0.0592364;
196 Nups3pp[14]=0.0330155;
199 double raapt[9],raa1s[9],raa2s[9],oldraa1s[9],oldraa2s[9];
225 TGraph* grRAA1S =
new TGraph(5,raapt,raa1s);
226 TGraph* grRAA2S =
new TGraph(5,raapt,raa2s);
227 TGraph* groldRAA1S =
new TGraph(5,raapt,oldraa1s);
228 TGraph* groldRAA2S =
new TGraph(5,raapt,oldraa2s);
230 Nups1[
i] = Nups1[
i] * grRAA1S->Eval(0.5+
i*1.0)/groldRAA1S->Eval(0.5+
i*1.0);
231 Nups2[
i] = Nups2[
i] * grRAA2S->Eval(0.5+
i*1.0)/groldRAA2S->Eval(0.5+
i*1.0);
233 grRAA1S->SetLineColor(kBlue);
234 grRAA1S->SetLineStyle(3);
235 grRAA1S->SetLineWidth(3);
236 grRAA2S->SetLineColor(kMagenta);
237 grRAA2S->SetLineStyle(3);
238 grRAA2S->SetLineWidth(3);
244 gStyle->SetOptStat(0);
245 gStyle->SetOptFit(0);
251 TH1D* hhfit[nbins+1];
252 TH1D* hhcorrbg_scaled[nbins+1];
253 TH1D* hhups1pp[nbins+1];
254 TH1D* hhups2pp[nbins+1];
255 TH1D* hhups3pp[nbins+1];
256 TH1D* hhupspp[nbins+1];
257 TH1D* hhups1[nbins+1];
258 TH1D* hhups2[nbins+1];
259 TH1D* hhups3[nbins+1];
260 TH1D* hhups[nbins+1];
261 TH1D* hhall_pp[nbins+1];
262 TH1D* hhcorrbg_pp[nbins+1];
264 TF1* fCBups1s =
new TF1(
"fCBups1s",
CBFunction,5.,14.,5);
265 TF1* fCBups2s =
new TF1(
"fCBups2s",
CBFunction,5.,14.,5);
266 TF1* fCBups1spp =
new TF1(
"fCBups1spp",
CBFunction,5.,14.,5);
267 TF1* fCBups2spp =
new TF1(
"fCBups2spp",
CBFunction,5.,14.,5);
273 double tonypar1 = 0.98;
274 double tonypar2 = 0.93;
276 double tonypar3 = 9.448;
277 double tonypar4 = 0.100;
279 double u1start = 9.25;
280 double u1stop = 9.65;
281 double u2start = 9.80;
282 double u2stop = 10.20;
283 double u3start = 10.20;
284 double u3stop = 10.55;
285 double sum1[nbins+1] = {0.};
286 double truesum1[nbins+1] = {0.};
287 double truesum1pp[nbins+1] = {0.};
288 double ersum1[nbins+1] = {0.};
289 double sum2[nbins+1] = {0.};
290 double truesum2[nbins+1] = {0.};
291 double truesum2pp[nbins+1] = {0.};
292 double ersum2[nbins+1] = {0.};
293 double sum1pp[nbins+1] = {0.};
294 double ersum1pp[nbins+1] = {0.};
295 double sum2pp[nbins+1] = {0.};
296 double ersum2pp[nbins+1] = {0.};
297 double sumfit1[nbins+1] = {0.};
298 double ersumfit1[nbins+1] = {0.};
299 double sumfit2[nbins+1] = {0.};
300 double ersumfit2[nbins+1] = {0.};
301 double sumfit1pp[nbins+1] = {0.};
302 double ersumfit1pp[nbins+1] = {0.};
303 double sumfit2pp[nbins+1] = {0.};
304 double ersumfit2pp[nbins+1] = {0.};
305 double sum1ppbg[nbins+1] = {0.};
306 double ersum1ppbg[nbins+1] = {0.};
307 double sum2ppbg[nbins+1] = {0.};
308 double ersum2ppbg[nbins+1] = {0.};
310 double xx1[nbins+1];
for(
int i=0;
i<nbins+1;
i++) {xx1[
i] = 0.50 +
double(
i);}
311 double xx2[nbins+1];
for(
int i=0;
i<nbins+1;
i++) {xx2[
i] = 0.40 +
double(
i);}
312 double xx3[nbins+1];
for(
int i=0;
i<nbins+1;
i++) {xx3[
i] = 0.60 +
double(
i);}
318 TFile*
f=
new TFile(
"ups_corrbg_24b_auau.root");
319 for(
int i=0;
i<nbins+1;
i++) {
321 sprintf(tmpname,
"hhfit_%d",
i);
322 hhfit[
i] = (TH1D*)f->Get(tmpname);
323 hhfit[
i]->SetDirectory(gROOT);
324 sprintf(tmpname,
"hhcorrbg_scaled_%d",
i);
325 hhcorrbg_scaled[
i] = (TH1D*)f->Get(tmpname);
326 hhcorrbg_scaled[
i]->SetDirectory(gROOT);
328 sprintf(tmpname,
"hhups1pp_%d",
i);
329 hhups1pp[
i] = (TH1D*)f->Get(tmpname);
330 hhups1pp[
i]->SetDirectory(gROOT);
331 sprintf(tmpname,
"hhups2pp_%d",
i);
332 hhups2pp[
i] = (TH1D*)f->Get(tmpname);
333 hhups2pp[
i]->SetDirectory(gROOT);
334 sprintf(tmpname,
"hhups3pp_%d",
i);
335 hhups3pp[
i] = (TH1D*)f->Get(tmpname);
336 hhups3pp[
i]->SetDirectory(gROOT);
337 sprintf(tmpname,
"hhupspp_%d",
i);
338 hhupspp[
i] = (TH1D*)f->Get(tmpname);
339 hhupspp[
i]->SetDirectory(gROOT);
341 sprintf(tmpname,
"hhups1_%d",
i);
342 hhups1[
i] = (TH1D*)f->Get(tmpname);
343 hhups1[
i]->SetDirectory(gROOT);
344 sprintf(tmpname,
"hhups2_%d",
i);
345 hhups2[
i] = (TH1D*)f->Get(tmpname);
346 hhups2[
i]->SetDirectory(gROOT);
347 sprintf(tmpname,
"hhups3_%d",
i);
348 hhups3[
i] = (TH1D*)f->Get(tmpname);
349 hhups3[
i]->SetDirectory(gROOT);
350 sprintf(tmpname,
"hhups_%d",
i);
351 hhups[
i] = (TH1D*)f->Get(tmpname);
352 hhups[
i]->SetDirectory(gROOT);
354 sprintf(tmpname,
"hhall_pp_%d",
i);
355 hhall_pp[
i] = (TH1D*)f->Get(tmpname);
356 hhall_pp[
i]->SetDirectory(gROOT);
357 sprintf(tmpname,
"hhcorrbg_pp_%d",
i);
358 hhcorrbg_pp[
i] = (TH1D*)f->Get(tmpname);
359 hhcorrbg_pp[
i]->SetDirectory(gROOT);
365 double bgpar0[nbins+1],bgpar1[nbins+1];
366 for(
int i=0;
i<nbins+1;
i++) {
367 bgpar0[
i] = hhcorrbg_scaled[
i]->GetFunction(
"expo")->GetParameter(0);
368 bgpar1[
i] = hhcorrbg_scaled[
i]->GetFunction(
"expo")->GetParameter(1);
370 double fgpar0 = hhups[
nbins]->GetFunction(
"fTCBauau")->GetParameter(0);
371 double fgpar5 = hhups[
nbins]->GetFunction(
"fTCBauau")->GetParameter(5);
372 double fgpar6 = hhups[
nbins]->GetFunction(
"fTCBauau")->GetParameter(6);
376 TCanvas* cups =
new TCanvas(
"cups",
"Upsilons and correlated BG",150,150,700,700);
379 fSandBauau->SetParameter(0,fgpar0);
380 fSandBauau->SetParameter(1,tonypar1);
381 fSandBauau->SetParameter(2,tonypar2);
382 fSandBauau->SetParameter(3,tonypar3);
383 fSandBauau->SetParameter(4,tonypar4);
384 fSandBauau->SetParameter(5,fgpar5);
385 fSandBauau->SetParameter(6,fgpar6);
386 fSandBauau->SetParameter(7,bgpar0[nbins]);
387 fSandBauau->SetParameter(8,bgpar1[nbins]);
388 fSandBauau->SetLineColor(kRed);
392 fCBups1s->SetParameter(0,fSandBauau->GetParameter(0));
393 fCBups1s->SetParameter(1,fSandBauau->GetParameter(1));
394 fCBups1s->SetParameter(2,fSandBauau->GetParameter(2));
395 fCBups1s->SetParameter(3,fSandBauau->GetParameter(3));
396 fCBups1s->SetParameter(4,fSandBauau->GetParameter(4));
397 double true_ups1s_integral = fCBups1s->Integral(5.,14.);
398 double true_ups1s_ampl = fSandBauau->GetParameter(0);
399 double true_ups1s_amplerr = fSandBauau->GetParError(0);
400 double binsize = hhfit[
nbins]->GetBinWidth(1);
401 cout <<
"TRUE Integral = " << true_ups1s_integral/binsize <<
" +- " << true_ups1s_integral*(true_ups1s_amplerr/true_ups1s_ampl)/binsize <<
" ( " << true_ups1s_amplerr/true_ups1s_ampl*100. <<
"% )" << endl;
404 TF1* fcorrbg[nbins+1];
405 fcorrbg[
nbins] =
new TF1(
"fcorrbg_15",
"exp([0]+[1]*x)",7.,14.);
406 fcorrbg[
nbins]->SetParameters(bgpar0[nbins],bgpar1[nbins]);
408 fcorrbg[
nbins]->SetLineWidth(1);
409 fcorrbg[
nbins]->SetLineColor(kRed);
413 fSandB->SetParameter(0,fgpar0);
414 fSandB->FixParameter(1,tonypar1);
415 fSandB->FixParameter(2,tonypar2);
416 fSandB->FixParameter(3,tonypar3);
417 fSandB->FixParameter(4,tonypar4);
418 fSandB->SetParameter(5,fgpar5);
419 fSandB->SetParameter(6,fgpar6);
420 fSandB->SetParameter(7,bgpar0[nbins]);
421 fSandB->SetParameter(8,bgpar1[nbins]);
422 hhfit[
nbins]->Fit(fSandB,
"qrl",
"",8.,11.);
424 hhfit[
nbins]->GetXaxis()->SetTitleOffset(1.0);
425 hhfit[
nbins]->GetYaxis()->SetTitleOffset(1.6);
426 hhfit[
nbins]->SetAxisRange(8.0,11.0);
427 hhfit[
nbins]->Draw();
429 TF1* fcorrbg_fromfit[nbins+1];
430 sprintf(tmpname,
"fcorrbg_fromfit_%d",15);
431 fcorrbg_fromfit[
nbins] =
new TF1(tmpname,
"exp([0]+[1]*x)",7.,14.);
432 fcorrbg_fromfit[
nbins]->SetParameters(fSandB->GetParameter(7),fSandB->GetParameter(8));
433 fcorrbg_fromfit[
nbins]->SetLineStyle(2);
434 fcorrbg_fromfit[
nbins]->SetLineWidth(3);
435 fcorrbg_fromfit[
nbins]->Draw(
"same");
436 fcorrbg[
nbins]->Draw(
"same");
439 TLine* line1 =
new TLine(u1start,0.,u1start,hhfit[nbins]->GetMaximum()*1.1); line1->SetLineStyle(2); line1->Draw();
440 TLine* line2 =
new TLine(u1stop,0.,u1stop,hhfit[nbins]->GetMaximum()*1.1); line2->SetLineStyle(2); line2->Draw();
443 fCBups1s->SetParameter(0,fSandB->GetParameter(0));
444 fCBups1s->SetParameter(1,fSandB->GetParameter(1));
445 fCBups1s->SetParameter(2,fSandB->GetParameter(2));
446 fCBups1s->SetParameter(3,fSandB->GetParameter(3));
447 fCBups1s->SetParameter(4,fSandB->GetParameter(4));
448 double ups1s_integral = fCBups1s->Integral(5.,14.);
449 double ups1s_ampl = fSandB->GetParameter(0);
450 double ups1s_amplerr = fSandB->GetParError(0);
451 cout <<
"Integral = " << ups1s_integral/binsize <<
" +- " << ups1s_integral*(ups1s_amplerr/ups1s_ampl)/binsize <<
" ( " << ups1s_amplerr/ups1s_ampl*100. <<
"% )" << endl;
455 int fbin1 = hhfit[
nbins]->FindBin(u1start + 0.001);
456 int lbin1 = hhfit[
nbins]->FindBin(u1stop - 0.001);
457 int fbin2 = hhfit[
nbins]->FindBin(u2start + 0.001);
458 int lbin2 = hhfit[
nbins]->FindBin(u2stop - 0.001);
459 int fbin3 = hhfit[
nbins]->FindBin(u3start + 0.001);
460 int lbin3 = hhfit[
nbins]->FindBin(u3stop - 0.001);
462 for(
int j=fbin1;
j<=lbin1;
j++) {
464 sum1[
nbins] += (hhfit[
nbins]->GetBinContent(
j) - fcorrbg[
nbins]->Eval(hhfit[nbins]->GetBinCenter(
j)));
466 truesum1[
nbins] += hhups1[
nbins]->GetBinContent(
j);
468 ersum1[
nbins] = sqrt(ersum1[nbins]);
469 cout <<
"Direct count = " << truesum1[
nbins] <<
" +- " << ersum1[
nbins] <<
" ( " << ersum1[
nbins]/truesum1[
nbins]*100. <<
"% )" << endl;
477 TCanvas*
dummy =
new TCanvas(
"dummy",
"dummy",0,0,500,500);
479 for(
int i=0;
i<npts;
i++) {
481 fSandB->SetParameter(0,hhfit[
i]->GetMaximum()/9.);
482 fSandB->SetParLimits(0,0.,99999.);
483 fSandB->FixParameter(1,tonypar1);
484 fSandB->FixParameter(2,tonypar2);
485 fSandB->FixParameter(3,tonypar3);
486 fSandB->FixParameter(4,tonypar4);
487 fSandB->SetParameter(5,fgpar5/1.);
488 fSandB->SetParLimits(5,0.5,9999.);
489 fSandB->SetParameter(6,fgpar6/1.);
490 fSandB->SetParLimits(6,0.,999.);
491 fSandB->SetParameter(7,bgpar0[
i]/9.);
492 fSandB->SetParLimits(7,0.,99.);
493 fSandB->FixParameter(8,bgpar1[
i]);
494 hhfit[
i]->Fit(fSandB,
"qrl",
"",8.,11.);
496 fCBups1s->SetParameter(0,fSandB->GetParameter(0));
497 fCBups1s->SetParameter(1,fSandB->GetParameter(1));
498 fCBups1s->SetParameter(2,fSandB->GetParameter(2));
499 fCBups1s->SetParameter(3,fSandB->GetParameter(3));
500 fCBups1s->SetParameter(4,fSandB->GetParameter(4));
501 double ups1s_integral = fCBups1s->Integral(5.,14.);
502 double ups1s_ampl = fSandB->GetParameter(0);
503 double ups1s_amplerr = fSandB->GetParError(0);
505 sumfit1[
i] = ups1s_integral/binsize;
506 ersumfit1[
i] = ups1s_integral*(ups1s_amplerr/ups1s_ampl)/binsize;
508 fCBups2s->SetParameter(0,fSandB->GetParameter(5));
509 fCBups2s->SetParameter(1,fSandB->GetParameter(1));
510 fCBups2s->SetParameter(2,fSandB->GetParameter(2));
511 fCBups2s->SetParameter(3,fSandB->GetParameter(3));
512 fCBups2s->SetParameter(4,fSandB->GetParameter(4));
513 double ups2s_integral = fCBups2s->Integral(5.,14.);
514 double ups2s_ampl = fSandB->GetParameter(5);
515 double ups2s_amplerr = fSandB->GetParError(5);
516 cout << i <<
" Integral2 = " << ups2s_integral/binsize <<
" +- " << ups2s_integral*(ups2s_amplerr/ups2s_ampl)/binsize <<
" ( " << ups2s_amplerr/ups2s_ampl*100. <<
"% )" << endl;
517 sumfit2[
i] = ups2s_integral/binsize;
518 ersumfit2[
i] = ups2s_integral*(ups2s_amplerr/ups2s_ampl)/binsize;
520 sprintf(tmpname,
"fcorrbg_fromfit_%d",i);
521 fcorrbg_fromfit[
i] =
new TF1(tmpname,
"exp([0]+[1]*x)",7.,14.);
522 fcorrbg_fromfit[
i]->SetLineStyle(2);
523 fcorrbg_fromfit[
i]->SetParameters(fSandB->GetParameter(7),fSandB->GetParameter(8));
525 sprintf(tmpname,
"fcorrbg_%d",i);
526 fcorrbg[
i] =
new TF1(tmpname,
"exp([0]+[1]*x)",7.,14.);
527 fcorrbg[
i]->SetLineWidth(1);
528 fcorrbg[
i]->SetLineColor(kRed);
529 fcorrbg[
i]->SetParameters(bgpar0[i],bgpar1[i]);
538 for(
int j=fbin1;
j<=lbin1;
j++) {
540 sum1[
i] += (hhfit[
i]->GetBinContent(
j) - fcorrbg[
i]->Eval(hhfit[i]->GetBinCenter(
j)));
541 ersum1[
i] += hhfit[
i]->GetBinError(
j)*hhfit[
i]->GetBinError(
j);
542 sum1pp[
i] += hhupspp[
i]->GetBinContent(
j);
543 ersum1pp[
i] += hhupspp[
i]->GetBinError(
j)*hhupspp[
i]->GetBinError(
j);
544 truesum1[
i] += hhups1[
i]->GetBinContent(
j);
546 ersum1[
i] = sqrt(ersum1[i]);
547 ersum1pp[
i] = sqrt(ersum1pp[i]);
555 for(
int j=fbin2;
j<=lbin2;
j++) {
557 sum2[
i] += (hhfit[
i]->GetBinContent(
j) - fcorrbg[
i]->Eval(hhfit[i]->GetBinCenter(
j)));
558 ersum2[
i] += hhfit[
i]->GetBinError(
j)*hhfit[
i]->GetBinError(
j);
559 sum2pp[
i] += hhupspp[
i]->GetBinContent(
j);
560 ersum2pp[
i] += hhupspp[
i]->GetBinError(
j)*hhupspp[
i]->GetBinError(
j);
561 truesum2[
i] += hhups2[
i]->GetBinContent(
j);
563 ersum2[
i] = sqrt(ersum2[i]);
564 ersum2pp[
i] = sqrt(ersum2pp[i]);
565 cout <<
" Direct count2 = " << truesum2[
i] <<
" +- " << ersum2[
i] <<
" ( " << ersum2[
i]/sum2[
i]*100. <<
"% )" << endl;
572 TCanvas* cupsvspt_fit =
new TCanvas(
"cupsvspt_fit",
"Upsilons vs. p_{T} after fit",100,100,1100,900);
573 cupsvspt_fit->Divide(3,3);
574 for(
int i=0;
i<9;
i++) {
575 if(
i==0) {cupsvspt_fit->cd(0);}
576 if(
i==1) {cupsvspt_fit->cd(1);}
577 if(
i==2) {cupsvspt_fit->cd(2);}
578 if(
i==3) {cupsvspt_fit->cd(3);}
579 if(
i==4) {cupsvspt_fit->cd(4);}
580 if(
i==5) {cupsvspt_fit->cd(5);}
581 if(
i==6) {cupsvspt_fit->cd(6);}
582 if(
i==7) {cupsvspt_fit->cd(7);}
583 if(
i==8) {cupsvspt_fit->cd(8);}
584 hhfit[
i]->SetAxisRange(8.0,11.0);
586 fcorrbg_fromfit[
i]->Draw(
"same");
587 fcorrbg[
i]->Draw(
"same");
588 sprintf(tlchar,
"%d-%d GeV",
i,
i+1); tl[
i] =
new TLatex(8.2,hhfit[
i]->GetMaximum()*0.95,tlchar); tl[
i]->Draw();
597 cout << endl <<
"---------- p+p ---------------------------------------" << endl << endl;
599 double bgpar0pp[nbins+1],bgpar1pp[nbins+1];
600 for(
int i=0;
i<nbins+1;
i++) {
601 bgpar0pp[
i] = hhcorrbg_pp[
i]->GetFunction(
"expo")->GetParameter(0);
602 bgpar1pp[
i] = hhcorrbg_pp[
i]->GetFunction(
"expo")->GetParameter(1);
604 TF1* fcorrbg_pp[nbins+1];
605 TF1* fcorrbg_pp_fromfit[nbins+1];
607 TCanvas* cpp =
new TCanvas(
"cpp",
"p+p",100,100,700,700);
609 double tmpmax = hhall_pp[
nbins]->GetMaximum();
611 fSandBpp->SetParameter(0,tmpmax/9.);
612 fSandBpp->SetParLimits(0,0.,99999.);
613 fSandBpp->FixParameter(1,tonypar1);
614 fSandBpp->FixParameter(2,tonypar2);
615 fSandBpp->FixParameter(3,tonypar3);
616 fSandBpp->FixParameter(4,0.089);
617 fSandBpp->SetParameter(5,tmpmax/99.);
618 fSandBpp->SetParLimits(5,0.5,9999.);
619 fSandBpp->SetParameter(6,tmpmax/99.);
620 fSandBpp->SetParLimits(6,0.,999.);
621 fSandBpp->SetParameter(7,bgpar0pp[nbins]/9.);
622 fSandBpp->SetParLimits(7,0.,99.);
623 fSandBpp->SetParameter(8,bgpar1pp[nbins]);
624 hhall_pp[
nbins]->Fit(fSandBpp,
"qrl",
"",7.,12.);
625 hhall_pp[
nbins]->SetAxisRange(8.,11.);
626 hhall_pp[
nbins]->Draw();
630 sprintf(tmpname,
"fcorrbg_pp_%d",nbins);
631 fcorrbg_pp[
nbins] =
new TF1(tmpname,
"exp([0]+[1]*x)",7.,14.);
632 fcorrbg_pp[
nbins]->SetLineColor(kRed);
633 fcorrbg_pp[
nbins]->SetLineWidth(1);
634 fcorrbg_pp[
nbins]->SetParameters(bgpar0[nbins], bgpar1pp[nbins]);
635 fcorrbg_pp[
nbins]->Draw(
"same");
637 sprintf(tmpname,
"fcorrbg_pp_fromfit_%d",nbins);
638 fcorrbg_pp_fromfit[
nbins] =
new TF1(tmpname,
"exp([0]+[1]*x)",7.,14.);
639 fcorrbg_pp_fromfit[
nbins]->SetLineStyle(2);
640 fcorrbg_pp_fromfit[
nbins]->SetParameters(hhall_pp[nbins]->GetFunction(
"fSandBpp")->
GetParameter(7), hhall_pp[nbins]->GetFunction(
"fSandBpp")->
GetParameter(8));
641 fcorrbg_pp_fromfit[
nbins]->Draw(
"same");
644 fCBups1spp->SetParameter(0,fSandBpp->GetParameter(0));
645 fCBups1spp->SetParameter(1,fSandBpp->GetParameter(1));
646 fCBups1spp->SetParameter(2,fSandBpp->GetParameter(2));
647 fCBups1spp->SetParameter(3,fSandBpp->GetParameter(3));
648 fCBups1spp->SetParameter(4,fSandBpp->GetParameter(4));
649 double ups1spp_integral = fCBups1spp->Integral(5.,14.);
650 double ups1spp_ampl = fSandBpp->GetParameter(0);
651 double ups1spp_amplerr = fSandBpp->GetParError(0);
652 cout <<
"p+p Integral1 = " << ups1spp_integral/binsize <<
" +- " << ups1spp_integral*(ups1spp_amplerr/ups1spp_ampl)/binsize <<
" ( " << ups1spp_amplerr/ups1spp_ampl*100. <<
"% )" << endl;
653 fCBups2spp->SetParameter(0,fSandBpp->GetParameter(5));
654 fCBups2spp->SetParameter(1,fSandBpp->GetParameter(1));
655 fCBups2spp->SetParameter(2,fSandBpp->GetParameter(2));
656 fCBups2spp->SetParameter(3,fSandBpp->GetParameter(3));
657 fCBups2spp->SetParameter(4,fSandBpp->GetParameter(4));
658 double ups2spp_integral = fCBups2spp->Integral(5.,14.);
659 double ups2spp_ampl = fSandBpp->GetParameter(5);
660 double ups2spp_amplerr = fSandBpp->GetParError(5);
661 cout <<
"p+p Integral2 = " << ups2spp_integral/binsize <<
" +- " << ups2spp_integral*(ups2spp_amplerr/ups2spp_ampl)/binsize <<
" ( " << ups2spp_amplerr/ups2spp_ampl*100. <<
"% )" << endl;
665 TCanvas* dummy2 =
new TCanvas(
"dummy2",
"dummy2",0,0,500,500);
667 for(
int i=0;
i<npts;
i++) {
669 double tmpmax = hhall_pp[
i]->GetMaximum()/9.;
671 fSandBpp->SetParameter(0,tmpmax);
672 fSandBpp->SetParLimits(0,0.,99999.);
673 fSandBpp->FixParameter(1,tonypar1);
674 fSandBpp->FixParameter(2,tonypar2);
675 fSandBpp->FixParameter(3,tonypar3);
676 fSandBpp->FixParameter(4,0.089);
677 fSandBpp->SetParameter(5,tmpmax);
678 fSandBpp->SetParLimits(5,0.0,9999.);
679 fSandBpp->SetParameter(6,tmpmax);
680 fSandBpp->SetParLimits(6,0.0,999.);
681 double tmppar7 = bgpar0pp[
i];
if(tmppar7<0.) {tmppar7=0.;}
682 fSandBpp->SetParameter(7,tmppar7);
683 fSandBpp->SetParLimits(7,0.,99.);
684 fSandBpp->FixParameter(8,bgpar1pp[
i]);
685 hhall_pp[
i]->Fit(fSandBpp,
"qrl",
"",8.,11.);
687 sprintf(tmpname,
"fcorrbg_pp_%d",i);
688 fcorrbg_pp[
i] =
new TF1(tmpname,
"exp([0]+[1]*x)",7.,14.);
689 fcorrbg_pp[
i]->SetLineColor(kRed);
690 fcorrbg_pp[
i]->SetLineWidth(1);
691 fcorrbg_pp[
i]->SetParameters(bgpar0pp[i], bgpar1pp[i]);
693 sprintf(tmpname,
"fcorrbg_pp_fromfit_%d",i);
694 fcorrbg_pp_fromfit[
i] =
new TF1(tmpname,
"exp([0]+[1]*x)",7.,14.);
695 fcorrbg_pp_fromfit[
i]->SetLineStyle(2);
696 fcorrbg_pp_fromfit[
i]->SetParameters(hhall_pp[i]->GetFunction(
"fSandBpp")->
GetParameter(7), hhall_pp[i]->GetFunction(
"fSandBpp")->
GetParameter(8));
698 fCBups1spp->SetParameter(0,fSandBpp->GetParameter(0));
699 fCBups1spp->SetParameter(1,fSandBpp->GetParameter(1));
700 fCBups1spp->SetParameter(2,fSandBpp->GetParameter(2));
701 fCBups1spp->SetParameter(3,fSandBpp->GetParameter(3));
702 fCBups1spp->SetParameter(4,fSandBpp->GetParameter(4));
703 double ups1spp_integral = fCBups1spp->Integral(5.,14.);
704 double ups1spp_ampl = fSandBpp->GetParameter(0);
705 double ups1spp_amplerr = fSandBpp->GetParError(0);
706 fCBups2spp->SetParameter(0,fSandBpp->GetParameter(5));
707 fCBups2spp->SetParameter(1,fSandBpp->GetParameter(1));
708 fCBups2spp->SetParameter(2,fSandBpp->GetParameter(2));
709 fCBups2spp->SetParameter(3,fSandBpp->GetParameter(3));
710 fCBups2spp->SetParameter(4,fSandBpp->GetParameter(4));
711 double ups2spp_integral = fCBups2spp->Integral(5.,14.);
712 double ups2spp_ampl = fSandBpp->GetParameter(5);
713 double ups2spp_amplerr = fSandBpp->GetParError(5);
714 cout <<
"p+p Integral1 vs pT = " << i <<
" " << ups1spp_integral/binsize <<
" +- " << ups1spp_integral*(ups1spp_amplerr/ups1spp_ampl)/binsize <<
" ( " << ups1spp_amplerr/ups1spp_ampl*100. <<
"% )" << endl;
717 sumfit1pp[
i] = ups1spp_integral/binsize;
718 ersumfit1pp[
i] = ups1spp_integral*(ups1spp_amplerr/ups1spp_ampl)/binsize;
719 sumfit2pp[
i] = ups2spp_integral/binsize;
720 ersumfit2pp[
i] = ups2spp_integral*(ups2spp_amplerr/ups2spp_ampl)/binsize;
728 for(
int j=fbin1;
j<=lbin1;
j++) {
730 sum1ppbg[
i] += hhall_pp[
i]->GetBinContent(
j) - fcorrbg_pp[
i]->Eval(hhall_pp[i]->GetBinCenter(
j));
731 ersum1ppbg[
i] += hhall_pp[
i]->GetBinError(
j)*hhall_pp[
i]->GetBinError(
j);
732 truesum1pp[
i] += hhups1pp[
i]->GetBinContent(
j);
734 ersum1ppbg[
i] = sqrt(ersum1ppbg[i]);
735 for(
int j=fbin2;
j<=lbin2;
j++) {
736 sum2ppbg[
i] += hhall_pp[
i]->GetBinContent(
j) - fcorrbg_pp[
i]->Eval(hhall_pp[i]->GetBinCenter(
j));
737 ersum2ppbg[
i] += hhall_pp[
i]->GetBinError(
j)*hhall_pp[
i]->GetBinError(
j);
738 truesum2pp[
i] += hhups2pp[
i]->GetBinContent(
j);
740 ersum2ppbg[
i] = sqrt(ersum2ppbg[i]);
747 TCanvas* cupsvspt_pp =
new TCanvas(
"cupsvspt_pp",
"p+p Upsilons vs. p_{T}",100,100,1100,900);
748 cupsvspt_pp->Divide(3,3);
749 for(
int i=0;
i<9;
i++) {
750 if(
i==0) {cupsvspt_pp->cd(0);}
751 if(
i==1) {cupsvspt_pp->cd(1);}
752 if(
i==2) {cupsvspt_pp->cd(2);}
753 if(
i==3) {cupsvspt_pp->cd(3);}
754 if(
i==4) {cupsvspt_pp->cd(4);}
755 if(
i==5) {cupsvspt_pp->cd(5);}
756 if(
i==6) {cupsvspt_pp->cd(6);}
757 if(
i==7) {cupsvspt_pp->cd(7);}
758 if(
i==8) {cupsvspt_pp->cd(8);}
759 hhall_pp[
i]->SetAxisRange(8.0,11.0);
761 fcorrbg_pp[
i]->Draw(
"same");
762 fcorrbg_pp_fromfit[
i]->Draw(
"same");
763 sprintf(tlchar,
"%d-%d GeV",
i,
i+1); tl[
i] =
new TLatex(8.2,hhall_pp[
i]->GetMaximum()*0.95,tlchar); tl[
i]->Draw();
770 TCanvas* cercomp =
new TCanvas(
"cercomp",
"error comparizon",50,50,700,700);
771 TH2F* hhcomp =
new TH2F(
"hhcomp",
" ",10,0.,10.,10,0.,1.0);
772 hhcomp->GetXaxis()->SetTitle(
"Transverse momentum [GeV/c]");
773 hhcomp->GetXaxis()->SetTitleOffset(1.0);
776 double reler1[nbins+1],reler2[nbins+1];
777 double relerfit1[nbins+1],relerfit2[nbins+1];
778 double reler1pp[nbins+1],reler2pp[nbins+1];
779 double reler1ppbg[nbins+1],reler2ppbg[nbins+1];
780 double relerfit1pp[nbins+1],relerfit2pp[nbins+1];
781 for(
int i=0;
i<npts;
i++) {
782 reler1[
i] = ersum1[
i]/truesum1[
i]; reler2[
i] = ersum2[
i]/truesum2[
i];
783 relerfit1[
i] = ersumfit1[
i]/Nups1[
i]; relerfit2[
i] = ersumfit2[
i]/Nups2[
i];
784 reler1pp[
i] = ersum1pp[
i]/truesum1pp[
i]; reler2pp[
i] = ersum2pp[
i]/truesum2pp[
i];
785 reler1ppbg[
i] = ersum1ppbg[
i]/truesum1pp[
i]; reler2ppbg[
i] = ersum2ppbg[
i]/truesum2pp[
i];
786 relerfit1pp[
i] = ersumfit1pp[
i]/Nups1pp[
i]; relerfit2pp[
i] = ersumfit2pp[
i]/Nups2pp[
i];
789 TGraphErrors* grcomp1 =
new TGraphErrors(npts,xx1,reler1,0,0);
790 grcomp1->SetMarkerStyle(20);
791 grcomp1->SetMarkerColor(kBlack);
792 grcomp1->SetLineColor(kBlack);
793 grcomp1->SetLineWidth(2);
794 grcomp1->SetMarkerSize(1.5);
797 TGraphErrors* grcompfit1 =
new TGraphErrors(npts,xx1,relerfit1,0,0);
798 grcompfit1->SetMarkerStyle(24);
799 grcompfit1->SetMarkerColor(kBlack);
800 grcompfit1->SetLineColor(kBlack);
801 grcompfit1->SetLineWidth(2);
802 grcompfit1->SetMarkerSize(1.5);
803 grcompfit1->Draw(
"p");
805 TCanvas* cercomppp =
new TCanvas(
"cercomppp",
"p+p error comparizon",50,50,700,700);
806 TH2F* hhcomppp =
new TH2F(
"hhcomppp",
" ",10,0.,10.,10,0.,1.0);
807 hhcomppp->GetXaxis()->SetTitle(
"Transverse momentum [GeV/c]");
808 hhcomppp->GetXaxis()->SetTitleOffset(1.0);
811 TGraphErrors* grcomp1pp =
new TGraphErrors(npts,xx1,reler1pp,0,0);
812 grcomp1pp->SetMarkerStyle(20);
813 grcomp1pp->SetMarkerColor(kBlue);
814 grcomp1pp->SetLineColor(kBlue);
815 grcomp1pp->SetLineWidth(2);
816 grcomp1pp->SetMarkerSize(1.5);
817 grcomp1pp->Draw(
"p");
819 TGraphErrors* grcomp1ppbg =
new TGraphErrors(npts,xx1,reler1ppbg,0,0);
820 grcomp1ppbg->SetMarkerStyle(21);
821 grcomp1ppbg->SetMarkerColor(kBlue);
822 grcomp1ppbg->SetLineColor(kBlue);
823 grcomp1ppbg->SetLineWidth(2);
824 grcomp1ppbg->SetMarkerSize(1.5);
825 grcomp1ppbg->Draw(
"p");
827 TGraphErrors* grcompfit1pp =
new TGraphErrors(npts,xx1,relerfit1pp,0,0);
828 grcompfit1pp->SetMarkerStyle(24);
829 grcompfit1pp->SetMarkerColor(kBlue);
830 grcompfit1pp->SetLineColor(kBlue);
831 grcompfit1pp->SetLineWidth(2);
832 grcompfit1pp->SetMarkerSize(1.5);
833 grcompfit1pp->Draw(
"p");
840 double raa1[nbins+1],raa2[nbins+1],raa3[nbins+1],erraa1[nbins+1],erraa2[nbins+1],erraa3[nbins+1];
841 double raa1fit[nbins+1],raa2fit[nbins+1],raa3fit[nbins+1],erraa1fit[nbins+1],erraa2fit[nbins+1],erraa3fit[nbins+1];
845 raa1[
i] = 0.535 * grRAA1S->Eval(0.5+
i*1.0)/groldRAA1S->Eval(0.5+
i*1.0);
846 raa2[
i] = 0.170 * grRAA2S->Eval(0.5+
i*1.0)/groldRAA2S->Eval(0.5+
i*1.0);
848 raa1fit[
i] = 0.535 * grRAA1S->Eval(0.5+
i*1.0)/groldRAA1S->Eval(0.5+
i*1.0);
849 raa2fit[
i] = 0.170 * grRAA2S->Eval(0.5+
i*1.0)/groldRAA2S->Eval(0.5+
i*1.0);
852 erraa1[
i] = raa1[
i]*sqrt(pow(ersum1[
i]/truesum1[
i],2)+pow(ersum1pp[i]/truesum1pp[i],2));
853 erraa2[
i] = raa2[
i]*sqrt(pow(ersum2[i]/truesum2[i],2)+pow(ersum2pp[i]/truesum2pp[i],2));
854 erraa1fit[
i] = raa1fit[
i]*sqrt(pow(ersumfit1[i]/Nups1[i],2)+pow(ersumfit1pp[i]/Nups1pp[i],2));
855 erraa2fit[
i] = raa2fit[
i]*sqrt(pow(ersumfit2[i]/Nups2[i],2)+pow(ersumfit2pp[i]/Nups2pp[i],2));
861 TCanvas* craa =
new TCanvas(
"craa",
"R_{AA}",120,120,600,600);
862 TH2F* hh2 =
new TH2F(
"hh2",
" ",10,0.,10.,10,0.,0.8);
863 hh2->GetXaxis()->SetTitle(
"Transverse momentum [GeV/c]");
864 hh2->GetXaxis()->SetTitleOffset(1.0);
865 hh2->GetXaxis()->SetTitleColor(1);
866 hh2->GetXaxis()->SetTitleSize(0.040);
867 hh2->GetXaxis()->SetLabelSize(0.040);
868 hh2->GetYaxis()->SetTitle(
"R_{AA}");
869 hh2->GetYaxis()->SetTitleOffset(1.3);
870 hh2->GetYaxis()->SetTitleSize(0.040);
871 hh2->GetYaxis()->SetLabelSize(0.040);
874 TGraphErrors* gr1 =
new TGraphErrors(npts,xx2,raa1,0,erraa1);
875 gr1->SetMarkerStyle(20);
876 gr1->SetMarkerColor(kBlack);
877 gr1->SetLineColor(kBlack);
878 gr1->SetLineWidth(2);
879 gr1->SetMarkerSize(1.5);
882 TGraphErrors* gr1fit =
new TGraphErrors(npts,xx3,raa1fit,0,erraa1fit);
883 gr1fit->SetMarkerStyle(24);
884 gr1fit->SetMarkerColor(kBlack);
885 gr1fit->SetLineColor(kBlack);
886 gr1fit->SetLineWidth(2);
887 gr1fit->SetMarkerSize(1.5);
890 TGraphErrors* gr2 =
new TGraphErrors(npts-2,xx2,raa2,0,erraa2);
891 gr2->SetMarkerStyle(20);
892 gr2->SetMarkerColor(kRed);
893 gr2->SetLineColor(kRed);
894 gr2->SetLineWidth(2);
895 gr2->SetMarkerSize(1.5);
898 TGraphErrors* gr2fit =
new TGraphErrors(npts-2,xx3,raa2fit,0,erraa2fit);
899 gr2fit->SetMarkerStyle(24);
900 gr2fit->SetMarkerColor(kRed);
901 gr2fit->SetLineColor(kRed);
902 gr2fit->SetLineWidth(2);
903 gr2fit->SetMarkerSize(1.5);
910 TCanvas* craafit =
new TCanvas(
"craafit",
"R_{AA}",20,20,600,600);
911 TH2F* hh2f =
new TH2F(
"hh2f",
" ",10,0.,10.,10,0.,0.8);
912 hh2f->GetXaxis()->SetTitle(
"Transverse momentum [GeV/c]");
913 hh2f->GetXaxis()->SetTitleOffset(1.0);
914 hh2f->GetXaxis()->SetTitleColor(1);
915 hh2f->GetXaxis()->SetTitleSize(0.040);
916 hh2f->GetXaxis()->SetLabelSize(0.040);
917 hh2f->GetYaxis()->SetTitle(
"R_{AA}");
918 hh2f->GetYaxis()->SetTitleOffset(1.3);
919 hh2f->GetYaxis()->SetTitleSize(0.040);
920 hh2f->GetYaxis()->SetLabelSize(0.040);
923 TGraphErrors* gr1f =
new TGraphErrors(npts,xx1,raa1fit,0,erraa1fit);
924 gr1f->SetMarkerStyle(20);
925 gr1f->SetMarkerColor(kBlack);
926 gr1f->SetLineColor(kBlack);
927 gr1f->SetLineWidth(2);
928 gr1f->SetMarkerSize(1.5);
929 gr1f->SetName(
"gr2c");
932 TGraphErrors* gr2f =
new TGraphErrors(npts-2,xx1,raa2fit,0,erraa2fit);
933 gr2f->SetMarkerStyle(20);
934 gr2f->SetMarkerColor(kRed);
935 gr2f->SetLineColor(kRed);
936 gr2f->SetLineWidth(2);
937 gr2f->SetMarkerSize(1.5);
938 gr2f->SetName(
"gr2f");
941 TLegend *
leg =
new TLegend(0.2,0.77,0.5,0.92);
942 leg->SetFillColor(10);
943 leg->SetFillStyle(1001);
947 leg->AddEntry(
"gr1f",
"Y(1S)",
"p");
948 leg->AddEntry(
"gr2f",
"Y(2S)",
"p");
949 leg->AddEntry(
"",
"",
"");
951 TLatex*
l1 =
new TLatex(3.5,0.73,
"sPHENIX Simulation");
959 TCanvas* craacount =
new TCanvas(
"craacount",
"R_{AA}",20,20,600,600);
960 TH2F* hh2c =
new TH2F(
"hh2c",
" ",10,0.,10.,10,0.,0.8);
961 hh2c->GetXaxis()->SetTitle(
"Transverse momentum [GeV/c]");
962 hh2c->GetXaxis()->SetTitleOffset(1.0);
963 hh2c->GetXaxis()->SetTitleColor(1);
964 hh2c->GetXaxis()->SetTitleSize(0.040);
965 hh2c->GetXaxis()->SetLabelSize(0.040);
966 hh2c->GetYaxis()->SetTitle(
"R_{AA}");
967 hh2c->GetYaxis()->SetTitleOffset(1.3);
968 hh2c->GetYaxis()->SetTitleSize(0.040);
969 hh2c->GetYaxis()->SetLabelSize(0.040);
972 TGraphErrors* gr1c =
new TGraphErrors(npts,xx1,raa1,0,erraa1);
973 gr1c->SetMarkerStyle(20);
974 gr1c->SetMarkerColor(kBlack);
975 gr1c->SetLineColor(kBlack);
976 gr1c->SetLineWidth(2);
977 gr1c->SetMarkerSize(1.5);
978 gr1c->SetName(
"gr1c");
981 TGraphErrors* gr2c =
new TGraphErrors(npts-3,xx1,raa2,0,erraa2);
982 gr2c->SetMarkerStyle(20);
983 gr2c->SetMarkerColor(kRed);
984 gr2c->SetLineColor(kRed);
985 gr2c->SetLineWidth(2);
986 gr2c->SetMarkerSize(1.5);
987 gr2c->SetName(
"gr2c");
990 TLegend *legc =
new TLegend(0.2,0.77,0.5,0.92);
991 legc->SetFillColor(10);
992 legc->SetFillStyle(1001);
993 legc->AddEntry(
"gr1c",
"Y(1S)",
"p");
994 legc->AddEntry(
"gr2c",
"Y(2S)",
"p");
995 legc->AddEntry(
"",
"",
"");
1000 TLatex* l1c =
new TLatex(3.5,0.73,
"sPHENIX Simulation");