There are two files at the end of this page.
"main_22.c" is an example program that calculate the process: e,E -> m, M and A, A -> m, M in the Standard Model.
main_22:main code
//============================== MAIN =============================
int main(void)
{ int err;
double pvec[16];
double *p1=pvec, *p2=pvec+4, *p3=pvec+8, *p4=pvec+12;
double m1,m2,m3,m4;
double Pin,Pout;
double totcoef, sqrt_S, S, lambda12, lambda34,ms,md;
double cos_fi, cos_step;
double sigmaTot=0;
int i;
char mess[20];
double GG;
numout*cc,*cc1;
// Specify model for work: Model directory and model number.
setModel("../models" , 2 );
/* assign variables */
err=assignVal("SW", 0.483);
// Calculation of public constraints
err=calcMainFunc();
if(err) { printf("Can not calculate constrained parameter %s\n",varNames[err]);return err;}
// SQME code generation
// extern numout*getMEcode(int twidth,int UnitaryGauge, char* Process,
// char * excludeVirtual,char*excludeOut,char*libraryName);
cc= getMEcode(0,0,"e,E->m,M","","","eemm");
cc1=getMEcode(0,0,"A,A->m,M","","","aamm");
for(i=1;i<=cc->interface->nvar;i++) if(cc->link[i]) cc->interface->va[i]=*(cc->link[i]);
err=cc->interface->calcFunc();
if(err) { printf("Can not calculate constrained parameter %s\n",cc->interface->varName[err]); return err;}
for(i=1 ;i<=cc->interface->nvar;i++)
printf("%s=%E\n",cc->interface->varName[i], cc->interface->va[i]);
/* Initial cms momentum */
Pin=100;
/* find masses */
cc->interface->pinf(1,1,&m1,NULL);
cc->interface->pinf(1,2,&m2,NULL);
cc->interface->pinf(1,3,&m3,NULL);
cc->interface->pinf(1,4,&m4,NULL);
/* 2-2 kinematics */
sqrt_S=sqrt(m1*m1+Pin*Pin) +sqrt(m2*m2+Pin*Pin);
S=sqrt_S*sqrt_S;
lambda12=2*sqrt_S*Pin;
ms = m3+m4; if (ms >= sqrt_S) return 1;
md = m3 -m4;
lambda34 = sqrt((S - ms*ms) * (S - md*md));
totcoef = 3.8937966E8 * lambda34 /(32.0 * M_PI * lambda12 * S);
Pout=lambda34/(2*sqrt_S);
/* fill momenta of particles */
for(i=0;i<16;i++) pvec[i]=0;
p1[0]= sqrt(Pin*Pin + m1*m1);
p1[3]= Pin;
p2[0]= sqrt(Pin*Pin + m2*m2);
p2[3]= -Pin;
p3[0]= sqrt(Pout*Pout + m3*m3);
p4[0]= sqrt(Pout*Pout + m4*m4);
/* Assign QCD coupling */
GG=1.238;
cos_step=0.1; /* step to calculate dsigma/dcos */
sigmaTot=0.; /* total cross section */
/* cycle */
for(cos_fi=1-cos_step/2; cos_fi>-1; cos_fi -= cos_step)
{ double DsigmaDcos;
double sin_fi=sqrt((1-cos_fi)*(1+cos_fi));
int err=0;
p3[3]=Pout*cos_fi; p4[3]=-p3[3];
p3[2]=Pout*sin_fi; p4[2]=-p3[2];
DsigmaDcos=totcoef*cc->interface->sqme(1,GG,pvec,&err);
sigmaTot += DsigmaDcos*cos_step;
}
printf("sigmaTot=%E\n",sigmaTot);
return 0;
}
"make_main" is the makefile to compile main_22.c file: ./make_main main_22.c
You need to change the first line of this code into your calchep directory.
CALCHEP= ...
excute main_22 and let's see what will happen.
Good example is here (This is for 2->2 process since it used "sum_int.m" file )
You must change the original "sum_int.m" file in "$CALCHEP/utile" directory with the one that is provided at the end of the webpage
For the general usage, please look at
Example is attached at the end of this page.