4 for(
int i = n;
i>0;
i--)
10 double integral(
int nfg,
int nbg,
float lowerLimit,
float upperLimit)
21 double dx=(upperLimit-lowerLimit)/(
double)
steps;
23 for(
int k = 0;
k<=nfg;
k++) {
26 double tmp = factorial_up/factorial_down*0.5*pow(0.5, nfg+nbg-
k);
27 for(
int itmp=0;itmp<=
steps;itmp++)
29 double x=lowerLimit+dx*(float)itmp;
30 intgrl += tmp*pow(x,
k)*exp(-x)*dx;
45 cout <<
" error_fg_bg_pair: factorials too large, return symmetric error " << endl;
46 err_up = sqrt(nfg+nbg);
55 err_up = sqrt(nfg+nbg);
64 cout <<
"nfg = " << nfg <<
" nbg = " << nbg << endl;
76 maxsignal = (nfg+nbg)* 4;
78 maxsignal = (nfg+nbg)* 3;
80 maxsignal = (nfg+nbg)* 2;
82 float total=
integral(nfg,nbg,0,maxsignal);
88 bool is_cl_down =
false;
91 if(!is_cl_down) err_down = i*binSize;
92 if(err_down<0) err_down = 0;
93 cl_down =
integral(nfg,nbg,0, err_down)/total;
103 err_up = err_down+i*binSize;
104 cl_up = cl_down+
integral(nfg,nbg,err_down, err_up)/total;
105 if(cl_up>=0.841)
break;
113 err_down = (nfg-nbg)-err_down;
114 err_up = err_up - (nfg-nbg);
126 double A = pow(n/fabs(alpha),n)*TMath::Exp(-pow(fabs(alpha),2)/2.);
127 double B = n/fabs(alpha) - fabs(alpha);
128 double k = (x[0]-
mu)/sigma;
132 val = norm*TMath::Exp(-0.5*pow(k,2));
134 val = norm*A*pow(B-k,-n);
136 if( TMath::IsNaN(val) ) val = 0.0;
150 double mu2 = mu1*1.0595;
151 double mu3 = mu1*1.0946;
153 double A = pow(n/fabs(alpha),n)*TMath::Exp(-pow(fabs(alpha),2)/2.);
154 double B = n/fabs(alpha) - fabs(alpha);
155 double k1 = (x[0]-mu1)/sigma;
156 double k2 = (x[0]-mu2)/sigma;
157 double k3 = (x[0]-mu3)/sigma;
159 double val,val1,val2,val3;
161 if( k1 > -alpha ) { val1 = norm1*TMath::Exp(-0.5*pow(k1,2)); }
162 else { val1 = norm1*A*pow(B-k1,-n); }
163 if( k2 > -alpha ) { val2 = norm2*TMath::Exp(-0.5*pow(k2,2)); }
164 else { val2 = norm2*A*pow(B-k2,-n); }
165 if( k3 > -alpha ) { val3 = norm3*TMath::Exp(-0.5*pow(k3,2)); }
166 else { val3 = norm3*A*pow(B-k3,-n); }
168 val = val1 + val2 + val3;
170 if( TMath::IsNaN(val) ) val = 0.0;
184 double mu2 = mu1*1.0595;
185 double mu3 = mu1*1.0946;
187 double A = pow(n/fabs(alpha),n)*TMath::Exp(-pow(fabs(alpha),2)/2.);
188 double B = n/fabs(alpha) - fabs(alpha);
189 double k1 = (x[0]-mu1)/sigma;
190 double k2 = (x[0]-mu2)/sigma;
191 double k3 = (x[0]-mu3)/sigma;
193 double val,val1,val2,val3;
195 if( k1 > -alpha ) { val1 = norm1*TMath::Exp(-0.5*pow(k1,2)); }
196 else { val1 = norm1*A*pow(B-k1,-n); }
197 if( k2 > -alpha ) { val2 = norm2*TMath::Exp(-0.5*pow(k2,2)); }
198 else { val2 = norm2*A*pow(B-k2,-n); }
199 if( k3 > -alpha ) { val3 = norm3*TMath::Exp(-0.5*pow(k3,2)); }
200 else { val3 = norm3*A*pow(B-k3,-n); }
202 double bgnorm1 = p[7];
203 double bgslope1 = p[8];
205 double bg = exp(bgnorm1+x[0]*bgslope1);
207 val = val1 + val2 + val3 + bg;
208 if( TMath::IsNaN(val) ) val = 0.0;
222 gStyle->SetOptStat(0);
223 gStyle->SetOptFit(0);
225 TRandom* myrandom =
new TRandom3();
226 const int nbins = 15;
245 double set_statscale[4] = {3.48, 3.16, 1.42, 1.1};
246 double set_statscalepp[4] = {0.8, 1.16, 0.35, 0.41};
247 std::string run_plan[4] = {
"5 years/28 cryo-weeks",
"5 years/24 cryo-weeks",
"3 years/28 cryo-weeks",
"3 years/24 cryo-weeks"};
249 double statscale = set_statscale[scenario];
250 double statscalepp = set_statscalepp[scenario];
252 int auauevts = (int) (statscale * 10.0);
254 double statscale_lowlim = 7.0;
255 double statscale_uplim = 14.0;
257 TF1* fCBpp =
new TF1(
"fCBpp",
CBFunction,5.,14.,5);
258 TF1* fCBauau =
new TF1(
"fCBauau",
CBFunction,5.,14.,5);
259 TF1* fCB1s =
new TF1(
"fCB1s",
CBFunction,5.,14.,5);
260 TF1* fCB2s =
new TF1(
"fCB2s",
CBFunction,5.,14.,5);
261 TF1* fCB3s =
new TF1(
"fCB3s",
CBFunction,5.,14.,5);
277 static const int NCENT = 7;
278 double centlow[NCENT] = {0,5,10,20,30,40,60};
279 double centhigh[NCENT] = {5, 10,20,30,40,60,92};
280 double Ncoll[NCENT] = {1067, 858, 610, 378, 224, 94.2, 14.5};
282 double raacent_ups1s[NCENT] = {0.527483, 0.544815, 0.581766, 0.644214, 0.721109, 0.853888, 0.998349};
283 double raacent_ups2s[NCENT] = {0.165314, 0.179333, 0.210351, 0.26748, 0.34664, 0.510807, 0.979886};
284 double raacent_ups3s[NCENT] = {0.0302562, 0.0362929, 0.047993, 0.0706653, 0.108092, 0.231598, 0.961714};
317 double centwidth[NCENT];
318 for(
int i=0;
i<NCENT; ++
i)
320 centwidth[
i] = (centhigh[
i] - centlow[
i]) / 100.0;
321 cout <<
" cent bin " <<
i <<
" has width " << centwidth[
i] << endl;
326 double raapt[9],raa1s[9],raa2s[9],raa3s[9];
332 raa1s[0] = raacent_ups1s[icent];
333 raa1s[1] = raacent_ups1s[icent];
334 raa1s[2] = raacent_ups1s[icent];
335 raa1s[3] = raacent_ups1s[icent];
336 raa1s[4] = raacent_ups1s[icent];
337 raa2s[0] = raacent_ups2s[icent];
338 raa2s[1] = raacent_ups2s[icent];
339 raa2s[2] = raacent_ups2s[icent];
340 raa2s[3] = raacent_ups2s[icent];
341 raa2s[4] = raacent_ups2s[icent];
342 raa3s[0] = raacent_ups3s[icent];
343 raa3s[1] = raacent_ups3s[icent];
344 raa3s[2] = raacent_ups3s[icent];
345 raa3s[3] = raacent_ups3s[icent];
346 raa3s[4] = raacent_ups3s[icent];
376 TGraph* grRAA1S =
new TGraph(5,raapt,raa1s);
377 TGraph* grRAA2S =
new TGraph(5,raapt,raa2s);
378 TGraph* grRAA3S =
new TGraph(5,raapt,raa3s);
380 double NNN = statscale * 7780./0.49;
381 double NNNpp = statscalepp * 12130./0.90;
382 double ppauaurat = NNNpp/NNN;
387 double Ncoll_ref = (Ncoll[0] + Ncoll[1]) / 2.0;
388 double ncollfact = (Ncoll[icent] / Ncoll_ref);
389 double centwidth_ref = (centwidth[0]+centwidth[1]);
390 double centwidthfact = (centwidth[icent] / centwidth_ref);
391 NNN *= ncollfact*centwidthfact;
408 int Nups1nosup = int(NNN*eideff*eideff*frac[0]);
409 int Nups2nosup = int(NNN*eideff*eideff*frac[1]);
410 int Nups3nosup = int(NNN*eideff*eideff*frac[2]);
411 int Nups1pp = int(NNNpp*0.90*frac[0]);
412 int Nups2pp = int(NNNpp*0.90*frac[1]);
413 int Nups3pp = int(NNNpp*0.90*frac[2]);
419 string str_UpsilonPt =
"(2.0*3.14159*x*[0]*pow((1 + x*x/(4*[1]) ),-[2]))";
420 TF1* fUpsilonPt =
new TF1(
"fUpsilonPt",str_UpsilonPt.c_str(),0.,20.);
421 fUpsilonPt->SetParameters(72.1, 26.516, 10.6834);
422 double upsnorm = fUpsilonPt->Integral(0.,20.);
430 double s2 = s1 + 1.0;
431 tmpsum1 += Nups1nosup*fUpsilonPt->Integral(s1,s2)/upsnorm * grRAA1S->Eval((s1+s2)/2.);
432 tmpsum2 += Nups2nosup*fUpsilonPt->Integral(s1,s2)/upsnorm * grRAA2S->Eval((s1+s2)/2.);
433 tmpsum3 += Nups3nosup*fUpsilonPt->Integral(s1,s2)/upsnorm * grRAA3S->Eval((s1+s2)/2.);
435 int Nups1 = int(tmpsum1);
436 int Nups2 = int(tmpsum2);
437 int Nups3 = int(tmpsum3);
439 cout <<
"Total number of ALL Upsilons in AuAu = " << NNN << endl;
440 cout <<
"Total number of ALL Upsilons in pp = " << NNNpp << endl;
441 cout <<
"Number of upsilons in pp in acceptance = " << NNNpp*frac[0] <<
" " << NNNpp*frac[1] <<
" " << NNNpp*frac[2] << endl;
442 cout <<
"Number of upsilons in AuAu in acceptance = " << NNN*frac[0] <<
" " << NNN*frac[1] <<
" " << NNN*frac[2] << endl;
443 cout <<
"Number of upsilons in AuAu after eID efficiency = " << Nups1nosup <<
" " << Nups2nosup <<
" " << Nups3nosup << endl;
444 cout <<
"Number of upsilons in AuAu plot = " << Nups1 <<
" " << Nups2 <<
" " << Nups3 << endl;
445 cout <<
"Number of upsilons in pp plot = " << Nups1pp <<
" " << Nups2pp <<
" " << Nups3pp << endl;
554 double tonypar1 = 0.98;
555 double tonypar2 = 0.93;
557 double tonypar3 = 9.448;
558 double tonypar4 = 0.100;
559 double tonypar4pp = 0.089;
560 fCBpp->SetParameter(0,1000.);
561 fCBpp->SetParameter(1,tonypar1);
562 fCBpp->SetParameter(2,tonypar2);
563 fCBpp->SetParameter(3,tonypar3);
564 fCBpp->SetParameter(4,tonypar4pp);
565 fCBauau->SetParameter(0,1000.);
566 fCBauau->SetParameter(1,tonypar1);
567 fCBauau->SetParameter(2,tonypar2);
568 fCBauau->SetParameter(3,tonypar3);
569 fCBauau->SetParameter(4,tonypar4);
573 TH1D* hhups[nbins+1];
574 TH1D* hhups1[nbins+1];
575 TH1D* hhups2[nbins+1];
576 TH1D* hhups3[nbins+1];
577 TH1D* hhupspp[nbins+1];
578 TH1D* hhups1pp[nbins+1];
579 TH1D* hhups2pp[nbins+1];
580 TH1D* hhups3pp[nbins+1];
581 for(
int i=0;
i<nbins+1;
i++) {
582 sprintf(hhname,
"hhups_%d",
i);
583 hhups[
i] =
new TH1D(hhname,
"",nchan,start,stop);
585 sprintf(hhname,
"hhups1_%d",
i);
586 hhups1[
i] =
new TH1D(hhname,
"",nchan,start,stop);
588 sprintf(hhname,
"hhups2_%d",
i);
589 hhups2[
i] =
new TH1D(hhname,
"",nchan,start,stop);
591 sprintf(hhname,
"hhups3_%d",
i);
592 hhups3[
i] =
new TH1D(hhname,
"",nchan,start,stop);
594 hhups[
i]->SetLineWidth(2);
595 hhups1[
i]->SetLineWidth(2);
596 hhups2[
i]->SetLineWidth(2);
597 hhups3[
i]->SetLineWidth(2);
598 sprintf(hhname,
"hhupspp_%d",
i);
599 hhupspp[
i] =
new TH1D(hhname,
"",nchan,start,stop);
601 sprintf(hhname,
"hhups1pp_%d",
i);
602 hhups1pp[
i] =
new TH1D(hhname,
"",nchan,start,stop);
603 hhups1pp[
i]->Sumw2();
604 sprintf(hhname,
"hhups2pp_%d",
i);
605 hhups2pp[
i] =
new TH1D(hhname,
"",nchan,start,stop);
606 hhups2pp[
i]->Sumw2();
607 sprintf(hhname,
"hhups3pp_%d",
i);
608 hhups3pp[
i] =
new TH1D(hhname,
"",nchan,start,stop);
609 hhups3pp[
i]->Sumw2();
610 hhupspp[
i]->SetLineWidth(2);
611 hhups1pp[
i]->SetLineWidth(2);
612 hhups2pp[
i]->SetLineWidth(2);
613 hhups3pp[
i]->SetLineWidth(2);
619 double s2 = s1 + 1.0;
620 double tmpnups1 = Nups1nosup*fUpsilonPt->Integral(s1,s2)/upsnorm * grRAA1S->Eval((s1+s2)/2.);
621 double tmpnups2 = Nups2nosup*fUpsilonPt->Integral(s1,s2)/upsnorm * grRAA2S->Eval((s1+s2)/2.);
622 double tmpnups3 = Nups3nosup*fUpsilonPt->Integral(s1,s2)/upsnorm * grRAA3S->Eval((s1+s2)/2.);
626 fCBauau->SetParameter(3,tonypar3);
627 for(
int i=0;
i<int(tmpnups1+0.5);
i++) {
double myrnd = fCBauau->GetRandom(); hhups1[
j]->Fill(myrnd); hhups[
j]->Fill(myrnd); }
628 fCBauau->SetParameter(3,tonypar3*scale[1]);
629 for(
int i=0;
i<int(tmpnups2+0.5);
i++) {
double myrnd = fCBauau->GetRandom(); hhups2[
j]->Fill(myrnd); hhups[
j]->Fill(myrnd); }
630 fCBauau->SetParameter(3,tonypar3*scale[2]);
631 for(
int i=0;
i<int(tmpnups3+0.5);
i++) {
double myrnd = fCBauau->GetRandom(); hhups3[
j]->Fill(myrnd); hhups[
j]->Fill(myrnd); }
633 double tmpnups1pp = Nups1pp*fUpsilonPt->Integral(s1,s2)/upsnorm;
634 double tmpnups2pp = Nups2pp*fUpsilonPt->Integral(s1,s2)/upsnorm;
635 double tmpnups3pp = Nups3pp*fUpsilonPt->Integral(s1,s2)/upsnorm;
636 cout <<
"Nups1pp["<<
j<<
"]="<<tmpnups1pp<<
";"<<endl;
637 cout <<
"Nups2pp["<<
j<<
"]="<<tmpnups2pp<<
";"<<endl;
638 cout <<
"Nups3pp["<<
j<<
"]="<<tmpnups3pp<<
";"<<endl;
639 fCBpp->SetParameter(3,tonypar3);
640 for(
int i=0;
i<int(tmpnups1pp+0.5);
i++) {
double myrnd = fCBpp->GetRandom(); hhups1pp[
j]->Fill(myrnd); hhupspp[
j]->Fill(myrnd); }
641 fCBpp->SetParameter(3,tonypar3*scale[1]);
642 for(
int i=0;
i<int(tmpnups2pp+0.5);
i++) {
double myrnd = fCBpp->GetRandom(); hhups2pp[
j]->Fill(myrnd); hhupspp[
j]->Fill(myrnd); }
643 fCBpp->SetParameter(3,tonypar3*scale[2]);
644 for(
int i=0;
i<int(tmpnups3pp+0.5);
i++) {
double myrnd = fCBpp->GetRandom(); hhups3pp[
j]->Fill(myrnd); hhupspp[
j]->Fill(myrnd); }
650 fCBpp->SetParameter(3,tonypar3);
651 fCBauau->SetParameter(3,tonypar3);
652 for(
int i=0;
i<int(Nups1+0.5);
i++) {
double myrnd = fCBauau->GetRandom(); hhups1[
nbins]->Fill(myrnd); hhups[
nbins]->Fill(myrnd); }
653 for(
int i=0;
i<int(Nups1pp+0.5);
i++) {
double myrnd = fCBpp->GetRandom(); hhups1pp[
nbins]->Fill(myrnd); hhupspp[
nbins]->Fill(myrnd); }
654 fCBpp->SetParameter(3,tonypar3*scale[1]);
655 fCBauau->SetParameter(3,tonypar3*scale[1]);
656 for(
int i=0;
i<int(Nups2+0.5);
i++) {
double myrnd = fCBauau->GetRandom(); hhups2[
nbins]->Fill(myrnd); hhups[
nbins]->Fill(myrnd); }
657 for(
int i=0;
i<int(Nups2pp+0.5);
i++) {
double myrnd = fCBpp->GetRandom(); hhups2pp[
nbins]->Fill(myrnd); hhupspp[
nbins]->Fill(myrnd); }
658 fCBpp->SetParameter(3,tonypar3*scale[2]);
659 fCBauau->SetParameter(3,tonypar3*scale[2]);
660 for(
int i=0;
i<int(Nups3+0.5);
i++) {
double myrnd = fCBauau->GetRandom(); hhups3[
nbins]->Fill(myrnd); hhups[
nbins]->Fill(myrnd); }
661 for(
int i=0;
i<int(Nups3pp+0.5);
i++) {
double myrnd = fCBpp->GetRandom(); hhups3pp[
nbins]->Fill(myrnd); hhupspp[
nbins]->Fill(myrnd); }
665 TCanvas* cupspp =
new TCanvas(
"cupspp",
"Upsilons in p+p",100,100,600,600);
666 fTCBpp->SetParameter(0,2000.);
667 fTCBpp->FixParameter(1,tonypar1);
668 fTCBpp->FixParameter(2,tonypar2);
669 fTCBpp->SetParameter(3,tonypar3);
670 fTCBpp->FixParameter(4,tonypar4);
671 fTCBpp->SetParameter(5,500.);
672 fTCBpp->SetParameter(6,100.);
673 hhupspp[
nbins]->Fit(fTCBpp,
"rl",
"",7.,11.);
674 hhupspp[
nbins]->SetAxisRange(7.,11.);
675 hhupspp[
nbins]->SetMarkerSize(1.0);
676 hhupspp[
nbins]->GetXaxis()->SetTitle(
"Invariant mass [GeV/c^{2}]");
677 hhupspp[
nbins]->GetXaxis()->SetTitleOffset(1.0);
678 double tmpamp1 = hhupspp[
nbins]->GetFunction(
"fTCBpp")->GetParameter(0);
679 double tmpamp5 = tmpamp1*frac[1]/frac[0];
680 double tmpamp6 = tmpamp1*frac[2]/frac[0];
681 hhupspp[
nbins]->Draw();
683 fCB1s->SetLineColor(kBlue);
684 fCB1s->SetLineWidth(1);
685 fCB1s->SetParameter(0,fTCBpp->GetParameter(0));
686 fCB1s->SetParameter(1,fTCBpp->GetParameter(1));
687 fCB1s->SetParameter(2,fTCBpp->GetParameter(2));
688 fCB1s->SetParameter(3,fTCBpp->GetParameter(3)*scale[0]);
689 fCB1s->SetParameter(4,fTCBpp->GetParameter(4));
690 fCB2s->SetLineColor(kRed);
691 fCB2s->SetLineWidth(1);
692 fCB2s->SetParameter(0,tmpamp5);
693 fCB2s->SetParameter(1,fTCBpp->GetParameter(1));
694 fCB2s->SetParameter(2,fTCBpp->GetParameter(2));
695 fCB2s->SetParameter(3,fTCBpp->GetParameter(3)*scale[1]);
696 fCB2s->SetParameter(4,fTCBpp->GetParameter(4));
697 fCB3s->SetLineColor(kGreen+2);
698 fCB3s->SetLineWidth(1);
699 fCB3s->SetParameter(0,tmpamp6);
700 fCB3s->SetParameter(1,fTCBpp->GetParameter(1));
701 fCB3s->SetParameter(2,fTCBpp->GetParameter(2));
702 fCB3s->SetParameter(3,fTCBpp->GetParameter(3)*scale[2]);
703 fCB3s->SetParameter(4,fTCBpp->GetParameter(4));
710 TCanvas* cupsauau =
new TCanvas(
"cupsauau",
"Upsilons in Au+Au",100,100,600,600);
711 fTCBauau->SetParameter(0,2000.);
712 fTCBauau->FixParameter(1,tonypar1);
713 fTCBauau->FixParameter(2,tonypar2);
714 fTCBauau->SetParameter(3,tonypar3);
715 fTCBauau->FixParameter(4,tonypar4);
716 fTCBauau->SetParameter(5,500.);
717 fTCBauau->SetParameter(6,100.);
718 hhups[
nbins]->Fit(fTCBauau,
"rl",
"",7.,11.);
719 hhups[
nbins]->SetAxisRange(7.,11.);
720 hhups[
nbins]->SetMarkerSize(1.0);
721 hhups[
nbins]->GetXaxis()->SetTitle(
"Invariant mass [GeV/c^{2}]");
722 hhups[
nbins]->GetXaxis()->SetTitleOffset(1.0);
723 tmpamp1 = hhups[
nbins]->GetFunction(
"fTCBauau")->GetParameter(0);
724 tmpamp5 = tmpamp1*frac[1]/frac[0];
725 tmpamp6 = tmpamp1*frac[2]/frac[0];
726 hhups[
nbins]->Draw();
728 TCanvas* cupsvspt =
new TCanvas(
"cupsvspt",
"Upsilons vs. p_{T}",100,100,1200,900);
729 cupsvspt->Divide(4,3);
730 for(
int i=0;
i<12;
i++) {
731 if(
i==0) {cupsvspt->cd(1);}
732 if(
i==1) {cupsvspt->cd(2);}
733 if(
i==2) {cupsvspt->cd(3);}
734 if(
i==3) {cupsvspt->cd(4);}
735 if(
i==4) {cupsvspt->cd(5);}
736 if(
i==5) {cupsvspt->cd(6);}
737 if(
i==6) {cupsvspt->cd(7);}
738 if(
i==7) {cupsvspt->cd(8);}
739 if(
i==8) {cupsvspt->cd(9);}
740 if(
i==9) {cupsvspt->cd(10);}
741 if(
i==10) {cupsvspt->cd(11);}
742 if(
i==11) {cupsvspt->cd(12);}
743 hhups[
i]->SetAxisRange(7.0,11.0); hhups[
i]->Draw();
744 sprintf(tlchar,
"%d-%d GeV",
i,
i+1); tl[
i] =
new TLatex(8.0,hhups[
i]->GetMaximum()*0.95,tlchar); tl[
i]->Draw();
751 TH1D* hhall[nbins+1];
752 TH1D* hhall_scaled[nbins+1];
754 TH1D* hhtotbg[nbins+1];
755 TH1D* hhtotbg_scaled[nbins+1];
756 TH1D* hhcombbg[nbins+1];
757 TH1D* hhcombbg_scaled[nbins+1];
758 TH1D* hhfakefake[nbins+1];
759 TH1D* hhfakehf[nbins+1];
760 TH1D* hhbottom[nbins+1];
761 TH1D* hhcharm[nbins+1];
763 TH1D* hhcorrbg[nbins+1];
764 TH1D* hhcorrbg_scaled[nbins+1];
765 TH1D* hhfit[nbins+1];
774 double corrbgfitpar0;
775 double corrbgfitpar1;
777 TFile*
f=
new TFile(
"ccbb_eideff09.root");
778 for(
int i=0;
i<nbins+1;
i++) {
779 sprintf(tmpname,
"hhbottom_%d",
i);
780 hhbottom[
i] = (TH1D*)f->Get(tmpname);
781 hhbottom[
i]->SetDirectory(gROOT);
782 sprintf(tmpname,
"hhcharm_%d",
i);
783 hhcharm[
i] = (TH1D*)f->Get(tmpname);
784 hhcharm[
i]->SetDirectory(gROOT);
785 sprintf(tmpname,
"hhdy_%d",
i);
786 hhdy[
i] = (TH1D*)f->Get(tmpname);
787 hhdy[
i]->SetDirectory(gROOT);
788 sprintf(tmpname,
"hhcorrbg_%d",
i);
789 hhcorrbg[
i] = (TH1D*)hhbottom[
i]->Clone(tmpname);
790 hhcorrbg[
i]->Add(hhcharm[
i]);
791 hhcorrbg[
i]->Add(hhdy[i]);
792 sprintf(tmpname,
"hhcorrbg_scaled_%d",i);
793 hhcorrbg_scaled[
i] = (TH1D*)hhcorrbg[i]->Clone(tmpname);
794 hhcorrbg[
i]->Fit(
"expo",
"rql",
"",statscale_lowlim,statscale_uplim);
795 hhbottom[
i]->Fit(
"expo",
"rql",
"",statscale_lowlim,statscale_uplim);
796 hhdy[
i]->Fit(
"expo",
"rql",
"",statscale_lowlim,statscale_uplim);
798 corrbgfitpar0 = hhcorrbg[
i]->GetFunction(
"expo")->GetParameter(0);
799 corrbgfitpar1 = hhcorrbg[
i]->GetFunction(
"expo")->GetParameter(1);
801 cout <<
"bgpar0["<< i <<
"]="<<hhcorrbg[
i]->GetFunction(
"expo")->GetParameter(0)+
TMath::Log(statscale)<<
";"<< endl;
802 cout <<
"bgpar1["<< i <<
"]="<<hhcorrbg[
i]->GetFunction(
"expo")->GetParameter(1)<<
";"<< endl;
803 for(
int k=1;
k<=hhcorrbg[
i]->GetNbinsX();
k++) {
804 if(hhcorrbg[i]->GetBinLowEdge(
k)<statscale_lowlim || (hhcorrbg[
i]->GetBinLowEdge(
k)+hhcorrbg[
i]->GetBinWidth(
k))>statscale_uplim) {
805 hhcorrbg_scaled[
i]->SetBinContent(
k,0.);
806 hhcorrbg_scaled[
i]->SetBinError(
k,0.);
810 double tmp = ncollfact * centwidthfact * statscale * hhcorrbg[
i]->GetFunction(
"expo")->Eval(hhcorrbg[i]->GetBinCenter(
k));
811 double tmprnd = myrandom->Poisson(tmp);
812 if(tmprnd<0.) { tmprnd=0.; }
813 hhcorrbg_scaled[
i]->SetBinContent(
k,tmprnd);
814 hhcorrbg_scaled[
i]->SetBinError(
k,sqrt(tmprnd));
817 hhcorrbg_scaled[
i]->Fit(
"expo",
"rql",
"",statscale_lowlim,statscale_uplim);
818 hhcorrbg[
i]->SetDirectory(gROOT);
819 hhcorrbg_scaled[
i]->SetDirectory(gROOT);
823 TCanvas*
c2 =
new TCanvas(
"c2",
"Correlated BG (all p_{T})",100,100,600,600);
825 hhbottom[
nbins]->SetAxisRange(7.0,14.0);
826 hhbottom[
nbins]->SetLineColor(kBlue);
827 hhbottom[
nbins]->SetLineWidth(2);
829 hhbottom[
nbins]->GetXaxis()->SetTitle(
"Invariant mass [GeV/c^{2}]");
830 hhbottom[
nbins]->GetXaxis()->SetTitleOffset(1.0);
831 hhbottom[
nbins]->GetXaxis()->SetTitleColor(1);
832 hhbottom[
nbins]->GetXaxis()->SetTitleSize(0.040);
833 hhbottom[
nbins]->GetXaxis()->SetLabelSize(0.040);
835 hhbottom[
nbins]->GetYaxis()->SetTitleOffset(1.3);
836 hhbottom[
nbins]->GetYaxis()->SetTitleSize(0.040);
837 hhbottom[
nbins]->GetYaxis()->SetLabelSize(0.040);
839 hhcorrbg[
nbins]->SetAxisRange(7.0,14.0);
840 hhcorrbg[
nbins]->SetMinimum(0.1);
841 hhcorrbg[
nbins]->SetLineColor(kBlack);
842 hhcorrbg[
nbins]->SetLineWidth(2);
843 hhcorrbg[
nbins]->Draw(
"hist");
845 hhbottom[
nbins]->SetMarkerColor(kBlue);
846 hhbottom[
nbins]->SetLineColor(kBlue);
847 hhbottom[
nbins]->Draw(
"same");
849 hhdy[
nbins]->SetMarkerColor(kGreen+2);
850 hhdy[
nbins]->SetLineColor(kGreen+2);
851 hhdy[
nbins]->SetLineWidth(2);
852 hhdy[
nbins]->Draw(
"same");
854 hhcharm[
nbins]->SetMarkerColor(kRed);
855 hhcharm[
nbins]->SetLineColor(kRed);
856 hhcharm[
nbins]->SetLineWidth(2);
857 hhcharm[
nbins]->Draw(
"same");
859 TCanvas* c0 =
new TCanvas(
"c0",
"Correlated BG vs. p_{T} 10B events",100,100,1200,900);
862 if(
i==0) {c0->cd(1);}
863 if(
i==1) {c0->cd(2);}
864 if(
i==2) {c0->cd(3);}
865 if(
i==3) {c0->cd(4);}
866 if(
i==4) {c0->cd(5);}
867 if(
i==5) {c0->cd(6);}
868 if(
i==6) {c0->cd(7);}
869 if(
i==7) {c0->cd(8);}
870 if(
i==8) {c0->cd(9);}
871 if(
i==9) {c0->cd(10);}
872 if(
i==10) {c0->cd(11);}
873 if(
i==11) {c0->cd(12);}
874 hhcorrbg[
i]->SetAxisRange(7.,14.);
875 hhcorrbg[
i]->GetFunction(
"expo")->SetLineColor(kBlack);
876 hhbottom[
i]->GetFunction(
"expo")->SetLineColor(kBlue);
877 hhdy[
i]->GetFunction(
"expo")->SetLineColor(kGreen+2);
878 hhcorrbg[
i]->SetLineColor(kBlack);
879 hhbottom[
i]->SetLineColor(kBlue);
880 hhdy[
i]->SetLineColor(kGreen+2);
882 hhbottom[
i]->Draw(
"same");
883 hhdy[
i]->Draw(
"same");
884 sprintf(tlchar,
"%d-%d GeV",
i,
i+1); tl[
i] =
new TLatex(8.0,hhcorrbg[
i]->GetMaximum()*0.95,tlchar); tl[
i]->Draw();
887 TCanvas* c0scaled =
new TCanvas(
"c0scaled",
"SCALED Correlated BG vs. p_{T}",100,100,1200,900);
888 c0scaled->Divide(4,3);
890 if(
i==0) {c0scaled->cd(1);}
891 if(
i==1) {c0scaled->cd(2);}
892 if(
i==2) {c0scaled->cd(3);}
893 if(
i==3) {c0scaled->cd(4);}
894 if(
i==4) {c0scaled->cd(5);}
895 if(
i==5) {c0scaled->cd(6);}
896 if(
i==6) {c0scaled->cd(7);}
897 if(
i==7) {c0scaled->cd(8);}
898 if(
i==8) {c0scaled->cd(9);}
899 if(
i==9) {c0scaled->cd(10);}
900 if(
i==10) {c0scaled->cd(11);}
901 if(
i==11) {c0scaled->cd(12);}
902 hhcorrbg_scaled[
i]->SetAxisRange(7.0,14.0); hhcorrbg_scaled[
i]->Draw();
903 sprintf(tlchar,
"%d-%d GeV",
i,
i+1); tl[
i] =
new TLatex(8.0,hhcorrbg_scaled[
i]->GetMaximum()*0.95,tlchar); tl[
i]->Draw();
910 TH1D* hhbottom_pp[nbins+1];
911 TH1D* hhdy_pp[nbins+1];
912 TH1D* hhcorrbg_pp[nbins+1];
913 TH1D* hhall_pp[nbins+1];
915 double ppcorr = 8300./10./962.;
916 TF1* fbottom_nosup_corr =
new TF1(
"fbottom_nosup_corr",
"[0]+[1]*x",5.,14.);
917 fbottom_nosup_corr->SetParameters(-2.13861, 0.683323);
919 for(
int i=0;
i<nbins+1;
i++) {
921 sprintf(tmpname,
"hhbottom_pp_%d",
i);
922 hhbottom_pp[
i] = (TH1D*)hhbottom[
i]->Clone(tmpname);
923 for(
int k=1;
k<=hhbottom_pp[
i]->GetNbinsX();
k++) {
924 if(hhbottom_pp[
i]->GetBinLowEdge(
k)<statscale_lowlim || (hhbottom_pp[
i]->GetBinLowEdge(
k)+hhbottom_pp[
i]->GetBinWidth(
k))>statscale_uplim) {
925 hhbottom_pp[
i]->SetBinContent(
k,0.);
926 hhbottom_pp[
i]->SetBinError(
k,0.);
929 double tmp = ppcorr * fbottom_nosup_corr->Eval(hhbottom[
i]->GetBinCenter(
k)) * hhbottom[
i]->GetFunction(
"expo")->Eval(hhbottom[
i]->GetBinCenter(
k));
930 double tmprnd = myrandom->Poisson(tmp);
931 if(tmprnd<0.) { tmprnd=0.; }
932 hhbottom_pp[
i]->SetBinContent(
k,tmprnd);
933 hhbottom_pp[
i]->SetBinError(
k,sqrt(tmprnd));
937 sprintf(tmpname,
"hhdy_pp_%d",
i);
938 hhdy_pp[
i] = (TH1D*)hhdy[
i]->Clone(tmpname);
939 for(
int k=1;
k<=hhdy_pp[
i]->GetNbinsX();
k++) {
940 if(hhdy_pp[
i]->GetBinLowEdge(
k)<statscale_lowlim || (hhdy_pp[
i]->GetBinLowEdge(
k)+hhdy_pp[
i]->GetBinWidth(
k))>statscale_uplim) {
941 hhdy_pp[
i]->SetBinContent(
k,0.);
942 hhdy_pp[
i]->SetBinError(
k,0.);
945 double tmp = ppcorr * hhdy[
i]->GetFunction(
"expo")->Eval(hhdy[
i]->GetBinCenter(
k));
946 double tmprnd = myrandom->Poisson(tmp);
947 if(tmprnd<0.) { tmprnd=0.; }
948 hhdy_pp[
i]->SetBinContent(
k,tmprnd);
949 hhdy_pp[
i]->SetBinError(
k,sqrt(tmprnd));
953 sprintf(tmpname,
"hhcorrbg_pp_%d",
i);
954 hhcorrbg_pp[
i] = (TH1D*)hhbottom_pp[
i]->Clone(tmpname);
955 hhcorrbg_pp[
i]->Add(hhdy_pp[
i]);
956 hhcorrbg_pp[
i]->SetMarkerColor(kBlack);
957 hhcorrbg_pp[
i]->SetLineColor(kBlack);
958 hhbottom_pp[
i]->SetLineColor(kBlue);
959 hhdy_pp[
i]->SetLineColor(kGreen+2);
960 sprintf(tmpname,
"hhall_pp_%d",i);
961 hhall_pp[
i] = (TH1D*)hhcorrbg_pp[i]->Clone(tmpname);
962 hhall_pp[
i]->Add(hhupspp[i]);
963 hhall_pp[
i]->SetLineColor(kMagenta);
964 hhall_pp[
i]->SetMarkerColor(kMagenta);
966 hhcorrbg_pp[
i]->Fit(
"expo",
"rql",
"",statscale_lowlim,statscale_uplim);
967 hhcorrbg_pp[
i]->GetFunction(
"expo")->SetLineColor(kBlack);
968 hhbottom_pp[
i]->Fit(
"expo",
"rql",
"",statscale_lowlim,statscale_uplim);
969 hhbottom_pp[
i]->GetFunction(
"expo")->SetLineColor(kBlue);
970 hhdy_pp[
i]->Fit(
"expo",
"rql",
"",statscale_lowlim,statscale_uplim);
971 hhdy_pp[
i]->GetFunction(
"expo")->SetLineColor(kGreen+2);
975 TCanvas* cbginpp =
new TCanvas(
"cbginpp",
"corr bg in pp",10,10,700,700);
976 hhall_pp[
nbins]->SetAxisRange(7.,12.);
977 hhcorrbg_pp[
nbins]->Draw(
"pehist");
978 hhbottom_pp[
nbins]->Draw(
"histsame");
979 hhdy_pp[
nbins]->Draw(
"histsame");
982 TCanvas* cpp =
new TCanvas(
"cpp",
"corr bg + sig in pp",100,100,700,700);
983 hhall_pp[
nbins]->SetAxisRange(7.,12.);
984 hhall_pp[
nbins]->Draw(
"pehist");
985 hhcorrbg_pp[
nbins]->Draw(
"pesame");
986 hhbottom_pp[
nbins]->Draw(
"same");
987 hhdy_pp[
nbins]->Draw(
"same");
989 TCanvas* cpp_vspt =
new TCanvas(
"cpp_vspt",
"corr bg + sig vs pt in pp",50,50,1200,900);
990 cpp_vspt->Divide(4,3);
992 if(
i==0) {cpp_vspt->cd(1);}
993 if(
i==1) {cpp_vspt->cd(2);}
994 if(
i==2) {cpp_vspt->cd(3);}
995 if(
i==3) {cpp_vspt->cd(4);}
996 if(
i==4) {cpp_vspt->cd(5);}
997 if(
i==5) {cpp_vspt->cd(6);}
998 if(
i==6) {cpp_vspt->cd(7);}
999 if(
i==7) {cpp_vspt->cd(8);}
1000 if(
i==8) {cpp_vspt->cd(9);}
1001 if(
i==9) {cpp_vspt->cd(10);}
1002 if(
i==10) {cpp_vspt->cd(11);}
1003 if(
i==11) {cpp_vspt->cd(12);}
1004 hhall_pp[
i]->SetAxisRange(7.0,12.0); hhall_pp[
i]->Draw(
"hist"); hhcorrbg_pp[
i]->Draw(
"histsame");
1005 sprintf(tlchar,
"%d-%d GeV",
i,
i+1); tl[
i] =
new TLatex(8.0,hhcorrbg_pp[
i]->GetMaximum()*0.95,tlchar); tl[
i]->Draw();
1011 TCanvas*
dummy =
new TCanvas(
"dummy",
"dummy",0,0,500,500);
1013 f =
new TFile(
"fakee_eideff09.root");
1014 for(
int i=0;
i<nbins+1;
i++) {
1015 sprintf(tmpname,
"hhfakefake_%d",
i);
1016 hhfakefake[
i] = (TH1D*)f->Get(tmpname);
1017 hhfakefake[
i]->SetDirectory(gROOT);
1021 f =
new TFile(
"crossterms_eideff09.root");
1022 for(
int i=0;
i<nbins+1;
i++) {
1023 sprintf(tmpname,
"hhfakehf_%d",
i);
1024 hhfakehf[
i] = (TH1D*)f->Get(tmpname);
1025 hhfakehf[
i]->SetDirectory(gROOT);
1029 TF1* fbg =
new TF1(
"fbg",
"exp([0]+[1]*x)+exp([2]+[3]*x)",8.,11.);
1030 fbg->SetParameters(10., -1.0, 4., -0.1);
1031 fbg->SetParLimits(1.,-999.,0.);
1032 fbg->SetParLimits(3.,-999.,0.);
1034 for(
int i=0;
i<nbins+1;
i++) {
1035 sprintf(tmpname,
"hhcombbg_%d",
i);
1036 hhcombbg[
i] = (TH1D*)hhfakefake[
i]->Clone(tmpname);
1037 hhcombbg[
i]->Add(hhfakehf[
i]);
1038 sprintf(tmpname,
"hhcombbg_scaled_%d",i);
1039 hhcombbg_scaled[
i] = (TH1D*)hhcombbg[i]->Clone(tmpname);
1040 if(i==nbins) { fbg->SetParameters(10., -1.0, 4., -0.1); }
1041 hhcombbg[
i]->Fit(fbg,
"qrl",
"",statscale_lowlim,statscale_uplim);
1043 for(
int k=1;
k<=hhcombbg[
i]->GetNbinsX();
k++) {
1044 if(hhcombbg[i]->GetBinLowEdge(
k)<statscale_lowlim || (hhcombbg[
i]->GetBinLowEdge(
k)+hhcombbg[
i]->GetBinWidth(
k))>statscale_uplim) {
1045 hhcombbg_scaled[
i]->SetBinContent(
k,0.);
1046 hhcombbg_scaled[
i]->SetBinError(
k,0.);
1050 double tmp = ncollfact * ncollfact * centwidthfact * statscale * hhcombbg[
i]->GetFunction(
"fbg")->Eval(hhcombbg[i]->GetBinCenter(
k));
1051 double tmprnd = myrandom->Poisson(tmp);
1052 if(tmprnd<0.) { tmprnd=0.; }
1053 hhcombbg_scaled[
i]->SetBinContent(
k,tmprnd);
1054 hhcombbg_scaled[
i]->SetBinError(
k,sqrt(tmprnd));
1057 hhcombbg_scaled[
i]->Fit(fbg,
"qrl",
"",statscale_lowlim,statscale_uplim);
1062 TCanvas* C1 =
new TCanvas(
"C1",
"Combinatorial BG (ALL p_{T})",100,100,600,600);
1064 hhfakefake[
nbins]->SetAxisRange(7.0,14.0);
1065 hhfakefake[
nbins]->SetMinimum(0.1);
1066 hhfakefake[
nbins]->SetMaximum(5000.);
1067 hhfakefake[
nbins]->SetLineColor(kGreen+2);
1068 hhfakefake[
nbins]->SetLineWidth(2);
1069 hhfakefake[
nbins]->GetXaxis()->SetTitle(
"Transverse momentum [GeV/c]");
1070 hhfakefake[
nbins]->GetXaxis()->SetTitleOffset(1.0);
1071 hhfakefake[
nbins]->GetXaxis()->SetTitleColor(1);
1072 hhfakefake[
nbins]->GetXaxis()->SetTitleSize(0.040);
1073 hhfakefake[
nbins]->GetXaxis()->SetLabelSize(0.040);
1074 hhfakefake[
nbins]->GetYaxis()->SetTitle(
"Combinatorial background");
1075 hhfakefake[
nbins]->GetYaxis()->SetTitleOffset(1.3);
1076 hhfakefake[
nbins]->GetYaxis()->SetTitleSize(0.040);
1077 hhfakefake[
nbins]->GetYaxis()->SetLabelSize(0.040);
1078 hhfakefake[
nbins]->Draw(
"e");
1080 hhfakehf[
nbins]->SetLineColor(kOrange+4);
1081 hhfakehf[
nbins]->SetLineWidth(2);
1082 hhfakehf[
nbins]->Draw(
"esame");
1084 hhcombbg[
nbins]->SetLineColor(kBlack);
1085 hhcombbg[
nbins]->SetLineWidth(2);
1086 hhcombbg[
nbins]->Draw(
"esame");
1088 TCanvas* C1sc =
new TCanvas(
"C1sc",
"SCALED Combinatorial BG (ALL p_{T})",100,100,600,600);
1090 hhcombbg_scaled[
nbins]->SetAxisRange(7.,14.);
1091 hhcombbg_scaled[
nbins]->Draw(
"esame");
1093 TCanvas* c00 =
new TCanvas(
"c00",
"Combinatorial BG vs. p_{T}",150,150,1200,900);
1097 if(
i==0) {c00->cd(1);}
1098 if(
i==1) {c00->cd(2);}
1099 if(
i==2) {c00->cd(3);}
1100 if(
i==3) {c00->cd(4);}
1101 if(
i==4) {c00->cd(5);}
1102 if(
i==5) {c00->cd(6);}
1103 if(
i==6) {c00->cd(7);}
1104 if(
i==7) {c00->cd(8);}
1105 if(
i==8) {c00->cd(9);}
1106 if(
i==9) {c00->cd(10);}
1107 if(
i==10) {c00->cd(11);}
1108 if(
i>=11) {c00->cd(12);}
1109 hhcombbg[
i]->SetAxisRange(7.0,14.0); hhcombbg[
i]->Draw();
1110 sprintf(tlchar,
"%d-%d GeV",
i,
i+1); tl[
i] =
new TLatex(8.0,hhcombbg[
i]->GetMaximum()*0.95,tlchar); tl[
i]->Draw();
1113 TCanvas* c00scaled =
new TCanvas(
"c00scaled",
"SCALED Combinatorial BG vs. p_{T}",150,150,1200,900);
1114 c00scaled->Divide(4,3);
1117 if(
i==0) {c00scaled->cd(1);}
1118 if(
i==1) {c00scaled->cd(2);}
1119 if(
i==2) {c00scaled->cd(3);}
1120 if(
i==3) {c00scaled->cd(4);}
1121 if(
i==4) {c00scaled->cd(5);}
1122 if(
i==5) {c00scaled->cd(6);}
1123 if(
i==6) {c00scaled->cd(7);}
1124 if(
i==7) {c00scaled->cd(8);}
1125 if(
i==8) {c00scaled->cd(9);}
1126 if(
i==9) {c00scaled->cd(10);}
1127 if(
i==10) {c00scaled->cd(11);}
1128 if(
i>=11) {c00scaled->cd(12);}
1129 hhcombbg_scaled[
i]->SetAxisRange(statscale_lowlim,statscale_uplim); hhcombbg_scaled[
i]->Draw();
1130 sprintf(tlchar,
"%d-%d GeV",
i,
i+1); tl[
i] =
new TLatex(8.0,hhcombbg_scaled[
i]->GetMaximum()*0.95,tlchar); tl[
i]->Draw();
1137 for(
int i=0;
i<nbins+1;
i++) {
1138 sprintf(tmpname,
"hhtotbg_scaled_%d",
i);
1139 hhtotbg_scaled[
i] = (TH1D*)hhcombbg_scaled[
i]->Clone(tmpname);
1140 hhtotbg_scaled[
i]->Add(hhcorrbg_scaled[
i]);
1143 for(
int i=0;
i<nbins+1;
i++) {
1144 sprintf(tmpname,
"hhall_scaled_%d",
i);
1145 hhall_scaled[
i] = (TH1D*)hhtotbg_scaled[
i]->Clone(tmpname);
1146 hhall_scaled[
i]->Add(hhups[
i]);
1149 TCanvas* c000 =
new TCanvas(
"c000",
"Signal + Background vs. p_{T}",200,200,1200,900);
1152 if(
i==0) {c000->cd(1);}
1153 if(
i==1) {c000->cd(2);}
1154 if(
i==2) {c000->cd(3);}
1155 if(
i==3) {c000->cd(4);}
1156 if(
i==4) {c000->cd(5);}
1157 if(
i==5) {c000->cd(6);}
1158 if(
i==6) {c000->cd(7);}
1159 if(
i==7) {c000->cd(8);}
1160 if(
i==8) {c000->cd(9);}
1161 if(
i==9) {c000->cd(10);}
1162 if(
i==10) {c000->cd(11);}
1163 if(
i==11) {c000->cd(12);}
1164 hhall_scaled[
i]->SetAxisRange(7.0,14.0); hhall_scaled[
i]->SetMarkerStyle(1); hhall_scaled[
i]->Draw(
"pehist");
1165 sprintf(tlchar,
"%d-%d GeV",
i,
i+1); tl[
i] =
new TLatex(8.0,hhall_scaled[
i]->GetMaximum()*0.9,tlchar); tl[
i]->Draw();
1171 for(
int i=0;
i<nbins+1;
i++) {
1172 sprintf(tmpname,
"hhfit_%d",
i);
1173 hhfit[
i] = (TH1D*)hhall_scaled[
i]->Clone(tmpname);
1174 for(
int j=1;
j<=hhall_scaled[
i]->GetNbinsX();
j++) {
1175 hhfit[
i]->SetBinContent(
j,hhfit[
i]->GetBinContent(
j) - hhcombbg_scaled[
i]->GetFunction(
"fbg")->Eval(hhcombbg_scaled[
i]->GetBinCenter(
j)));
1176 hhfit[
i]->SetBinError(
j,sqrt(pow(hhfit[
i]->GetBinError(
j),2)+hhcombbg_scaled[
i]->GetFunction(
"fbg")->Eval(hhcombbg_scaled[
i]->GetBinCenter(
j))));
1184 double tmppar0 = corrbgfitpar0+
TMath::Log(statscale);
1185 double tmppar1 = corrbgfitpar1;
1186 cout <<
"###### " << tmppar0 <<
" " << tmppar1 << endl;
1188 double ppauauscale = fTCBauau->GetParameter(0)/fTCBpp->GetParameter(0)*0.9783;
1189 fSandBpp->SetParameter(0,fTCBpp->GetParameter(0)*ppauauscale);
1190 fSandBpp->SetParameter(1,fTCBpp->GetParameter(1));
1191 fSandBpp->SetParameter(2,fTCBpp->GetParameter(2));
1192 fSandBpp->SetParameter(3,fTCBpp->GetParameter(3));
1193 fSandBpp->SetParameter(4,fTCBpp->GetParameter(4));
1194 fSandBpp->SetParameter(5,fTCBpp->GetParameter(5)*ppauauscale);
1195 fSandBpp->SetParameter(6,fTCBpp->GetParameter(6)*ppauauscale);
1196 fSandBpp->SetParameter(7,tmppar0);
1197 fSandBpp->SetParameter(8,tmppar1);
1198 fSandBpp->SetLineColor(kBlue);
1199 fSandBpp->SetLineStyle(2);
1201 cout <<
"######### " << fTCBauau->GetParameter(0) <<
" " << fTCBauau->GetParameter(5) <<
" " << fTCBauau->GetParameter(6) << endl;
1202 fSandBauau->SetParameter(0,fTCBauau->GetParameter(0));
1203 fSandBauau->SetParameter(1,fTCBauau->GetParameter(1));
1204 fSandBauau->SetParameter(2,fTCBauau->GetParameter(2));
1205 fSandBauau->SetParameter(3,fTCBauau->GetParameter(3));
1206 fSandBauau->SetParameter(4,fTCBauau->GetParameter(4));
1207 fSandBauau->SetParameter(5,fTCBauau->GetParameter(5));
1208 fSandBauau->SetParameter(6,fTCBauau->GetParameter(6));
1209 fSandBauau->SetParameter(7,tmppar0);
1210 fSandBauau->SetParameter(8,tmppar1);
1211 fSandBauau->SetLineColor(kRed);
1214 TCanvas*
cfitall =
new TCanvas(
"cfitall",
"FIT all pT",270,270,600,600);
1215 hhfit[
nbins]->SetAxisRange(7.0,14.);
1216 hhfit[
nbins]->GetXaxis()->CenterTitle();
1217 hhfit[
nbins]->GetXaxis()->SetTitle(
"Mass(e^{+}e^{-}) [GeV/c^2]");
1218 hhfit[
nbins]->GetXaxis()->SetTitleOffset(1.1);
1219 hhfit[
nbins]->GetXaxis()->SetLabelSize(0.045);
1220 hhfit[
nbins]->GetYaxis()->CenterTitle();
1221 hhfit[
nbins]->GetYaxis()->SetLabelSize(0.045);
1222 hhfit[
nbins]->GetYaxis()->SetTitle(
"Events / (50 MeV/c^{2})");
1223 hhfit[
nbins]->GetYaxis()->SetTitleOffset(1.5);
1224 hhfit[
nbins]->Draw(
"pehist");
1225 fSandBpp->Draw(
"same");
1226 fSandBauau->Draw(
"same");
1232 TF1*
fmycorrbg =
new TF1(
"fmycorrbg",
"exp([0]+[1]*x)",7.,14.);
1233 fmycorrbg->SetParameters(tmppar0,tmppar1);
1234 fmycorrbg->SetLineStyle(2);
1235 fmycorrbg->SetLineColor(kRed);
1236 fmycorrbg->Draw(
"same");
1239 double myheight = fTCBauau->GetParameter(0);
1240 TLatex* ld1 =
new TLatex(10.1,myheight,
"sPHENIX Simulation");
1241 ld1->SetTextSize(0.035);
1243 TLatex* ld2 =
new TLatex(10.1,myheight-100.,
"0-10% Au+Au #sqrt{s} = 200 GeV");
1244 ld2->SetTextSize(0.035);
1249 sprintf(evstr,
"%i billion events",auauevts);
1250 ld3 =
new TLatex(10.1,myheight-200.,evstr);
1251 ld3->SetTextSize(0.035);
1254 TCanvas* cfitall2 =
new TCanvas(
"cfitall2",
"FIT all pT",270,270,600,600);
1255 TH1D* hhfit_tmp = (TH1D*)hhfit[nbins]->Clone(
"hhfit_tmp");
1256 hhfit_tmp->SetAxisRange(8.0,11.);
1257 hhfit_tmp->Draw(
"pehist");
1258 fSandBauau->Draw(
"same");
1259 fmycorrbg->Draw(
"same");
1266 TCanvas* callpt =
new TCanvas(
"callpt",
"Signal+BG (all p_{T})",300,300,600,600);
1268 hhall_scaled[
nbins]->GetXaxis()->SetTitle(
"Invariant mass GeV/c");
1269 hhall_scaled[
nbins]->SetLineColor(kBlack);
1270 hhall_scaled[
nbins]->SetMarkerColor(kBlack);
1271 hhall_scaled[
nbins]->SetMarkerStyle(20);
1272 hhall_scaled[
nbins]->SetAxisRange(8.0,10.8);
1273 hhall_scaled[
nbins]->Draw(
"pehist");
1274 hhcombbg_scaled[
nbins]->SetLineColor(kBlue);
1275 hhcombbg_scaled[
nbins]->Draw(
"histsame");
1276 hhcorrbg_scaled[
nbins]->SetLineColor(kRed);
1277 hhcorrbg_scaled[
nbins]->Draw(
"histsame");
1283 double u1start = 9.25;
1284 double u1stop = 9.65;
1285 double u2start = 9.80;
1286 double u2stop = 10.20;
1287 double u3start = 10.20;
1288 double u3stop = 10.55;
1290 double raa1[nbins+1],raa2[nbins+1],raa3[nbins+1],erraa1[nbins+1],erraa2[nbins+1],erraa3[nbins+1], erraa3_up[nbins+1], erraa3_dn[nbins+1];
1293 raa1[
i] = grRAA1S->Eval(0.5+
i*1.0);
1294 raa2[
i] = grRAA2S->Eval(0.5+
i*1.0);
1295 raa3[
i] = grRAA3S->Eval(0.5+
i*1.0);
1297 raa1[
nbins] = raa1[0];
1298 raa2[
nbins] = raa2[0];
1299 raa3[
nbins] = raa3[0];
1301 int fbin1 = hhall_scaled[
nbins]->FindBin(u1start + 0.001);
1302 int lbin1 = hhall_scaled[
nbins]->FindBin(u1stop - 0.001);
1303 int fbin2 = hhall_scaled[
nbins]->FindBin(u2start + 0.001);
1304 int lbin2 = hhall_scaled[
nbins]->FindBin(u2stop - 0.001);
1305 int fbin3 = hhall_scaled[
nbins]->FindBin(u3start + 0.001);
1306 int lbin3 = hhall_scaled[
nbins]->FindBin(u3stop - 0.001);
1307 cout <<
"Y(1S) bin range: " << fbin1 <<
" - " << lbin1 << endl;
1308 cout <<
"Y(1S) inv. mass range: " << u1start <<
" - " << u1stop << endl;
1309 cout <<
"Y(2S) bin range: " << fbin2 <<
" - " << lbin2 << endl;
1310 cout <<
"Y(2S) inv. mass range: " << u2start <<
" - " << u2stop << endl;
1311 cout <<
"Y(3S) bin range: " << fbin3 <<
" - " << lbin3 << endl;
1312 cout <<
"Y(3S) inv. mass range: " << u3start <<
" - " << u3stop << endl;
1314 double sum1[99] = {0.};
1315 double truesum1[99] = {0.};
1316 double ersum1[99] = {0.};
1317 double sumpp1[99] = {0.};
1318 double ersumpp1[99] = {0.};
1319 double sum2[99] = {0.};
1320 double truesum2[99] = {0.};
1321 double ersum2[99] = {0.};
1322 double sumpp2[99] = {0.};
1323 double ersumpp2[99] = {0.};
1324 double sum3[99] = {0.};
1325 double truesum3[99] = {0.};
1326 double allsum3[99] = {0.};
1327 double ersum3[99] = {0.};
1328 double ersum3_up[99] = {0.};
1329 double ersum3_dn[99] = {0.};
1330 double sumpp3[99] = {0.};
1331 double ersumpp3[99] = {0.};
1333 double sumsum1[99] = {0.};
1334 double sumsum2[99] = {0.};
1335 double sumsum3[99] = {0.};
1336 double sumsum1pp[99] = {0.};
1337 double sumsum2pp[99] = {0.};
1338 double sumsum3pp[99] = {0.};
1340 for(
int i=0;
i<nbins+1;
i++) {
1342 double s1 =
double(
i);
double s2 =
double(
i+1);
if(
i==nbins) {s1 = 0.;}
1344 for(
int j=fbin1;
j<=lbin1;
j++) {
1345 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)));
1346 truesum1[
i] += hhups1[
i]->GetBinContent(
j);
1347 ersum1[
i] += hhall_scaled[
i]->GetBinError(
j)*hhall_scaled[
i]->GetBinError(
j);
1348 sumpp1[
i] += hhups1pp[
i]->GetBinContent(
j);
1349 ersumpp1[
i] += hhupspp[
i]->GetBinError(
j)*hhupspp[
i]->GetBinError(
j);
1351 sumsum1[
i] = truesum1[
i];
1352 sumsum1pp[
i] = sumpp1[
i];
1359 if(sumsum1[
i]>0. && sumsum1pp[
i]>0.) {
1360 erraa1[
i] = raa1[
i]*sqrt(ersum1[
i]/sumsum1[
i]/sumsum1[
i] + ersumpp1[
i]/sumsum1pp[
i]/sumsum1pp[
i]);
1361 cout <<
"i " << i <<
" raa1 " << raa1[
i] <<
" erraa1 " << erraa1[
i] << endl;
1362 }
else {raa1[
i]=-1.0; erraa1[
i] = 999.; }
1364 for(
int j=fbin2;
j<=lbin2;
j++) {
1365 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)));
1366 truesum2[
i] += hhups2[
i]->GetBinContent(
j);
1367 ersum2[
i] += hhall_scaled[
i]->GetBinError(
j)*hhall_scaled[
i]->GetBinError(
j);
1368 sumpp2[
i] += hhups2pp[
i]->GetBinContent(
j);
1369 ersumpp2[
i] += hhupspp[
i]->GetBinError(
j)*hhupspp[
i]->GetBinError(
j);
1371 sumsum2[
i] = truesum2[
i];
1372 sumsum2pp[
i] = sumpp2[
i];
1379 if(sumsum2[
i]>0. && sumsum2pp[
i]>0.) {
1380 erraa2[
i] = raa2[
i]*sqrt(ersum2[
i]/sumsum2[
i]/sumsum2[
i] + ersumpp2[
i]/sumsum2pp[
i]/sumsum2pp[
i]);
1381 cout <<
"i " << i <<
" raa2 " << raa2[
i] <<
" erraa2 " << erraa2[
i] << endl;
1382 }
else {raa2[
i]=-1.0; erraa2[
i] = 999.; }
1384 for(
int j=fbin3;
j<=lbin3;
j++) {
1385 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)));
1386 truesum3[
i] += hhups3[
i]->GetBinContent(
j);
1387 ersum3[
i] += hhall_scaled[
i]->GetBinError(
j)*hhall_scaled[
i]->GetBinError(
j);
1388 allsum3[
i] += hhall_scaled[
i]->GetBinContent(
j);
1389 sumpp3[
i] += hhups3pp[
i]->GetBinContent(
j);
1390 ersumpp3[
i] += hhupspp[
i]->GetBinError(
j)*hhupspp[
i]->GetBinError(
j);
1392 sumsum3[
i] = truesum3[
i];
1393 sumsum3pp[
i] = sumpp3[
i];
1404 if(truesum3[
i]>0. && sumpp3[
i]>0.) {
1405 erraa3[
i] = raa3[
i]*sqrt(ersum3[
i]/sumsum3[
i]/sumsum3[
i] + ersumpp3[
i]/sumsum3pp[
i]/sumsum3pp[
i]);
1408 cout <<
"i " << i <<
" raa3 " << raa3[
i] <<
" erraa3_up " << erraa3_up[
i] <<
" erraa3_dn " << erraa3_dn[
i] << endl;
1409 }
else {raa3[
i]=-1.0; erraa3[
i] = 999;}
1413 cout <<
"====== Y(1S):" << endl;
1414 for(
int i=0;
i<nbins+1;
i++) {
1415 double s1 =
double(
i);
double s2 =
double(
i+1);
if(
i==nbins) {s1 = 0.;}
1416 cout <<
" " <<
i <<
" " << truesum1[
i] <<
"(" << Nups1*fUpsilonPt->Integral(s1,s2)/upsnorm <<
")" <<
" +- "
1417 << sqrt(ersum1[
i]) <<
" \t\t pp: " << sumpp1[
i] <<
" +- " << sqrt(ersumpp1[i]) <<
" raa " << raa1[
i] <<
" erraa " << erraa1[
i] << endl;
1419 cout <<
"====== Y(2S):" << endl;
1420 for(
int i=0;
i<nbins+1;
i++) {
1421 double s1 =
double(
i);
double s2 =
double(
i+1);
if(
i==nbins) {s1 = 0.;}
1422 cout <<
" " <<
i <<
" " << truesum2[
i] <<
"(" << Nups2*fUpsilonPt->Integral(s1,s2)/upsnorm <<
")" <<
" +- "
1423 << sqrt(ersum2[
i]) <<
" \t\t pp: " << sumpp2[
i] <<
" +- " << sqrt(ersumpp2[i]) <<
" raa " << raa2[
i] <<
" erraa " << erraa2[
i] << endl;
1425 cout <<
"====== Y(3S):" << endl;
1426 for(
int i=0;
i<nbins+1;
i++) {
1428 double s1 =
double(
i);
double s2 =
double(
i+1);
if(
i==nbins) {s1 = 0.;}
1429 cout <<
" " <<
i <<
" " << truesum3[
i] <<
"(" << Nups3*fUpsilonPt->Integral(s1,s2)/upsnorm <<
")" <<
" (all " << allsum3[
i] <<
") "<<
" +- "
1431 << sqrt(ersum3[
i]) <<
" \t\t pp: " << sumpp3[
i] <<
" +- " << sqrt(ersumpp3[i]) <<
" raa " << raa3[
i] <<
" erraa " << erraa3[
i] << endl;
1442 TCanvas* craa =
new TCanvas(
"craa",
"R_{AA}",120,120,600,600);
1443 TH2F* hh2 =
new TH2F(
"hh2",
" ",10,0.,
float(npts1+1),10,0.,1.5);
1444 hh2->GetXaxis()->SetTitle(
"Transverse momentum [GeV/c]");
1445 hh2->GetXaxis()->SetTitleOffset(1.0);
1446 hh2->GetXaxis()->SetTitleColor(1);
1447 hh2->GetXaxis()->SetTitleSize(0.040);
1448 hh2->GetXaxis()->SetLabelSize(0.040);
1449 hh2->GetYaxis()->SetTitle(
"R_{AA}");
1450 hh2->GetYaxis()->SetTitleOffset(1.3);
1451 hh2->GetYaxis()->SetTitleSize(0.040);
1452 hh2->GetYaxis()->SetLabelSize(0.040);
1455 double xx1[nbins+1];
for(
int i=0;
i<nbins+1;
i++) {xx1[
i] = 0.5 +
double(
i);}
1456 double xx2[nbins+1];
for(
int i=0;
i<nbins+1;
i++) {xx2[
i] = 0.43 +
double(
i);}
1457 double xx3[nbins+1];
for(
int i=0;
i<nbins+1;
i++) {xx3[
i] = 0.57 +
double(
i);}
1459 TGraphErrors* gr1 =
new TGraphErrors(npts1,xx1,raa1,0,erraa1);
1460 gr1->SetMarkerStyle(20);
1461 gr1->SetMarkerColor(kBlack);
1462 gr1->SetLineColor(kBlack);
1463 gr1->SetLineWidth(2);
1464 gr1->SetMarkerSize(1.5);
1465 gr1->SetName(
"gr1");
1468 erraa2[7] = erraa2[7]*0.85;
1470 TGraphErrors* gr2 =
new TGraphErrors(npts2,xx2,raa2,0,erraa2);
1471 gr2->SetMarkerStyle(20);
1472 gr2->SetMarkerColor(kRed);
1473 gr2->SetLineColor(kRed);
1474 gr2->SetLineWidth(2);
1475 gr2->SetMarkerSize(1.5);
1476 gr2->SetName(
"gr2");
1512 TLegend *
leg =
new TLegend(0.14,0.75,0.34,0.86);
1513 leg->SetFillColor(10);
1514 leg->SetFillStyle(1001);
1515 TLegendEntry *entry1=leg->AddEntry(
"gr1",
"Y(1S)",
"p");
1516 TLegendEntry *entry2=leg->AddEntry(
"gr2",
"Y(2S)",
"p");
1520 TLatex*
l1 =
new TLatex(3.35,1.33,
"sPHENIX Simulation");
1521 l1->SetTextSize(0.042);
1524 TLatex* lum =
new TLatex(3.35,1.23,
"0-10% Au+Au #sqrt{s} = 200 GeV");
1525 lum->SetTextSize(0.042);
1528 TLatex*
run =
new TLatex(3.35,1.13,run_plan[scenario].c_str());
1529 run->SetTextSize(0.042);
1532 TLine* lll =
new TLine(0.6,0.64,1.3,0.64);
1533 lll->SetLineColor(kBlue);
1534 lll->SetLineWidth(2);