BOSS 7.1.0
BESIII Offline Software System
Loading...
Searching...
No Matches
EvtD0ToKpiEtap.cc
Go to the documentation of this file.
1// Environment:
2// This software is part of the EvtGen package developed jointly
3// for the BaBar and CLEO collaborations. If you use all or part
4// of it, please give an appropriate acknowledgement.
5//
6// Copyright Information: See EvtGen/COPYRIGHT
7// Copyright (C) 1998 Caltech, UCSB
8//
9// Module: EvtD0ToEtapipi.cc
10//
11// Description: Routine to handle three-body decays of D0/D0_bar or D+/D-
12//
13// Modification history:
14//
15// Liaoyuan Dong Dec 04 2022 Module created
16//
17//------------------------------------------------------------------------
21#include "EvtGenBase/EvtPDL.hh"
27#include <stdlib.h>
28using namespace std;
29
31
32void EvtD0ToKpiEtap::getName(std::string& model_name){
33 model_name="D0ToKpiEtap";
34}
35
37 return new EvtD0ToKpiEtap;
38}
40 checkNArg(0);
41 checkNDaug(3);
46
47 phi[0] = 0.0; rho[0] = 1.0;
48 phi[1] = 3.5567 ; rho[1] = 2.0540e-01; //892
49 phi[2] = 0.61028; rho[2] = 1.5846e+00;//1680
50
51 //std::cout << "Initializing EvtD0ToKpiEtap" << std::endl;
52 //for (int i=0; i<3; i++) {
53 // cout << i << " rho= " << rho[i] << " phi= " << phi[i] << endl;
54 //}
55
56 modetype[0]= 132;
57 modetype[1]= 12;
58 modetype[2]= 12;
59
60 mass[2] = 1.718;
61 mass[1] = 0.89555;
62 width[2]= 0.322;
63 width[1]= 0.0473;
64 mass[0] = 1.414;
65 width[0]= 0.232;
66 const double mk0 = 0.497614;
67 const double mass_Kaon = 0.49368;
68 const double mass_Pion = 0.13957;
69 const double mass_Pi0 = 0.1349766;
70 const double meta = 0.547862;
71 const double metap = 0.95778;
72 mpi = 0.13957;
73 mD = 1.86486;
74 mDs = 1.9683;
75 rRes= 9.0;
76 rD = 5.0;
77 math_pi = 3.1415926;
78 GS1 = 0.636619783;
79 GS2 = 0.01860182466;
80 GS3 = 0.1591549458; // 1/(2*math_2pi)
81 GS4 = 0.00620060822; // mass_Pion2/math_pi
82
83 int GG[4][4] = { {1,0,0,0}, {0,-1,0,0}, {0,0,-1,0}, {0,0,0,-1} };
84 for (int i=0; i<4; i++) { for (int j=0; j<4; j++) {
85 G[i][j] = GG[i][j];
86 }
87 }
88}
90 setProbMax(3.76);
91}
92
94
95 // This piece of code could in principle be used to calculate maximum
96 // probablity on fly. But as it uses high number of points and model
97 // deals with single final state, we keep hardcoded number for now rather
98 // than adapting code to work here.
99
100 /* double maxprob = 0.0;
101 for(int ir=0;ir<=60000000;ir++){
102 p->initializePhaseSpace(getNDaug(),getDaugs());
103 EvtVector4R D1 = p->getDaug(0)->getP4();
104 EvtVector4R D2 = p->getDaug(1)->getP4();
105 EvtVector4R D3 = p->getDaug(2)->getP4();
106
107 double P1[4], P2[4], P3[4];
108 P1[0] = D1.get(0); P1[1] = D1.get(1); P1[2] = D1.get(2); P1[3] = D1.get(3);
109 P2[0] = D2.get(0); P2[1] = D2.get(1); P2[2] = D2.get(2); P2[3] = D2.get(3);
110 P3[0] = D3.get(0); P3[1] = D3.get(1); P3[2] = D3.get(2); P3[3] = D3.get(3);
111
112 double value;
113 value = calDalEva(P1, P2, P3);
114 if(value>maxprob) {
115 maxprob=value;
116 cout << "ir = " << ir << " maxProb= " << value << endl;
117 }
118 }
119 cout << "maxProb = " << maxprob << endl;
120 */
122 EvtVector4R D1 = p->getDaug(0)->getP4();
123 EvtVector4R D2 = p->getDaug(1)->getP4();
124 EvtVector4R D3 = p->getDaug(2)->getP4();
125
126 double P1[4], P2[4], P3[4];
127 P1[0] = D1.get(0); P1[1] = D1.get(1); P1[2] = D1.get(2); P1[3] = D1.get(3);
128 P2[0] = D2.get(0); P2[1] = D2.get(1); P2[2] = D2.get(2); P2[3] = D2.get(3);
129 P3[0] = D3.get(0); P3[1] = D3.get(1); P3[2] = D3.get(2); P3[3] = D3.get(3);
130
131
132/* double P1[4] = {0.5891186 , 0.1178592 , -0.289217 , 0.0761997};
133 double P2[4] = {0.2860281 , -0.095573 , 0.2069696 , -0.101791};
134 double P3[4] = {1.0120198 , -0.171013 , 0.2017959 , -0.192027};
135*/
136
137 double value;
138 int g0[3]={0,1,1};
139 int spin[3]={0,1,1};
140 int nstates=3;
141 calEva(P1, P2, P3, mass, width, rho, phi, g0, spin, modetype, nstates, value);
142
143 setProb(value);
144 return ;
145
146}
147
148void EvtD0ToKpiEtap::Com_Multi(double a1[2], double a2[2], double res[2])
149{
150 res[0] = a1[0]*a2[0]-a1[1]*a2[1];
151 res[1] = a1[1]*a2[0]+a1[0]*a2[1];
152}
153void EvtD0ToKpiEtap::Com_Divide(double a1[2], double a2[2], double res[2])
154{
155 double tmp = a2[0]*a2[0]+a2[1]*a2[1];
156 res[0] = (a1[0]*a2[0]+a1[1]*a2[1])/tmp;
157 res[1] = (a1[1]*a2[0]-a1[0]*a2[1])/tmp;
158}
159//------------base---------------------------------
160double EvtD0ToKpiEtap::SCADot(double a1[4], double a2[4])
161{
162 double _cal = a1[0]*a2[0]-a1[1]*a2[1]-a1[2]*a2[2]-a1[3]*a2[3];
163 return _cal;
164}
165double EvtD0ToKpiEtap::barrier(int l, double sa, double sb, double sc, double r, double mass)
166{
167 double q = (sa+sb-sc)*(sa+sb-sc)/(4*sa)-sb;
168 if(q < 0) q = -q;
169 double z;
170 z = q*r*r;
171 double sa0;
172 sa0 = mass*mass;
173 double q0 = (sa0+sb-sc)*(sa0+sb-sc)/(4*sa0)-sb;
174 if(q0 < 0) q0 = -1*q0;
175 double z0 = q0*r*r;
176 double F = 0.0;
177 if(l == 0) F = 1;
178 if(l == 1) F = sqrt((1+z0)/(1+z));
179 if(l == 2) F = sqrt((9+3*z0+z0*z0)/(9+3*z+z*z));
180 return F;
181}
182void EvtD0ToKpiEtap::calt1(double daug1[4], double daug2[4], double t1[4])
183{
184 double p, pq, tmp;
185 double pa[4], qa[4];
186 for(int i=0; i<4; i++) {
187 pa[i] = daug1[i] + daug2[i];
188 qa[i] = daug1[i] - daug2[i];
189 }
190 p = SCADot(pa,pa);
191 pq = SCADot(pa,qa);
192 tmp = pq/p;
193 for(int i=0; i<4; i++) {
194 t1[i] = qa[i] - tmp*pa[i];
195 }
196}
197void EvtD0ToKpiEtap::calt2(double daug1[4], double daug2[4], double t2[4][4])
198{
199 double p, r;
200 double pa[4], t1[4];
201 calt1(daug1,daug2,t1);
202 r = SCADot(t1,t1)/3.0;
203 for(int i=0; i<4; i++) {
204 pa[i] = daug1[i] + daug2[i];
205 }
206 p = SCADot(pa,pa);
207 for(int i=0; i<4; i++) {
208 for(int j=0; j<4; j++) {
209 t2[i][j] = t1[i]*t1[j] - r*(G[i][j]-pa[i]*pa[j]/p);
210 }
211 }
212}
213//-------------------prop--------------------------------------------
214double EvtD0ToKpiEtap::wid(double mass2, double mass, double sa, double sb, double sc, double r2, int l)
215{
216 double widm = 0.;
217 double m = sqrt(sa);
218 double tmp = sb-sc;
219 double tmp1 = sa+tmp;
220 double q = 0.25*tmp1*tmp1/sa-sb;
221 if(q<0) q = -q;
222 double tmp2 = mass2+tmp;
223 double q0 = 0.25*tmp2*tmp2/mass2-sb;
224 if(q0<0) q0 = -q0;
225 double z = q*r2;
226 double z0 = q0*r2;
227 double t = q/q0;
228 if(l == 0) {widm = sqrt(t)*mass/m;}
229 else if(l == 1) {widm = t*sqrt(t)*mass/m*(1+z0)/(1+z);}
230 else if(l == 2) {widm = t*t*sqrt(t)*mass/m*(9+3*z0+z0*z0)/(9+3*z+z*z);}
231 return widm;
232}
233double EvtD0ToKpiEtap::widl1(double mass2, double mass, double sa, double sb, double sc, double r2)
234{
235 double widm = 0.;
236 double m = sqrt(sa);
237 double tmp = sb-sc;
238 double tmp1 = sa+tmp;
239 double q = 0.25*tmp1*tmp1/sa-sb;
240 if(q<0) q = -q;
241 double tmp2 = mass2+tmp;
242 double q0 = 0.25*tmp2*tmp2/mass2-sb;
243 if(q0<0) q0 = -q0;
244 double z = q*r2;
245 double z0 = q0*r2;
246 double F = (1+z0)/(1+z);
247 double t = q/q0;
248 widm = t*sqrt(t)*mass/m*F;
249 return widm;
250}
251void EvtD0ToKpiEtap::propagatorRBW(double mass2, double mass, double width, double sa, double sb, double sc, double r2, int l, double prop[2])
252{
253 double a[2], b[2];
254 a[0] = 1;
255 a[1] = 0;
256 double q=0.25*(sa+sb-sc)*(sa+sb-sc)/sa-sb;
257
258 b[0] = mass2-sa;
259 b[1] = -mass*width*wid(mass2,mass,sa,sb,sc,r2,l);
260 Com_Divide(a,b,prop);
261}
262
263void EvtD0ToKpiEtap::propagatorFlatte(double mass, double width, double sa, double sb, double sc, int r, double prop[2]){
264 double q, qKsK,qetapi;
265 // double qKsK,qetapi;
266 double rhoab[2], rhoKsK[2];
267 q = 0.25*(sa+sb-sc)*(sa+sb-sc)/sa-sb;
268 qetapi=0.25*(sa+0.547862-0.13957039)*(sa+0.547862-0.13957039)/sa-0.547862*0.547862;
269 if(r == 0) qKsK = 0.25*sa - 0.49368*0.49368;
270 if(r == 1) qKsK = 0.25*(sa+sb-sc)*(sa+sb-sc)/sa - sb;
271 if(qetapi>0){
272 rhoab[0] = 2*sqrt(qetapi/sa);
273 rhoab[1] = 0;
274 }
275 if(qetapi<0){
276 rhoab[0] = 0;
277 rhoab[1] = 2*sqrt(-qetapi/sa);
278 }
279 if(qKsK>0){
280 rhoKsK[0] = 2*sqrt(qKsK/sa);
281 rhoKsK[1] = 0;
282 }
283 if(qKsK<0){
284 rhoKsK[0] = 0;
285 rhoKsK[1] = 2*sqrt(-qKsK/sa);
286 }
287 double a[2], b[2];
288 a[0] = 1;
289 a[1] = 0;
290 b[0] = mass*mass - sa + 0.341*rhoab[1] + 0.892*0.341*rhoKsK[1];
291 b[1] = - (0.341*rhoab[0] + 0.892*0.341*rhoKsK[0]);
292 Com_Divide(a,b,prop);
293}
294
295
296void EvtD0ToKpiEtap::propagatorGS(double mass2, double mass, double width, double sa, double sb, double sc, double r2, double prop[2])
297{
298 double a[2], b[2];
299 double tmp = sb-sc;
300 double tmp1 = sa+tmp;
301 double q2 = 0.25*tmp1*tmp1/sa-sb;
302 if(q2<0) q2 = 1e-16;
303
304 double tmp2 = mass2+tmp;
305 double q02 = 0.25*tmp2*tmp2/mass2-sb;
306 if(q02<0) q02 = 1e-16;
307
308 double q = sqrt(q2);
309 double q0 = sqrt(q02);
310 double m = sqrt(sa);
311 double q03 = q0*q02;
312 //double tmp3 = log(mass+2*q0)+1.2760418309; // log(mass_2Pion) = 1.2760418309;
313 double tmp3 = log(mass+2*q0)+1.2926305904; // log(mpi0+mpip) = -1.2926305904;
314
315 double h = GS1*q/m*(log(m+2*q)+1.2926305904);
316 double h0 = GS1*q0/mass*tmp3;
317 double dh = h0*(0.125/q02-0.5/mass2)+GS3/mass2;
318 double d = GS2/q02*tmp3+GS3*mass/q0-GS4*mass/q03;
319 double f = mass2/q03*(q2*(h-h0)+(mass2-sa)*q02*dh);
320
321 a[0] = 1.0+d*width/mass;
322 a[1] = 0.0;
323 b[0] = mass2-sa+width*f;
324 b[1] = -mass*width*widl1(mass2,mass,sa,sb,sc,r2);
325 Com_Divide(a,b,prop);
326}
327
328void EvtD0ToKpiEtap::KPiSLASS(double sa, double sb, double sc, double prop[2]) {
329 const double m1430 = 1.441;
330 const double sa0 = 1.441*1.441; // m1430*m1430;
331 const double w1430 = 0.193;
332 const double Lass1 = 0.25/sa0;
333 double tmp = sb-sc;
334 double tmp1 = sa0+tmp;
335 double q0 = Lass1*tmp1*tmp1-sb;
336 if(q0<0) q0 = -1*q0;
337 double tmp2 = sa+tmp;
338 double qs = 0.25*tmp2*tmp2/sa-sb;
339 double q = sqrt(qs);
340 double width = w1430*q*m1430/sqrt(sa*q0);
341 double temp_R = atan(m1430*width/(sa0-sa));
342 if(temp_R<0) temp_R += math_pi;
343 double deltaR = -1.915 + temp_R; //fiR=-109.7
344 double temp_F = atan(0.226*q/(2.0-3.819*qs)); // 2.0*0.113 = 0.226; 0.113*33.8 = 3.819
345 if(temp_F<0) temp_F += math_pi;
346 double deltaF = 0.002 + temp_F; //fiF=0.1
347 double deltaS = deltaR + 2.0*deltaF;
348 double t1 = 0.96*sin(deltaF);
349 double t2 = sin(deltaR);
350 double CF[2], CS[2];
351 CF[0] = cos(deltaF);
352 CF[1] = sin(deltaF);
353 CS[0] = cos(deltaS);
354 CS[1] = sin(deltaS);
355 prop[0] = t1*CF[0] + t2*CS[0];
356 prop[1] = t1*CF[1] + t2*CS[1];
357}
358double EvtD0ToKpiEtap::DDalitz(double P1[4], double P2[4], double P3[4], int Ang, double mass){
359 double pR[4], pD[4];
360 double temp_PDF, v_re;
361 temp_PDF = 0.0;
362 v_re = 0.0;
363 double B[2], s1, s2, s3, sR, sD;
364 for(int i=0; i<4; i++){
365 pR[i] = P1[i] + P2[i];
366 pD[i] = pR[i] + P3[i];
367 }
368 s1 = SCADot(P1,P1);
369 s2 = SCADot(P2,P2);
370 s3 = SCADot(P3,P3);
371 sR = SCADot(pR,pR);
372 sD = SCADot(pD,pD);
373 if(Ang == 0){
374 B[0] = 1;
375 B[1] = 1;
376 temp_PDF = 1;
377 }
378 if(Ang == 1){
379 B[0] = barrier(1,sR,s1,s2,3.0,mass);
380 B[1] = barrier(1,sD,sR,s3,5.0,1.86484);
381 //B[0] = Barrier(1,sR,s1,s2,9.0);
382 //B[1] = Barrier(1,sD,sR,s3,25.0);
383 double t1[4], T1[4];
384 calt1(P1,P2,t1);
385 calt1(pR,P3,T1);
386 temp_PDF = 0;
387 for(int i=0; i<4; i++){
388 temp_PDF += t1[i]*T1[i]*G[i][i];
389 }
390 }
391 if(Ang == 2){
392 B[0] = barrier(2,sR,s1,s2,3.0,mass);
393 B[1] = barrier(2,sD,sR,s3,5.0,1.86484);
394 // B[0] = Barrier(2,sR,s1,s2,9.0);
395 // B[1] = Barrier(2,sD,sR,s3,25.0);
396 double t2[4][4], T2[4][4];
397 calt2(P1,P2,t2);
398 calt2(pR,P3,T2);
399 temp_PDF = 0;
400 for(int i=0; i<4; i++){
401 for(int j=0; j<4; j++){
402 temp_PDF += t2[i][j]*T2[j][i]*G[i][i]*G[j][j];
403 }
404 }
405 }
406 v_re = temp_PDF*B[0]*B[1];
407 return v_re;
408}
409
410void EvtD0ToKpiEtap::calEva(double* Ks0, double* Kc, double* Pi0, double *mass1, double *width1, double *amp, double *phase,int* g0,int* spin, int* modetype, int nstates, double & Result)
411{
412 double P12[4], P23[4], P13[4];
413 double cof[2], amp_PDF[2], PDF[2];
414 double snpi, sck, sks0;
415 double s12, s13, s23;
416 for(int i=0; i<4; i++){
417 P12[i] = Kc[i] + Ks0[i];
418 P13[i] = Pi0[i] + Ks0[i];
419 P23[i] = Kc[i] + Pi0[i];
420 }
421 sck = SCADot(Kc,Kc);
422 snpi = SCADot(Pi0,Pi0);
423 sks0 = SCADot(Ks0,Ks0);
424 s12 = SCADot(P12,P12);
425 s13 = SCADot(P13,P13);
426 s23 = SCADot(P23,P23);
427 double pro[2], temp_PDF, amp_tmp[2],temp_PDF1 ,temp_PDF2,pro1[2],pro2[2];
428 double mass1sq;
429 amp_PDF[0] = 0;
430 amp_PDF[1] = 0;
431 PDF[0] = 0;
432 PDF[1] = 0;
433 amp_tmp[0] = 0;
434 amp_tmp[1] = 0;
435 for(int i=0; i<nstates; i++) {
436 amp_tmp[0] = 0;
437 amp_tmp[1] = 0;
438 mass1sq = mass1[i]*mass1[i];
439 cof[0] = amp[i]*cos(phase[i]);
440 cof[1] = amp[i]*sin(phase[i]);
441 temp_PDF = 0;
442
443 if(modetype[i] == 12){
444 temp_PDF = DDalitz(Ks0, Kc, Pi0, spin[i], mass1[i]);
445 if(g0[i]==1) propagatorRBW(mass1sq, mass1[i],width1[i],s12,sks0,sck,rRes,spin[i],pro);
446 // if(g0[i]==2) KPiSLASS(s12,sks0,scpi,pro);
447 if(g0[i]==2) {propagatorFlatte(mass1[i],width1[i],s12,sks0,sck,1,pro);
448 pro[0]=pro[0]*(0.01+0.990*0.990)/(0.01+s12);
449 pro[1]=pro[1]*(0.01+0.990*0.990)/(0.01+s12);
450 // pro[0]=pro[0]*(0.6*0.6)/(0.6*0.6)+(s12-0.990*0.990)*(s12-0.990*0.990);
451 // pro[1]=pro[1]*(0.6*0.6)/(0.6*0.6)+(s12-0.990*0.990)*(s12-0.990*0.990);
452 }
453 if(g0[i]==3) propagatorFlatte(mass1[i],width1[i],s12,sks0,sck,1,pro);//Only for a0(980)
454
455 if(g0[i]==0){
456 pro[0] = 1;
457 pro[1] = 0;
458 }
459 amp_tmp[0] = temp_PDF*pro[0];
460 amp_tmp[1] = temp_PDF*pro[1];
461 }
462
463 if(modetype[i] == 132){
464 KPiSLASS(s12,sks0,sck,pro);
465 amp_tmp[0] = pro[0];
466 amp_tmp[1] = pro[1];
467
468 }
469 Com_Multi(amp_tmp,cof,amp_PDF);
470 PDF[0] += amp_PDF[0];
471 PDF[1] += amp_PDF[1];
472
473 }
474 double value = PDF[0]*PDF[0] + PDF[1]*PDF[1];
475 if(value <=0) value = 1e-20;
476 Result = value;
477}
478
479
double sin(const BesAngle a)
Definition: BesAngle.h:210
double cos(const BesAngle a)
Definition: BesAngle.h:213
double mass
TFile f("ana_bhabha660a_dqa_mcPat_zy_old.root")
****INTEGER imax DOUBLE PRECISION m_pi *DOUBLE PRECISION m_amfin DOUBLE PRECISION m_Chfin DOUBLE PRECISION m_Xenph DOUBLE PRECISION m_sinw2 DOUBLE PRECISION m_GFermi DOUBLE PRECISION m_MfinMin DOUBLE PRECISION m_ta2 INTEGER m_out INTEGER m_KeyFSR INTEGER m_KeyQCD *COMMON c_Semalib $ !copy of input $ !CMS energy $ !beam mass $ !final mass $ !beam charge $ !final charge $ !smallest final mass $ !Z mass $ !Z width $ !EW mixing angle $ !Gmu Fermi $ alphaQED at q
Definition: KKsem.h:33
TCrossPart * CS
Definition: Mcgpj.cxx:51
TTree * t
Definition: binning.cxx:23
void decay(EvtParticle *p)
EvtDecayBase * clone()
virtual ~EvtD0ToKpiEtap()
void getName(std::string &name)
void checkSpinDaughter(int d1, EvtSpinType::spintype sp)
void checkSpinParent(EvtSpinType::spintype sp)
void setProbMax(double prbmx)
void checkNDaug(int d1, int d2=-1)
EvtId * getDaugs()
Definition: EvtDecayBase.hh:65
void checkNArg(int a1, int a2=-1, int a3=-1, int a4=-1)
void setProb(double prob)
Definition: EvtDecayProb.hh:34
const EvtVector4R & getP4() const
Definition: EvtParticle.cc:120
EvtParticle * getDaug(int i)
Definition: EvtParticle.cc:84
double initializePhaseSpace(int numdaughter, EvtId *daughters, double poleSize=-1., int whichTwo1=0, int whichTwo2=1)
double get(int i) const
Definition: EvtVector4R.hh:179
double double double double * s12
Definition: qcdloop1.h:77
double double double double double * s23
Definition: qcdloop1.h:77
const double b
Definition: slope.cxx:9