37 model_name=
"DsToKKpipipi";
96 mass_Pion_N = 0.134977;
106 int GG[4][4] = { {1,0,0,0}, {0,-1,0,0}, {0,0,-1,0}, {0,0,0,-1} };
108 { { {{0,0,0,0}, {0,0,0,0}, {0,0,0,0}, {0,0,0,0} },
109 {{0,0,0,0}, {0,0,0,0}, {0,0,0,1}, {0,0,-1,0}},
110 {{0,0,0,0}, {0,0,0,-1}, {0,0,0,0}, {0,1,0,0} },
111 {{0,0,0,0}, {0,0,1,0}, {0,-1,0,0}, {0,0,0,0} } },
112 { {{0,0,0,0}, {0,0,0,0}, {0,0,0,-1}, {0,0,1,0} },
113 {{0,0,0,0}, {0,0,0,0}, {0,0,0,0}, {0,0,0,0} },
114 {{0,0,0,1}, {0,0,0,0}, {0,0,0,0}, {-1,0,0,0}},
115 {{0,0,-1,0}, {0,0,0,0}, {1,0,0,0}, {0,0,0,0} } },
116 { {{0,0,0,0}, {0,0,0,1}, {0,0,0,0}, {0,-1,0,0}},
117 {{0,0,0,-1}, {0,0,0,0}, {0,0,0,0}, {1,0,0,0} },
118 {{0,0,0,0}, {0,0,0,0}, {0,0,0,0}, {0,0,0,0} },
119 {{0,1,0,0}, {-1,0,0,0}, {0,0,0,0}, {0,0,0,0} } },
120 { {{0,0,0,0}, {0,0,-1,0}, {0,1,0,0}, {0,0,0,0} },
121 {{0,0,1,0}, {0,0,0,0}, {-1,0,0,0}, {0,0,0,0} },
122 {{0,-1,0,0}, {1,0,0,0}, {0,0,0,0}, {0,0,0,0} },
123 {{0,0,0,0}, {0,0,0,0}, {0,0,0,0}, {0,0,0,0} } } };
124 for (
int i=0; i<4; i++) {
125 for (
int j=0; j<4; j++) {
127 for (
int k=0; k<4; k++) {
128 for (
int l=0; l<4; l++) {
129 E[i][j][k][l] = EE[i][j][k][l];
180 double Km[4],Kp[4], Pip1[4],Pip2[4],Pim[4];
181 Km[0] = km.
get(0); Kp[0] = kp.
get(0); Pip1[0] = pip1.
get(0); Pip2[0] = pip2.
get(0); Pim[0] = pim.
get(0);
182 Km[1] = km.
get(1); Kp[1] = kp.
get(1); Pip1[1] = pip1.
get(1); Pip2[1] = pip2.
get(1); Pim[1] = pim.
get(1);
183 Km[2] = km.
get(2); Kp[2] = kp.
get(2); Pip1[2] = pip1.
get(2); Pip2[2] = pip2.
get(2); Pim[2] = pim.
get(2);
184 Km[3] = km.
get(3); Kp[3] = kp.
get(3); Pip1[3] = pip1.
get(3); Pip2[3] = pip2.
get(3); Pim[3] = pim.
get(3);
188 calEvaMy(Km,Kp,Pip1,Pip2,Pim,mass1,mass2,mass3,width1,width2,width3,rho,phi,modetype,nstates,prob);
195void EvtDsToKKpipipi::Com_Multi(
double a1[2],
double a2[2],
double res[2]){
196 res[0] = a1[0]*a2[0]-a1[1]*a2[1];
197 res[1] = a1[1]*a2[0]+a1[0]*a2[1];
199void EvtDsToKKpipipi::Com_Divide(
double a1[2],
double a2[2],
double res[2]){
200 double tmp = a2[0]*a2[0]+a2[1]*a2[1];
201 res[0] = (a1[0]*a2[0]+a1[1]*a2[1])/tmp;
202 res[1] = (a1[1]*a2[0]-a1[0]*a2[1])/tmp;
204double EvtDsToKKpipipi::SCADot(
double a1[4],
double a2[4]){
205 double _cal = a1[0]*a2[0]-a1[1]*a2[1]-a1[2]*a2[2]-a1[3]*a2[3];
208double EvtDsToKKpipipi::barrier(
int l,
double sa,
double sb,
double sc,
double r,
double mass)
210 double q = (sa+sb-sc)*(sa+sb-sc)/(4*sa)-sb;
216 double q0 = (sa0+sb-sc)*(sa0+sb-sc)/(4*sa0)-sb;
217 if(q0 < 0) q0 = 1e-16;
221 if(l == 1) F = sqrt((1+z0)/(1+z));
222 if(l == 2) F = sqrt((9+3*z0+z0*z0)/(9+3*z+z*z));
242void EvtDsToKKpipipi::calt1(
double daug1[4],
double daug2[4],
double t1[4]){
245 for(
int i=0; i<4; i++) {
246 pa[i] = daug1[i] + daug2[i];
247 qa[i] = daug1[i] - daug2[i];
252 for(
int i=0; i<4; i++) {
253 t1[i] = qa[i] - tmp*pa[i];
256void EvtDsToKKpipipi::calt2(
double daug1[4],
double daug2[4],
double t2[4][4]){
259 calt1(daug1,daug2,t1);
260 r = SCADot(t1,t1)/3.0;
261 for(
int i=0; i<4; i++) {
262 pa[i] = daug1[i] + daug2[i];
265 for(
int i=0; i<4; i++) {
266 for(
int j=0; j<4; j++) {
267 t2[i][j] = t1[i]*t1[j] - r*(G[i][j]-pa[i]*pa[j]/p);
271void EvtDsToKKpipipi::Flatte_rhoab(
double sa,
double sb,
double sc,
double rho[2]){
272 double q = (sa+sb-sc)*(sa+sb-sc)/(4*sa)-sb;
274 rho[0]=2* sqrt(
q/sa);
279 rho[1]=2*sqrt(-
q/sa);
282void EvtDsToKKpipipi::propagatora0980(
double mass2,
double mass,
double sx,
double *sb,
double *sc,
double prop[2]){
283 double unit[2]={1.0};
286 Flatte_rhoab(sx,sb[0],sc[0],rho1);
288 Flatte_rhoab(sx,sb[1],sc[1],rho2);
290 double gKK_a980=0.892*0.341, gPiEta_a980=0.341;
291 double tmp1[2]={gKK_a980,0};
293 double tmp2[2]={gPiEta_a980,0};
295 Com_Multi(tmp1,rho1,tmp11);
296 Com_Multi(tmp2,rho2,tmp22);
297 double tmp3[2]={tmp11[0]+tmp22[0],tmp11[1]+tmp22[1]};
299 Com_Multi(tmp3, ci,tmp31);
300 double tmp4[2]={mass2-sx-tmp31[0], -1.0*tmp31[1]};
301 Com_Divide(
unit,tmp4, prop);
303double EvtDsToKKpipipi::wid(
double mass2,
double mass,
double sa,
double sb,
double sc,
double r2,
int l){
307 double tmp1 = sa+tmp;
308 double q = 0.25*tmp1*tmp1/sa-sb;
310 double tmp2 = mass2+tmp;
311 double q0 = 0.25*tmp2*tmp2/mass2-sb;
316 if(l == 0){widm = sqrt(
t)*
mass/m;}
317 else if(l == 1){widm =
t*sqrt(
t)*
mass/m*(1+z0)/(1+z);}
318 else if(l == 2){widm =
t*
t*sqrt(
t)*
mass/m*(9+3*z0+z0*z0)/(9+3*z+z*z);}
321double EvtDsToKKpipipi::widl1(
double mass2,
double mass,
double sa,
double sb,
double sc,
double r2){
325 double tmp1 = sa+tmp;
326 double q = 0.25*tmp1*tmp1/sa-sb;
328 double tmp2 = mass2+tmp;
329 double q0 = 0.25*tmp2*tmp2/mass2-sb;
333 double F = (1+z0)/(1+z);
335 widm =
t*sqrt(
t)*
mass/m*F;
338void EvtDsToKKpipipi::propagatorRBW(
double mass2,
double mass,
double width,
double sa,
double sb,
double sc,
double r2,
int l,
double prop[2]){
343 b[1] = -
mass*width*wid(mass2,
mass,sa,sb,sc,r2,l);
344 Com_Divide(a,
b,prop);
346void EvtDsToKKpipipi::propagatorNBW(
double mass2,
double mass,
double width,
double sa,
double sb,
double sc,
double r2,
int l,
double prop[2]){
352 Com_Divide(a,
b,prop);
354void EvtDsToKKpipipi::propagatorRBWl1(
double mass2,
double mass,
double width,
double sa,
double sb,
double sc,
double r2,
double prop[2]){
359 b[1] = -
mass*width*widl1(mass2,
mass,sa,sb,sc,r2);
360 Com_Divide(a,
b,prop);
362void EvtDsToKKpipipi::propagatorGS(
double mass2,
double mass,
double width,
double sa,
double sb,
double sc,
double r2,
double prop[2]){
365 double tmp1 = sa+tmp;
366 double q2 = 0.25*tmp1*tmp1/sa-sb;
369 double tmp2 = mass2+tmp;
370 double q02 = 0.25*tmp2*tmp2/mass2-sb;
371 if(q02<0) q02 = 1e-16;
374 double q0 = sqrt(q02);
377 double tmp3 = log(
mass+2*q0)+1.2760418309;
379 double h = GS1*
q/m*(log(m+2*
q)+1.2760418309);
380 double h0 = GS1*q0/
mass*tmp3;
381 double dh = h0*(0.125/q02-0.5/mass2)+GS3/mass2;
382 double d = GS2/q02*tmp3+GS3*
mass/q0-GS4*
mass/q03;
383 double f = mass2/q03*(q2*(h-h0)+(mass2-sa)*q02*dh);
385 a[0] = 1.0+d*width/
mass;
387 b[0] = mass2-sa+width*
f;
388 b[1] = -
mass*width*widl1(mass2,
mass,sa,sb,sc,r2);
389 Com_Divide(a,
b,prop);
391void EvtDsToKKpipipi::KPiSLASS(
double sa,
double sb,
double sc,
double prop[2]){
392 const double m1430 = 1.441;
393 const double sa0 = 2.076481;
394 const double w1430 = 0.193;
395 const double Lass1 = 0.25/sa0;
397 double tmp1 = sa0+tmp;
398 double q0 = Lass1*tmp1*tmp1-sb;
400 double tmp2 = sa+tmp;
401 double qs = 0.25*tmp2*tmp2/sa-sb;
403 double width = w1430*
q*m1430/sqrt(sa*q0);
404 double temp_R = atan(m1430*width/(sa0-sa));
405 if(temp_R<0) temp_R += math_pi;
406 double deltaR = -109.7*math_pi/180.0 + temp_R;
407 double temp_F = atan(0.226*
q/(2.0-3.8194*qs));
408 if(temp_F<0) temp_F += math_pi;
409 double deltaF = 0.1*math_pi/180.0 + temp_F;
410 double deltaS = deltaR + 2.0*deltaF;
411 double t1 = 0.96*
sin(deltaF);
412 double t2 =
sin(deltaR);
418 prop[0] = t1*CF[0] + t2*
CS[0];
419 prop[1] = t1*CF[1] + t2*
CS[1];
422void EvtDsToKKpipipi::calEvaMy(
double* Km,
double* Kp,
double* Pip1,
double* Pip2,
double* Pim,
double *mass1,
double *mass2,
double *mass3,
double *width1,
double *width2,
double *width3,
double *amp,
double *phase,
int* modetype,
int nstates,
double & Result){
423 double cof[2], amp_tmp[2], amp_PDF[2], PDF[2];
438 double prho1[4],prho2[4],pphi[4],pa11[4],pa12[4],pD1[4],pD2[4],pD3[4],pD4[4],psigma1[4],psigma2[4],pa13[4],pa14[4];
439 for(
int i=0;i!=4;i++){
440 pphi[i] =Km[i] +Kp[i];
441 prho1[i] =Pim[i] +Pip1[i];
442 prho2[i] =Pim[i] +Pip2[i];
443 pa11[i] =prho1[i] +Pip2[i];
444 pa12[i] =prho2[i] +Pip1[i];
445 psigma1[i] =Pim[i] +Pip1[i];
446 psigma2[i] =Pim[i] +Pip2[i];
447 pa13[i] =psigma1[i] +Pip2[i];
448 pa14[i] =psigma2[i] +Pip1[i];
449 pD1[i] =pa11[i] +pphi[i];
450 pD2[i] =pa12[i] +pphi[i];
451 pD3[i] =pa13[i] +pphi[i];
452 pD4[i] =pa14[i] +pphi[i];
455 double skaon1,skaon2,spion1,spion2,spim,sphi,sa11,sa12,srho1,srho2,sD1,sD2,sD3,sD4,ssigma1,ssigma2,sa13,sa14;
456 skaon1 = SCADot(Km, Km);
457 skaon2 = SCADot(Kp, Kp);
458 sphi = SCADot(pphi, pphi);
460 spion1 = SCADot(Pip1, Pip1);
461 spion2 = SCADot(Pip2, Pip2);
462 spim = SCADot(Pim, Pim);
464 srho1 = SCADot(prho1, prho1);
465 srho2 = SCADot(prho2, prho2);
466 sa11 = SCADot(pa11, pa11);
467 sa12 = SCADot(pa12, pa12);
469 sD1 = SCADot(pD1, pD1);
470 sD2 = SCADot(pD2, pD2);
471 sD3 = SCADot(pD3, pD3);
472 sD4 = SCADot(pD4, pD4);
474 ssigma1 = SCADot(psigma1,psigma1);
475 ssigma2 = SCADot(psigma2,psigma2);
476 sa13 = SCADot(pa13, pa13);
477 sa14 = SCADot(pa14, pa14);
479 double t1phi[4], t1rho1[4], t2a11[4][4], t1sigma1[4], t1a13[4], t1D1[4], t1D3[4], t2D1[4][4], t2D3[4][4],
480 t1rho2[4], t2a12[4][4], t1sigma2[4], t1a14[4], t1D2[4], t1D4[4], t2D2[4][4], t2D4[4][4];
482 calt1(Km, Kp, t1phi);
484 calt1(Pip1, Pim, t1rho1);
485 calt1(Pip2, Pim, t1rho2);
486 calt1(Pip1, Pim, t1sigma1);
487 calt1(Pip2, Pim, t1sigma2);
488 calt1(psigma1,Pip2, t1a13);
489 calt1(psigma2,Pip1, t1a14);
491 calt1(pa11,pphi,t1D1);
492 calt1(pa12,pphi,t1D2);
493 calt1(pa13,pphi,t1D3);
494 calt1(pa14,pphi,t1D4);
496 calt2(prho1,Pip2, t2a11);
497 calt2(prho2,Pip1, t2a12);
499 calt2(pa11,pphi,t2D1);
500 calt2(pa12,pphi,t2D2);
501 calt2(pa13,pphi,t2D3);
502 calt2(pa14,pphi,t2D4);
509 double temp_PDF, tmp1, tmp2, amp_tmp1[2], amp_tmp2[2];
510 double pro[2], pro0[2], pro1[2],pro2[2],pro3[2];
511 double mass1sq, mass2sq, mass3sq;
512 for(
int i=0; i<nstates; i++){
513 tmp1 = 0;tmp2 = 0;temp_PDF = 0;
514 cof[0] = amp[i]*
cos(phase[i]);
515 cof[1] = amp[i]*
sin(phase[i]);
516 mass1sq = mass1[i]*mass1[i];
517 mass2sq = mass2[i]*mass2[i];
518 mass3sq = mass3[i]*mass3[i];
535 double B_phi=-1.0, B_rho1=-1.0;
536 propagatorRBWl1(mass1sq, mass1[i], width1[i], sphi, skaon1, skaon2, rRes2, pro0);
537 propagatorGS(mass2sq, mass2[i], width2[i], srho1, spion1, spim, rRes2, pro1);
538 propagatorRBW(mass3sq, mass3[i], width3[i], sa11, srho1, spion2, rRes2, 0 , pro2);
539 Com_Multi(pro0,pro1,pro3);
540 Com_Multi(pro2,pro3,pro);
541 if (B_phi<0.0) B_phi = barrier(1, sphi, skaon1, skaon2, rRes2, 1.019461);
542 if (B_rho1<0.0) B_rho1 = barrier(1, srho1, spion1, spim, rRes2, 0.77526);
543 for(
int a=0; a<4; a++){
544 for(
int j=0; j<4; j++){
545 temp_PDF += (G[a][j]-pa11[a]*pa11[j]/sa11)*t1phi[a]*t1rho1[j]*G[a][a]*G[j][j];
548 tmp1 = B_phi*B_rho1*temp_PDF;
549 amp_tmp1[0] = tmp1*pro[0];
550 amp_tmp1[1] = tmp1*pro[1];
554 propagatorRBWl1(mass1sq, mass1[i], width1[i], sphi, skaon1, skaon2, rRes2, pro0);
555 propagatorGS(mass2sq, mass2[i], width2[i], srho2, spion2, spim, rRes2, pro1);
556 propagatorRBW(mass3sq, mass3[i], width3[i], sa12, srho2, spion1, rRes2, 0, pro2);
557 Com_Multi(pro0,pro1,pro3);
558 Com_Multi(pro2,pro3,pro);
559 if (B_phi<0.0) B_phi = barrier(1, sphi, skaon1, skaon2, rRes2, 1.019461);
560 if (B_rho2<0.0) B_rho2 = barrier(1, srho2, spion2, spim, rRes2, 0.77526);
561 for(
int a=0; a<4; a++){
562 for(
int j=0; j<4; j++){
563 temp_PDF += (G[a][j]-pa12[a]*pa12[j]/sa12)*t1phi[a]*t1rho2[j]*G[a][a]*G[j][j];
566 tmp2 = B_phi*B_rho2*temp_PDF;
567 amp_tmp2[0] = tmp2*pro[0];
568 amp_tmp2[1] = tmp2*pro[1];
571 double B_phi=-1.0, B_rho1=-1.0, B_phia11=-1.0;
572 propagatorRBWl1(mass1sq, mass1[i], width1[i], sphi, skaon1, skaon2, rRes2, pro0);
573 propagatorGS(mass2sq, mass2[i], width2[i], srho1, spion1, spim, rRes2, pro1);
574 propagatorRBW(mass3sq, mass3[i], width3[i], sa11, srho1, spion2, rRes2, 0 , pro2);
585 Com_Multi(pro0,pro1,pro3);
586 Com_Multi(pro2,pro3,pro);
587 if (B_phi<0.0) B_phi = barrier(1, sphi, skaon1, skaon2, rRes2, 1.019461);
588 if (B_rho1<0.0) B_rho1 = barrier(1, srho1, spion1, spim, rRes2, 0.77526);
589 if (B_phia11<0.0) B_phia11 = barrier(1, sD1, sphi, sa11, rD2, 1.9683);
590 for(
int w=0;
w<4;
w++){
592 for(
int j=0; j<4; j++){
594 for(
int m=0; m<4; m++){
595 for(
int k=0; k<4; k++){
596 tt4=t1phi[k]*G[k][k];
597 for(
int l=0; l<4; l++){
598 temp_PDF += E[
w][m][k][l]*G[m][m]*tt1*tt2*(G[m][j]-pa11[m]*pa11[j]/sa11)*tt4*t1rho1[l]*G[l][l];
604 tmp1 = B_phi*B_rho1*B_phia11*temp_PDF;
605 amp_tmp1[0] = tmp1*pro[0];
606 amp_tmp1[1] = tmp1*pro[1];
609 double B_rho2=-1.0, B_phia12=-1.0;
610 propagatorRBWl1(mass1sq, mass1[i], width1[i], sphi, skaon1, skaon2, rRes2, pro0);
611 propagatorGS(mass2sq, mass2[i], width2[i], srho2, spion2, spim, rRes2, pro1);
612 propagatorRBW(mass3sq, mass3[i], width3[i], sa12, srho2, spion1, rRes2, 0, pro2);
613 Com_Multi(pro0,pro1,pro3);
614 Com_Multi(pro2,pro3,pro);
615 if (B_phi<0.0) B_phi = barrier(1, sphi, skaon1, skaon2, rRes2, 1.019461);
616 if (B_rho2<0.0) B_rho2 = barrier(1, srho2, spion2, spim, rRes2, 0.77526);
617 if (B_phia12<0.0) B_phia12 = barrier(1, sD2, sphi, sa12, rD2, 1.9683);
618 for(
int w=0;
w<4;
w++){
620 for(
int j=0; j<4; j++){
622 for(
int m=0; m<4; m++){
623 for(
int k=0; k<4; k++){
624 tt4=t1phi[k]*G[k][k];
625 for(
int l=0; l<4; l++){
626 temp_PDF += E[
w][m][k][l]*G[m][m]*tt1*tt2*(G[m][j]-pa12[m]*pa12[j]/sa12)*tt4*t1rho2[l]*G[l][l];
632 tmp2 = B_phi*B_rho2*B_phia12*temp_PDF;
633 amp_tmp2[0] = tmp2*pro[0];
634 amp_tmp2[1] = tmp2*pro[1];
642 amp_tmp[0] = amp_tmp1[0]+amp_tmp2[0];
643 amp_tmp[1] = amp_tmp1[1]+amp_tmp2[1];
644 Com_Multi(amp_tmp,cof,amp_PDF);
645 PDF[0] += amp_PDF[0];
646 PDF[1] += amp_PDF[1];
648 double value = PDF[0]*PDF[0] + PDF[1]*PDF[1];
650 if(value <=0) value = 1e-20;
double sin(const BesAngle a)
double cos(const BesAngle a)
TFile f("ana_bhabha660a_dqa_mcPat_zy_old.root")
*******INTEGER m_nBinMax INTEGER m_NdiMax !No of bins in histogram for cell exploration division $ !Last vertex $ !Last active cell $ !Last cell in buffer $ !No of sampling when dividing cell $ !No of function total $ !Flag for random ceel for $ !Flag for type of for WtMax $ !Flag which decides whether vertices are included in the sampling $ entire domain is hyp !Maximum effective eevents per saves r n generator level $ !Flag for chat level in !Latex Output unit
****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
void checkSpinDaughter(int d1, EvtSpinType::spintype sp)
void checkSpinParent(EvtSpinType::spintype sp)
void setProbMax(double prbmx)
void checkNDaug(int d1, int d2=-1)
void checkNArg(int a1, int a2=-1, int a3=-1, int a4=-1)
void setProb(double prob)
virtual ~EvtDsToKKpipipi()
void getName(std::string &name)
void decay(EvtParticle *p)
const EvtVector4R & getP4() const
EvtParticle * getDaug(int i)
double initializePhaseSpace(int numdaughter, EvtId *daughters, double poleSize=-1., int whichTwo1=0, int whichTwo2=1)