CbmRoot
L1HitPoint.h
Go to the documentation of this file.
1 #ifndef _L1HitPoint_h_
2 #define _L1HitPoint_h_
3 
5 #if 1
6 struct L1HitPoint {
8  : // x(0.f)
9  // , y(0.f)
10  // , dx(0.f)
11  // , dy(0.f)
12  // , dxy(0.f)
13  u(0.f)
14  , v(0.f)
15  , du(0.f)
16  , dv(0.f)
17  , z(0.f)
18  , time(0.f)
19  , timeEr(2.9f) {};
21  // fscal dx_,
22  // fscal dy_,
23  // fscal dxy_,
24  fscal du_,
25  fscal dv_,
26  fscal z_,
27  fscal v_,
28  fscal u_,
29  float time_,
30  float /*timeEv1_*/ = 0,
31  float timeEr_ = 2.9f)
32  : // : x(x_)
33  // , y(y_)
34  // , dx(dx_)
35  // , dy(dy_)
36  // , dxy(dxy_)
37  u(u_)
38  , v(v_)
39  , du(du_)
40  , dv(dv_)
41  , z(z_)
42  , time(time_)
43  , timeEr(timeEr_) {};
44 
45  // L1HitPoint(fscal x_, fscal y_, fscal z_, fscal v_, fscal u_, fscal time_, unsigned short int n_ = 0):
46  // x(x_), y(y_), z(z_), u(u_), v(v_), time(time_){};
47 
48  // fscal Xs() const { return X() / Z(); }
49  // fscal Ys() const { return Y() / Z(); } // value to sort hits by
50 
51  // fscal X() const { return x; }
52  // fscal Y() const { return y; }
53  // fscal dX() const { return dx; }
54  // fscal dY() const { return dy; }
55  // fscal dXY() const { return dxy; }
56  fscal dU() const { return du; }
57  fscal dV() const { return dv; }
58  fscal Z() const { return z; }
59  fscal U() const { return u; }
60  fscal V() const { return v; }
61  // unsigned short int N() const { return n; }
62  // int GetSortIndex() const { return SortIndex; }
63  // void SetX(fscal X1) { x = X1; }
64  // void SetY(fscal Y1) { y = Y1; }
65  void SetZ(fscal Z1) { z = Z1; }
66  void SetU(fscal U1) { u = U1; }
67  void SetV(fscal V1) { v = V1; }
68 
69  void Set(
70  // const float& dx1,
71  // const float& dy1,
72  // const float& xy1,
73  const float& z1,
74  const fscal& u1,
75  const fscal& v1,
76  const fscal& du1,
77  const fscal& dv1,
78  const float& time1,
79  float timeEr1) {
80  // x = x1;
81  // y = y1;
82  // dx = dx1;
83  // dy = dy1;
84  du = du1;
85  // dxy = xy1;
86  dv = dv1;
87  z = z1;
88  u = u1;
89  v = v1;
90  time = time1;
91  timeEr = timeEr1;
92  }
93 
94 private:
95  // x, y,
96  float u, v, du, dv;
97  float z; // TODO: may be we should use iz
98  // x\u, v - front and back strips; x, y, z - coordinates of hits
99 
100 public:
101  float time, timeEr;
102  // int track;
103 };
104 #else
105 
106 static const float R = 60;
107 static const float shortPackingConstant = 2 * R / 65535.f;
108 static const float MZ = 110;
109 static const float shortPackingConstantZ = MZ / 65535.f;
110 
112 struct L1HitPoint {
113  L1HitPoint() {};
114  L1HitPoint(fscal x_,
115  fscal y_,
116  fscal z_,
117  fscal v_,
118  fscal u_,
119  unsigned short int n_ = 0)
120  : x(f2s(x_)), y(f2s(y_)), z(f2sZ(z_)), u(f2s(u_)), v(f2s(v_)), n(n_) {};
121 
122  fscal Xs() const { return X() / Z(); }
123  fscal Ys() const { return Y() / Z(); } // value to sort hits by
124 
125  fscal X() const { return s2f(x); }
126  fscal Y() const { return s2f(y); }
127  fscal Z() const { return s2fZ(z); }
128  fscal U() const { return s2f(u); }
129  fscal V() const { return s2f(v); }
130 
131  unsigned short int N() const { return n; }
132 
133 private:
134  //unsigned short int
135  unsigned short int f2s(float f) const {
136  return (f + R) / shortPackingConstant;
137  }
138  float s2f(unsigned short int f) const {
139  return (float(f) + 0.5) * shortPackingConstant - R;
140  }
141 
142  unsigned short int f2sZ(float f) const { return (f) / shortPackingConstantZ; }
143  float s2fZ(unsigned short int f) const {
144  return (float(f) + 0.5) * shortPackingConstantZ;
145  }
146 
147  unsigned short int x, y;
148  unsigned short int z; // TODO: may be we should use iz
149  unsigned short int u,
150  v; // x\u, v - front and back strips; x, y, z - coordinates of hits
151 };
152 
153 #endif
154 
155 #endif
fscal
float fscal
Definition: L1/vectors/P4_F32vec4.h:250
L1HitPoint
contain strips positions and coordinates of hit
Definition: L1HitPoint.h:6
L1HitPoint::dU
fscal dU() const
Definition: L1HitPoint.h:56
f
float f
Definition: L1/vectors/P4_F32vec4.h:24
L1HitPoint::V
fscal V() const
Definition: L1HitPoint.h:60
L1HitPoint::u
float u
Definition: L1HitPoint.h:96
L1HitPoint::Z
fscal Z() const
Definition: L1HitPoint.h:58
L1HitPoint::v
float v
Definition: L1HitPoint.h:96
L1HitPoint::z
float z
Definition: L1HitPoint.h:97
L1HitPoint::time
float time
Definition: L1HitPoint.h:101
L1HitPoint::L1HitPoint
L1HitPoint(fscal du_, fscal dv_, fscal z_, fscal v_, fscal u_, float time_, float=0, float timeEr_=2.9f)
Definition: L1HitPoint.h:20
L1HitPoint::SetU
void SetU(fscal U1)
Definition: L1HitPoint.h:66
L1HitPoint::dV
fscal dV() const
Definition: L1HitPoint.h:57
L1HitPoint::dv
float dv
Definition: L1HitPoint.h:96
L1HitPoint::Set
void Set(const float &z1, const fscal &u1, const fscal &v1, const fscal &du1, const fscal &dv1, const float &time1, float timeEr1)
Definition: L1HitPoint.h:69
L1HitPoint::SetV
void SetV(fscal V1)
Definition: L1HitPoint.h:67
x
Double_t x
Definition: CbmMvdSensorDigiToHitTask.cxx:68
y
Double_t y
Definition: CbmMvdSensorDigiToHitTask.cxx:68
L1HitPoint::du
float du
Definition: L1HitPoint.h:96
z1
Double_t z1[nSects1]
Definition: pipe_v16a_mvdsts100.h:6
L1HitPoint::U
fscal U() const
Definition: L1HitPoint.h:59
L1HitPoint::L1HitPoint
L1HitPoint()
Definition: L1HitPoint.h:7
L1HitPoint::timeEr
float timeEr
Definition: L1HitPoint.h:101
L1HitPoint::SetZ
void SetZ(fscal Z1)
Definition: L1HitPoint.h:65