11 #include "TMultiGraph.h"
15 #include "cauchyIntegral.h"
16 #include "Math/IFunction.h"
17 #include "Math/GSLIntegrator.h"
24 double const mpi=0.13957018;
26 double const mK=0.493677;
28 double const mEta=0.547853;
31 double const pi=TMath::Pi();
37 double const b1=3.728;
38 double const b2=0.092;
43 double const g4=0.012;
45 double const s0=3.238;
48 typedef complex<double>
comp;
54 if(s>4*m2)
return sqrt(1-4*m2/s);
55 else return ic*sqrt(4*m2/s-1);
60 if(s-4*m2<0)alpha=8.4;
61 return exp(-alpha*fabs(s-4*m2));
66 if(s<16*
mpi2)
return 0;
100 if(s<16*
mpi2)
return 0;
112 return 1./
pi*(2 + r*TMath::Log((1-r)/(1+r)));
123 double s1=3.0533;
double ds1=(s-s1)*(s-s1);
124 double w1=1.0448;
double w12=w1*w1;
125 double dM1=(
M2-s1)*(
M2-s1);
127 double s2=-0.0975;
double ds2=(s-s2)*(s-s2);
128 double w2=0.2801;
double w22=w2*w2;
129 double dM2=(
M2-s2)*(
M2-s2);
139 result=a1/(ds1+w12)-a1/(dM1+w12)+a2/(ds2+w22)-a2/(dM2+w22);
152 double nom=
gamma4(x[0]).real();
153 double denom=(x[0]-par[0])*(x[0]-par[1]);
160 class dispInt:
public ROOT::Math::IBaseFunctionOneDim {
163 double DoEval(
double x)
const;
164 ROOT::Math::IBaseFunctionOneDim*
Clone()
const {
return new dispInt(*
this);}
167 void setPoles(
double s,
double s2){_pole=s;_pole2=s2;}
178 double nom=
gamma4(x).real();
179 double denom=(x-_pole);
180 if(_pole2!=0){denom*=(x-_pole2);
191 dispIntEven(
double pole1,
double pole2,
double center):_pole(pole1),_pole2(pole2),_center(center){};
192 double DoEval(
double x)
const;
196 void setPoles(
double s,
double s2,
double center){_pole=s;_pole2=s2;_center=center;}
207 double xplus=_center+x;
208 double xminus=_center-x;
209 double nom1=
gamma4(xplus).real();
210 double nom2=
gamma4(xminus).real();
212 double denom1=(xplus-_pole)*(xplus-_pole2);
213 double denom2=(xminus-_pole)*(xminus-_pole2);
215 return 2*(nom1/denom1+nom2/denom2);
226 if(s<W2)cutoffs=W2*2;
227 TF1* f=
new TF1(
"ms",&
disperse,16*
mpi2,cutoff,2,
"disperse");
228 f->SetParameter(0,s);
229 f->SetParameter(1,W2);
231 double residual_s=
gamma4(s).real()/(s-W2);
232 double residual_mS=
gamma4(W2).real()/(W2-s);
234 if(s>low)p.push_back(realPole(s,residual_s));
235 p.push_back(realPole(W2,residual_mS));
237 cauchyIntegral cauchy(f,p,low,cutoffs);
238 double I=cauchy.eval_Hunter(4);
241 double I1=f->Integral(cutoffs,cutoff);
248 return (s-W2)/TMath::Pi()*(I+I1);
253 ROOT::Math::GSLIntegrator Integrator;
259 double mid=0.5*(s+mym2);
260 double top= s > mym2 ? s : mym2;
261 double bottom= s > mym2 ? mym2 : s;
264 Integrator.SetFunction(d);
265 double val1=Integrator.IntegralCauchy(16*
mpi2,mid,bottom);
267 Integrator.SetFunction(d);
268 double val2=Integrator.IntegralCauchy(d,mid,top+1,top);
270 Integrator.SetFunction(d);
271 double val3=Integrator.IntegralUp(d,top+1);
272 double msgsl=(s-mym2)/TMath::Pi()*(val1+val2+val3);
280 ROOT::Math::GSLIntegrator Integrator(ROOT::Math::IntegrationOneDim::kADAPTIVESINGULAR);
287 double mid=0.5*(s+mym2);
288 double diff1=0.2*fabs(s-mym2);
289 double top= s > mym2 ? s : mym2;
290 double bottom= s > mym2 ? mym2 : s;
291 double diff2=fabs(bottom-4*
mpi2);
292 double diff=diff1 > diff2 ? diff2 : diff1;
304 Integrator.SetFunction(d);
305 double val1=Integrator.Integral(16*
mpi2,bottom-diff);
308 Integrator.SetFunction(dE);
309 double val2=2*Integrator.Integral(0,+diff);
311 Integrator.SetFunction(d);
312 double val3=Integrator.Integral(bottom+diff,top-diff);
315 Integrator.SetFunction(dE);
316 double val4=2*Integrator.Integral(0,+diff);
318 Integrator.SetFunction(d);
319 double val5=Integrator.IntegralUp(top+diff);
321 double msgsl=(s-mym2)/TMath::Pi()*(val1+val2+val3+val4+val5);
354 unsigned int npoints=240;
355 TGraph* gRe=
new TGraph(npoints);
356 TGraph* gIm=
new TGraph(npoints);
357 TGraph* gIntense=
new TGraph(npoints);
358 TGraph* gPhase=
new TGraph(npoints);
359 TGraph* g4piPS=
new TGraph(npoints);
360 TGraph* gMS=
new TGraph(npoints);
361 TGraph* gMSGSL=
new TGraph(npoints);
362 TGraph* gMSLong=
new TGraph(npoints);
364 std::vector<TGraph*> vgMSCut;
366 TMultiGraph* multi=
new TMultiGraph();
367 for(
unsigned int ig=0;ig<ng;++ig){
368 vgMSCut.push_back(
new TGraph(npoints));
369 multi->Add(vgMSCut[ig]);
371 TGraph* gMSParam=
new TGraph(npoints);
373 gMS->SetTitle(
"Dispersive Term m(s)");
374 gRe->SetTitle(
"Scattering");
375 gIm->SetTitle(
"Scattering Imag");
376 gIntense->SetTitle(
"Scattering Intensity");
377 gPhase->SetTitle(
"Scattering Phase");
379 TGraph* gReProd=
new TGraph(npoints);
380 TGraph* gImProd=
new TGraph(npoints);
381 TGraph* gIntenseProd=
new TGraph(npoints);
382 TGraph* gPhaseProd=
new TGraph(npoints);
383 gReProd->SetTitle(
"Production");
384 gImProd->SetTitle(
"Production Imag");
385 gIntenseProd->SetTitle(
"Production Intensity");
386 gPhaseProd->SetTitle(
"Production Phase");
389 double Mass=2*
mpi+step;
390 for(
unsigned int i=0;
i<npoints; ++
i){
391 complex<double> amp=
tscat(Mass);
392 complex<double> pamp=
tprod(Mass);
393 double p=sqrt(Mass*Mass/4.-
mpi2);
395 g4piPS->SetPoint(
i,Mass,
rho4pi(Mass*Mass).real());
397 gMSGSL->SetPoint(
i,Mass,
msGSL(Mass*Mass).real());
398 gMSLong->SetPoint(
i,Mass,
msLong(Mass*Mass).real());
399 gMSParam->SetPoint(
i,Mass,
msParam(Mass*Mass).real());
407 gRe->SetPoint(
i,Mass,amp.real()*Mass/(2*
p));
408 gIm->SetPoint(
i,Mass,amp.imag()*Mass/(2*
p));
409 gIntense->SetPoint(
i,Mass,norm(amp));
410 gPhase->SetPoint(
i,Mass,arg(amp));
412 gReProd->SetPoint(
i,Mass,pamp.real());
413 gImProd->SetPoint(
i,Mass,pamp.imag());
414 gIntenseProd->SetPoint(
i,Mass,norm(pamp));
415 gPhaseProd->SetPoint(
i,Mass,arg(pamp));
419 cout <<
"finished" << endl;
421 TCanvas* c=
new TCanvas(
"c",
"c",10,10,1200,600);
432 gReProd->Draw(
"APL");
433 gImProd->Draw(
"PL same");
435 gIntenseProd->Draw(
"APL");
438 gPhaseProd->Draw(
"APL");
441 gMSParam->SetLineColor(kRed);
442 gMSParam->SetMarkerColor(kRed);
443 gMSParam->Draw(
"same PL");
444 g4piPS->SetLineColor(kBlue);
445 g4piPS->SetMarkerColor(kBlue);
446 g4piPS->Draw(
"same PL");
447 gMSLong->SetLineColor(kMagenta);
448 gMSLong->SetMarkerColor(kMagenta);
449 gMSLong->Draw(
"same PL");
489 TGraph* gms=
new TGraph(n);
490 for(
unsigned int i=0;
i<
n;++
i){
491 double m=(2+(double)
i*0.01);
493 gms->SetPoint(
i,m,
ms(s,cut).real());
496 TGraph* ggsl=
new TGraph(n);
497 ROOT::Math::GSLIntegrator Integrator;
499 for(
unsigned int i=0;
i<
n;++
i){
500 double m=(2*
mpi+(double)
i*0.01);
501 double s=m*m;
double mym2=1.35*1.35;
503 double mid=0.5*(s+mym2);
504 double top= s > mym2 ? s : mym2;
505 double bottom= s > mym2 ? mym2 : s;
510 <<
" top="<<top<<endl;
513 Integrator.SetFunction(d);
514 double val1=Integrator.IntegralCauchy(16*
mpi2,mid,bottom);
516 Integrator.SetFunction(d);
517 double val2=Integrator.IntegralCauchy(d,mid,3*top,top);
519 Integrator.SetFunction(d);
520 double val3=Integrator.IntegralUp(d,3*top);
521 double msgsl=(s-
M2)/TMath::Pi()*(val1+val2+val3);
522 ggsl->SetPoint(
i,m,msgsl);
527 TCanvas* c2=
new TCanvas();
533 gMSParam->Draw(
"same");
534 gMSGSL->SetLineColor(kBlue);
535 gMSGSL->SetMarkerColor(kBlue);
536 gMSGSL->Draw(
"same");