1 #ifndef __JFIT__JLINE1ZESTIMATOR__
2 #define __JFIT__JLINE1ZESTIMATOR__
18 namespace JPP {
using namespace JFIT; }
110 (*this)(__begin, __end);
130 using namespace JTOOLS;
134 if (
N >= NUMBER_OF_PARAMETERS) {
143 for (
T i = __begin; i != __end; ++i) {
150 const double W = 1.0/
N;
167 double xi = j->getX() - getX();
168 double yi = j->getY() - getY();
173 if ((
done = (++j == __end))) {
177 double xj = j->getX() - getX();
178 double yj = j->getY() - getY();
185 const double y = ((xj + xi) * dx +
217 __x += V.a00 * y0 + V.a01 * y1 + V.a02 * y2;
218 __y += V.a10 * y0 + V.a11 * y1 + V.a12 * y2;
219 __t = V.a20 * y0 + V.a21 * y1 + V.a22 * y2;
225 throw JValueOutOfRange(
"JEstimator<JLine1Z>::JEstimator(): Not enough data points.");
252 using namespace JTOOLS;
256 if (
N != (
int) A.
size()) {
260 if (
N >= NUMBER_OF_PARAMETERS) {
270 for (
size_t row = 0; row != A.
size(); ++row, ++i) {
272 const double dx = i->getX() - getX();
273 const double dy = i->getY() - getY();
275 const double rt = sqrt(dx*dx + dy*dy);
288 for (
size_t col = 0; col != A.
size(); ++col, ++
j) {
290 const double dx = j->getX() - getX();
291 const double dy = j->getY() - getY();
292 const double dz = j->getZ() - getZ();
294 const double rt = sqrt(dx*dx + dy*dy);
307 const double vs =
A(row,col);
313 V.a00 += xr * vs * xc;
314 V.a01 += xr * vs * yc;
315 V.a02 += xr * vs * tc;
316 V.a11 += yr * vs * yc;
317 V.a12 += yr * vs * tc;
318 V.a22 += tr * vs * tc;
328 __x += V.a00 * x1 + V.a01 * y1 + V.a02 * t1;
329 __y += V.a10 * x1 + V.a11 * y1 + V.a12 * t1;
330 __t = V.a20 * x1 + V.a21 * y1 + V.a22 * t1;
338 static const int NUMBER_OF_PARAMETERS = 3;
Linear fit of straight line parallel to z-axis to set of hits (objects with position and time)...
std::vector< T >::difference_type distance(typename std::vector< T >::const_iterator first, typename PhysicsEvent::const_iterator< T > second)
Specialisation of STL distance.
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
JEstimator()
Default constructor.
Template definition of linear fit.
JEstimator(T __begin, T __end)
Constructor.
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.
do set_variable OUTPUT_DIRECTORY $WORKDIR T
const JEstimator< JLine1Z > & operator()(T __begin, T __end)
Fit.
JMATH::JMatrix3S V
co-variance matrix of fit parameters
size_t size() const
Get dimension of matrix.
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.
then usage $script[input file[working directory[option]]] nWhere option can be N
source $JPP_DIR setenv csh $JPP_DIR eval JShellParser o a A