35 model_name=
"DsToKpipi";
69 phi[2] = -1.249864467;
70 phi[3] = -0.3067504308;
71 phi[4] = 0.9229242379;
72 phi[5] = -3.278567926;
73 phi[6] = -0.6346408622;
77 rho[2] = 0.7361782665;
114 mass[7] = 1.432787726;
126 mass_Pi0 = 0.1349766;
143 int GG[4][4] = { {1,0,0,0}, {0,-1,0,0}, {0,0,-1,0}, {0,0,0,-1} };
144 for (
int i=0; i<4; i++) {
145 for (
int j=0; j<4; j++) {
192 double P1[4], P2[4], P3[4];
193 P1[0] = D1.
get(0); P1[1] = D1.
get(1); P1[2] = D1.
get(2); P1[3] = D1.
get(3);
194 P2[0] = D2.
get(0); P2[1] = D2.
get(1); P2[2] = D2.
get(2); P2[3] = D2.
get(3);
195 P3[0] = D3.
get(0); P3[1] = D3.
get(1); P3[2] = D3.
get(2); P3[3] = D3.
get(3);
202 int g0[8]={1,1,4,2,500,1,1,2};
203 int spin[8]={1,1,0,0,0,1,1,0};
205 calEva(P1, P2, P3, mass, width, rho, phi, g0, spin, modetype, nstates, value);
212void EvtDsToKpipi::Com_Multi(
double a1[2],
double a2[2],
double res[2])
214 res[0] = a1[0]*a2[0]-a1[1]*a2[1];
215 res[1] = a1[1]*a2[0]+a1[0]*a2[1];
217void EvtDsToKpipi::Com_Divide(
double a1[2],
double a2[2],
double res[2])
219 double tmp = a2[0]*a2[0]+a2[1]*a2[1];
220 res[0] = (a1[0]*a2[0]+a1[1]*a2[1])/tmp;
221 res[1] = (a1[1]*a2[0]-a1[0]*a2[1])/tmp;
224double EvtDsToKpipi::SCADot(
double a1[4],
double a2[4])
226 double _cal = a1[0]*a2[0]-a1[1]*a2[1]-a1[2]*a2[2]-a1[3]*a2[3];
229double EvtDsToKpipi::barrier(
int l,
double sa,
double sb,
double sc,
double r,
double mass)
231 double q = (sa+sb-sc)*(sa+sb-sc)/(4*sa)-sb;
237 double q0 = (sa0+sb-sc)*(sa0+sb-sc)/(4*sa0)-sb;
238 if(q0 < 0) q0 = 1e-16;
242 if(l == 1) F = sqrt((1+z0)/(1+z));
243 if(l == 2) F = sqrt((9+3*z0+z0*z0)/(9+3*z+z*z));
246void EvtDsToKpipi::calt1(
double daug1[4],
double daug2[4],
double t1[4])
250 for(
int i=0; i<4; i++) {
251 pa[i] = daug1[i] + daug2[i];
252 qa[i] = daug1[i] - daug2[i];
257 for(
int i=0; i<4; i++) {
258 t1[i] = qa[i] - tmp*pa[i];
261void EvtDsToKpipi::calt2(
double daug1[4],
double daug2[4],
double t2[4][4])
265 calt1(daug1,daug2,t1);
266 r = SCADot(t1,t1)/3.0;
267 for(
int i=0; i<4; i++) {
268 pa[i] = daug1[i] + daug2[i];
271 for(
int i=0; i<4; i++) {
272 for(
int j=0; j<4; j++) {
273 t2[i][j] = t1[i]*t1[j] - r*(G[i][j]-pa[i]*pa[j]/p);
280void EvtDsToKpipi::propagatorCBW(
double mass,
double width,
double sx,
double prop[2])
287 Com_Divide(a,
b,prop);
289double EvtDsToKpipi::wid(
double mass2,
double mass,
double sa,
double sb,
double sc,
double r2,
int l)
294 double tmp1 = sa+tmp;
295 double q = 0.25*tmp1*tmp1/sa-sb;
297 double tmp2 = mass2+tmp;
298 double q0 = 0.25*tmp2*tmp2/mass2-sb;
303 if(l == 0) {widm = sqrt(
t)*
mass/m;}
304 else if(l == 1) {widm =
t*sqrt(
t)*
mass/m*(1+z0)/(1+z);}
305 else if(l == 2) {widm =
t*
t*sqrt(
t)*
mass/m*(9+3*z0+z0*z0)/(9+3*z+z*z);}
309double EvtDsToKpipi::widl1(
double mass2,
double mass,
double sa,
double sb,
double sc,
double r2)
314 double tmp1 = sa+tmp;
315 double q = 0.25*tmp1*tmp1/sa-sb;
317 double tmp2 = mass2+tmp;
318 double q0 = 0.25*tmp2*tmp2/mass2-sb;
322 double F = (1+z0)/(1+z);
324 widm =
t*sqrt(
t)*
mass/m*F;
327void EvtDsToKpipi::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);
338void EvtDsToKpipi::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);
371void EvtDsToKpipi::propagatorGS(
double mass,
double width,
double sa,
double sb,
double sc,
double r2,
double prop[2])
376 double tmp1 = sa+tmp;
377 double q2 = 0.25*tmp1*tmp1/sa-sb;
380 double tmp2 = mass2+tmp;
381 double q02 = 0.25*tmp2*tmp2/mass2-sb;
382 if(q02<0) q02 = 1e-16;
385 double q0 = sqrt(q02);
388 double tmp3 = log(mass+2*q0)+1.2760418309;
390 double h = GS1*
q/m*(log(m+2*
q)+1.2760418309);
391 double h0 = GS1*q0/
mass*tmp3;
392 double dh = h0*(0.125/q02-0.5/mass2)+GS3/mass2;
393 double d = GS2/q02*tmp3+GS3*
mass/q0-GS4*
mass/q03;
394 double f = mass2/q03*(q2*(h-h0)+(mass2-sa)*q02*dh);
396 a[0] = 1.0+d*width/
mass;
398 b[0] = mass2-sa+width*
f;
399 b[1] = -
mass*width*widl1(mass2,mass,sa,sb,sc,r2);
400 Com_Divide(a,
b,prop);
403void EvtDsToKpipi::Flatte_rhoab(
double sa,
double sb,
double sc,
double rho[2]){
404 double q = (sa+sb-sc)*(sa+sb-sc)/(4*sa)-sb;
406 rho[0]=2* sqrt(
q/sa);
411 rho[1]=2*sqrt(-
q/sa);
416void EvtDsToKpipi::propagatorKstr1430(
double mass,
double sx,
double *sb,
double *sc,
double prop[2])
418 double unit[2]={1.0};
421 Flatte_rhoab(sx,sb[0],sc[0],rho1);
423 Flatte_rhoab(sx,sb[1],sc[1],rho2);
424 double gKPi_Kstr1430=0.2990, gEtaPK_Kstr1430=0.0529;
425 double tmp1[2]={gKPi_Kstr1430,0};
427 double tmp2[2]={gEtaPK_Kstr1430,0};
429 Com_Multi(tmp1,rho1,tmp11);
430 Com_Multi(tmp2,rho2,tmp22);
431 double tmp3[2]={tmp11[0]+tmp22[0],tmp11[1]+tmp22[1]};
433 Com_Multi(tmp3, ci,tmp31);
434 double tmp4[2]={
mass*
mass-sx-tmp31[0], -1.0*tmp31[1]};
435 Com_Divide(
unit,tmp4, prop);
438double EvtDsToKpipi::DDalitz(
double P1[4],
double P2[4],
double P3[4],
int Ang,
double mass){
440 double temp_PDF, v_re;
443 double B[2], s1, s2, s3, sR, sD;
444 for(
int i=0; i<4; i++){
445 pR[i] = P1[i] + P2[i];
446 pD[i] = pR[i] + P3[i];
454 for(
int i=0; i!=4; i++){
455 for(
int j=0; j!=4; j++){
457 if(i==0) G[i][j] = 1;
469 B[0] = barrier(1,sR,s1,s2,3.0,mass);
470 B[1] = barrier(1,sD,sR,s3,5.0,mDsM);
477 for(
int i=0; i<4; i++){
478 temp_PDF += t1[i]*T1[i]*G[i][i];
482 B[0] = barrier(2,sR,s1,s2,3.0,mass);
483 B[1] = barrier(2,sD,sR,s3,5.0,mDsM);
484 double t2[4][4], T2[4][4];
488 for(
int i=0; i<4; i++){
489 for(
int j=0; j<4; j++){
490 temp_PDF += t2[i][j]*T2[j][i]*G[i][i]*G[j][j];
494 v_re = temp_PDF*
B[0]*
B[1];
499void EvtDsToKpipi::rhoab(
double sa,
double sb,
double sc,
double res[2]) {
500 double tmp = sa+sb-sc;
501 double q = 0.25*tmp*tmp/sa-sb;
503 res[0]=2.0*sqrt(
q/sa);
507 res[1]=2.0*sqrt(-
q/sa);
510void EvtDsToKpipi::rho4Pi(
double sa,
double res[2]) {
511 double temp = 1.0-0.3116765584/sa;
513 res[0]=sqrt(temp)/(1.0+
exp(9.8-3.5*sa));
517 res[1]=sqrt(-temp)/(1.0+
exp(9.8-3.5*sa));
521void EvtDsToKpipi::propagatorsigma500(
double sa,
double sb,
double sc,
double prop[2]) {
522 double f = 0.5843+1.6663*sa;
523 const double M = 0.9264;
524 const double mass2 = 0.85821696;
525 const double mpi2d2 = 0.00973989245;
526 double g1 =
f*(sa-mpi2d2)/(mass2-mpi2d2)*
exp((mass2-sa)/1.082);
527 double rho1s[2], rho1M[2], rho2s[2], rho2M[2], rho1[2], rho2[2];
528 rhoab(sa,sb,sc,rho1s);
529 rhoab(mass2,sb,sc,rho1M);
532 Com_Divide(rho1s,rho1M,rho1);
533 Com_Divide(rho2s,rho2M,rho2);
537 b[0] = mass2-sa+M*(
g1*rho1[1]+0.0024*rho2[1]);
538 b[1] = -M*(
g1*rho1[0]+0.0024*rho2[0]);
539 Com_Divide(a,
b,prop);
543void EvtDsToKpipi::calEva(
double* K,
double* Pi1,
double* Pi2,
double *mass1,
double *width1,
double *amp,
double *phase,
int* g0,
int* spin,
int* modetype,
int nstates,
double & Result)
548 double P23[4], P13[4];
549 double cof[2], amp_PDF[2], PDF[2];
553 for(
int i=0; i<4; i++){
555 P13[i] = K[i] + Pi2[i];
556 P23[i] = Pi1[i] + Pi2[i];
558 s13 = SCADot(P13,P13);
559 s23 = SCADot(P23,P23);
562 s2 = SCADot(Pi1,Pi1);
563 s3 = SCADot(Pi2,Pi2);
564 double pro[2], temp_PDF, amp_tmp[2],temp_PDF1 ,temp_PDF2,pro1[2],pro2[2];
572 for(
int i=0; i<nstates; i++) {
576 cof[0] = amp[i]*
cos(phase[i]);
577 cof[1] = amp[i]*
sin(phase[i]);
580 if(modetype[i] == 13){
581 temp_PDF = DDalitz(K, Pi2, Pi1, spin[i], mass1[i]);
582 if(g0[i]==1) propagatorRBW(mass1[i],width1[i],s13,mKa2,mPi2,rRess,spin[i],pro);
585 double skm2[2]={s1, 0.95778*0.95778};
586 double spi2[2]={s3, mass_Kaon *mass_Kaon};
587 propagatorKstr1430(mass1[i],s13,skm2,spi2,pro);
593 amp_tmp[0] = temp_PDF*pro[0];
594 amp_tmp[1] = temp_PDF*pro[1];
597 if(modetype[i] == 23){
598 temp_PDF = DDalitz(Pi1, Pi2, K, spin[i], mass1[i]);
599 if(g0[i]==4) propagatorFlatte(mass1[i],width1[i],
s23,pro);
600 if(g0[i]==3) propagatorCBW(mass1[i],width1[i],
s23,pro);
601 if(g0[i]==2) propagatorRBW(mass1[i],width1[i],
s23,mPi2,mPi2,rRess,spin[i],pro);
602 if(g0[i]==1) propagatorGS(mass1[i],width1[i],
s23,mPi2,mPi2,9.0,pro);
603 if(g0[i]==500) propagatorsigma500(
s23, s2, s3, pro);
608 amp_tmp[0] = temp_PDF*pro[0];
609 amp_tmp[1] = temp_PDF*pro[1];
611 Com_Multi(amp_tmp,cof,amp_PDF);
612 PDF[0] += amp_PDF[0];
613 PDF[1] += amp_PDF[1];
618 double value = PDF[0]*PDF[0] + PDF[1]*PDF[1];
620 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 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)
void decay(EvtParticle *p)
void getName(std::string &name)
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 double * s23