1 #ifndef __JFIT__JLINE1ZESTIMATOR__
2 #define __JFIT__JLINE1ZESTIMATOR__
18 namespace JPP {
using namespace JFIT; }
109 using namespace JTOOLS;
111 const int N = distance(__begin, __end);
113 if (N >= NUMBER_OF_PARAMETERS) {
117 for (T i = __begin; i != __end; ++i) {
137 double xi = j->getX() - getX();
138 double yi = j->getY() - getY();
141 for (
bool done =
false; !done; ) {
143 if ((done = (++j == __end))) {
147 double xj = j->getX() - getX();
148 double yj = j->getY() - getY();
155 const double y = ((xj + xi) * dx +
187 __x += V.a00 * y0 + V.a01 * y1 + V.a02 * y2;
188 __y += V.a10 * y0 + V.a11 * y1 + V.a12 * y2;
189 __t = V.a20 * y0 + V.a21 * y1 + V.a22 * y2;
195 throw JValueOutOfRange(
"JEstimator<JLine1Z>::JEstimator(): Not enough data points.");
220 using namespace JTOOLS;
222 const int N = distance(__begin, __end);
224 if (N >= NUMBER_OF_PARAMETERS) {
236 const double dx = i->getX() - getX();
237 const double dy = i->getY() - getY();
239 const double rt = sqrt(dx*dx + dy*dy);
254 const double dx = j->getX() - getX();
255 const double dy = j->getY() - getY();
256 const double dz = j->getZ() - getZ();
258 const double rt = sqrt(dx*dx + dy*dy);
271 x1 += xr * (*col) * ts;
272 y1 += yr * (*col) * ts;
273 t1 += tr * (*col) * ts;
275 V.a00 += xr * (*col) * xc;
276 V.a01 += xr * (*col) * yc;
277 V.a02 += xr * (*col) * tc;
278 V.a11 += yr * (*col) * yc;
279 V.a12 += yr * (*col) * tc;
280 V.a22 += tr * (*col) * tc;
290 __x += V.a00 * x1 + V.a01 * y1 + V.a02 * t1;
291 __y += V.a10 * x1 + V.a11 * y1 + V.a12 * t1;
292 __t = V.a20 * x1 + V.a21 * y1 + V.a22 * t1;
295 throw JValueOutOfRange(
"JEstimator<JLine1Z>::update(): Not enough data points.");
300 static const int NUMBER_OF_PARAMETERS = 3;
Template definition of linear fit.
JEstimator(T __begin, T __end)
Fit constructor.
matrix_type::const_iterator const_row_type
Determination of the co-variance matrix of hits for a track along z-axis (JFIT::JLine1Z).
void update(T __begin, T __end, const JMatrixNZ &A)
Update track parameters using updated co-variance matrix (e.g.
std::vector< double >::const_iterator const_col_type
JMATH::JMatrix3S V
co-variance matrix of fit parameters
Data structure for fit of straight line paralel to z-axis.
Exception for accessing a value in a collection that is outside of its range.