Go to the source code of this file.
|
double | mzdelta (int i, int k) |
|
double | mzvscalar (int n, double *p, double *q) |
|
double | mzvmod2 (int n, double *p) |
|
void | mzboost (int flag, double *p, double *q, double *q_prime) |
|
double | mzenergy (double m, double p_x, double p_y, double p_z) |
|
double | mzpolar (double *p) |
|
double | mzazimuthal (double *p) |
|
double | mzcospolar (double *p) |
|
double | mzangle (double *p, double *q) |
|
double | mzrnd (double a, double b) |
|
double | mzcomplexmod (double Re_z, double Im_z) |
|
double | mz_E_to_s (double E) |
|
double | mz_legendre_polynomial (int n, double x) |
|
double | mz_linear_extrapolation (double x1, double y1, double x2, double y2, double x) |
|
double mz_E_to_s |
( |
double |
E | ) |
|
function mz_E_to_s
arguments:
E: pbar energy in lab (GeV)
returns:
cm-energy square s of pbar p system
Definition at line 410 of file mzfunctions.cxx.
References exit(), i, mp, mzvmod2(), P, printf(), and s.
437 printf(
"ERROR: function mz_E_to_s called with argument E out of range \n");
438 printf(
" => E should be larger than the proton mass M = %5.3f GeV\n",M);
452 P=pow((E*E-M*M),0.5);
461 for(
int i=0;
i<4;
i++){
462 pbarp_p[
i]=p_p[
i]+pbar_p[
i];
printf("RealTime=%f seconds, CpuTime=%f seconds\n", rtime, ctime)
double mzvmod2(int n, double *p)
double mz_legendre_polynomial |
( |
int |
n, |
|
|
double |
x |
|
) |
| |
function mz_legendre_polynomial
INPUT:
n -> polynomial degree, [0,10] x -> independent variable, [-1,1]
returns:
P_{n}(x)
Definition at line 470 of file mzfunctions.cxx.
References exit(), printf(), x, and y.
Referenced by mz_pp_to_pipi_vandewi_sigma_legendre().
488 if( !( (
n>=0)&&(
n<=10) ) ){
489 printf(
"ERROR: function mz_legendre_polynomial called with n out of range \n");
490 printf(
" => n should be contained in the interval [0,10]\n");
495 if( !( (
x>=-1.0)&&(
x<=1.0) ) ){
496 printf(
"ERROR: function mz_legendre_polynomial called with x out of range \n");
497 printf(
" => x should be contained in the interval [-1.0,1.0]\n");
512 y=(1.0/2.0)*(3.0*pow(
x,2.0) -1.0);
516 y=(1.0/2.0)*(5.0*pow(
x,3.0) -3.0*
x);
520 y=(1.0/8.0)*(35.0*pow(
x,4.0) -30.0*pow(
x,2.0) +3.0);
524 y=(1.0/8.0)*(63.0*pow(
x,5.0) -70.0*pow(
x,3.0) +15.0*
x);
528 y=(1.0/16.0)*(231.0*pow(
x,6.0) -315.0*pow(
x,4.0)
529 +105.0*pow(
x,2.0) -5.0);
533 y=(1.0/16.0)*(429.0*pow(
x,7.0) -693.0*pow(
x,5.0)
534 +315.0*pow(
x,3.0) -35.0*
x);
538 y=(1.0/128.0)*(6435.0*pow(
x,8.0) -12012.0*pow(
x,6.0)
539 +6930.0*pow(
x,4.0) -1260.0*pow(
x,2.0)
544 y=(1.0/128.0)*(12155.0*pow(
x,9.0) -25740.0*pow(
x,7.0)
545 +18018.0*pow(
x,5.0) -4620.0*pow(
x,3.0)
550 y=(1.0/256.0)*(46189.0*pow(
x,10.0) -109395.0*pow(
x,8.0)
551 +90090.0*pow(
x,6.0) -30030*pow(
x,4.0)
552 +3465.0*pow(
x,2.0) -63.0);
printf("RealTime=%f seconds, CpuTime=%f seconds\n", rtime, ctime)
double mz_linear_extrapolation |
( |
double |
x1, |
|
|
double |
y1, |
|
|
double |
x2, |
|
|
double |
y2, |
|
|
double |
x |
|
) |
| |
funtion mz_linear_extrapolation
INPUT:
(x1,y1) first point in (x,y)-plane (x2,y2) second point in (x,y)-plane
x independent variable
RETURNS:
y=f(x), with f the linear function atisfying y1=f(x1) and y2=f(x2)
Definition at line 558 of file mzfunctions.cxx.
References a, b, exit(), printf(), and y.
Referenced by mz_pp_to_pipi_sigma().
584 printf(
"ERROR: function mz_linear_extrapolation called with x_2=x_1 \n");
585 printf(
" => argument x_2 should be different from argument x_1 \n");
printf("RealTime=%f seconds, CpuTime=%f seconds\n", rtime, ctime)
double mzangle |
( |
double * |
p, |
|
|
double * |
q |
|
) |
| |
function mzangle
input: 4-mom p, 4-mom q output: angle between 3-dim components of p, q in range [0,180]
Definition at line 310 of file mzfunctions.cxx.
References acos(), alpha, mzvmod2(), mzvscalar(), and PI.
324 double scalar, pmod, qmod, cosalpha;
332 cerr <<
"WARNING: mzangle called with p[1]=p[2]=p[3]=0.0 " << endl;
337 cerr <<
"WARNING: mzangle called with q[1]=q[2]=q[3]=0.0 " << endl;
342 cosalpha=scalar/(pmod*qmod);
344 if(cosalpha > 1.0) cosalpha=1.0;
345 if(cosalpha < -1.0) cosalpha=-1.0;
347 alpha=
acos(cosalpha) * 180.0 /
PI;
friend F32vec4 acos(const F32vec4 &a)
double mzvmod2(int n, double *p)
double mzvscalar(int n, double *p, double *q)
double mzazimuthal |
( |
double * |
p | ) |
|
function mzazimuthal
input: 4-mom p output: azimuthal angle phi in range [0,180]
Definition at line 258 of file mzfunctions.cxx.
References acos(), atan2(), phi, and PI.
271 if ( (
p[1]==0.) && (
p[2]==0.0) ) {
272 cerr <<
"WARNING: mzazimuthal called with p[1]=p[2]=0.0 " << endl;
280 if (phi<0.0) phi = phi + 360.0;
friend F32vec4 acos(const F32vec4 &a)
friend F32vec4 atan2(const F32vec4 &y, const F32vec4 &x)
void mzboost |
( |
int |
flag, |
|
|
double * |
p, |
|
|
double * |
q, |
|
|
double * |
q_prime |
|
) |
| |
function mzboost
input: flag=0 lab->CM, flag=1 CM->lab p 4-mom of CM particle (M!=0) in lab frame q 4-mom of test particle in lab frame (flag=0) / CM frame (flag=1)
output: q_prime 4-mom of test particle in the CM frame (flag=0) / lab frame (flag=1)
Definition at line 123 of file mzfunctions.cxx.
References i, L, m, mzdelta(), and mzvmod2().
Referenced by mz_pp_to_leplep_vandewi_event(), and mz_pp_to_pipi_vandewi_event().
154 for (i=1; i<=3; i++) {
162 for (i=1; i<=3; i++) {
163 L[0][
i] = p_uni[
i] * pow((gamma*gamma - 1.0),0.5);
168 for (i=1; i<=3; i++) {
169 for (k=1; k<=3; k++) {
170 L[
i][k] =
mzdelta(i,k) + (gamma -1.0)*p_uni[
i]*p_uni[k];
181 for (i=1; i<=3; i++) {
182 LI[0][
i] = -1.0*L[
i][0];
183 LI[
i][0] = -1.0*L[0][
i];
186 for (i=1; i<=3; i++) {
187 for (k=1; k<=3; k++) {
196 for (i=0; i<=3; i++) {
198 for (k=0; k<=3; k++) {
199 if (flag==0) mztemp = mztemp + LI[
i][k]*q[k];
200 if (flag==1) mztemp = mztemp + L[
i][k]*q[k];
double mzdelta(int i, int k)
double mzvmod2(int n, double *p)
double mzcomplexmod |
( |
double |
Re_z, |
|
|
double |
Im_z |
|
) |
| |
function mzcomplexmod
arguments:
Re_z = real part of complex number z Im_z = imaginary part of complex number z
returns:
modulus of complex number z
Definition at line 389 of file mzfunctions.cxx.
References y.
405 y=pow(Re_z*Re_z + Im_z*Im_z,0.5);
double mzcospolar |
( |
double * |
p | ) |
|
function mzcospolar
input: 4-mom p output: cos of polar angle theta
Definition at line 285 of file mzfunctions.cxx.
References mzvmod2().
301 cerr <<
"WARNING: mzcospolar called with p[1]=p[2]=p[3]=0.0 " << endl;
305 costheta =
p[3]/pmod;
double mzvmod2(int n, double *p)
double mzdelta |
( |
int |
i, |
|
|
int |
k |
|
) |
| |
double mzenergy |
( |
double |
m, |
|
|
double |
p_x, |
|
|
double |
p_y, |
|
|
double |
p_z |
|
) |
| |
input: mass m, 3-mom components px, py, pz of a particle
output: energy of the particle
Definition at line 207 of file mzfunctions.cxx.
218 E=pow(
m*
m +p_x*p_x +p_y*p_y +p_z*p_z,0.5);
double mzpolar |
( |
double * |
p | ) |
|
function mzpolar
input: 4-mom p output: polar angle theta in range [0,180]
Definition at line 223 of file mzfunctions.cxx.
References acos(), mzvmod2(), PI, and theta.
242 cerr <<
"WARNING: mzpolar called with p[1]=p[2]=p[3]=0.0 " << endl;
246 costheta =
p[3]/pmod;
248 if(costheta > 1.0) costheta=1.0;
249 if(costheta < -1.0) costheta=-1.0;
251 theta =
acos(costheta) * 180.0 /
PI ;
friend F32vec4 acos(const F32vec4 &a)
double mzvmod2(int n, double *p)
double mzrnd |
( |
double |
a, |
|
|
double |
b |
|
) |
| |
function mzrnd
arguments:
a = inf[a,b] b = sup[a,b]
returns:
random number in interval [a,b]
Definition at line 353 of file mzfunctions.cxx.
References a, exit(), printf(), ranlxd(), x, and y.
Referenced by mz_pp_to_leplep_vandewi_event(), and mz_pp_to_pipi_vandewi_event().
376 printf(
"ERROR: function mzrnd called with arguments b<=a \n");
377 printf(
" => argument b should be larger than argument a \n");
void ranlxd(double r[], int n)
printf("RealTime=%f seconds, CpuTime=%f seconds\n", rtime, ctime)
double mzvmod2 |
( |
int |
n, |
|
|
double * |
p |
|
) |
| |
function mzvmod2
input: int n, 4-vector p
output:
n=2 -> returns p[1]*p[1] + p[2]*p[2] n=3 -> returns p[1]*p[1] + p[2]*p[2] + p[3]*p[3] n=4 -> returns p[0]*p[0] -p[1]*p[1] -p[2]*p[2] -p[3]*p[3]
Definition at line 93 of file mzfunctions.cxx.
References exit(), m2(), mzvscalar(), and printf().
Referenced by mz_E_to_s(), mz_pp_to_leplep_vandewi_event(), mz_pp_to_pipi_vandewi_event(), mz_pp_to_pipi_vandewi_init(), mzangle(), mzboost(), mzcospolar(), and mzpolar().
110 if( !(
n==2||
n==3||
n==4) ){
111 printf(
"ERROR: function mzvmod2 called with flag n out of range \n");
112 printf(
" => n should take the value 2,3 or 4 \n");
printf("RealTime=%f seconds, CpuTime=%f seconds\n", rtime, ctime)
TString m2(TString pts, TString exts="e px py pz")
double mzvscalar(int n, double *p, double *q)
double mzvscalar |
( |
int |
n, |
|
|
double * |
p, |
|
|
double * |
q |
|
) |
| |
function mzvscalar
input: int n, 4-vector p, 4-vector q
output:
n=2 -> returns p[1]*q[1] + p[2]*q[2] n=3 -> returns p[1]*q[1] + p[2]*q[2] + p[3]*q[3] n=4 -> returns p[0]*q[0] -p[1]*q[1] -p[2]*q[2] -p[3]*q[3]
Definition at line 53 of file mzfunctions.cxx.
References exit(), printf(), and s.
Referenced by mzangle(), and mzvmod2().
70 if( !(
n==2||
n==3||
n==4) ){
71 printf(
"ERROR: function mzvscalar called with flag n out of range \n");
72 printf(
" => n should take the value 2,3 or 4 \n");
79 s =
p[1]*q[1] +
p[2]*q[2];
83 s =
p[1]*q[1] +
p[2]*q[2] +
p[3]*q[3];
87 s =
p[0]*q[0] -1.0*
p[1]*q[1] -1.0*
p[2]*q[2] -1.0*
p[3]*q[3];
printf("RealTime=%f seconds, CpuTime=%f seconds\n", rtime, ctime)