77 const double& m2,
const double& b2,
78 const double& m3,
const double& b3,
92 if (vX0Y0Z0.size() != 3)
96 double x0 = vX0Y0Z0.at(0);
97 double y0 = vX0Y0Z0.at(1);
98 double z0 = vX0Y0Z0.at(2);
108 std::cout <<
"\nThe parametric form of the 3D line is:" << std::endl;
109 std::cout <<
"x = " << x0 <<
" + " << a <<
".t" << std::endl;
110 std::cout <<
"y = " << y0 <<
" + " << b <<
".t" << std::endl;
111 std::cout <<
"z = " << z0 <<
" + " << c <<
".t" << std::endl;
114 const std::vector<double> vDir = {a, b, c};
148 double x = coords[0];
149 double y = coords[1];
150 double z = coords[2];
153 double px = params[0];
154 double py = params[1];
155 double pz = params[2];
156 double vx = params[3];
157 double vy = params[4];
158 double vz = params[5];
171 double u = ((x - px) * vx + (y - py) * vy + (z - pz) * vz) / (vx * vx + vy * vy + vz * vz);
179 double dx = px + u * vx - x;
180 double dy = py + u * vy - y;
181 double dz = pz + u * vz - z;
190 return std::sqrt(dx*dx + dy*dy + dz*dz);
std::vector< double > ROOTEquationSolver(const double &m1, const double &b1, const double &m2, const double &b2, const double &m3, const double &b3, bool debugMode)
Definition: LinearAlgebra.h:19
Line3DParametricForm Getline3DParametricForm(const double &m1, const double &b1, const double &m2, const double &b2, const double &m3, const double &b3, const int &trkID, const int &g3PID, bool debugMode)
Definition: Line.h:76
double distanceFromLine3D(double *coords, double *params)
Definition: Line.h:122
double fit_chi2ndf
Definition: Line.h:21
double c
Definition: Line.h:18
double err_m
Definition: Line.h:19
double m
Definition: Line.h:17
FitLine2D(double m, double c, double err_m, double err_c, double fit_chi2ndf, int trkID, int g3PID)
Definition: Line.h:25
int g3PID
Definition: Line.h:23
int trkID
Definition: Line.h:22
double err_c
Definition: Line.h:20
int ndf
Definition: Line.h:41
FitLine3DMinuit()
Definition: Line.h:43
bool fitSuccess
Definition: Line.h:36
int trkID
Definition: Line.h:33
int g3PID
Definition: Line.h:34
double chi2
Definition: Line.h:40
std::vector< double > fitErrors
Definition: Line.h:38
std::vector< double > fitParameters
Definition: Line.h:37
FitLine3D()
Definition: Line.h:54
int g3PID
Definition: Line.h:52
int trkID
Definition: Line.h:51
TFitResultPtr fit
Definition: Line.h:50