Go to the documentation of this file. 1 #ifndef __JFIT__JLINE1ZESTIMATOR__
2 #define __JFIT__JLINE1ZESTIMATOR__
18 namespace JPP {
using namespace JFIT; }
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.");
222 const int N =
distance(__begin, __end);
224 if (N != (
int) A.
size()) {
228 if (N >= NUMBER_OF_PARAMETERS) {
238 for (
size_t row = 0; row != A.
size(); ++row, ++i) {
240 const double dx = i->getX() - getX();
241 const double dy = i->getY() - getY();
243 const double rt = sqrt(dx*dx + dy*dy);
256 for (
size_t col = 0; col != A.
size(); ++col, ++
j) {
258 const double dx =
j->getX() - getX();
259 const double dy =
j->getY() - getY();
260 const double dz =
j->getZ() - getZ();
262 const double rt = sqrt(dx*dx + dy*dy);
275 const double vs = A(row,col);
281 V.a00 += xr * vs * xc;
282 V.a01 += xr * vs * yc;
283 V.a02 += xr * vs * tc;
284 V.a11 += yr * vs * yc;
285 V.a12 += yr * vs * tc;
286 V.a22 += tr * vs * tc;
296 __x += V.a00 * x1 + V.a01 * y1 + V.a02 * t1;
297 __y += V.a10 * x1 + V.a11 * y1 + V.a12 * t1;
298 __t = V.a20 * x1 + V.a21 * y1 + V.a22 * t1;
306 static const int NUMBER_OF_PARAMETERS = 3;
Auxiliary classes and methods for linear and iterative data regression.
void update(T __begin, T __end, const JMatrixNZ &A)
Update track parameters using updated co-variance matrix (e.g.
JMATH::JMatrix3S V
co-variance matrix of fit parameters
JEstimator(T __begin, T __end)
Fit constructor.
size_t size() const
Get dimension of matrix.
std::vector< T >::difference_type distance(typename std::vector< T >::const_iterator first, typename PhysicsEvent::const_iterator< T > second)
Specialisation of STL distance.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Template definition of linear fit.
Exception for accessing a value in a collection that is outside of its range.
Data structure for fit of straight line paralel to z-axis.
Determination of the co-variance matrix of hits for a track along z-axis (JFIT::JLine1Z).