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