44 double P_PANDA_THRESHOLD=1.5;
60 printf(
"###########################################################\n");
62 if( !( (P>=p_a)&&(P<=p_d) ) ){
63 printf(
"ERROR: P (anti-proton momentum) out of range \n");
64 printf(
" => P should be contained in the interval [%4.2f,%5.2f] GeV\n",p_a,p_d);
70 if(P<P_PANDA_THRESHOLD){
71 printf(
"WARNING: P (anti-proton momentum) smaller than PANDA threshold %4.2f GeV \n", P_PANDA_THRESHOLD);
76 if( !( (cos_theta_min>=-1.0)&&(cos_theta_max>cos_theta_min)&&(cos_theta_max<=1.0) ) ){
77 printf(
"ERROR: cos(theta*) range NOT allowed \n");
78 printf(
" => cos(theta*) range [cos(theta*) min, cos(theta*) max]\n");
79 printf(
" should be contained within [-1.0,1.0]\n");
85 if( ((P>=p_a)&&(P<p_c))&&( (cos_theta_min<-0.94)||(cos_theta_max>0.94)) ){
86 printf(
"WARNING: in the momentum range [%4.2f,%5.2f) GeV,\n",p_a,p_c);
87 printf(
" it is recommended to keep cos(theta*) range within the interval [-0.94,0.94]\n");
88 printf(
" to avoid potentially large extrapolations in the cross section\n");
103 E=pow((P*P+M*M),0.5);
111 for(
int i=0;
i<4;
i++){
112 pbarp_p[
i]=p_p[
i]+pbar_p[
i];
120 printf(
"Initial state kinematics\n");
121 printf(
"------------------------\n");
123 printf(
"=> CM energy square: S = %5.2f GeV^2 \n", S);
124 printf(
" CM energy: sqrt(S) = %5.2f GeV \n", sqrt_S);
131 printf(
"Kinematic regime and cross section parametrization\n");
132 printf(
"--------------------------------------------------\n");
135 if( (P>=p_a)&&(P<=p_b) ){
136 printf(
"%5.2f < P < %5.2f GeV => low energy regime\n", p_a, p_b);
137 printf(
"cross section parametrization: Legendre polynomial series\n");
141 if( (P>p_b)&&(P<p_c) ){
142 printf(
"%5.2f < P < %5.2f GeV => GAP energy regime\n", p_b, p_c);
143 printf(
"cross section parametrization: extrapolation Legendre polynomial series / Regge description\n");
147 if( (P>=p_c)&&(P<=
pz[24]) ){
148 printf(
"%5.2f < P < %5.2f GeV => transition energy regime\n", p_c,
pz[24]);
149 printf(
"cross section parametrization: Regge description\n");
154 if( (P>
pz[24])&&(P<=p_d) ){
155 printf(
"%5.2f < P < %5.2f GeV => high energy regime\n",
pz[24],p_d);
156 printf(
"cross section parametrization: Regge description\n");
167 printf(
"P at lattice site: no cross section extrapolation needed \n");
172 printf(
"P NOT at lattice site: extrapolating cross section between momenta %5.2f and %5.2f GeV\n",
pz[i_min],
pz[i_min+1]);
176 printf(
"###########################################################\n");
207 if( (P>
pz[i])&&(P<
pz[i+1]) ){
234 double a=(2.0)/(200.0);
239 if( !((cos_theta>=-1.0)&&(cos_theta<=1.0)) ){
240 printf(
"ERROR: function mz_pp_to_pipi_get_costheta_lattice_site\n");
241 printf(
" called with argument cos_theta out of range \n");
242 printf(
" => cos_theta should be contained in the interval [-1.0,1.0]\n");
249 k_min=int( (cos_theta+1.0)/(a) );
253 diff=cos_theta -1.0*(-1.0 +a*(double)(k_min));
254 if(diff>0.0) kflag=1;
275 if( (P>=
pz[0])&&(P<
pz[1]) ) max=300.0;
276 if( (P>=
pz[1])&&(P<
pz[2]) ) max=300.0;
277 if( (P>=
pz[2])&&(P<
pz[3]) ) max=150.0;
278 if( (P>=
pz[3])&&(P<
pz[4]) ) max=150.0;
279 if( (P>=
pz[4])&&(P<
pz[5]) ) max=120.0;
280 if( (P>=
pz[5])&&(P<
pz[6]) ) max=160.0;
281 if( (P>=
pz[6])&&(P<
pz[7]) ) max=160.0;
282 if( (P>=
pz[7])&&(P<
pz[8]) ) max=100.0;
283 if( (P>=
pz[8])&&(P<
pz[9]) ) max=130.0;
284 if( (P>=
pz[9])&&(P<
pz[10]) ) max=130.0;
285 if( (P>=
pz[10])&&(P<
pz[11]) ) max=90.0;
286 if( (P>=
pz[11])&&(P<
pz[12]) ) max=90.0;
287 if( (P>=
pz[12])&&(P<
pz[13]) ) max=65.0;
288 if( (P>=
pz[13])&&(P<
pz[14]) ) max=65.0;
289 if( (P>=
pz[14])&&(P<
pz[15]) ) max=65.0;
290 if( (P>=
pz[15])&&(P<
pz[16]) ) max=70.0;
291 if( (P>=
pz[16])&&(P<
pz[17]) ) max=70.0;
292 if( (P>=
pz[17])&&(P<
pz[18]) ) max=65.0;
293 if( (P>=
pz[18])&&(P<=
pz[19]) ) max=23.0;
295 if( (P>
pz[19])&&(P<
pz[20]) ) max=50.0;
297 if( (P>=
pz[20])&&(P<=
pz[38]) ){
327 if( !((i>=0)&&(i<=19)) ){
328 printf(
"ERROR: function mz_pp_to_pipi_vandewi_sigma_legendre\n");
329 printf(
" called with argument i out of range \n");
330 printf(
" => i should be contained in the interval [0,19]\n");
337 for(
int k=0; k<11; k++){
367 double factor=2.77207297;
369 double sigma_1,sigma_2;
370 double a=(2.0)/(200.0);
374 if( !((cos_theta>=-1.0)&&(cos_theta<=1.0)) ){
375 printf(
"ERROR: function mz_pp_to_pipi_vandewi_sigma\n");
376 printf(
" called with argument cos_theta out of range \n");
377 printf(
" => cos_theta should be contained in the interval [-1.0,1.0]\n");
392 if( (P>=
pz[0])&&(P<=
pz[19]) ){
407 if( (P>
pz[19])&&(P<
pz[20]) ){
419 x1=-1.0+a*(double)(k_min);
421 x2=-1.0+a*(double)(k_min+1);
435 if( (P>=
pz[20])&&(P<=
pz[38]) ){
436 if( (iflag==0)&&(kflag==0) ){
440 if( (iflag==0)&&(kflag==1) ){
441 x1=-1.0+a*(double)(k_min);
443 x2=-1.0+a*(double)(k_min+1);
448 if( (iflag==1)&&(kflag==0) ){
456 if( (iflag==1)&&(kflag==1) ){
457 x1=-1.0+a*(double)(k_min);
459 x2=-1.0+a*(double)(k_min+1);
463 x1=-1.0+a*(double)(k_min);
465 x2=-1.0+a*(double)(k_min+1);
515 double piplus_pcm[4];
516 double piminus_pcm[4];
529 E=pow((P*P+M*M),0.5);
537 for(
int i=0;
i<4;
i++){
538 pbarp_p[
i]=p_p[
i]+pbar_p[
i];
553 x=
mzrnd(cos_theta_min,cos_theta_max);
561 if(costheta > 1.0) costheta=1.0;
562 if(costheta < -1.0) costheta=-1.0;
563 theta=
acos(costheta);
564 phi=
mzrnd(0.0,2.0*PI);
567 piminus_pcm[0]=sqrt_S/2.0;
568 piminus_pcm[1]=pow(S/4.0-
mpi*
mpi,0.5)*
sin(theta)*
cos(phi);
569 piminus_pcm[2]=pow(S/4.0-mpi*mpi,0.5)*
sin(theta)*
sin(phi);
570 piminus_pcm[3]=pow(S/4.0-mpi*mpi,0.5)*
cos(theta);
573 piplus_pcm[0]=piminus_pcm[0];
574 piplus_pcm[1]=-1.0*piminus_pcm[1];
575 piplus_pcm[2]=-1.0*piminus_pcm[2];
576 piplus_pcm[3]=-1.0*piminus_pcm[3];
579 mzboost(1,pbarp_p,piplus_pcm,piplus_p);
580 mzboost(1,pbarp_p,piminus_pcm,piminus_p);
friend F32vec4 acos(const F32vec4 &a)
void ranlxd(double r[], int n)
double mz_pp_to_pipi_sigma(double P, double cos_theta)
printf("RealTime=%f seconds, CpuTime=%f seconds\n", rtime, ctime)
double mz_pp_to_pipi_vandewi_sigma_legendre(int i, double cos_theta)
friend F32vec4 cos(const F32vec4 &a)
void mz_pp_to_pipi_get_p_lattice_site(double P, int &i_min, int &iflag)
double mzvmod2(int n, double *p)
friend F32vec4 sin(const F32vec4 &a)
void ranlxs(float r[], int n)
friend F32vec4 max(const F32vec4 &a, const F32vec4 &b)
void mz_pp_to_pipi_vandewi_event(double P, double cos_theta_min, double cos_theta_max, double *piplus_p, double *piminus_p)
void mz_pp_to_pipi_get_costheta_lattice_site(double cos_theta, int &k_min, int &kflag)
double sigmas_dt[19][201]
double mzrnd(double a, double b)
double mz_linear_extrapolation(double x1, double y1, double x2, double y2, double x)
void mzboost(int flag, double *p, double *q, double *q_prime)
double fitlegendre[20][11]
void mz_pp_to_pipi_vandewi_init(int seed, double P, double cos_theta_min, double cos_theta_max)
void rlxs_init(int level, int seed)
double mz_legendre_polynomial(int n, double x)
void rlxd_init(int level, int seed)
double mz_pp_to_pipi_vandewi_maximum_sigma(double P)