29 #include <TGraphAsymmErrors.h> 34 #include <TGenPhaseSpace.h> 35 #include <TLorentzVector.h> 39 double Wmin [
kNWBins] = { 1.100, 1.180, 1.230, 1.280, 1.500, 1.700 };
40 double Wmax [
kNWBins] = { 1.180, 1.230, 1.280, 1.500, 1.700, 2.000 };
41 double Wc [
kNWBins] = { 1.140, 1.205, 1.255, 1.390, 1.600, 1.850 };
74 const double kPi = 3.14;
79 double coeff (
double W,
int m,
int l,
bool real);
80 double Y (
double th,
double phi,
int m,
int l,
bool real);
81 double Y00 (
double th,
double phi,
bool real);
82 double Y01 (
double th,
double phi,
bool real);
83 double Y02 (
double th,
double phi,
bool real);
84 double Y11 (
double th,
double phi,
bool real);
85 double Y12 (
double th,
double phi,
bool real);
86 double Y22 (
double th,
double phi,
bool real);
93 TFile
f(
"./events.root",
"recreate");
94 TNtuple
nt(
"nt",
"",
"m:i:th:phi");
96 TRandom rndgen(18928928);
98 const int nev = 10000000;
103 double phi_max = 2*
kPi;
108 const int nphi = 360;
109 double dth = (th_max - th_min ) / (nth -1);
110 double dphi = (phi_max - phi_min) / (nphi-1);
113 for(
int i=0;
i<nth;
i++)
114 for(
int j=0; j<nphi; j++)
115 pdf_max = TMath::Max(pdf_max,
121 for(
int iev=0; iev<nev; iev++) {
122 bool generated=
false;
124 double th = rndgen.Rndm() *
kPi;
125 double phi = rndgen.Rndm() * 2*
kPi;
126 double t = rndgen.Rndm() * pdf_max;
129 if(generated) { nt.Fill(1,iev,th,phi); }
136 const double MN = 0.938;
137 const double Mpi = 0.139;
138 TLorentzVector p4(0.0, 0.0, 0.0, W);
139 Double_t masses[Np] = { MN, Mpi } ;
141 TGenPhaseSpace phspg;
142 Bool_t is_allowed = phspg.SetDecay(p4, Np, masses);
145 double max_wght = -1;
146 for (Int_t iev=0; iev<200; iev++) {
147 double weight = phspg.Generate();
148 max_wght = TMath::Max(max_wght, weight);
152 for(
int iev=0; iev<nev; iev++) {
153 bool generated=
false;
155 double weight = phspg.Generate();
156 double t = rndgen.Rndm() * max_wght;
157 generated = (t<weight);
159 TLorentzVector * p4pi = phspg.GetDecay(1);
160 double th = p4pi->Theta();
161 double phi = p4pi->Phi() +
kPi;
162 nt.Fill(-1,iev,th,phi);
175 TFile
f(
"./inputs.root",
"recreate");
176 TNtuple
nt(
"nt",
"",
"th:phi:W:sum:r01:r02:r11:i11:r12:i12:r22:i22");
180 const int nphi = 360;
185 double phi_max = 2*
kPi;
186 double dth = (th_max - th_min ) / (nth -1);
187 double dphi = (phi_max - phi_min) / (nphi-1);
189 double W[nw] = { 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0 };
191 for(
int i=0;
i<nth;
i++) {
192 double th = th_min +
i*dth;
193 for(
int j=0; j<nphi; j++) {
194 double phi = phi_min + j*dphi;
195 for(
int k=0;
k<nw;
k++) {
199 double r01 =
coeff(w, 0,1,
true ) *
Y(th,phi, 0,1,
true );
200 double r02 =
coeff(w, 0,2,
true ) *
Y(th,phi, 0,2,
true );
201 double r11 =
coeff(w, 1,1,
true ) *
Y(th,phi, 1,1,
true );
202 double i11 =
coeff(w, 1,1,
false) *
Y(th,phi, 1,1,
false);
203 double r12 =
coeff(w, 1,2,
true ) *
Y(th,phi, 1,2,
true );
204 double i12 =
coeff(w, 1,2,
false) *
Y(th,phi, 1,2,
false);
205 double r22 =
coeff(w, 2,2,
true ) *
Y(th,phi, 2,2,
true );
206 double i22 =
coeff(w, 2,2,
false) *
Y(th,phi, 2,2,
false);
208 nt.Fill(th,phi,w,sum,r01,r02,r11,i11,r12,i12,r22,i22);
216 TH1D cr01(
"cr01",
"coefficients of R{Y01} vs W",nwb,wmin,wmax);
217 TH1D cr02(
"cr02",
"coefficients of R{Y02} vs W",nwb,wmin,wmax);
218 TH1D cr11(
"cr11",
"coefficients of R{Y11} vs W",nwb,wmin,wmax);
219 TH1D ci11(
"ci11",
"coefficients of I{Y11} vs W",nwb,wmin,wmax);
220 TH1D cr12(
"cr12",
"coefficients of R{Y12} vs W",nwb,wmin,wmax);
221 TH1D ci12(
"ci12",
"coefficients of I{Y12} vs W",nwb,wmin,wmax);
222 TH1D cr22(
"cr22",
"coefficients of R{Y22} vs W",nwb,wmin,wmax);
223 TH1D ci22(
"ci22",
"coefficients of I{Y22} vs W",nwb,wmin,wmax);
225 for(
int i=1;
i<cr01.GetNbinsX();
i++) {
226 double w = cr01.GetBinCenter(
i);
227 cr01.Fill( w,
coeff(w,0,1,
true) );
228 cr02.Fill( w,
coeff(w,0,2,
true) );
229 cr11.Fill( w,
coeff(w,1,1,
true) );
230 ci11.Fill( w,
coeff(w,1,1,
false) );
231 cr12.Fill( w,
coeff(w,1,2,
true) );
232 ci12.Fill( w,
coeff(w,1,2,
false) );
233 cr22.Fill( w,
coeff(w,2,2,
true) );
234 ci22.Fill( w,
coeff(w,2,2,
false) );
278 coeff(W, 0,1,
true ) *
Y(th,phi, 0,1,
true ) +
279 coeff(W, 0,2,
true ) *
Y(th,phi, 0,2,
true ) +
280 coeff(W, 1,1,
true ) *
Y(th,phi, 1,1,
true ) +
281 coeff(W, 1,2,
true ) *
Y(th,phi, 1,2,
true ) +
282 coeff(W, 2,2,
true ) *
Y(th,phi, 2,2,
true );
284 double fi =
coeff(W, 1,1,
false) *
Y(th,phi, 1,1,
false) +
285 coeff(W, 1,2,
false) *
Y(th,phi, 1,2,
false) +
286 coeff(W, 2,2,
false) *
Y(th,phi, 2,2,
false);
288 double f = TMath::Sqrt(fr*fr+fi*fi);
292 double coeff(
double W,
int m,
int l,
bool real)
294 if (m==0 && l==0 && real)
return 1;
298 else if (m==1 && l==1 && !real)
return splCoeffImY11.Eval(W);
300 else if (m==1 && l==2 && !real)
return splCoeffImY12.Eval(W);
302 else if (m==2 && l==2 && !real)
return splCoeffImY22.Eval(W);
307 double Y(
double th,
double phi,
int m,
int l,
bool real)
309 if (m==0 && l==0)
return Y00(th,phi,real);
310 else if (m==0 && l==1)
return Y01(th,phi,real);
311 else if (m==0 && l==2)
return Y02(th,phi,real);
312 else if (m==1 && l==1)
return Y11(th,phi,real);
313 else if (m==1 && l==2)
return Y12(th,phi,real);
314 else if (m==2 && l==2)
return Y22(th,phi,real);
319 double Y00(
double ,
double ,
bool real)
322 return 0.5/TMath::Sqrt(
kPi);
325 double Y01(
double th,
double ,
bool real)
328 return 0.5 * TMath::Sqrt(3./
kPi) * TMath::Cos(th);
331 double Y02(
double th,
double ,
bool real)
334 return 0.25 * TMath::Sqrt(5./
kPi) * (3.* TMath::Power(TMath::Cos(th),2.) - 1);
337 double Y11(
double th,
double phi,
bool real)
339 double a = -0.5 * TMath::Sqrt(1.5/
kPi) * TMath::Sin(th);
340 if(!real)
return a * TMath::Sin(phi);
341 else return a * TMath::Cos(phi);
344 double Y12(
double th,
double phi,
bool real)
346 double a = -0.5 * TMath::Sqrt(7.5/
kPi) * TMath::Cos(th) * TMath::Sin(th);
347 if(!real)
return a * TMath::Sin(phi);
348 else return a * TMath::Cos(phi);
351 double Y22(
double th,
double phi,
bool real)
353 double a = 0.25 * TMath::Sqrt(7.5/
kPi) * TMath::Power( TMath::Sin(th), 2.);
354 if(!real)
return a * TMath::Sin(2*phi);
355 else return a * TMath::Cos(2*phi);
void run_evgen_test(double W)
void plot_input_data(void)
double Y12(double th, double phi, bool real)
TSpline3 splCoeffImY22("splCoeffImY22", Wc, CoeffImY22, kNWBins,"", 1, 1)
double dCoeffImY22[kNWBins]
double CoeffImY12[kNWBins]
double CoeffReY02[kNWBins]
double dCoeffReY02[kNWBins]
TSpline3 splCoeffImY12("splCoeffImY12", Wc, CoeffImY12, kNWBins,"", 1, 1)
double dCoeffReY22[kNWBins]
double Y22(double th, double phi, bool real)
double dCoeffReY11[kNWBins]
double Y00(double th, double phi, bool real)
double angular_distribution_pdf(double W, double th, double phi)
TSpline3 splCoeffReY11("splCoeffReY11", Wc, CoeffReY11, kNWBins,"", 1, 1)
TSpline3 splCoeffReY12("splCoeffReY12", Wc, CoeffReY12, kNWBins,"", 1, 1)
double Y01(double th, double phi, bool real)
TSpline3 splCoeffReY01("splCoeffReY01", Wc, CoeffReY01, kNWBins,"", 0, 0)
double coeff(double W, int m, int l, bool real)
double CoeffImY11[kNWBins]
double Y(double th, double phi, int m, int l, bool real)
double CoeffReY22[kNWBins]
double dCoeffReY12[kNWBins]
double Y11(double th, double phi, bool real)
double dCoeffImY11[kNWBins]
TSpline3 splCoeffImY11("splCoeffImY11", Wc, CoeffImY11, kNWBins,"", 1, 1)
double Y02(double th, double phi, bool real)
TSpline3 splCoeffReY02("splCoeffReY02", Wc, CoeffReY02, kNWBins,"", 1, 1)
double CoeffReY12[kNWBins]
double CoeffReY01[kNWBins]
double CoeffImY22[kNWBins]
double dCoeffImY12[kNWBins]
TSpline3 splCoeffReY22("splCoeffReY22", Wc, CoeffReY22, kNWBins,"", 1, 1)
double CoeffReY11[kNWBins]
double dCoeffReY01[kNWBins]