12 Double_t
CBcalc(Double_t *xx, Double_t *par)
18 double alpha = par[0];
20 double x_mean = par[2];
21 double sigma = par[3];
25 double A = pow( (n/TMath::Abs(alpha)),n) * exp(-pow(alpha,2)/2.0);
26 double B = n/TMath::Abs(alpha) - TMath::Abs(alpha);
29 if( (x-x_mean)/sigma > -alpha)
31 f = N * exp( -pow(x-x_mean,2) / (2.0*pow(sigma,2)));
35 f = N * A * pow(B - (x-x_mean)/sigma, -n);
39 double slope = par[6];
41 TF1 *fexp =
new TF1(
"fexp",
"[0]*exp([1]*x)",7,11);
42 fexp->SetParameter(0,Nexp);
43 fexp->SetParameter(1,slope);
45 f = f + fexp->Eval(x);
49 Double_t
Upscalc(Double_t *xx, Double_t *par)
54 double alpha1s = par[0];
56 double sigma1s = par[2];
64 double slope = par[10];
68 TF1 *
f1 =
new TF1(
"f1",
CBcalc,7,11,5);
69 f1->SetParameter(0,alpha1s);
70 f1->SetParameter(1,n1s);
71 f1->SetParameter(2,m1s);
72 f1->SetParameter(3,sigma1s);
73 f1->SetParameter(4,N1s);
75 TF1 *
f2 =
new TF1(
"f2",
CBcalc,7,11,5);
76 f2->SetParameter(0,alpha1s);
77 f2->SetParameter(1,n1s);
78 f2->SetParameter(2,m2s);
79 f2->SetParameter(3,sigma1s);
80 f2->SetParameter(4,N2s);
82 TF1 *
f3 =
new TF1(
"f3",
CBcalc,7,11,5);
83 f3->SetParameter(0,alpha1s);
84 f3->SetParameter(1,n1s);
85 f3->SetParameter(2,m3s);
86 f3->SetParameter(3,sigma1s);
87 f3->SetParameter(4,N3s);
89 TF1 *fexp =
new TF1(
"fexp",
"[0]*exp([1]*x)",7,11);
90 fexp->SetParameter(0,Nexp);
91 fexp->SetParameter(1,slope);
95 double mass = f1->Eval(x) + f2->Eval(x) + f3->Eval(x) + fexp->Eval(x);
103 gROOT->SetStyle(
"Plain");
104 gStyle->SetOptStat(0);
105 gStyle->SetOptFit(0);
106 gStyle->SetOptTitle(0);
108 TFile *file1S, *file2S, *file3S;
109 TH1 *recomass1S, *recomass2S, *recomass3S;
111 bool draw_gauss =
false;
116 bool AuAu_20pc =
false;
117 bool AuAu_10pc =
true;
121 file1S =
new TFile(
"root_files/ntp_quarkonium_out.root");
125 cout <<
"Failed to open file " << endl;
129 recomass1S = (TH1 *)file1S->Get(
"recomass0");
131 TH1 *
recomass = (TH1*)recomass1S->Clone(
"recomass1");
134 cout <<
"Failed to get recomass histogram " << endl;
138 recomass->GetXaxis()->SetTitle(
"invariant mass (GeV/c^{2})");
143 recomass->Rebin(nrebin);
145 TCanvas *cups =
new TCanvas(
"cups",
"cups",5,5,800,800);
146 recomass->SetTitle(
"Y(1S,2S,3S) #rightarrow e^{+}e^{-}");
147 recomass->SetMarkerStyle(20);
148 recomass->SetMarkerSize(1);
149 recomass->SetLineStyle(kSolid);
150 recomass->SetLineWidth(2);
152 recomass->DrawCopy(
"p");
155 TF1 *f1S =
new TF1(
"f1S",
CBcalc,7,11,7);
156 f1S->SetParameter(0, 1.0);
157 f1S->SetParameter(1, 1.0);
158 f1S->SetParameter(2, 9.46);
159 f1S->SetParameter(3, 0.08);
160 f1S->SetParameter(4, 2000.0);
162 f1S->SetParameter(5,3.5);
163 f1S->SetParameter(6,0.05);
165 f1S->SetParNames(
"alpha1S",
"n1S",
"m1S",
"sigma1S",
"N1S");
166 f1S->SetLineColor(kBlue);
167 f1S->SetLineWidth(3);
168 f1S->SetLineStyle(kDashed);
172 cout <<
"f1S pars " << f1S->GetParameter(3) <<
" " << f1S->GetParError(3) << endl;
175 sprintf(resstr,
"#sigma_{1S} = %.1f #pm %.1f MeV", f1S->GetParameter(3)*1000, f1S->GetParError(3)*1000);
176 TLatex *res =
new TLatex(0.13,0.55,resstr);
178 res->SetTextSize(0.05);
182 double binw = recomass->GetBinWidth(1);
183 double renorm = 1.0/binw;
184 cout <<
"renorm = " << renorm << endl;
186 cout <<
"Area of f1S is " << renorm * f1S->Integral(7,11) << endl;
190 TF1 *fgauss =
new TF1(
"fgauss",
"gaus(0)",7,11);
191 fgauss->SetParameter(0, f1S->GetParameter(4));
192 fgauss->SetParameter(1, f1S->GetParameter(2));
193 fgauss->SetParameter(2, f1S->GetParameter(3));
194 fgauss->SetLineColor(kRed);
195 if(draw_gauss) fgauss->Draw(
"same");
198 double area_fgauss = fgauss->Integral(7,11) * renorm;
199 double area_f1S = f1S->Integral(7,11) * renorm;
200 double fraction = area_fgauss / area_f1S;
203 cout <<
"Parameters of fgauss = " << fgauss->GetParameter(0) <<
" " << fgauss->GetParameter(1) <<
" " << fgauss->GetParameter(2) <<
" Area of fgauss is " << renorm * fgauss->Integral(7,11) <<
" fraction in fgauss " << area_fgauss / area_f1S << endl;
206 sprintf(labfrac,
"Gauss fraction %.2f", fraction);
207 TLatex *lab =
new TLatex(0.13,0.75,labfrac);
209 lab->SetTextSize(0.05);
210 if(draw_gauss) lab->Draw();