3 #include "PhotosUtilities.h"
11 using namespace Photospp;
17 double (*PhotosMEforZ::currentVakPol)(
double[4],
double[4],
double[4],
double[4],
double[4], int, int) = default_VakPol;
22 double PHINT(
int idumm);
35 void PhotosMEforZ::GIVIZO(
int IDFERM,
int IHELIC,
double *SIZO3,
double *CHARGE,
int *KOLOR) {
37 int IH, IDTYPE, IC, LEPQUA, IUPDOW;
38 if (IDFERM==0 || abs(IDFERM)>4 || abs(IHELIC)!=1){
39 cout <<
"STOP IN GIVIZO: WRONG PARAMS" << endl;
46 LEPQUA=(int)(IDTYPE*0.4999999);
47 IUPDOW=IDTYPE-2*LEPQUA-1;
48 *CHARGE =(-IUPDOW+2.0/3.0*LEPQUA)*IC;
49 *SIZO3 =0.25*(IC-IH)*(1-2*IUPDOW);
64 double s,Sw2,MZ,MZ2,GammZ,AlfInv,GFermi;
66 double xe,yf,xf,ye,ff0,ff1,amx2,amfin,Vf,Af;
67 double ReChiZ,SqChiZ,RaZ;
96 if(fabs(costhe) > 1.0){
97 cout <<
"+++++STOP in PHBORN: costhe>0 =" << costhe << endl;
101 RaZ = (GFermi *MZ2 *AlfInv )/( sqrt(2.0) *8.0 *PI);
102 RaZ = 1/(16.0*Sw2*(1.0-Sw2));
105 if( KeyWidFix == 0 ){
106 ReChiZ=(s-MZ2)*s/((s-MZ2)*(s-MZ2)+(GammZ*s/MZ)*(GammZ*s/MZ)) *RaZ;
107 SqChiZ= s*s/((s-MZ2)*(s-MZ2)+(GammZ*s/MZ)*(GammZ*s/MZ)) *RaZ*RaZ;
110 ReChiZ=(s-MZ2)*s/((s-MZ2)*(s-MZ2)+(GammZ*MZ)*(GammZ*MZ)) *RaZ;
111 SqChiZ= s*s/((s-MZ2)*(s-MZ2)+(GammZ*MZ)*(GammZ*MZ)) *RaZ*RaZ;
117 ff0= qe*qe*qf*qf +2*ReChiZ*qe*qf*Ve*Vf +SqChiZ*xe*xf;
118 ff1= +2*ReChiZ*qe*qf*Ae*Af +SqChiZ*ye*yf;
119 Born = (1.0+ costhe*costhe)*ff0 +2.0*costhe*ff1;
123 if( svar < 4.0*amfin*amfin){
126 else if(svar < 16.0*amfin*amfin){
127 amx2=4.0*amfin*amfin/svar;
128 thresh=sqrt(1.0-amx2)*(1.0+amx2/2.0);
146 double PhotosMEforZ::AFBCALC(
double SVAR,
int IDEE,
int IDFF){
148 double T3e,qe,T3f,qf,A,B;
149 GIVIZO(IDEE,-1,&T3e,&qe,&KOLOR);
150 GIVIZO(IDFF,-1,&T3f,&qf,&KOLOR1);
152 A=PHBORNM(SVAR,0.5,T3e,qe,T3f,qf,KOLOR*KOLOR1);
153 B=PHBORNM(SVAR,-0.5,T3e,qe,T3f,qf,KOLOR*KOLOR1);
154 return (A-B)/(A+B)*5.0/2.0 *3.0/8.0;
158 int PhotosMEforZ::GETIDEE(
int IDE){
162 if((IDE==11) || (IDE== 13) || (IDE== 15)){
165 else if((IDE==-11) || (IDE==-13) || (IDE==-15)){
168 else if((IDE== 12) || (IDE== 14) || (IDE== 16)){
171 else if((IDE==-12) || (IDE==-14) || (IDE==-16)){
174 else if((IDE== 1) || (IDE== 3) || (IDE== 5)){
177 else if((IDE== -1) || (IDE== -3) || (IDE== -5)){
180 else if((IDE== 2) || (IDE== 4) || (IDE== 6)){
183 else if((IDE==- 2) || (IDE== -4) || (IDE== -6)){
186 if(IDEE==-555) {cout <<
" ERROR IN GETIDEE of PHOTS Z-ME: I3= &4i"<<IDEE<<endl;}
215 double PhotosMEforZ::PHASYZ(
double SVAR,
int IDE,
int IDF){
220 IDEE=abs(GETIDEE(IDE));
221 IDFF=abs(GETIDEE(IDF));
222 AFB= -AFBCALC(SVAR,IDEE,IDFF);
249 double PhotosMEforZ::Zphwtnlo(
double svar,
double xk,
int IDHEP3,
int IREP,
double qp[4],
double qm[4],
double ph[4],
double pp[4],
double pm[4],
double COSTHG,
double BETA,
double th1,
int IDE,
int IDF){
250 double C,s,xkaM,xkaP,t,u,t1,u1,BT,BU;
258 if (IREP==1) IBREM=-1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BT*t1*t1+BU*u1*u1)
310 /(1+(1-xk)*(1-xk))* 2.0/(BT*(1-C)*(1-C)+BU*(1+C)*(1+C))/svar/svar;
312 wagan2=wagan2*VakPol(qp,qm,ph,pp,pm,IDE,IDF);
315 waga=2/(1.0+COSTHG*BETA)*wagan2;
319 if(wagan2<=3.8)
return waga;
325 FILE *PHLUN = stdout;
330 fprintf(PHLUN,
" IDE= %i IDF= %i",IDE,IDF);
331 fprintf(PHLUN,
"bt,bu,bt+bu= %f %f %f",BT,BU,BT+BU);
335 fprintf(PHLUN,
"%i %i <-- IREP,IBREM", IREP,IBREM);
337 fprintf(PHLUN,
"%f %f %f %f qp = ",qp[0],qp[1],qp[2],qp[3]);
338 fprintf(PHLUN,
"%f %f %f %f qm = ",qm[0],qm[1],qm[2],qm[3]);
340 fprintf(PHLUN,
"%f %f %f %f ph = ",ph[0],ph[1],ph[2],ph[3]);
347 fprintf(PHLUN,
" c= %f theta= %f",C,th1);
353 fprintf(PHLUN,
" - ");
354 fprintf(PHLUN,
"t,u = %f %f",t,u);
355 fprintf(PHLUN,
"t1,u1 = %f %f",t1,u1);
356 fprintf(PHLUN,
"sredniaki = %f %f",svar*(1-C)/2,svar*(1+C)/2);
358 fprintf(PHLUN,
"PHASYZ(svar)=',%f,' svar= %f',' waga= %f",PHASYZ(svar,IDE,IDF),svar,waga);
359 fprintf(PHLUN,
" - ");
360 fprintf(PHLUN,
"BT-part= %f BU-part= %f",
362 /(1+(1-xk)*(1-xk))* 2.0/(BT*(1-C)*(1-C))/svar/svar,
364 /(1+(1-xk)*(1-xk))* 2.0/(BU*(1+C)*(1+C))/svar/svar);
365 fprintf(PHLUN,
"BT-part*BU-part= %f wagan2= %f",
367 /(1+(1-xk)*(1-xk))* 2.0/(BT*(1-C)*(1-C))/svar/svar
369 /(1+(1-xk)*(1-xk))* 2.0/(BU*(1+C)*(1+C))/svar/svar, wagan2);
371 fprintf(PHLUN,
"wagan2= %f",wagan2);
372 fprintf(PHLUN,
" ################### ");
376 waga=2/(1.0+COSTHG*BETA)*wagan2 ;
386 double PhotosMEforZ::VakPol(
double qp[4],
double qm[4],
double ph[4],
double pp[4],
double pm[4],
int IDE,
int IDF)
388 return PhotosMEforZ::currentVakPol(qp,qm,ph,pp,pm,IDE,IDF);
391 double PhotosMEforZ::default_VakPol(
double qp[4],
double qm[4],
double ph[4],
double pp[4],
double pm[4],
int IDE,
int IDF)
396 void PhotosMEforZ::set_VakPol(
double (*fun)(
double[4],
double[4],
double[4],
double[4],
double[4],
int,
int) )
398 if (fun==NULL) PhotosMEforZ::currentVakPol = default_VakPol;
399 else PhotosMEforZ::currentVakPol = fun;
425 double PhotosMEforZ::phwtnlo(){
436 int K,L,IDHEP3,IDUM=0;
438 double QP[4],QM[4],PH[4],QQ[4],PP[4],PM[4],QQS[4];
454 XK=2.0*pho.phep[pho.nhep-i][4-i]/pho.phep[1-i][4-i];
458 if(pho.nhep<=4) XK=0.0;
461 if (XK>1.0e-10 &&(pho.idhep[1-i]==22 || pho.idhep[1-i]==23)){
477 PP[K-i]=pho.phep[1-i][K-i];
478 PM[K-i]=pho.phep[2-i][K-i];
479 QP[K-i]=pho.phep[3-i][K-i];
480 QM[K-i]=pho.phep[4-i][K-i];
481 PH[K-i]=pho.phep[pho.nhep-i][K-i];
483 QQS[K-i]=QP[K-i]+QM[K-i];
487 PP[4-i]=(pho.phep[1-i][4-i]+pho.phep[2-i][4-i])/2.0;
488 PM[4-i]=(pho.phep[1-i][4-i]+pho.phep[2-i][4-i])/2.0;
492 for(L=5;L<=pho.nhep-1;L++){
494 QQ [K-i]=QQ [K-i]+ pho.phep[L-i][K-i];
495 QQS[K-i]=QQS[K-i]+ pho.phep[L-i][K-i];
503 ENE=(QP[4-i]+QM[4-i]+QQ[4-i])/2;
507 double a=sqrt(ENE*ENE-pho.phep[3-i][5-i]*pho.phep[3-i][5-i])/sqrt(QM[4-i]*QM[4-i]-pho.phep[3-i][5-i]*pho.phep[3-i][5-i]);
516 double a=sqrt(ENE*ENE-pho.phep[3-i][5-i]*pho.phep[3-i][5-i])/sqrt(QP[4-i]*QP[4-i]-pho.phep[3-i][5-i]*pho.phep[3-i][5-i]);
531 svar=pho.phep[1-i][4-i]*pho.phep[1-i][4-i];
535 if(abs(hep.idhep[4-i])==abs(hep.idhep[3-i])) IDF=hep.idhep[3-i];
537 IDHEP3=pho.idhep[3-i];
538 return Zphwtnlo(svar,XK,IDHEP3,phopro.irep,QP,QM,PH,PP,PM,phophs.costhg,phwt.beta,phorest.th1,IDE,IDF);
static double Zphwtnlo(double svar, double xk, int IDHEP3, int IREP, double qp[4], double qm[4], double ph[4], double pp[4], double pm[4], double COSTHG, double BETA, double th1, int IDE, int IDF)
static double PHBORNM(double svar, double costhe, double T3e, double qe, double T3f, double qf, int Ncf)