PandaRoot
PndFTSCAGBHit.h
Go to the documentation of this file.
1 //-*- Mode: C++ -*-
2 // $Id: PndFTSCAGBHit.h,v 1.2 2016/11/21 14:22:47 mpugach Exp $
3 // ************************************************************************
4 // This file is property of and copyright by the ALICE HLT Project *
5 // ALICE Experiment at CERN, All rights reserved. *
6 // See cxx source for full Copyright notice *
7 // *
8 //*************************************************************************
9 
10 #ifndef PNDFTSCAGBHIT_H
11 #define PNDFTSCAGBHIT_H
12 
13 //#include "PndFTSCADef.h"
14 //#include "PndFTSCAMath.h"
15 #include "FTSCAStrip.h"
16 #include "TMatrix.h"
17 
18 #include <iostream>
19 using std::istream;
20 using std::ostream;
21 
30  public:
32  : fX(0), fY(0), fZ(0), fErr2X0(0), fErr2X1(0), fErrX12(0), fErr2X2(0), fIRow(0), fID(0), fPhi(0)
33 #if defined(DRIFT_TUBES)
34  ,
35  fR(0), fErr2R(0), fIsLeft(false), fIsPileuped(false), fXW(0), fYW(0), fZW(0), fTubeR(0), fHalfLength(0), fEX(0), fEY(0), fEZ(0)
36 #endif
37  {
38  }
39 
40  float X() const { return fX; }
41  float Y() const { return fY; }
42  float Z() const { return fZ; }
43 
44  float Err2X() const { return fErr2X0; }
45  float Err2Y() const { return fErr2X1; }
46  float Err2Z() const { return fErr2X2; }
47 
48  void GetLocalX0X1X2(float &x0, float &x1, float &x2) const;
49 
50  float Err2X0() const { return fErr2X0; }
51  float Err2X1() const { return fErr2X1; }
52  float ErrX12() const { return fErrX12; }
53  float Err2X2() const { return fErr2X2; }
54 
55  int IRow() const { return fIRow; }
56  int ID() const { return fID; }
57 
58 #if defined(DRIFT_TUBES)
59  float R() const { return fR; }
60  float Err2R() const { return fErr2R; }
61  float Err2A() const { return (fHalfLength / 1.5) * (fHalfLength / 1.5); }
62  float Beta() const { return -0.5 * atan(2 * ErrX12() / (Err2X2() - Err2X1())); }
63  float DistanceFromWireToPoint(float x, float y, float z) const
64  {
65  // distance from line to point is |dr x e| / |e|
66  const float dx = x - fXW;
67  const float dy = y - fYW;
68  const float dz = z - fZW;
69  const float productX = dy * fEZ - dz * fEY;
70  const float productY = dz * fEX - dx * fEZ;
71  const float productZ = dx * fEY - dy * fEX;
72  return sqrt(productX * productX + productY * productY + productZ * productZ) / sqrt(fEX * fEX + fEY * fEY + fEZ * fEZ);
73  }
74 
75  bool IsLeft() const { return fIsLeft; }
76  bool IsPileduped() const { return fIsPileuped; }
77 
78  float XW() const { return fXW; }
79  float YW() const { return fYW; }
80  float ZW() const { return fZW; }
81 
82  float C(int i1, int i2) const { return fC[i1][i2]; }
83 #endif
84 
85  FTSCAStrip *BStripP() const { return fBStripP; }
86  FTSCAStrip *FStripP() const { return fFStripP; }
87 
88  void SetX(float v) { fX = v; }
89  void SetY(float v) { fY = v; }
90  void SetZ(float v) { fZ = v; }
91  void SetErr2X(float v) { fErr2X0 = v; }
92  void SetErr2Y(float v) { fErr2X1 = v; }
93  void SetErr2Z(float v) { fErr2X2 = v; }
94  void SetErrYZ(float v) { fErrX12 = v; }
95  void SetIRow(int v) { fIRow = v; }
96  void SetID(int v) { fID = v; }
97 
98  void SetErr2X0(float v) { fErr2X0 = v; }
99  void SetErr2X1(float v) { fErr2X1 = v; }
100  void SetErrX12(float v) { fErrX12 = v; }
101  void SetErr2X2(float v) { fErr2X2 = v; }
102 
103  void SetFStripP(FTSCAStrip *s) { fFStripP = s; }
104  void SetBStripP(FTSCAStrip *s) { fBStripP = s; }
105 
106  void SetAngle(float v) { fPhi = v; }
107  float Angle() const { return fPhi; }
108 
109  void SetC(const TMatrixT<Double_t> c)
110  {
111  for (int i = 0; i < 3; i++)
112  for (int j = 0; j < 3; j++)
113  fC[i][j] = c[i][j];
114  }
115 #if defined(DRIFT_TUBES)
116  void SetTubeR(float v) { fTubeR = v; }
117  void SetTubeHalfLength(float v) { fHalfLength = v; }
118 
119  void SetR(float v) { fR = v; }
120  void SetErr2R(float v) { fErr2R = v; }
121  void SetIsLeft(bool v) { fIsLeft = v; }
122  void SetIsPileuped(bool b) { fIsPileuped = b; }
123 
124  void SetXW(float v) { fXW = v; }
125  void SetYW(float v) { fYW = v; }
126  void SetZW(float v) { fZW = v; }
127 
128  void SetEX(float v) { fEX = v; }
129  void SetEY(float v) { fEY = v; }
130  void SetEZ(float v) { fEZ = v; }
131 
132  void SetC(float v, int i1, int i2) { fC[i1][i2] = v; }
133 #endif
134 
135  static bool Compare(const PndFTSCAGBHit &a, const PndFTSCAGBHit &b);
136 
139 
140  static bool CompareRowDown(const PndFTSCAGBHit &a, const PndFTSCAGBHit &b)
141  {
142  return (a.fIRow > b.fIRow);
143 
145  }
146  static bool ComparePRowDown(const PndFTSCAGBHit *a, const PndFTSCAGBHit *b)
147  {
148  return (a->fIRow > b->fIRow);
150  }
151 
152  void SetPndDetID(int v) { fPndDetID = v; }
153  void SetPndHitID(int v) { fPndHitID = v; }
154  int PndDetID() const { return fPndDetID; }
155  int PndHitID() const { return fPndHitID; }
156 
157  friend ostream &operator<<(ostream &out, const PndFTSCAGBHit &a);
158  friend istream &operator>>(istream &in, PndFTSCAGBHit &a);
159 
160  float point_X;
161  float point_Y;
162  float point_Z;
163  float point_Px;
164  float point_Py;
165  float point_Pz;
166  float point_Qp;
167  int Track_ID;
168 
169  protected:
171 
172  double fX; //* X position
173  double fY; //* Y position
174  double fZ; //* Z position
175 
176  float fErr2X0; //* position error^2 in local c.s. (x0 is perpendicular to station)
177  float fErr2X1;
178  float fErrX12; // covariance
179  float fErr2X2;
180 
181  double fC[3][3]; // cov matrix in global c.s.
182 
183  int fIRow; //* row number
184  int fID; //* external ID (id of AliTPCcluster)
185 
186  double fPhi;
187 
188 #if defined(DRIFT_TUBES)
189  double fR, fErr2R;
190  bool fIsLeft;
191  bool fIsPileuped;
192  double fXW; //* X wire position
193  double fYW; //* Y wire position
194  double fZW; //* Z wire position
195 
196  double fTubeR, fHalfLength;
197  double fEX, fEY, fEZ; // wire direction
198 #endif
201 };
202 
203 inline bool PndFTSCAGBHit::Compare(const PndFTSCAGBHit &a, const PndFTSCAGBHit &b)
204 
205 
208 {
209  //* Comparison function for sorting hits
210  if (a.fIRow < b.fIRow)
211  return 1;
212  if (a.fIRow > b.fIRow)
213  return 0;
214  return (a.fZ < b.fZ);
215 }
216 
217 #endif
void SetC(const TMatrixT< Double_t > c)
float Err2X1() const
Definition: PndFTSCAGBHit.h:51
float Err2Y() const
Definition: PndFTSCAGBHit.h:45
void SetErr2X(float v)
Definition: PndFTSCAGBHit.h:91
static bool CompareRowDown(const PndFTSCAGBHit &a, const PndFTSCAGBHit &b)
Hits reordering in accordance with the geometry and the track-finder needs: Hits are sorted by sector...
static bool Compare(const PndFTSCAGBHit &a, const PndFTSCAGBHit &b)
Hits reordering in accordance with the geometry and the track-finder needs: Hits are sorted by sector...
double fC[3][3]
basic_istream< char, char_traits< char > > istream
float Z() const
Definition: PndFTSCAGBHit.h:42
float Err2Z() const
Definition: PndFTSCAGBHit.h:46
void SetErr2Z(float v)
Definition: PndFTSCAGBHit.h:93
void SetErr2X1(float v)
Definition: PndFTSCAGBHit.h:99
friend F32vec4 sqrt(const F32vec4 &a)
Definition: P4_F32vec4.h:28
float Err2X2() const
Definition: PndFTSCAGBHit.h:53
void SetPndHitID(int v)
void SetPndDetID(int v)
float Err2X() const
Definition: PndFTSCAGBHit.h:44
void SetFStripP(FTSCAStrip *s)
FTSCAStrip * FStripP() const
Definition: PndFTSCAGBHit.h:86
int PndDetID() const
__m128 v
Definition: P4_F32vec4.h:3
unsigned int i
Definition: P4_F32vec4.h:21
float Y() const
Definition: PndFTSCAGBHit.h:41
void SetErr2Y(float v)
Definition: PndFTSCAGBHit.h:92
float ErrX12() const
Definition: PndFTSCAGBHit.h:52
void GetLocalX0X1X2(float &x0, float &x1, float &x2) const
void SetY(float v)
Definition: PndFTSCAGBHit.h:89
void SetIRow(int v)
Definition: PndFTSCAGBHit.h:95
int IRow() const
Definition: PndFTSCAGBHit.h:55
FTSCAStrip * fBStripP
friend istream & operator>>(istream &in, PndFTSCAGBHit &a)
void SetErrYZ(float v)
Definition: PndFTSCAGBHit.h:94
void SetBStripP(FTSCAStrip *s)
static bool ComparePRowDown(const PndFTSCAGBHit *a, const PndFTSCAGBHit *b)
void SetErrX12(float v)
float X() const
Definition: PndFTSCAGBHit.h:40
void SetX(float v)
Definition: PndFTSCAGBHit.h:88
FTSCAStrip * fFStripP
void SetZ(float v)
Definition: PndFTSCAGBHit.h:90
basic_ostream< char, char_traits< char > > ostream
void SetID(int v)
Definition: PndFTSCAGBHit.h:96
void SetAngle(float v)
float Err2X0() const
Definition: PndFTSCAGBHit.h:50
float Angle() const
void SetErr2X0(float v)
Definition: PndFTSCAGBHit.h:98
FTSCAStrip * BStripP() const
Definition: PndFTSCAGBHit.h:85
int PndHitID() const
int ID() const
Definition: PndFTSCAGBHit.h:56
void SetErr2X2(float v)
friend ostream & operator<<(ostream &out, const PndFTSCAGBHit &a)