54 gStyle->SetStatW(0.20);
55 gStyle->SetStatH(0.12);
58 double x[25] = {2.219, 2.221, 2.221, 2.222, 2.224, 2.226, 2.226, 2.228, 2.229, 2.231, 2.231, 2.233, 2.235, 2.236, 2.242, 2.247, 2.254, 2.255, 2.272, 2.289, 2.307, 2.333, 2.360, 2.404, 2.430};
59 double dx[25] = {0.0};
61 double y[25] = {4.15, 4.16, 3.87, 3.94, 4.40, 3.90, 3.68, 3.00, 3.20, 3.73, 2.97, 4.20, 3.52, 2.48, 3.38, 2.68, 2.63, 3.01, 2.25, 2.15, 1.97, 2.04, 2.04, 1.61, 1.93 };
62 double dy[25] = {0.34, 0.36, 0.54, 0.35, 0.36, 0.34, 0.34, 0.30, 0.32, 0.35, 0.33, 0.35, 0.34, 0.30, 0.45, 0.39, 0.35, 0.16, 0.17, 0.21, 0.24, 0.14, 0.12, 0.18, 0.11 };
65 TGraphErrors *gphi =
new TGraphErrors(25,x,y,dx,dy);
67 confgraph(gphi,
"#phi#phi cross section [JetSet];E_{cm} [GeV];#sigma [#mub]");
68 TH1F *hphi =
createHistoGraph(gphi,
"#phi#phi cross section [JetSet];E_{cm} [GeV];#sigma [#mub]",2.21,2.435);
71 TF1 *
f1=
new TF1(
"f1",
"0.5*[0]*(1.0-TMath::Erf((x-[1])/[2]))+[3]",2.21,2.435);
72 f1->SetParameters(3,2.23,0.01,1);
75 TF1 *finel=
new TF1(
"finel",
"[0]+[1]/x^[2]-[3]/x^[4]");
76 finel->SetParameters(32,82,0.67,45,0.85);
77 finel->SetRange(1.,100.);
79 TCanvas *
c1=
new TCanvas(
"c1",
"c1",20,20,1500,500);
80 c1->Divide(3,1,0.0001,0.0001);
91 l.DrawLine(emin,0,emin,hphi->GetMaximum()*0.5);
92 l.DrawLine(emax,0,emax,hphi->GetMaximum()*0.5);
95 double effs = 20322./100000.;
96 double effg = 35./840.5e6;
98 double fBR = 0.489*0.489;
103 double sigphi = f1->Eval(2.3)*1000;
109 double S = sigs*effs*fBR*
t*Lint;
110 double Bphi = sigphi*effs*fBR*
t*Lint;
111 double Bg = sigg*effg*
t*Lint;
113 cout <<
"S="<<S<<
" B_phi(sig ="<<sigphi<<
" nb)="<<Bphi<<
" B_g="<<Bg<<endl;
119 TF1 *fbw =
new TF1(
"fbw",
"[0]*[3]*TMath::BreitWigner(x,[1],[2])");
120 fbw->SetParameters(1,
m,G,1);
121 fbw->SetParNames(
"#sigma_{S}",
"m",
"#Gamma",
"f_{scale}");
124 TF1 *fbg=
new TF1(
"fbg",
"pol2",2.21,2.435);
127 TF1 *ffit =
new TF1(
"ffit",
"[0]*TMath::BreitWigner(x,[1],[2]) + pol2(3)");
128 ffit->SetParNames(
"A",
"m",
"#Gamma",
"a_{0}",
"a_{1}",
"a_{2}",
"a_{3}");
130 double stsize = (emax-emin)/(steps-1);
132 TGraphErrors *gscan =
new TGraphErrors(steps);
133 TGraphErrors *gscansig =
new TGraphErrors(steps);
134 TGraphErrors *gscanbg =
new TGraphErrors(steps);
135 confgraph(gscan,Form(
"#phi#phi scan (t=%.2fd);E_{cm} [GeV];counts",
t));
136 confgraph(gscanbg,Form(
"#phi#phi scan (t=%.2fd);E_{cm} [GeV];counts",
t),16);
137 confgraph(gscansig,Form(
"#phi#phi scan (t=%.2fd);E_{cm} [GeV];counts",
t));
139 double st_t =
t/steps;
143 for (
int i=0;
i<steps;++
i)
145 double ecm = emin +
i*stsize;
147 double st_sigs = fbw->Eval(ecm)/fbw->Eval(
m)*sigs;
148 double st_sigphi = f1->Eval(ecm)*1000;
149 double st_sigg = finel->Eval(ecm)*1e6;
151 double yieldS = gRandom->Poisson(st_sigs * effs * fBR * st_t * Lint);
152 double yieldBphi = gRandom->Poisson(st_sigphi * effs * fBR * st_t * Lint);
153 double yieldBg = gRandom->Poisson(st_sigg * effg * st_t * Lint);
155 printf(
"(%2d) Ecm = %5.3f GeV : sig_S = %.2f nb (S = %6.0f) sig_phi = %.2f nb (B = %6.0f) sig_gen = %.2f mub (Bg = %5.0f)\n",
i, ecm, st_sigs, yieldS, st_sigphi, yieldBphi, st_sigg/1000, yieldBg);
157 double yield = (yieldS + yieldBg + yieldBphi);
159 gscan->SetPoint(
i,ecm, yield);
160 gscan->SetPointError(
i, 0,
sqrt(yield));
162 gscanbg->SetPoint(
i,ecm, gRandom->Poisson(yieldBg));
163 gscanbg->SetPointError(
i, 0,
sqrt(yieldBg));
166 ffit->SetParameters(sigs,
m,G,1,1,1);
167 ffit->FixParameter(1,
m);
168 ffit->FixParameter(2,G);
171 ffit->ReleaseParameter(1);
172 ffit->ReleaseParameter(2);
173 gscan->Fit(
"ffit",
"m");
175 fbg->SetParameters(ffit->GetParameter(3),ffit->GetParameter(4),ffit->GetParameter(5),ffit->GetParameter(6));
177 TH1F *hscan =
createHistoGraph(gscan,Form(
"#phi#phi scan (t = %.2fd, #sigma = %.0fnb);E_{cm} [GeV];counts",
t,sigs),0,0,1.3);
179 gscan->Draw(
"Psame");
180 gscanbg->Draw(
"Psame");
182 for (
int i=0;
i<steps;++
i)
185 gscan->GetPoint(
i,x,y);
186 gscansig->SetPoint(
i,x,y-fbg->Eval(x));
187 gscansig->SetPointError(
i,gscan->GetErrorX(
i),gscan->GetErrorY(
i));
193 TH1F *hscansig =
createHistoGraph(gscansig,Form(
"#phi#phi scan (t = %.2fd, #sigma = %.0fnb);E_{cm} [GeV];counts",
t,sigs),0,0,1.3);
194 hscansig->SetMinimum(-100);
196 gscansig->Draw(
"Psame");
197 fbw->FixParameter(3,1);
198 gscansig->Fit(
"fbw");
199 fbw->SetParameter(0,1);
200 fbw->FixParameter(3, 1./fbw->GetMaximum(emin,emax)*(effs*fBR*st_t*Lint) );
201 fbw->SetParameter(0,TMath::MaxElement(gscansig->GetN(),gscansig->GetY())/(effs*fBR*st_t*Lint));
202 gscansig->Fit(
"fbw");
206 TPaveStats *st = (TPaveStats *)gscan->GetListOfFunctions()->FindObject(
"stats");
215 else cout <<
"***"<<endl;
printf("RealTime=%f seconds, CpuTime=%f seconds\n", rtime, ctime)
friend F32vec4 sqrt(const F32vec4 &a)
void confgraph(TGraph *g, TString tit, int col=1, int marker=20)
std::map< int, double > effs
TH1F * createHistoGraph(TGraph *g, TString tit="", double xmin=0, double xmax=0, double ymaxf=1.05)