6 static void locate(
const double *xx,
int n,
double x,
int *j){
12 ascnd=(xx[n-1]>=xx[0]);
15 if ( (x>=xx[jm])==ascnd)
21 else if (x==xx[n-1]) *j=n-2;
27 static void polint(
const double *xa,
const double *ya,
int n,
double x,
double *
y,
30 double den,dif,dift,ho,hp,w;
32 double *
c=(
double *)calloc(n,
sizeof(
double));
33 double *d=(
double *)calloc(n,
sizeof(
double));
37 if ((dift=fabs(x-xa[i]))<dif){
51 if ((den=ho-hp)==0.0){
62 *y+=(*dy=(2*ns<(n-m) ?c[ns+1]:d[ns--]));
75 double r=
sqrt(x*x+y*y);
92 imin=((ind+3)>LORENTZ_X_POINTS)?(LORENTZ_X_POINTS-4):(ind-1);
103 double alpha,
double dx)
const
105 double tanz=0.,tanr=0.;
109 double phi=atan2(y,x);
110 return (-tanz*dx*
sin(alpha)*cos(phi)+tanr*dx*cos(alpha));
static void polint(const double *xa, const double *ya, int n, double x, double *y, double *dy)
double lorentz_x[LORENTZ_X_POINTS]
double lorentz_nx[LORENTZ_X_POINTS][LORENTZ_Z_POINTS]
static void locate(const double *xx, int n, double x, int *j)
jerror_t GetLorentzCorrectionParameters(double x, double y, double z, double &tanz, double &tanr) const
double lorentz_z[LORENTZ_Z_POINTS]
double lorentz_nz[LORENTZ_X_POINTS][LORENTZ_Z_POINTS]
double GetLorentzCorrection(double x, double y, double z, double alpha, double dx) const