FairRoot/PandaRoot
Functions
mzfunctions_pp_to_pipi_vandewi.cxx File Reference
#include <stdlib.h>
#include <iostream>
#include <fstream>
#include <sstream>
#include <cmath>
#include "ranlxs.h"
#include "ranlxd.h"
#include "mzparameters.h"
#include "mzfunctions.h"
#include "pipisigmas.h"
#include "mzfunctions_pp_to_pipi_vandewi.h"

Go to the source code of this file.

Functions

void ranlxs (float r[], int n)
 
void ranlxd (double r[], int n)
 
void rlxs_init (int level, int seed)
 
void rlxd_init (int level, int seed)
 
void mz_pp_to_pipi_vandewi_init (int seed, double P, double cos_theta_min, double cos_theta_max)
 
void mz_pp_to_pipi_get_p_lattice_site (double P, int &i_min, int &iflag)
 
void mz_pp_to_pipi_get_costheta_lattice_site (double cos_theta, int &k_min, int &kflag)
 
double mz_pp_to_pipi_vandewi_maximum_sigma (double P)
 
double mz_pp_to_pipi_vandewi_sigma_legendre (int i, double cos_theta)
 
double mz_pp_to_pipi_sigma (double P, double cos_theta)
 
void mz_pp_to_pipi_vandewi_event (double P, double cos_theta_min, double cos_theta_max, double *piplus_p, double *piminus_p)
 

Function Documentation

void mz_pp_to_pipi_get_costheta_lattice_site ( double  cos_theta,
int &  k_min,
int &  kflag 
)

function mz_pp_to_pipi_get_costheta_lattice_site

INPUT:

cos_theta -> cos(theta*)

OUTPUT:

k_min -> lower site in cos(theta*) lattice for input cos(theta*) kflag -> cos(theta*) extrapolation flag kflag=0: input cos(theta*) at lattice site, i.e. no extrapolation needed iflag=1: input cos(theta*) NOT at lattice site, i.e. extrapolation needed

Definition at line 216 of file mzfunctions_pp_to_pipi_vandewi.cxx.

References a, exit(), and printf().

Referenced by mz_pp_to_pipi_sigma().

217 {
234  double a=(2.0)/(200.0); //lattice spacing in cos(theta*)
235  double diff;
236 
237  //checking arguments range...
238 
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");
243  printf("\n\n");
244  exit(1);
245  }
246 
247 
248  //calculate lower cos(theta*) lattice site for input cos_theta
249  k_min=int( (cos_theta+1.0)/(a) );
250 
251  //decide whether or not extrapolation is needed
252  kflag=0;
253  diff=cos_theta -1.0*(-1.0 +a*(double)(k_min));
254  if(diff>0.0) kflag=1;
255 }
printf("RealTime=%f seconds, CpuTime=%f seconds\n", rtime, ctime)
exit(0)
Int_t a
Definition: anaLmdDigi.C:126
void mz_pp_to_pipi_get_p_lattice_site ( double  P,
int &  i_min,
int &  iflag 
)

function mz_pp_to_pipi_get_p_lattice_site

INPUT:

P -> pbar momentum lab frame [GeV]

OUTPUT:

i_min -> lower site in momentum lattice for input momentum P iflag -> momentum extrapolation flag iflag=0: input momentum P at lattice site, i.e. no extrapolation needed iflag=1: input momentum P NOT at lattice site, i.e. extrapolation needed

Definition at line 183 of file mzfunctions_pp_to_pipi_vandewi.cxx.

References dim_pz, i, and pz.

Referenced by mz_pp_to_pipi_sigma(), mz_pp_to_pipi_vandewi_init(), and mz_pp_to_pipi_vandewi_maximum_sigma().

184 {
201  for(int i=0; i < dim_pz; i++){
202  if(P==pz[i]){
203  iflag=0;
204  i_min=i;
205  }
206  if(i<(dim_pz-1)){
207  if( (P>pz[i])&&(P<pz[i+1]) ){
208  iflag=1;
209  i_min=i;
210  }
211  }
212  }
213 
214 }
Int_t i
Definition: run_full.C:25
int dim_pz
Definition: pipisigmas.h:10
GeV c P
double pz[39]
Definition: pipisigmas.h:14
double mz_pp_to_pipi_sigma ( double  P,
double  cos_theta 
)

function mz_pp_to_pipi_sigma

INPUT:

P -> anti-proton momentum (lab frame) [GeV] cos_theta -> cos(theta*)

RETURNS:

value of cross section for the pbar momentum P at the point cos_theta

Definition at line 346 of file mzfunctions_pp_to_pipi_vandewi.cxx.

References a, exit(), mz_linear_extrapolation(), mz_pp_to_pipi_get_costheta_lattice_site(), mz_pp_to_pipi_get_p_lattice_site(), mz_pp_to_pipi_vandewi_sigma_legendre(), printf(), pz, sigma, and sigmas_dt.

Referenced by mz_pp_to_pipi_vandewi_event().

347 {
362  double sigma;
363 
364  int i_min, iflag;
365  int k_min, kflag;
366  double x1,y1,x2,y2;
367  double factor=2.77207297; //conversion dsigma/d(cos\theta*) -> dsigma/dt at p=2.43 GeV
368 
369  double sigma_1,sigma_2;
370  double a=(2.0)/(200.0); //lattice spacing in cos(theta*)
371 
372  //checking arguments range...
373 
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");
378  printf("\n\n");
379  exit(1);
380  }
381 
382 
383  //get momentum-lattice site
384  mz_pp_to_pipi_get_p_lattice_site(P, i_min, iflag);
385 
386  //get cos(theta*) lattice site
387  mz_pp_to_pipi_get_costheta_lattice_site(cos_theta, k_min, kflag);
388 
389 
390 
391  //legendre zone
392  if( (P>=pz[0])&&(P<=pz[19]) ){
393  if(iflag==0){ //NO p-extrapolation
394  sigma=mz_pp_to_pipi_vandewi_sigma_legendre(i_min,cos_theta);
395  }
396  if(iflag==1){ //YES p_extrapolation
397  x1=pz[i_min];
398  y1=mz_pp_to_pipi_vandewi_sigma_legendre(i_min,cos_theta);
399  x2=pz[i_min+1];
400  y2=mz_pp_to_pipi_vandewi_sigma_legendre(i_min+1,cos_theta);
401  sigma=mz_linear_extrapolation(x1,y1,x2,y2,P);
402  }
403  }
404 
405 
406  //legendre/vandewi extrapolation zone
407  if( (P>pz[19])&&(P<pz[20]) ){
408  if(kflag==0){ //NO cos(theta*) extrapolation
409  x1=pz[19];
410  y1=mz_pp_to_pipi_vandewi_sigma_legendre(19,cos_theta)*factor;
411  x2=pz[20];
412  y2=sigmas_dt[0][k_min];
413  sigma=mz_linear_extrapolation(x1,y1,x2,y2,P);
414  }
415  //
416  if(kflag==1){ //YES cos(theta*) extrapolation
417  sigma_1=mz_pp_to_pipi_vandewi_sigma_legendre(19,cos_theta)*factor;
418  //
419  x1=-1.0+a*(double)(k_min);
420  y1=sigmas_dt[0][k_min];
421  x2=-1.0+a*(double)(k_min+1);
422  y2=sigmas_dt[0][k_min+1];
423  sigma_2=mz_linear_extrapolation(x1,y1,x2,y2,cos_theta);
424  //
425  x1=pz[19];
426  y1=sigma_1;
427  x2=pz[20];
428  y2=sigma_2;
429  sigma=mz_linear_extrapolation(x1,y1,x2,y2,P);
430  }
431  }
432 
433 
434  //vandewi zone
435  if( (P>=pz[20])&&(P<=pz[38]) ){
436  if( (iflag==0)&&(kflag==0) ){ //NO p-extrapolation NO cos(theta*)-extrapolation
437  sigma=sigmas_dt[i_min-20][k_min];
438  }
439  //
440  if( (iflag==0)&&(kflag==1) ){ //NO p-extrapolation YES cos(theta*)-extrapolation
441  x1=-1.0+a*(double)(k_min);
442  y1=sigmas_dt[i_min-20][k_min];
443  x2=-1.0+a*(double)(k_min+1);
444  y2=sigmas_dt[i_min-20][k_min+1];
445  sigma=mz_linear_extrapolation(x1,y1,x2,y2,cos_theta);
446  }
447  //
448  if( (iflag==1)&&(kflag==0) ){ //YES p-extrapolation NO cos(theta*)-extrapolation
449  x1=pz[i_min];
450  y1=sigmas_dt[i_min-20][k_min];
451  x2=pz[i_min+1];
452  y2=sigmas_dt[i_min+1-20][k_min];
453  sigma=mz_linear_extrapolation(x1,y1,x2,y2,P);
454  }
455  //
456  if( (iflag==1)&&(kflag==1) ){ //YES p-extrapolation YES cos(theta*)-extrapolation
457  x1=-1.0+a*(double)(k_min);
458  y1=sigmas_dt[i_min-20][k_min];
459  x2=-1.0+a*(double)(k_min+1);
460  y2=sigmas_dt[i_min-20][k_min+1];
461  sigma_1=mz_linear_extrapolation(x1,y1,x2,y2,cos_theta);
462  //
463  x1=-1.0+a*(double)(k_min);
464  y1=sigmas_dt[i_min+1-20][k_min];
465  x2=-1.0+a*(double)(k_min+1);
466  y2=sigmas_dt[i_min+1-20][k_min+1];
467  sigma_2=mz_linear_extrapolation(x1,y1,x2,y2,cos_theta);
468  //
469  x1=pz[i_min];
470  y1=sigma_1;
471  x2=pz[i_min+1];
472  y2=sigma_2;
473  sigma=mz_linear_extrapolation(x1,y1,x2,y2,P);
474  }
475  }
476 
477  return sigma;
478 }
printf("RealTime=%f seconds, CpuTime=%f seconds\n", rtime, ctime)
double mz_pp_to_pipi_vandewi_sigma_legendre(int i, double cos_theta)
void mz_pp_to_pipi_get_p_lattice_site(double P, int &i_min, int &iflag)
exit(0)
Double_t sigma[nsteps]
Definition: dedx_bands.C:65
void mz_pp_to_pipi_get_costheta_lattice_site(double cos_theta, int &k_min, int &kflag)
double sigmas_dt[19][201]
Definition: pipisigmas.h:80
Int_t a
Definition: anaLmdDigi.C:126
double mz_linear_extrapolation(double x1, double y1, double x2, double y2, double x)
GeV c P
double pz[39]
Definition: pipisigmas.h:14
void mz_pp_to_pipi_vandewi_event ( double  P,
double  cos_theta_min,
double  cos_theta_max,
double *  piplus_p,
double *  piminus_p 
)

function mz_pp_to_pipi_vandewi_event

INPUT:

P: anti-proton momentum (lab frame) [GeV] cos_theta_min: cos(theta*) minimum; theta*=angle(pi-,pbar) CMS frame cos_theta_max: cos(theta*) maximum

OUTPUT:

piplus_p: 4-momentum pi- lab frame piminus_p: 4-momentum pi+ lab frame

Definition at line 480 of file mzfunctions_pp_to_pipi_vandewi.cxx.

References acos(), cos(), i, max(), mp, mpi, mz_pp_to_pipi_sigma(), mz_pp_to_pipi_vandewi_maximum_sigma(), mzboost(), mzrnd(), mzvmod2(), P, phi, PI, sin(), theta, x, and y.

Referenced by PndPiPiGenerator::ReadEvent().

481 {
499  double M=mp; //proton mass
500  double PI=acos(-1.0);
501 
502  double p_p[4]; //lab frame: 4-mom p (proton target)
503  double pbar_p[4]; //lab frame: 4-mom pbar (anti-proton beam)
504  double pbarp_p[4]; //lab frame: 4-mom pbarpsystem
505  double E; //lab frame: energy pbar
506  double S; //invariant mass square pbarpsystem
507  double sqrt_S; //invariant mass pbarpsystem
508 
509  int flag;
510  double x,y;
511  double max;
512  double prob;
513  double costheta, theta, phi;
514 
515  double piplus_pcm[4]; //CMS frame: 4-mom pi+
516  double piminus_pcm[4]; //CMS frame: 4-mom pi-
517 
518 
519 
520  //initial state kinematic
521 
522  //4-mom of p (lab frame)
523  p_p[0]=M;
524  p_p[1]=0.;
525  p_p[2]=0.;
526  p_p[3]=0.;
527 
528  //4-mom of pbar (lab frame)
529  E=pow((P*P+M*M),0.5);
530 
531  pbar_p[0]=E;
532  pbar_p[1]=0.;
533  pbar_p[2]=0.;
534  pbar_p[3]=P;
535 
536  //4-mom pbarpsystem (lab frame)
537  for(int i=0; i<4; i++){
538  pbarp_p[i]=p_p[i]+pbar_p[i];
539  }
540 
541  //invariant mass pbarpsystem (cms energy)
542  S=mzvmod2(4,pbarp_p);
543  sqrt_S=pow(S,0.5);
544 
545 
546  //get upper bound to cross section for pbar momentum P
548 
549 
550  flag=0;
551 
552  while(flag==0){
553  x=mzrnd(cos_theta_min,cos_theta_max); //random cos(theta*) in range [cos_theta_min,cos_theta_max]
554  y=mzrnd(0.0,max); //random in range [0.0,upper bound to the cross section]
555  prob=mz_pp_to_pipi_sigma(P,x); //cross section at generated cos(theta*)
556 
557  if(y<prob){ //accept event
558  flag=1;
559 
560  costheta=x;
561  if(costheta > 1.0) costheta=1.0; //just make sure about range...
562  if(costheta < -1.0) costheta=-1.0;
563  theta=acos(costheta); //theta* pi-
564  phi=mzrnd(0.0,2.0*PI); //phi pi-
565 
566  //build pi- 4-momentum in CMS frame
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);
571 
572  //build pi+ 4-momentum in CMS frame
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];
577 
578  //boost pi- and pi+ 4-momenta to lab frame
579  mzboost(1,pbarp_p,piplus_pcm,piplus_p);
580  mzboost(1,pbarp_p,piminus_pcm,piminus_p);
581  }
582 
583  }
584 
585 }
friend F32vec4 acos(const F32vec4 &a)
Definition: P4_F32vec4.h:113
double mz_pp_to_pipi_sigma(double P, double cos_theta)
friend F32vec4 cos(const F32vec4 &a)
Definition: P4_F32vec4.h:112
static const double mpi
Definition: mzparameters.h:15
Int_t i
Definition: run_full.C:25
double mzvmod2(int n, double *p)
Definition: mzfunctions.cxx:93
friend F32vec4 sin(const F32vec4 &a)
Definition: P4_F32vec4.h:111
friend F32vec4 max(const F32vec4 &a, const F32vec4 &b)
Definition: P4_F32vec4.h:26
static const double mp
Definition: mzparameters.h:11
double mzrnd(double a, double b)
const Double_t PI
void mzboost(int flag, double *p, double *q, double *q_prime)
GeV c P
Double_t x
Double_t y
double mz_pp_to_pipi_vandewi_maximum_sigma(double P)
void mz_pp_to_pipi_vandewi_init ( int  seed,
double  P,
double  cos_theta_min,
double  cos_theta_max 
)
Author
Manuel Zambrana zambr.nosp@m.ana@.nosp@m.kph.u.nosp@m.ni-m.nosp@m.ainz..nosp@m.de and Dmitry Khaneftd khane.nosp@m.ftd@.nosp@m.kph.u.nosp@m.ni-m.nosp@m.ainz..nosp@m.de

Mainz, May 2011

Definition at line 34 of file mzfunctions_pp_to_pipi_vandewi.cxx.

References exit(), i, mp, mz_pp_to_pipi_get_p_lattice_site(), mzvmod2(), P, printf(), pz, and rlxd_init().

Referenced by PndPiPiGenerator::Init().

37 {
38 
39  double p_a=pz[0]; //momentum range
40  double p_b=pz[19];
41  double p_c=pz[20];
42  double p_d=pz[38];
43 
44  double P_PANDA_THRESHOLD=1.5; //pbar momentum threshold in PANDA
45 
46  double M=mp; //proton mass
47 
48  double p_p[4]; //lab frame: 4-mom p (proton target)
49  double pbar_p[4]; //lab frame: 4-mom pbar (anti-proton beam)
50  double pbarp_p[4]; //lab frame: 4-mom pbarpsystem
51  double E; //lab frame: energy pbar
52  double S; //invariant mass square pbarpsystem
53  double sqrt_S; //invariant mass pbarpsystem
54 
55  int p_flag; //momentum extrapolation flag
56  int i_min; //lower site in p-lattice for input momentum P
57 
58  //checking parameter range...
59  printf("\n\n");
60  printf("###########################################################\n");
61 
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);
65  printf("\n\n");
66  exit(1);
67  }
68 
69 
70  if(P<P_PANDA_THRESHOLD){
71  printf("WARNING: P (anti-proton momentum) smaller than PANDA threshold %4.2f GeV \n", P_PANDA_THRESHOLD);
72  printf("\n\n");
73  }
74 
75 
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");
80  printf("\n\n");
81  exit(1);
82  }
83 
84 
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");
89  printf("\n\n");
90  }
91 
92 
93 
94  //initial state kinematic
95 
96  //4-mom of p (lab frame)
97  p_p[0]=M;
98  p_p[1]=0.;
99  p_p[2]=0.;
100  p_p[3]=0.;
101 
102  //4-mom of pbar (lab frame)
103  E=pow((P*P+M*M),0.5);
104 
105  pbar_p[0]=E;
106  pbar_p[1]=0.;
107  pbar_p[2]=0.;
108  pbar_p[3]=P;
109 
110  //4-mom pbarpsystem (lab frame)
111  for(int i=0; i<4; i++){
112  pbarp_p[i]=p_p[i]+pbar_p[i];
113  }
114 
115  //invariant mass pbarpsystem (cms energy)
116  S=mzvmod2(4,pbarp_p);
117  sqrt_S=pow(S,0.5);
118 
119  //print out kinematics
120  printf("Initial state kinematics\n");
121  printf("------------------------\n");
122  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);
125  printf("\n\n\n\n");
126 
127 
128 
129  //determining kinematic range and cross section parametrization...
130 
131  printf("Kinematic regime and cross section parametrization\n");
132  printf("--------------------------------------------------\n");
133  printf("\n");
134 
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");
138  printf("\n\n");
139  }
140 
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");
144  printf("\n\n");
145  }
146 
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");
150  printf("\n\n");
151  }
152 
153 
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");
157  printf("\n\n");
158  }
159 
160 
161  //determining if some cross section extrapolation is needed...
162 
163  mz_pp_to_pipi_get_p_lattice_site(P, i_min, p_flag);
164 
165 
166  if(p_flag==0){
167  printf("P at lattice site: no cross section extrapolation needed \n");
168  printf("\n\n\n\n");
169  }
170 
171  if(p_flag==1){
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]);
173  printf("\n\n\n\n");
174  }
175 
176  printf("###########################################################\n");
177  printf("\n\n");
178 
179  //initialize RANLUX
180  rlxd_init(1,seed);
181 }
printf("RealTime=%f seconds, CpuTime=%f seconds\n", rtime, ctime)
void mz_pp_to_pipi_get_p_lattice_site(double P, int &i_min, int &iflag)
Int_t i
Definition: run_full.C:25
exit(0)
double mzvmod2(int n, double *p)
Definition: mzfunctions.cxx:93
static const double mp
Definition: mzparameters.h:11
unsigned int seed
GeV c P
void rlxd_init(int level, int seed)
Definition: ranlxd.cxx:501
double pz[39]
Definition: pipisigmas.h:14
double mz_pp_to_pipi_vandewi_maximum_sigma ( double  P)

funtion mz_pp_to_pipi_vandewi_maximum_sigma

INPUT:

P -> pbar input momentum lab frame [GeV]

RETURNS:

cross section maximum for momentum P in full cos(theta*) range

Definition at line 257 of file mzfunctions_pp_to_pipi_vandewi.cxx.

References max(), mz_pp_to_pipi_get_p_lattice_site(), pz, and sigmas_dt.

Referenced by mz_pp_to_pipi_vandewi_event().

258 {
272  double max;
273  int i_min, p_flag;
274 
275  if( (P>=pz[0])&&(P<pz[1]) ) max=300.0; // legendre zone
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;
294  //
295  if( (P>pz[19])&&(P<pz[20]) ) max=50.0; // legendre/vandewi extrapolation zone
296  //
297  if( (P>=pz[20])&&(P<=pz[38]) ){ // vandewi zone
298  mz_pp_to_pipi_get_p_lattice_site(P, i_min, p_flag);
299  max=sigmas_dt[i_min-20][200]*1.10;
300  }
301 
302  return max;
303 }
void mz_pp_to_pipi_get_p_lattice_site(double P, int &i_min, int &iflag)
friend F32vec4 max(const F32vec4 &a, const F32vec4 &b)
Definition: P4_F32vec4.h:26
double sigmas_dt[19][201]
Definition: pipisigmas.h:80
GeV c P
double pz[39]
Definition: pipisigmas.h:14
double mz_pp_to_pipi_vandewi_sigma_legendre ( int  i,
double  cos_theta 
)

function mz_pp_to_pipi_vandewi_sigma_legendre

INPUT:

i -> momentum lattice site cos_theta -> cos(theta*)

RETURNS:

cross section (legendre polinomial series parametrization) at cos(theta*) for the pbar momentum corresponding to the i-th lattice site

Definition at line 305 of file mzfunctions_pp_to_pipi_vandewi.cxx.

References exit(), fitlegendre, i, mz_legendre_polynomial(), printf(), and sigma.

Referenced by mz_pp_to_pipi_sigma().

306 {
322  double sigma;
323  double sum=0.0;
324 
325  //checking arguments range...
326 
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");
331  printf("\n\n");
332  exit(1);
333  }
334 
335 
336  //calculate the cross section using the fit coeficients
337  for(int k=0; k<11; k++){
338  sum=sum+fitlegendre[i][k]*mz_legendre_polynomial(k,cos_theta);
339  }
340 
341  sigma=sum;
342 
343  return sigma;
344 }
printf("RealTime=%f seconds, CpuTime=%f seconds\n", rtime, ctime)
Int_t i
Definition: run_full.C:25
exit(0)
Double_t sigma[nsteps]
Definition: dedx_bands.C:65
double fitlegendre[20][11]
Definition: pipisigmas.h:56
double mz_legendre_polynomial(int n, double x)
void ranlxd ( double  r[],
int  n 
)

Definition at line 571 of file ranlxd.cxx.

572 {
573  int k;
574 
575  if (init==0)
576  rlxd_init(1,1);
577 
578  for (k=0;k<n;k++)
579  {
580  is=next[is];
581  if (is==is_old)
582  update();
583  r[k]=one_bit*((double)(x.num[is+4])+one_bit*(double)(x.num[is]));
584  }
585 }
double r
Definition: RiemannTest.C:14
static double one_bit
Definition: ranlxd.cxx:375
static void update(void)
Definition: ranlxd.cxx:453
int n
static int init
Definition: ranlxd.cxx:374
static union @18 x
static int is
Definition: ranlxd.cxx:374
static int is_old
Definition: ranlxd.cxx:374
void rlxd_init(int level, int seed)
Definition: ranlxd.cxx:501
static int next[96]
Definition: ranlxd.cxx:374
void ranlxs ( float  r[],
int  n 
)
Author
Manuel Zambrana zambr.nosp@m.ana@.nosp@m.kph.u.nosp@m.ni-m.nosp@m.ainz..nosp@m.de and Dmitry Khaneftd khane.nosp@m.ftd@.nosp@m.kph.u.nosp@m.ni-m.nosp@m.ainz..nosp@m.de

Mainz, May 2011

Definition at line 566 of file ranlxs.cxx.

567 {
568  int k;
569 
570  if (init==0)
571  rlxs_init(0,1);
572 
573  for (k=0;k<n;k++)
574  {
575  is=next[is];
576  if (is==is_old)
577  update();
578  r[k]=one_bit*(float)(x.num[is]);
579  }
580 }
double r
Definition: RiemannTest.C:14
static float one_bit
Definition: ranlxs.cxx:373
int n
static int is_old
Definition: ranlxs.cxx:372
static int is
Definition: ranlxs.cxx:372
static union @19 x
void rlxs_init(int level, int seed)
Definition: ranlxs.cxx:495
static int init
Definition: ranlxs.cxx:372
static void update(void)
Definition: ranlxs.cxx:451
static int next[96]
Definition: ranlxs.cxx:372
void rlxd_init ( int  level,
int  seed 
)

Definition at line 501 of file ranlxd.cxx.

Referenced by mz_pp_to_pipi_vandewi_init().

502 {
503  int i,k,l;
504  int ibit,jbit,xbit[31];
505  int ix,iy;
506 
507  if ((INT_MAX<2147483647)||(FLT_RADIX!=2)||(FLT_MANT_DIG<24)||
508  (DBL_MANT_DIG<48))
509  error(0);
510 
512 
513  if (level==1)
514  pr=202;
515  else if (level==2)
516  pr=397;
517  else
518  error(1);
519 
520  i=seed;
521 
522  for (k=0;k<31;k++)
523  {
524  xbit[k]=i%2;
525  i/=2;
526  }
527 
528  if ((seed<=0)||(i!=0))
529  error(2);
530 
531  ibit=0;
532  jbit=18;
533 
534  for (i=0;i<4;i++)
535  {
536  for (k=0;k<24;k++)
537  {
538  ix=0;
539 
540  for (l=0;l<24;l++)
541  {
542  iy=xbit[ibit];
543  ix=2*ix+iy;
544 
545  xbit[ibit]=(xbit[ibit]+xbit[jbit])%2;
546  ibit=(ibit+1)%31;
547  jbit=(jbit+1)%31;
548  }
549 
550  if ((k%4)!=i)
551  ix=16777215-ix;
552 
553  x.num[4*k+i]=ix;
554  }
555  }
556 
557  carry.c1=0;
558  carry.c2=0;
559  carry.c3=0;
560  carry.c4=0;
561 
562  ir=0;
563  jr=7;
564  is=91;
565  is_old=0;
566  prm=pr%12;
567  init=1;
568 }
static int jr
Definition: ranlxd.cxx:374
static int prm
Definition: ranlxd.cxx:374
Int_t i
Definition: run_full.C:25
int c2
Definition: ranlxd.cxx:366
int c4
Definition: ranlxd.cxx:366
static void error(int no)
Definition: ranlxd.cxx:419
static int init
Definition: ranlxd.cxx:374
int c3
Definition: ranlxd.cxx:366
unsigned int seed
static union @18 x
int c1
Definition: ranlxd.cxx:366
static void define_constants(void)
Definition: ranlxd.cxx:486
static int is
Definition: ranlxd.cxx:374
static int is_old
Definition: ranlxd.cxx:374
static vec_t carry
Definition: ranlxd.cxx:376
static int pr
Definition: ranlxd.cxx:374
static int ir
Definition: ranlxd.cxx:374
void rlxs_init ( int  level,
int  seed 
)

Definition at line 495 of file ranlxs.cxx.

496 {
497  int i,k,l;
498  int ibit,jbit,xbit[31];
499  int ix,iy;
500 
501  if ((INT_MAX<2147483647)||(FLT_RADIX!=2)||(FLT_MANT_DIG<24))
502  error(0);
503 
505 
506  if (level==0)
507  pr=109;
508  else if (level==1)
509  pr=202;
510  else if (level==2)
511  pr=397;
512  else
513  error(1);
514 
515  i=seed;
516 
517  for (k=0;k<31;k++)
518  {
519  xbit[k]=i%2;
520  i/=2;
521  }
522 
523  if ((seed<=0)||(i!=0))
524  error(2);
525 
526  ibit=0;
527  jbit=18;
528 
529  for (i=0;i<4;i++)
530  {
531  for (k=0;k<24;k++)
532  {
533  ix=0;
534 
535  for (l=0;l<24;l++)
536  {
537  iy=xbit[ibit];
538  ix=2*ix+iy;
539 
540  xbit[ibit]=(xbit[ibit]+xbit[jbit])%2;
541  ibit=(ibit+1)%31;
542  jbit=(jbit+1)%31;
543  }
544 
545  if ((k%4)==i)
546  ix=16777215-ix;
547 
548  x.num[4*k+i]=ix;
549  }
550  }
551 
552  carry.c1=0;
553  carry.c2=0;
554  carry.c3=0;
555  carry.c4=0;
556 
557  ir=0;
558  jr=7;
559  is=95;
560  is_old=0;
561  prm=pr%12;
562  init=1;
563 }
Int_t i
Definition: run_full.C:25
static int prm
Definition: ranlxs.cxx:372
static int ir
Definition: ranlxs.cxx:372
int c2
Definition: ranlxd.cxx:366
static int is_old
Definition: ranlxs.cxx:372
int c4
Definition: ranlxd.cxx:366
static int is
Definition: ranlxs.cxx:372
static void define_constants(void)
Definition: ranlxs.cxx:484
int c3
Definition: ranlxd.cxx:366
static void error(int no)
Definition: ranlxs.cxx:417
static int jr
Definition: ranlxs.cxx:372
unsigned int seed
static vec_t carry
Definition: ranlxs.cxx:374
int c1
Definition: ranlxd.cxx:366
static union @19 x
static int pr
Definition: ranlxs.cxx:372
static int init
Definition: ranlxs.cxx:372