74 rho[1] = 1.121155232058;
75 phi[1] = 3.322105212534;
77 rho[2] = 1.214264427529;
78 phi[2] = -5.321965906572;
80 rho[3] = 1.086952630367;
81 phi[3] = -4.213398459878;
83 rho[4] = 1.121071578335;
84 phi[4] =-1.055595448689;
86 rho[5] =-1.473195648049;
87 phi[5] =5.841826108667;
89 rho[6] = 5.396864431453;
90 phi[6] =-0.360227442474;
92 rho[7] = 0.436480711396;
93 phi[7] = 0.778423040673;
131 mass_Pion2 = 0.0194797849;
132 mass_2Pion = 0.27914;
133 math_2pi = 6.2831852;
144 int GG[4][4] = { {1,0,0,0}, {0,-1,0,0}, {0,0,-1,0}, {0,0,0,-1} };
145 for (
int i=0; i<4; i++) {
146 for (
int j=0; j<4; j++) {
197 double P1[4], P2[4], P3[4];
198 P1[0] = D1.
get(0); P1[1] = D1.
get(1); P1[2] = D1.
get(2); P1[3] = D1.
get(3);
199 P2[0] = D2.
get(0); P2[1] = D2.
get(1); P2[2] = D2.
get(2); P2[3] = D2.
get(3);
200 P3[0] = D3.
get(0); P3[1] = D3.
get(1); P3[2] = D3.
get(2); P3[3] = D3.
get(3);
209 int g0[8]={1,1,4,1,1,1,3,1};
210 double r0[8]={3.0,3.0,3.0,3.0,3.0,3.0,3.0,3.0};
211 double r1[8]={5.0,5.0,5.0,5.0,5.0,5.0,5.0,5.0};
213 calEva(P1, P2, P3, mass, width, rho, phi, g0, spin, modetype, nstates, value,r0,r1);
220void EvtDToKKpi::Com_Multi(
double a1[2],
double a2[2],
double res[2])
222 res[0] = a1[0]*a2[0]-a1[1]*a2[1];
223 res[1] = a1[1]*a2[0]+a1[0]*a2[1];
225void EvtDToKKpi::Com_Divide(
double a1[2],
double a2[2],
double res[2])
227 double tmp = a2[0]*a2[0]+a2[1]*a2[1];
228 res[0] = (a1[0]*a2[0]+a1[1]*a2[1])/tmp;
229 res[1] = (a1[1]*a2[0]-a1[0]*a2[1])/tmp;
232double EvtDToKKpi::SCADot(
double a1[4],
double a2[4])
234 double _cal = a1[0]*a2[0]-a1[1]*a2[1]-a1[2]*a2[2]-a1[3]*a2[3];
237double EvtDToKKpi::barrier(
int l,
double sa,
double sb,
double sc,
double r,
double mass)
239 double q = fabs((sa+sb-sc)*(sa+sb-sc)/(4*sa)-sb);
244 double q0 = fabs((sa0+sb-sc)*(sa0+sb-sc)/(4*sa0)-sb);
248 if(l == 1) F = sqrt((1+z0)/(1+z));
249 if(l == 2) F = sqrt((9+3*z0+z0*z0)/(9+3*z+z*z));
253void EvtDToKKpi::calt1(
double daug1[4],
double daug2[4],
double t1[4])
257 for(
int i=0; i<4; i++) {
258 pa[i] = daug1[i] + daug2[i];
259 qa[i] = daug1[i] - daug2[i];
264 for(
int i=0; i<4; i++) {
265 t1[i] = qa[i] - tmp*pa[i];
268void EvtDToKKpi::calt2(
double daug1[4],
double daug2[4],
double t2[4][4])
272 calt1(daug1,daug2,t1);
273 r = SCADot(t1,t1)/3.0;
274 for(
int i=0; i<4; i++) {
275 pa[i] = daug1[i] + daug2[i];
278 for(
int i=0; i<4; i++) {
279 for(
int j=0; j<4; j++) {
280 t2[i][j] = t1[i]*t1[j] - r*(G[i][j]-pa[i]*pa[j]/p);
285void EvtDToKKpi::propagator(
double mass2,
double mass,
double width,
double sx,
double prop[2])
292 Com_Divide(a,
b,prop);
294double EvtDToKKpi::wid(
double mass2,
double mass,
double sa,
double sb,
double sc,
double r2,
int l)
299 double tmp1 = sa+tmp;
300 double q = fabs(0.25*tmp1*tmp1/sa-sb);
301 double tmp2 = mass2+tmp;
302 double q0 = fabs(0.25*tmp2*tmp2/mass2-sb);
306 if(l == 0) {widm = sqrt(
t)*
mass/m;}
307 else if(l == 1) {widm =
t*sqrt(
t)*
mass/m*(1+z0)/(1+z);}
308 else if(l == 2) {widm =
t*
t*sqrt(
t)*
mass/m*(9+3*z0+z0*z0)/(9+3*z+z*z);}
311double EvtDToKKpi::widl1(
double mass2,
double mass,
double sa,
double sb,
double sc,
double r2)
316 double tmp1 = sa+tmp;
317 double q = fabs(0.25*tmp1*tmp1/sa-sb);
318 double tmp2 = mass2+tmp;
319 double q0 = fabs(0.25*tmp2*tmp2/mass2-sb);
322 double F = (1+z0)/(1+z);
324 widm =
t*sqrt(
t)*
mass/m*F;
327void EvtDToKKpi::propagatorRBW(
double mass,
double width,
double sa,
double sb,
double sc,
double r2,
int l,
double prop[2])
335 b[1] = -
mass*width*wid(mass2,mass,sa,sb,sc,r2,l);
336 Com_Divide(a,
b,prop);
339void EvtDToKKpi::propagatorFlatte(
double mass,
double width,
double sa,
double prop[2]){
341 double rhoPi[2], rhoKa[2];
343 q2_Pi = 0.25*sa-mPi*mPi;
344 q2_Ka = 0.25*sa-mKa*mKa;
347 rhoPi[0] = 2.0*sqrt(q2_Pi/sa);
352 rhoPi[1] = 2.0*sqrt(-q2_Pi/sa);
356 rhoKa[0] = 2.0*sqrt(q2_Ka/sa);
361 rhoKa[1] = 2.0*sqrt(-q2_Ka/sa);
367 b[0] =
mass*
mass - sa + 0.165*rhoPi[1] + 0.69465*rhoKa[1];
368 b[1] = - (0.165*rhoPi[0] + 0.69465*rhoKa[0]);
369 Com_Divide(a,
b,prop);
372void EvtDToKKpi::rhoab(
double sa,
double sb,
double sc,
double res[2]) {
373 double tmp = sa+sb-sc;
374 double q = 0.25*tmp*tmp/sa-sb;
376 res[0]=2.0*sqrt(
q/sa);
380 res[1]=2.0*sqrt(-
q/sa);
383void EvtDToKKpi::rho4Pi(
double sa,
double res[2]) {
384 double temp = 1.0-0.3116765584/sa;
386 res[0]=sqrt(temp)/(1.0+
exp(9.8-3.5*sa));
390 res[1]=sqrt(-temp)/(1.0+
exp(9.8-3.5*sa));
395void EvtDToKKpi::propagatorsigma500(
double sa,
double sb,
double sc,
double prop[2]) {
396 double f = 0.5843+1.6663*sa;
397 const double M = 0.9264;
398 const double mass2 = 0.85821696;
399 const double mpi2d2 = 0.00973989245;
400 double g1 =
f*(sa-mpi2d2)/(mass2-mpi2d2)*
exp((mass2-sa)/1.082);
401 double rho1s[2], rho1M[2], rho2s[2], rho2M[2], rho1[2], rho2[2];
402 rhoab(sa,sb,sc,rho1s);
403 rhoab(mass2,sb,sc,rho1M);
406 Com_Divide(rho1s,rho1M,rho1);
407 Com_Divide(rho2s,rho2M,rho2);
411 b[0] = mass2-sa+M*(
g1*rho1[1]+0.0024*rho2[1]);
412 b[1] = -M*(
g1*rho1[0]+0.0024*rho2[0]);
413 Com_Divide(a,
b,prop);
415void EvtDToKKpi::Flatte_rhoab(
double sa,
double sb,
double rho[2])
417 double q = 1.0-(4*sb/sa);
429void EvtDToKKpi::propagator980(
double mass,
double sx,
double *sb,
double prop[2])
432 double gpipi1 = 2.0/3.0*0.165;
433 double gpipi2 = 1.0/3.0*0.165;
434 double gKK1 = 0.5*0.69465;
435 double gKK2 = 0.5*0.69465;
437 double unit[2]={1.0};
440 Flatte_rhoab(sx,sb[0],rho1);
442 Flatte_rhoab(sx,sb[1],rho2);
444 Flatte_rhoab(sx,sb[2],rho3);
446 Flatte_rhoab(sx,sb[3],rho4);
448 double tmp1[2]={gpipi1,0};
450 double tmp2[2]={gpipi2,0};
452 double tmp3[2]={gKK1,0};
454 double tmp4[2]={gKK2,0};
457 Com_Multi(tmp1,rho1,tmp11);
458 Com_Multi(tmp2,rho2,tmp22);
459 Com_Multi(tmp3,rho3,tmp33);
460 Com_Multi(tmp4,rho4,tmp44);
462 double tmp5[2]={tmp11[0]+tmp22[0]+tmp33[0]+tmp44[0],tmp11[1]+tmp22[1]+tmp33[1]+tmp44[1]};
464 Com_Multi(tmp5, ci,tmp51);
465 double tmp6[2]={
mass*
mass-sx-tmp51[0], -1.0*tmp51[1]};
467 Com_Divide(
unit,tmp6, prop);
471void EvtDToKKpi::KPiSLASS(
double sa,
double sb,
double sc,
double prop[2]) {
472 const double m1430 = 1.441;
473 const double sa0 = 2.076481;
474 const double w1430 = 0.193;
475 const double Lass1 = 0.25/sa0;
477 double tmp1 = sa0+tmp;
478 double q0 = fabs(Lass1*tmp1*tmp1-sb);
479 double tmp2 = sa+tmp;
480 double qs = 0.25*tmp2*tmp2/sa-sb;
482 double width = w1430*
q*m1430/sqrt(sa*q0);
483 double temp_R = atan(m1430*width/(sa0-sa));
484 if(temp_R<0) temp_R += math_pi;
485 double deltaR = -109.7*math_pi/180.0 + temp_R;
486 double temp_F = atan(0.226*
q/(2.0-3.8194*qs));
487 if(temp_F<0) temp_F += math_pi;
488 double deltaF = 0.1*math_pi/180.0 + temp_F;
489 double deltaS = deltaR + 2.0*deltaF;
490 double t1 = 0.96*
sin(deltaF);
491 double t2 =
sin(deltaR);
497 prop[0] = t1*CF[0] + t2*
CS[0];
498 prop[1] = t1*CF[1] + t2*
CS[1];
501void EvtDToKKpi::propagatorGS(
double mass2,
double mass,
double width,
double sa,
double sb,
double sc,
double r2,
double prop[2])
505 double tmp1 = sa+tmp;
506 double q2 = fabs(0.25*tmp1*tmp1/sa-sb);
508 double tmp2 = mass2+tmp;
509 double q02 = fabs(0.25*tmp2*tmp2/mass2-sb);
512 double q0 = sqrt(q02);
515 double tmp3 = log(mass+2*q0)+1.2926305904;
517 double h = GS1*
q/m*(log(m+2*
q)+1.2926305904);
518 double h0 = GS1*q0/
mass*tmp3;
519 double dh = h0*(0.125/q02-0.5/mass2)+GS3/mass2;
520 double d = GS2/q02*tmp3+GS3*
mass/q0-GS4*
mass/q03;
521 double f = mass2/q03*(q2*(h-h0)+(mass2-sa)*q02*dh);
523 a[0] = 1.0+d*width/
mass;
525 b[0] = mass2-sa+width*
f;
526 b[1] = -
mass*width*widl1(mass2,mass,sa,sb,sc,r2);
527 Com_Divide(a,
b,prop);
530double EvtDToKKpi::DDalitz(
double P1[4],
double P2[4],
double P3[4],
int Ang,
double mass){
532 double temp_PDF, v_re;
535 double B[2], s1, s2, s3, sR, sD;
536 for(
int i=0; i<4; i++){
537 pR[i] = P1[i] + P2[i];
538 pD[i] = pR[i] + P3[i];
546 for(
int i=0; i!=4; i++){
547 for(
int j=0; j!=4; j++){
549 if(i==0) G[i][j] = 1;
561 B[0] = barrier(1,sR,s1,s2,3.0,mass);
562 B[1] = barrier(1,sD,sR,s3,5.0,mDp);
567 for(
int i=0; i<4; i++){
568 temp_PDF += t1[i]*T1[i]*G[i][i];
572 B[0] = barrier(2,sR,s1,s2,3.0,mass);
573 B[1] = barrier(2,sD,sR,s3,5.0,mDp);
574 double t2[4][4], T2[4][4];
578 for(
int i=0; i<4; i++){
579 for(
int j=0; j<4; j++){
580 temp_PDF += t2[i][j]*T2[j][i]*G[i][i]*G[j][j];
584 v_re = temp_PDF*
B[0]*
B[1];
588void EvtDToKKpi::calEva(
double* K01,
double* K02,
double* Pi,
double *mass1,
double *width1,
double *amp,
double *phase,
int* g0,
int* spin,
int* modetype,
int nstates,
double & Result ,
double*r0 ,
double*r1)
591 double P12[4], P23[4], P13[4];
592 double cof[2], amp_PDF[2], PDF[2];
596 for(
int i=0; i<4; i++){
597 P12[i] = K01[i] + K02[i];
598 P13[i] = K01[i] + Pi[i];
599 P23[i] = K02[i] + Pi[i];
601 s1 = SCADot(K01,K01);
602 s2 = SCADot(K02,K02);
605 s12 = SCADot(P12,P12);
606 s13 = SCADot(P13,P13);
607 s23 = SCADot(P23,P23);
609 double pro[2], temp_PDF, amp_tmp[2];
617 for(
int i=0; i<nstates; i++) {
620 mass1sq = mass1[i]*mass1[i];
621 cof[0] = amp[i]*
cos(phase[i]);
622 cof[1] = amp[i]*
sin(phase[i]);
625 if(modetype[i] == 12){
626 temp_PDF = DDalitz(K01, K02, Pi, spin[i], mass1[i]);
627 if(g0[i]==1) propagatorRBW(mass1[i],width1[i],
s12,s1,s2,rRes2,spin[i],pro);
628 if(g0[i]==4) propagatorFlatte(mass1[i],width1[i],
s12,pro);
629 amp_tmp[0] = temp_PDF*pro[0];
630 amp_tmp[1] = temp_PDF*pro[1];
633 if(modetype[i] == 13){
634 temp_PDF = DDalitz(K01, Pi, K02, spin[i], mass1[i]);
635 if(g0[i]==1) propagatorRBW(mass1[i],width1[i],s13,s1,s3,rRes2,spin[i],pro);
636 if(g0[i]==3) KPiSLASS(s13,s1,s3,pro);
638 amp_tmp[0] = temp_PDF*pro[0];
639 amp_tmp[1] = temp_PDF*pro[1];
642 Com_Multi(amp_tmp,cof,amp_PDF);
643 PDF[0] += amp_PDF[0];
644 PDF[1] += amp_PDF[1];
646 double value = PDF[0]*PDF[0] + PDF[1]*PDF[1];
647 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")
EvtComplex exp(const EvtComplex &c)
*******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 getName(std::string &name)
void decay(EvtParticle *p)
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)
const EvtVector4R & getP4() const
EvtParticle * getDaug(int i)
double initializePhaseSpace(int numdaughter, EvtId *daughters, double poleSize=-1., int whichTwo1=0, int whichTwo2=1)
double double double double * s12
double double double double double * s23