#ifndef _L1HitPoint_h_ #define _L1HitPoint_h_ /// contain strips positions and coordinates of hit #if 1 struct L1HitPointV{ L1HitPointV(){}; // L1HitPoint(fscal x_, fscal y_, fscal z_, fscal v_, fscal u_, unsigned short int n_ = 0): // x(x_), y(y_), z(z_), u(u_), v(v_), n(n_){}; // L1HitPointV(fvec x_, fvec y_, fvec z_, fvec v_, fvec u_, unsigned short int n_ = 0):{}; fvec Xs(int n) const { return X(n)/Z(n); } fvec Ys(int n) const { return Y(n)/Z(n); } // value to sort hits by fvec X( int n) const { return x[n]; } fvec Y( int n) const { return y[n]; } fvec Z( int n) const { return z[n]; } fvec U( int n) const { return u[n]; } fvec V( int n) const { return v[n]; } const float* X() const { return reinterpret_cast(&x[0]); } const float* Y() const { return reinterpret_cast(&y[0]); } const float* Z() const { return reinterpret_cast(&z[0]); } const float* U() const { return reinterpret_cast(&u[0]); } const float* V() const { return reinterpret_cast(&v[0]); } // unsigned short int N() const { return n; } // int GetSortIndex() const { return SortIndex; } void SetX(fvec X1, int n) { x[n] = X1; } void SetY(fvec Y1, int n) { y[n] = Y1; } void SetZ(fvec Z1, int n) { z[n] = Z1; } void SetU(fvec U1, int n) { u[n] = U1; } void SetV(fvec V1, int n) { v[n] = V1; } void SetL1HitPointV(const fvec &x_, const fvec &y_, const fvec &z_, const fvec &v_, const fvec &u_, int &n) { x[n]=x_; y[n]=y_; z[n]=z_; v[n]=v_; u[n]=u_; }; int size() const { return x.size(); } void resize(const int n) { x.resize(n, 0.f); y.resize(n, 0.f); z.resize(n, 0.f); u.resize(n, 0.f); v.resize(n, 0.f); } // void SetN(unsigned short int N1) { n = N1; } // void SetSortIndex(int SortIndex1) { SortIndex = SortIndex1; } //private: nsL1::vector ::TSimd x, y; nsL1::vector ::TSimd z; // TODO: may be we should use iz nsL1::vector ::TSimd u, v; // x\u, v - front and back strips; x, y, z - coordinates of hits // unsigned short int n; // number of event // int SortIndex; }; struct L1HitPoint{ L1HitPoint(){}; // L1HitPoint(fscal x_, fscal y_, fscal z_, fscal v_, fscal u_, unsigned short int n_ = 0): // x(x_), y(y_), z(z_), u(u_), v(v_), n(n_){}; L1HitPoint(fscal x_, fscal y_, fscal z_, fscal v_, fscal u_, unsigned short int n_ = 0): x(x_), y(y_), z(z_), u(u_), v(v_){}; fscal Xs() const { return X()/Z(); } fscal Ys() const { return Y()/Z(); } // value to sort hits by fscal X() const { return x; } fscal Y() const { return y; } fscal Z() const { return z; } fscal U() const { return u; } fscal V() const { return v; } // unsigned short int N() const { return n; } // int GetSortIndex() const { return SortIndex; } void SetX(fscal X1) { x = X1; } void SetY(fscal Y1) { y = Y1; } void SetZ(fscal Z1) { z = Z1; } void SetU(fscal U1) { u = U1; } void SetV(fscal V1) { v = V1; } // void SetN(unsigned short int N1) { n = N1; } // void SetSortIndex(int SortIndex1) { SortIndex = SortIndex1; } private: float x, y; float z; // TODO: may be we should use iz float u, v; // x\u, v - front and back strips; x, y, z - coordinates of hits // unsigned short int n; // number of event // int SortIndex; }; #else static const float R = 60; static const float shortPackingConstant = 2 * R / 65535.f; static const float MZ = 110; static const float shortPackingConstantZ = MZ / 65535.f; /// contain strips positions and coordinates of hit struct L1HitPoint{ L1HitPoint(){}; L1HitPoint(fscal x_, fscal y_, fscal z_, fscal v_, fscal u_, unsigned short int n_ = 0): x(f2s(x_)), y(f2s(y_)), z(f2sZ(z_)), u(f2s(u_)), v(f2s(v_)), n(n_){}; fscal Xs() const { return X()/Z(); } fscal Ys() const { return Y()/Z(); } // value to sort hits by fscal X() const { return s2f(x); } fscal Y() const { return s2f(y); } fscal Z() const { return s2fZ(z); } fscal U() const { return s2f(u); } fscal V() const { return s2f(v); } unsigned short int N() const { return n; } private: //unsigned short int unsigned short int f2s(float f) const { return (f + R)/shortPackingConstant; } float s2f(unsigned short int f) const { return (float(f)+0.5)*shortPackingConstant - R; } unsigned short int f2sZ(float f) const { return (f)/shortPackingConstantZ; } float s2fZ(unsigned short int f) const { return (float(f)+0.5)*shortPackingConstantZ; } unsigned short int x, y; unsigned short int z; // TODO: may be we should use iz unsigned short int u, v; // x\u, v - front and back strips; x, y, z - coordinates of hits unsigned short int n; // number of event }; #endif #endif