3 #include "PhotosUtilities.h"
11 using namespace Photospp;
20 double PHINT(
int idumm);
33 void PhotosMEforZ::GIVIZO(
int IDFERM,
int IHELIC,
double *SIZO3,
double *CHARGE,
int *KOLOR) {
35 int IH, IDTYPE, IC, LEPQUA, IUPDOW;
36 if (IDFERM==0 || abs(IDFERM)>4 || abs(IHELIC)!=1){
37 cout <<
"STOP IN GIVIZO: WRONG PARAMS" << endl;
44 LEPQUA=(int)(IDTYPE*0.4999999);
45 IUPDOW=IDTYPE-2*LEPQUA-1;
46 *CHARGE =(-IUPDOW+2.0/3.0*LEPQUA)*IC;
47 *SIZO3 =0.25*(IC-IH)*(1-2*IUPDOW);
60 double PhotosMEforZ::PHBORNM(
double svar,
double costhe,
double T3e,
double qe,
double T3f,
double qf,
int NCf){
62 double s,Sw2,MZ,MZ2,GammZ,AlfInv,GFermi;
64 double xe,yf,xf,ye,ff0,ff1,amx2,amfin,Vf,Af;
65 double ReChiZ,SqChiZ,RaZ;
94 if(fabs(costhe) > 1.0){
95 cout <<
"+++++STOP in PHBORN: costhe>0 =" << costhe << endl;
99 RaZ = (GFermi *MZ2 *AlfInv )/( sqrt(2.0) *8.0 *PI);
100 RaZ = 1/(16.0*Sw2*(1.0-Sw2));
103 if( KeyWidFix == 0 ){
104 ReChiZ=(s-MZ2)*s/((s-MZ2)*(s-MZ2)+(GammZ*s/MZ)*(GammZ*s/MZ)) *RaZ;
105 SqChiZ= s*s/((s-MZ2)*(s-MZ2)+(GammZ*s/MZ)*(GammZ*s/MZ)) *RaZ*RaZ;
108 ReChiZ=(s-MZ2)*s/((s-MZ2)*(s-MZ2)+(GammZ*MZ)*(GammZ*MZ)) *RaZ;
109 SqChiZ= s*s/((s-MZ2)*(s-MZ2)+(GammZ*MZ)*(GammZ*MZ)) *RaZ*RaZ;
115 ff0= qe*qe*qf*qf +2*ReChiZ*qe*qf*Ve*Vf +SqChiZ*xe*xf;
116 ff1= +2*ReChiZ*qe*qf*Ae*Af +SqChiZ*ye*yf;
117 Born = (1.0+ costhe*costhe)*ff0 +2.0*costhe*ff1;
121 if( svar < 4.0*amfin*amfin){
124 else if(svar < 16.0*amfin*amfin){
125 amx2=4.0*amfin*amfin/svar;
126 thresh=sqrt(1.0-amx2)*(1.0+amx2/2.0);
144 double PhotosMEforZ::AFBCALC(
double SVAR,
int IDEE,
int IDFF){
146 double T3e,qe,T3f,qf,A,B;
147 GIVIZO(IDEE,-1,&T3e,&qe,&KOLOR);
148 GIVIZO(IDFF,-1,&T3f,&qf,&KOLOR1);
150 A=PHBORNM(SVAR,0.5,T3e,qe,T3f,qf,KOLOR*KOLOR1);
151 B=PHBORNM(SVAR,-0.5,T3e,qe,T3f,qf,KOLOR*KOLOR1);
152 return (A-B)/(A+B)*5.0/2.0 *3.0/8.0;
156 int PhotosMEforZ::GETIDEE(
int IDE){
160 if((IDE==11) || (IDE== 13) || (IDE== 15)){
163 else if((IDE==-11) || (IDE==-13) || (IDE==-15)){
166 else if((IDE== 12) || (IDE== 14) || (IDE== 16)){
169 else if((IDE==-12) || (IDE==-14) || (IDE==-16)){
172 else if((IDE== 1) || (IDE== 3) || (IDE== 5)){
175 else if((IDE== -1) || (IDE== -3) || (IDE== -5)){
178 else if((IDE== 2) || (IDE== 4) || (IDE== 6)){
181 else if((IDE==- 2) || (IDE== -4) || (IDE== -6)){
184 if(IDEE==-555) {cout <<
" ERROR IN GETIDEE of PHOTS Z-ME: I3= &4i"<<IDEE<<endl;}
213 double PhotosMEforZ::PHASYZ(
double SVAR,
int IDE,
int IDF){
218 IDEE=abs(GETIDEE(IDE));
219 IDFF=abs(GETIDEE(IDF));
220 AFB= -AFBCALC(SVAR,IDEE,IDFF);
247 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){
248 double C,s,xkaM,xkaP,t,u,t1,u1,BT,BU;
256 if (IREP==1) IBREM=-1;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T*t1*t1+BU*u1*u1)
308 /(1+(1-xk)*(1-xk))* 2.0/(BT*(1-C)*(1-C)+BU*(1+C)*(1+C))/svar/svar;
312 waga=2/(1.0+COSTHG*BETA)*wagan2;
315 if(wagan2<=3.8)
return waga;
321 FILE *PHLUN = stdout;
326 fprintf(PHLUN,
" IDE= %i IDF= %i",IDE,IDF);
327 fprintf(PHLUN,
"bt,bu,bt+bu= %f %f %f",BT,BU,BT+BU);
331 fprintf(PHLUN,
"%i %i <-- IREP,IBREM", IREP,IBREM);
333 fprintf(PHLUN,
"%f %f %f %f qp = ",qp[0],qp[1],qp[2],qp[3]);
334 fprintf(PHLUN,
"%f %f %f %f qm = ",qm[0],qm[1],qm[2],qm[3]);
336 fprintf(PHLUN,
"%f %f %f %f ph = ",ph[0],ph[1],ph[2],ph[3]);
343 fprintf(PHLUN,
" c= %f theta= %f",C,th1);
349 fprintf(PHLUN,
" - ");
350 fprintf(PHLUN,
"t,u = %f %f",t,u);
351 fprintf(PHLUN,
"t1,u1 = %f %f",t1,u1);
352 fprintf(PHLUN,
"sredniaki = %f %f",svar*(1-C)/2,svar*(1+C)/2);
354 fprintf(PHLUN,
"PHASYZ(svar)=',%f,' svar= %f',' waga= %f",PHASYZ(svar,IDE,IDF),svar,waga);
355 fprintf(PHLUN,
" - ");
356 fprintf(PHLUN,
"BT-part= %f BU-part= %f",
358 /(1+(1-xk)*(1-xk))* 2.0/(BT*(1-C)*(1-C))/svar/svar,
360 /(1+(1-xk)*(1-xk))* 2.0/(BU*(1+C)*(1+C))/svar/svar);
361 fprintf(PHLUN,
"BT-part*BU-part= %f wagan2= %f",
363 /(1+(1-xk)*(1-xk))* 2.0/(BT*(1-C)*(1-C))/svar/svar
365 /(1+(1-xk)*(1-xk))* 2.0/(BU*(1+C)*(1+C))/svar/svar, wagan2);
367 fprintf(PHLUN,
"wagan2= %f",wagan2);
368 fprintf(PHLUN,
" ################### ");
372 waga=2/(1.0+COSTHG*BETA)*wagan2 ;
405 double PhotosMEforZ::phwtnlo(){
416 int K,L,IDHEP3,IDUM=0;
418 double QP[4],QM[4],PH[4],QQ[4],PP[4],PM[4],QQS[4];
434 XK=2.0*pho.phep[pho.nhep-i][4-i]/pho.phep[1-i][4-i];
438 if(pho.nhep<=4) XK=0.0;
441 if (XK>1.0e-10 &&(pho.idhep[1-i]==22 || pho.idhep[1-i]==23)){
457 PP[K-i]=pho.phep[1-i][K-i];
458 PM[K-i]=pho.phep[2-i][K-i];
459 QP[K-i]=pho.phep[3-i][K-i];
460 QM[K-i]=pho.phep[4-i][K-i];
461 PH[K-i]=pho.phep[pho.nhep-i][K-i];
463 QQS[K-i]=QP[K-i]+QM[K-i];
467 PP[4-i]=(pho.phep[1-i][4-i]+pho.phep[2-i][4-i])/2.0;
468 PM[4-i]=(pho.phep[1-i][4-i]+pho.phep[2-i][4-i])/2.0;
472 for(L=5;L<=pho.nhep-1;L++){
474 QQ [K-i]=QQ [K-i]+ pho.phep[L-i][K-i];
475 QQS[K-i]=QQS[K-i]+ pho.phep[L-i][K-i];
483 ENE=(QP[4-i]+QM[4-i]+QQ[4-i])/2;
487 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]);
496 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]);
511 svar=pho.phep[1-i][4-i]*pho.phep[1-i][4-i];
515 if(abs(hep.idhep[4-i])==abs(hep.idhep[3-i])) IDF=hep.idhep[3-i];
517 IDHEP3=pho.idhep[3-i];
518 return Zphwtnlo(svar,XK,IDHEP3,phopro.irep,QP,QM,PH,PP,PM,phophs.costhg,phwt.beta,phorest.th1,IDE,IDF);