ROOTPWA
sigmaBugg.C
Go to the documentation of this file.
1 // David Buggs sigma parameterization
2 // From: J.Phys.G34 (2007) 151
3 
4 #include <complex>
5 #include <vector>
6 
7 #include <iostream>
8 #include <iomanip>
9 #include "TMath.h"
10 #include "TGraph.h"
11 #include "TMultiGraph.h"
12 #include "TGraph2D.h"
13 #include "TCanvas.h"
14 #include "TF1.h"
15 #include "cauchyIntegral.h"
16 #include "Math/IFunction.h"
17 #include "Math/GSLIntegrator.h"
18 
19 //#include "SpecFuncMathMore.h"
20 
21 //using namespace ROOT::Math;
22 using namespace std;
23 
24 double const mpi=0.13957018;
25 double const mpi2=mpi*mpi;
26 double const mK=0.493677;
27 double const mK2=mK*mK;
28 double const mEta=0.547853;
29 double const mEta2=mEta*mEta;
30 
31 double const pi=TMath::Pi();
32 
33 // sigma mass
34 double const M=0.900;//1.3150;
35 double const M2=M*M;
36 
37 double const b1=3.728;//1.302;
38 double const b2=0.092;//0.340;
39 double const A=2.882;//2.426;
40 double const sa=0.41*mpi2;
41 double const gKK=0.6;
42 double const gEtaEta=0.2;
43 double const g4=0.012;
44 double const Lambda=3.39;
45 double const s0=3.238;
46 
47 
48 typedef complex<double> comp;
49 
50 comp const ic(0,1);
51 
52 // phase space factor analytically continued below threshold
53 comp rho(double s, double m2){
54  if(s>4*m2)return sqrt(1-4*m2/s);
55  else return ic*sqrt(4*m2/s-1);
56 }
57 
58 comp dampedRho(double s, double m2){
59  double alpha=5.2;
60  if(s-4*m2<0)alpha=8.4;
61  return exp(-alpha*fabs(s-4*m2));
62 }
63 
64 // 4pi rho parametr
65 comp rho4pi(double s){
66  if(s<16*mpi2)return 0;
67  //return sqrt(1-16*mpi2/s)/(1+exp(Lambda*(s0-s)));//
68  return sqrt(1-16*mpi2/s)/(1+exp(Lambda*(s0-s)));//*exp(-0.5*(s-1.45*1.45));
69 }
70 
71 
72 // empirical factor from BES analysis
73 comp g1(double s){
74  return M*(b1+b2*s)*exp(-(s-M2)/A);
75 }
76 
77 comp adler(double s){
78  return g1(s)*(s-sa)/(M2-sa);
79 }
80 
81 // pipi width
82 comp gamma1(double s){
83  return adler(s)*rho(s,mpi2);
84 }
85 
86 
87 
88 // KK
89 comp gamma2(double s){
90  return gKK*g1(s)*dampedRho(s,mK2)*rho(s,mK2);
91 }
92 
93 // etaeta
94 comp gamma3(double s){
95  return gEtaEta*g1(s)*dampedRho(s,mEta2)*rho(s,mEta2);
96 }
97 
98 // 4pi
99 comp gamma4(double s){
100  if(s<16*mpi2)return 0;
101  else return M*g4*rho4pi(s)/rho4pi(M2);
102 }
103 
104 comp gammaTot(double s){
105  return gamma1(s)+gamma2(s)+gamma3(s)+gamma4(s);
106 }
107 
108 
109 // dispersion term (only needed for pipi -> r=real
110 comp myj1(double s){
111  double r=rho(s,mpi2).real();
112  return 1./pi*(2 + r*TMath::Log((1-r)/(1+r)));
113 }
114 
115 comp z1(double s){
116  return myj1(s)-myj1(M2);
117 }
118 
119 
120 comp msParam(double s){
121  comp result;
122  double a1=17.051;
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);
126  double a2=-0.0536;
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);
130 
131  // double a1=3.5320;
132 // double s1=2.9876;double ds1=(s-s1)*(s-s1);
133 // double w1=0.8804;double w12=w1*w1;
134 // double dM1=(M2-s1)*(M2-s1);
135 // double a2=-0.0427;
136 // double s2=-0.4619;double ds2=(s-s2)*(s-s2);
137 // double w2=-0.0036;double w22=w2*w2;
138 // double dM2=(M2-s2)*(M2-s2);
139  result=a1/(ds1+w12)-a1/(dM1+w12)+a2/(ds2+w22)-a2/(dM2+w22);
140 
141 
142  return result;
143 
144 }
145 
146 // dispersion function for pipi
147 double disperse(double* x, double* par){
148  // x[0] is s' (which will be integrated over in the cauchyIntegral)
149  // par[0] is s (which the dispersion integral depends on)
150  // par[1] is M2 (pole mass of sigma squared)
151  //cout << "Calling disperse" << endl;
152  double nom=gamma4(x[0]).real();
153  double denom=(x[0]-par[0])*(x[0]-par[1]);
154  return nom/denom;
155 }
156 
157 
158 
159 // the function may contain only one pole, which has to ly outside of integration region. The other pole will be added by the principal value integrator. For normal integration both poles can be added
160 class dispInt: public ROOT::Math::IBaseFunctionOneDim {
161 public:
162  dispInt(double pole):_pole(pole),_pole2(0){};
163  double DoEval(double x) const;
164  ROOT::Math::IBaseFunctionOneDim* Clone() const {return new dispInt(*this);}
165 
166  void setPole(double s){_pole=s;_pole2=0;}
167  void setPoles(double s, double s2){_pole=s;_pole2=s2;}
168 
169 
170 private:
171  double _pole;
172  double _pole2;
173 
174 };
175 
176 double
177 dispInt::DoEval(double x) const{
178  double nom=gamma4(x).real();
179  double denom=(x-_pole);
180  if(_pole2!=0){denom*=(x-_pole2);
181 
182  //cout << "2poles" << endl;
183  }
184  return nom/denom;
185 }
186 
187 // even component of dispersion integrand
188 // Used for Longman method of integration
189 class dispIntEven: public ROOT::Math::IBaseFunctionOneDim {
190 public:
191  dispIntEven(double pole1, double pole2, double center):_pole(pole1),_pole2(pole2),_center(center){};
192  double DoEval(double x) const;
193  ROOT::Math::IBaseFunctionOneDim* Clone() const {return new dispIntEven(*this);}
194 
195  // center should coincide with one of the poles
196  void setPoles(double s, double s2, double center){_pole=s;_pole2=s2;_center=center;}
197 
198 private:
199  double _pole;
200  double _pole2;
201  double _center;
202 
203 };
204 
205 double
206 dispIntEven::DoEval(double x) const{
207  double xplus=_center+x;
208  double xminus=_center-x;
209  double nom1=gamma4(xplus).real();
210  double nom2=gamma4(xminus).real();
211 
212  double denom1=(xplus-_pole)*(xplus-_pole2);
213  double denom2=(xminus-_pole)*(xminus-_pole2);
214 
215  return 2*(nom1/denom1+nom2/denom2);
216 }
217 
218 
219 
220 
221 comp ms(double s, double cutoff=10){
222  if(s==M2)return 0;
223  double W=1.315; // mass
224  double W2=W*W;
225  double cutoffs=s*2;//cutoff;
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);
230  vector<realPole> p;
231  double residual_s=gamma4(s).real()/(s-W2);
232  double residual_mS=gamma4(W2).real()/(W2-s);
233  double low=16*mpi2;
234  if(s>low)p.push_back(realPole(s,residual_s)); // this pole only exists above threshold!
235  p.push_back(realPole(W2,residual_mS));
236 
237  cauchyIntegral cauchy(f,p,low,cutoffs);
238  double I=cauchy.eval_Hunter(4);
239  // calculate the rest of the integral cutoffs-> inifinty
240 
241  double I1=f->Integral(cutoffs,cutoff);
242  //cout << cutoff << " " << I1 << endl;
243 
244 
245  delete f;
246 
247 
248  return (s-W2)/TMath::Pi()*(I+I1);
249 }
250 
251 
252 comp msGSL(double s){
253  ROOT::Math::GSLIntegrator Integrator;
254  dispInt d(0);
255 
256  double mym2=0.9*0.9;
257 
258  // split integral in three parts containting at most one pole each
259  double mid=0.5*(s+mym2);
260  double top= s > mym2 ? s : mym2;
261  double bottom= s > mym2 ? mym2 : s;
262 
263  d.setPole(top);
264  Integrator.SetFunction(d);
265  double val1=Integrator.IntegralCauchy(16*mpi2,mid,bottom);
266  d.setPole(bottom);
267  Integrator.SetFunction(d);
268  double val2=Integrator.IntegralCauchy(d,mid,top+1,top);
269  d.setPoles(bottom,top);
270  Integrator.SetFunction(d);
271  double val3=Integrator.IntegralUp(d,top+1);
272  double msgsl=(s-mym2)/TMath::Pi()*(val1+val2+val3);
273  return msgsl;
274 
275 
276 }
277 
278 // using Longmans decomposition method
279 comp msLong(double s){
280  ROOT::Math::GSLIntegrator Integrator(ROOT::Math::IntegrationOneDim::kADAPTIVESINGULAR);
281 
282  double mym2=0.9*0.9;
283 
284  // split integral into 5 parts containting at most one pole each
285  // such that the pole lies in the center of the interval
286 
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;
293  // intervals:
294  // [16mpi2, bottom-diff] no pole
295  // [bottom-diff, bottom+diff] bottom pole
296  // [bottom+diff, top-diff] no pole
297  // [top -diff, top+diff] top pole
298  // [top+diff, infty] no pole
299  dispInt d(0);
300  dispIntEven dE(0,0,0);
301 
302  // [16mpi2, bottom-diff] no pole
303  d.setPoles(bottom,top);
304  Integrator.SetFunction(d);
305  double val1=Integrator.Integral(16*mpi2,bottom-diff);
306  // [bottom-diff, bottom+diff] bottom pole
307  dE.setPoles(bottom,top,bottom);
308  Integrator.SetFunction(dE);
309  double val2=2*Integrator.Integral(0,+diff);
310  // [bottom+diff, top-diff] no pole
311  Integrator.SetFunction(d);
312  double val3=Integrator.Integral(bottom+diff,top-diff);
313  // [top -diff, top+diff] top pole
314  dE.setPoles(bottom,top,top);
315  Integrator.SetFunction(dE);
316  double val4=2*Integrator.Integral(0,+diff);
317 // [top+diff, infty] no pole
318  Integrator.SetFunction(d);
319  double val5=Integrator.IntegralUp(top+diff);
320 
321  double msgsl=(s-mym2)/TMath::Pi()*(val1+val2+val3+val4+val5);
322  return msgsl;
323 
324 
325 }
326 
327 
328 
329 
330 comp D(double s){
331 
332  return M2 - s - adler(s)*z1(s) - ic*gammaTot(s) - msGSL(s);
333 
334 
335 }
336 
337 
338 comp tscat(double m){
339  double s=m*m;
340  return M*gamma1(s)/D(s);
341 
342 }
343 
344 comp tprod(double m){
345  double s=m*m;
346  return 1./D(s);
347 
348 }
349 
350 
351 void sigmaBugg(){
352 
353 
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);
363 
364  std::vector<TGraph*> vgMSCut;
365  unsigned int ng=80;
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]);
370  }
371  TGraph* gMSParam=new TGraph(npoints);
372 
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");
378 
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");
387 
388  double step=0.02;
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);
394 
395  g4piPS->SetPoint(i,Mass,rho4pi(Mass*Mass).real());
396  //gMS->SetPoint(i,Mass,ms(Mass*Mass,100).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());
400 
401  // for(unsigned int j=0;j<ng;++j){
402 // double cut=8+(double)j*5;
403 // vgMSCut[j]->SetPoint(i,Mass,ms(Mass*Mass,cut).real());
404 // }
405 
406 
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));
411 
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));
416 
417  Mass+=step;
418  }
419  cout << "finished" << endl;
420 
421  TCanvas* c=new TCanvas("c","c",10,10,1200,600);
422  c->Divide(4,1);
423  // c->cd(1);
424  //gRe->Draw("APL");
425  //gIm->Draw("PL same");
426  //c->cd(2);
427  //gIntense->Draw("APL");
428  //c->cd(3);
429  //gPhase->Draw("APL");
430 
431  c->cd(1);
432  gReProd->Draw("APL");
433  gImProd->Draw("PL same");
434  c->cd(2);
435  gIntenseProd->Draw("APL");
436  //g4piPS->Draw("PL same");
437  c->cd(3);
438  gPhaseProd->Draw("APL");
439  c->cd(4);
440  gMSGSL->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");
450 
451 
452 
453 
454 // TF1* f=new TF1("f","0.5*exp(0.5*x)/cos(TMath::Pi()*0.5*x)",-2,2);
455 // //TF1* f=new TF1("f","x*exp(-x)",0,20);
456 // unsigned int n=400;
457 // TGraph* gf=new TGraph(400);
458 // //f->SetParameter(0,1);
459 // vector<realPole> p;
460 // p.push_back(realPole(-1,exp(-0.5)/TMath::Pi()));
461 // for(unsigned int ip=1;ip<4;++ip){
462 // cout << ip << " ";
463 // for(int sig=-1;sig<2;sig+=2){
464 
465 // double k=sig*(double)ip;
466 // double res=pow(-1,k)*exp(k-0.5)/TMath::Pi();
467 // if(fabs(k-0.5)<1){p.push_back(realPole(2*(k-0.5),res));
468 // cout << sig << " z=" <<k-0.5<<" res="<< res << " ";}
469 // }
470 // cout << endl;
471 // }
472 
473  //p.push_back(realPole(4,36.63127778));
474 
475  //p.push_back(realPole(6,1));
476 
477  // for(double k=0;k<=1;k+=1){
478  // double res=pow(-1.,k)*TMath::Exp(k-0.5)/TMath::Pi();
479  // p.push_back(realPole(k-0.5,res));
480 
481  // }
482 
483  // cauchyIntegral cauchy(f,p,-2,2);
484 // cout << "Calculating hunter: " << setprecision(12);
485 // double I=cauchy.eval_Hunter(4); cout << I << endl;
486 
487  unsigned int n=200;
488  double s=1.5*1.5;
489  TGraph* gms=new TGraph(n);
490  for(unsigned int i=0;i<n;++i){
491  double m=(2+(double)i*0.01);
492  double cut=m*m;
493  gms->SetPoint(i,m,ms(s,cut).real());
494  }
495 
496  TGraph* ggsl=new TGraph(n);
497  ROOT::Math::GSLIntegrator Integrator;
498  dispInt d(0);
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;
502 
503  double mid=0.5*(s+mym2);
504  double top= s > mym2 ? s : mym2;
505  double bottom= s > mym2 ? mym2 : s;
506 
507  cout << "s=" << s
508  <<" bottom="<<bottom
509  <<" mid="<<mid
510  <<" top="<<top<<endl;
511 
512  d.setPole(top);
513  Integrator.SetFunction(d);
514  double val1=Integrator.IntegralCauchy(16*mpi2,mid,bottom);
515  d.setPole(bottom);
516  Integrator.SetFunction(d);
517  double val2=Integrator.IntegralCauchy(d,mid,3*top,top);
518  d.setPoles(bottom,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);
523  }
524 
525 
526 
527  TCanvas* c2=new TCanvas();
528  //c2->Divide(1,2);
529  //c2->cd(1);gms->Draw("APL");
530  //c2->cd(2);gf->Draw("APL");
531  //c2->cd(1);
532  multi->Draw("APL");
533  gMSParam->Draw("same");
534  gMSGSL->SetLineColor(kBlue);
535  gMSGSL->SetMarkerColor(kBlue);
536  gMSGSL->Draw("same");
537 
538  //c2->cd(2);ggsl->Draw("APL");
539 
540  // double W=0.9128; // mass
541 // double W2=W*W;
542 // TF1* gf=new TF1("ms",&disperse,16*mpi2,100,2,"disperse");
543 // double s1=2.5;
544 // gf->SetParameter(0,s1);
545 // gf->SetParameter(1,W2);
546 // vector<realPole> p;
547 // double residual_s=gamma4(s).real()/(s1-W2);
548 // double residual_mS=gamma4(W2).real()/(W2-s1);
549 // double low=16*mpi2;
550 // if(s>low)p.push_back(realPole(s1,residual_s)); // this pole only exists above threshold!
551 // p.push_back(realPole(W2,residual_mS));
552 
553 
554  //c2->cd(2);gf->Draw("");
555 }
556 
557 
558 
559 
560 
561 
562 
563 
564