31                                   double P, 
double GE_to_GM,
 
   32                                   double cos_theta_min, 
double cos_theta_max)
 
   62   double P_PANDA_THRESHOLD=1.5;        
 
   63   double P_PANDA_UP=15.0;              
 
   76   if( (seed<1)||(seed>2147483647) ){   
 
   77    printf(
"ERROR: RANLUX seed out of range: \n");
 
   78    printf(
"    => RANLUX seed should be contained within [1,2^31-1]\n");
 
   79    printf(
"    => job killed!!! \n");
 
   85   if( !( ( particle_flag==0)||( particle_flag==1)||( particle_flag==2) ) ){
 
   86     printf(
"ERROR: particle flag out of range: \n");
 
   87     printf(
"    => particle flag should be 0 (=electron), 1 (=muon) or 2 (=tau)\n");
 
   88     printf(
"    => job killed!!! \n");
 
   95     printf(
"ERROR: P (anti-proton momentum) out of range: \n");
 
   96     printf(
"    => P should be a positive real number \n");
 
   97     printf(
"    => job killed!!! \n");
 
  103   if(P<P_PANDA_THRESHOLD){
 
  104     printf(
"WARNING: P (anti-proton momentum) smaller than PANDA threshold %4.2f GeV \n", 
 
  111     printf(
"WARNING: P (anti-proton momentum) larger than PANDA upper limit %4.2f GeV \n", 
 
  118     printf(
"ERROR: |G_E|/|G_M|  out of range: \n");
 
  119     printf(
"    => |G_E|/|G_M|  should be a positive real number \n");
 
  120     printf(
"    => job killed!!! \n");
 
  126   if( !( (cos_theta_min>=-1.0)&&(cos_theta_max>cos_theta_min)&&(cos_theta_max<=1.0) ) ){
 
  127     printf(
"ERROR: cos(theta*) range NOT allowed \n");
 
  128     printf(
"    => cos(theta*) range [cos(theta*) min, cos(theta*) max]\n");
 
  129     printf(
"       should be contained within [-1.0,1.0]\n");
 
  130     printf(
"    => job killed!!! \n");
 
  141   E=pow((P*P+M*M),0.5);
 
  151   E_min=S_min/(2.0*M)-M;
 
  152   P_min=pow((E_min*E_min-M*M),0.5);
 
  156   if( (particle_flag==2)&&(S<=S_min) ){
 
  157    printf(
"ERROR: center of mass energy below threshold for tau+tau- production \n");
 
  158    printf(
"    => tau+tau- production requires: \n");
 
  159    printf(
"           center-of-mass energy squared   s > 4.0*m_{tau}^2 = %4.2f GeV^2, i.e. \n", S_min);
 
  160    printf(
"           antiproton energy               E > %4.2f GeV, i.e. \n", E_min);
 
  161    printf(
"           antiproton momentum             P > %4.2f GeV \n", P_min);
 
  162    printf(
"    => job killed!!! \n");
 
  168   printf(
"Initial state kinematics\n");
 
  169   printf(
"------------------------\n");
 
  171   printf(
"=> CM energy square:        S = %5.2f GeV^2 \n", S);
 
  172   printf(
"   CM energy:         sqrt(S) = %5.2f GeV \n", sqrt_S);
 
  184                                      double P, 
double GE, 
double GM, 
 
  207   double hc2_units=
hc2*1000000000000.0;    
 
  221   double A_1, A_2, A_3, A_4;  
 
  226   if(particle_flag==0) mlepton=
me;
 
  227   if(particle_flag==1) mlepton=
mmu;
 
  228   if(particle_flag==2) mlepton=
mtau;
 
  231   E=pow((P*P+M*M),0.5);
 
  238   beta_l=pow(1.0-4.0*mlepton*mlepton/S,0.5);
 
  239   beta_p=pow(1.0-4.0*M*M/S,0.5);
 
  243   A_2 = beta_l/(beta_p*S);
 
  245   A_3 = (2.0 -beta_l*beta_l +beta_l*beta_l*cos_theta*cos_theta)*GM*GM;
 
  247   A_4 = (1.0/tau)*(1.0 -beta_l*beta_l*cos_theta*cos_theta)*GE*GE;
 
  250   sigma = A_1*A_2*(A_3+A_4);
 
  254   if( (particle_flag==2)&&(S<=S_min) ) sigma=0.0;
 
  264                                             double P, 
double GE_to_GM, 
 
  305   if(particle_flag==0) mlepton=
me;
 
  306   if(particle_flag==1) mlepton=
mmu;
 
  307   if(particle_flag==2) mlepton=
mtau;
 
  310   E=pow((P*P+M*M),0.5);
 
  317   beta_l=pow(1.0-4.0*mlepton*mlepton/S,0.5);
 
  319   A=( beta_l*beta_l*(1.0-R*R/tau) )/( 2.0-beta_l*beta_l + R*R/tau );  
 
  322   sigma = 1.0 +A*cos_theta*cos_theta;
 
  332                                    double P, 
double GE_to_GM, 
 
  333                                    double cos_theta_min, 
double cos_theta_max, 
 
  334                                    double* lepplus_p, 
double* lepminus_p)
 
  376   double lepplus_pcm[4];    
 
  377   double lepminus_pcm[4];   
 
  381   if(particle_flag==0) mlepton=
me;
 
  382   if(particle_flag==1) mlepton=
mmu;
 
  383   if(particle_flag==2) mlepton=
mtau;
 
  395   E=pow((P*P+M*M),0.5);
 
  403   for(
int i=0; 
i<4; 
i++){
 
  404     pbarp_p[
i]=p_p[
i]+pbar_p[
i];
 
  414   beta_l=pow(1.0-4.0*mlepton*mlepton/S,0.5);
 
  416   A=( beta_l*beta_l*(1.0-R*R/tau) )/( 2.0-beta_l*beta_l + R*R/tau );
 
  423     x=
mzrnd(cos_theta_min,cos_theta_max);   
 
  431       if(costheta > 1.0) costheta=1.0;      
 
  432       if(costheta < -1.0) costheta=-1.0;
 
  433       theta=
acos(costheta);                 
 
  434       phi=
mzrnd(0.0,2.0*PI);                
 
  437       lepminus_pcm[0]=sqrt_S/2.0;
 
  438       lepminus_pcm[1]=pow(S/4.0-mlepton*mlepton,0.5)*
sin(theta)*
cos(phi);
 
  439       lepminus_pcm[2]=pow(S/4.0-mlepton*mlepton,0.5)*
sin(theta)*
sin(phi);
 
  440       lepminus_pcm[3]=pow(S/4.0-mlepton*mlepton,0.5)*
cos(theta);
 
  443       lepplus_pcm[0]=lepminus_pcm[0];
 
  444       lepplus_pcm[1]=-1.0*lepminus_pcm[1];
 
  445       lepplus_pcm[2]=-1.0*lepminus_pcm[2];
 
  446       lepplus_pcm[3]=-1.0*lepminus_pcm[3];
 
  449       mzboost(1,pbarp_p,lepplus_pcm,lepplus_p);
 
  450       mzboost(1,pbarp_p,lepminus_pcm,lepminus_p);
 
friend F32vec4 acos(const F32vec4 &a)
 
printf("RealTime=%f seconds, CpuTime=%f seconds\n", rtime, ctime)
 
friend F32vec4 cos(const F32vec4 &a)
 
void mz_pp_to_leplep_vandewi_init(int seed, int particle_flag, double P, double GE_to_GM, double cos_theta_min, double cos_theta_max)
 
double mzvmod2(int n, double *p)
 
friend F32vec4 sin(const F32vec4 &a)
 
friend F32vec4 max(const F32vec4 &a, const F32vec4 &b)
 
double mz_pp_to_leplep_vandewi_sigma(int particle_flag, double P, double GE, double GM, double cos_theta)
 
double mzrnd(double a, double b)
 
double mz_pp_to_leplep_vandewi_sigma_nonorm(int particle_flag, double P, double GE_to_GM, double cos_theta)
 
void ranlxs(float r[], int n)
 
void ranlxd(double r[], int n)
 
void rlxs_init(int level, int seed)
 
void mzboost(int flag, double *p, double *q, double *q_prime)
 
void mz_pp_to_leplep_vandewi_event(int particle_flag, double P, double GE_to_GM, double cos_theta_min, double cos_theta_max, double *lepplus_p, double *lepminus_p)
 
friend F32vec4 fabs(const F32vec4 &a)
 
void rlxd_init(int level, int seed)
 
static const double alpha_QED