ROOTPWA
mixingRes.C
Go to the documentation of this file.
1 #include <complex>
2 #include "TCanvas.h"
3 #include "TF1.h"
4 
5 using namespace std;
6 
7 
8 complex<double> singleMixedBW(double* x, double* par){
9  double s=x[0]*x[0];
10  double m1=par[0]; // mass of resonance
11  double gamma1=par[1]; // width of resonance
12  double m2=par[2];
13  double gamma2=par[3];
14  complex<double> B(par[4],par[5]); // mixing strength
15 
16  complex<double> bw1(m1*m1-s,-gamma1*m1);
17  complex<double> bw2(m2*m2-s,-gamma2*m2);
18 
19  complex<double> D=bw1 - B/bw2;
20  return 1./D;
21 }
22 
23 
24 double singleMixedBWamp(double* x, double* par){
25  return norm(singleMixedBW(x,par));
26 }
27 
28 double singleMixedBWphase(double* x, double* par){
29  return arg(singleMixedBW(x,par));
30 }
31 
32 complex<double> doubleMixedBW(double* x, double* par){
33  double* par1=par;
34  double* par2=&par[6];
35  return singleMixedBW(x,par1)+ 0.5*singleMixedBW(x,par2);
36 }
37 
38 double doubleMixedBWamp(double* x, double* par){
39  return norm(doubleMixedBW(x,par));
40 }
41 
42 double doubleMixedBWphase(double* x, double* par){
43  return arg(doubleMixedBW(x,par));
44 }
45 
46 void mixingRes(double m1, double m2,double bre, double bim){
47  double gamma1=0.3;
48  double gamma2=0.3;
49  double Bre=bre; double Bim=bim;
50 
51  TF1* fAmp1=new TF1("fAmp1",&singleMixedBWamp,1.0,2.5,6);
52  TF1* fPhase1=new TF1("fPhase1",&singleMixedBWphase,1.0,2.5,6);
53  TF1* fAmp2=new TF1("fAmp2",&singleMixedBWamp,1.0,2.5,6);
54  TF1* fPhase2=new TF1("fPhase2",&singleMixedBWphase,1.0,2.5,6);
55  TF1* fAmp=new TF1("fAmp",&doubleMixedBWamp,1.0,2.5,12);
56  TF1* fPhase=new TF1("fPhase",&doubleMixedBWphase,1.0,2.5,12);
57 
58  double par[12]={m1,gamma1,m2,gamma2,Bre,Bim,m2,gamma2,m1,gamma1,Bre,Bim};
59 
60  double par1[6]={m1,gamma1,m2,gamma2,Bre,Bim};
61  double par2[6]={m2,gamma2,m1,gamma1,Bre,Bim};
62 
63  fAmp1->SetParameters(par1);
64  fPhase1->SetParameters(par1);
65  fAmp2->SetParameters(par2);
66  fPhase2->SetParameters(par2);
67  fAmp->SetParameters(par);
68  fPhase->SetParameters(par);
69 
70 
71  TCanvas* c=new TCanvas("Mixing","Mixing",10,10,800,800);
72  c->Divide(2,3);
73  c->cd(1);fAmp1->Draw();
74  c->cd(2);fPhase1->Draw();
75  c->cd(3);fAmp2->Draw();
76  c->cd(4);fPhase2->Draw();
77  c->cd(5);fAmp->Draw();
78  c->cd(6);fPhase->Draw();
79 }