PandaRoot
PndCAGBHit.h
Go to the documentation of this file.
1 //-*- Mode: C++ -*-
2 // $Id: PndCAHit.h,v 1.2 2010/09/01 10:38:27 ikulakov 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 PNDCAGBHIT_H
11 #define PNDCAGBHIT_H
12 
13 //#include "PndCADef.h"
14 //#include "PndCAMath.h"
15 #include "TMatrix.h"
16 #include <iostream>
17 // using std::ostream;
18 // using std::istream;
19 
27 class PndCAGBHit {
28  public:
30  : fX(0), fY(0), fZ(0), fErr2X0(0), fErr2X1(0), fErrX12(0), fErr2X2(0), fIRow(0), fID(0), fPhi(0), fR(0), fErr2R(0), fIsLeft(false), fXW(0), fYW(0), fZW(0), fTubeR(0),
31  fHalfLength(0),
32  // fEX( 0 ), fEY( 0 ), fEZ( 0 ),
33  fPndDetID(0), fPndHitID(0), fIsUsed(0)
34  {
35  }
36 
37  // float X() const { return fX; }
38  // float Y() const { return fY; }
39  float GlobalX() const { return fX; }
40  float GlobalY() const { return fY; }
41  float Z() const { return fZ; }
42 
43  float Err2X() const { return fErr2X0; }
44  float Err2Y() const { return fErr2X1; }
45  float Err2Z() const { return fErr2X2; }
46 
47  void GetLocalX0X1X2(float &x0, float &x1, float &x2) const;
48 
49  float Err2X0() const { return fErr2X0; }
50  float Err2X1() const { return fErr2X1; }
51  float ErrX12() const { return fErrX12; }
52  float Err2X2() const { return fErr2X2; }
53 
54  int IRow() const { return fIRow; }
55  int ID() const { return fID; }
56 
57  float R() const { return fR; }
58  float Err2R() const { return fErr2R; }
59  float Err2A() const { return (fHalfLength / 1.5) * (fHalfLength / 1.5); }
60  // float Beta() const { return -0.5*atan(2*ErrX12()/(Err2X2() - Err2X1())); }
61 
62  bool IsLeft() const { return fIsLeft; }
63 
64  float XW() const { return fXW; }
65  float YW() const { return fYW; }
66  float ZW() const { return fZW; }
67 
68  float C(int i1, int i2) const { return fC[i1][i2]; }
69 
70  int PndDetID() const { return fPndDetID; }
71  int PndHitID() const { return fPndHitID; }
72 
73  void SetGlobalX(float v) { fX = v; }
74  void SetGlobalY(float v) { fY = v; }
75  void SetZ(float v) { fZ = v; }
76  void SetErr2X(float v) { fErr2X0 = v; }
77  void SetErr2Y(float v) { fErr2X1 = v; }
78  void SetErr2Z(float v) { fErr2X2 = v; }
79  void SetIRow(int v) { fIRow = v; }
80  void SetID(int v) { fID = v; }
81 
82  void SetErr2X0(float v) { fErr2X0 = v; }
83  void SetErr2X1(float v) { fErr2X1 = v; }
84  void SetErrX12(float v) { fErrX12 = v; }
85  void SetErr2X2(float v) { fErr2X2 = v; }
86 
87  void SetAngle(float v) { fPhi = v; }
88  float Angle() const { return fPhi; }
89 
90  void SetR(float v) { fR = v; }
91  void SetErr2R(float v) { fErr2R = v; }
92  void SetIsLeft(bool v) { fIsLeft = v; }
93 
94  void SetXW(float v) { fXW = v; }
95  void SetYW(float v) { fYW = v; }
96  void SetZW(float v) { fZW = v; }
97 
98  void SetTubeR(float v) { fTubeR = v; }
99  void SetTubeHalfLength(float v) { fHalfLength = v; }
100 
101  void SetC(float v, int i1, int i2) { fC[i1][i2] = v; }
102  void SetC(const TMatrixT<Double_t> c)
103  {
104  for (int i = 0; i < 3; i++)
105  for (int j = 0; j < 3; j++)
106  fC[i][j] = c[i][j];
107  }
108 
109  void SetPndDetID(int v) { fPndDetID = v; }
110  void SetPndHitID(int v) { fPndHitID = v; }
111 
112  static bool Compare(const PndCAGBHit &a, const PndCAGBHit &b);
113 
116 
117  static bool CompareRowDown(const PndCAGBHit &a, const PndCAGBHit &b)
118  {
119  return (a.fIRow > b.fIRow);
120 
122  }
123  static bool ComparePRowDown(const PndCAGBHit *a, const PndCAGBHit *b)
124  {
125  return (a->fIRow > b->fIRow);
127  }
128 
129  bool IsUsed() const { return fIsUsed; }
130  void SetAsUsed() { fIsUsed = true; }
131 
132  friend std::ostream &operator<<(std::ostream &out, const PndCAGBHit &a);
133  friend std::istream &operator>>(std::istream &in, PndCAGBHit &a);
134 
135  protected:
136  double fX; //* X position
137  double fY; //* Y position
138  double fZ; //* Z position
139 
140  float fErr2X0; //* position error^2 in local c.s. (x0 is perpendicular to station)
141  float fErr2X1;
142  float fErrX12; // covariance
143  float fErr2X2;
144 
145  double fC[3][3]; // cov matrix
146 
147  int fIRow; //* row number
148  int fID; //* external ID (id of AliTPCcluster)
149 
150  double fPhi;
151 
152  double fR, fErr2R;
153  bool fIsLeft;
154  double fXW; //* X wire position
155  double fYW; //* Y wire position
156  double fZW; //* Z wire position
157 
159  // double fEX, fEY, fEZ; // wire direction
162  bool fIsUsed;
163 };
164 
165 inline bool PndCAGBHit::Compare(const PndCAGBHit &a, const PndCAGBHit &b)
166 
167 
170 {
171  //* Comparison function for sorting hits
172  if (a.fIRow < b.fIRow)
173  return 1;
174  if (a.fIRow > b.fIRow)
175  return 0;
176  return (a.fZ < b.fZ);
177 }
178 
179 #endif
friend std::istream & operator>>(std::istream &in, PndCAGBHit &a)
bool fIsUsed
Definition: PndCAGBHit.h:162
static bool ComparePRowDown(const PndCAGBHit *a, const PndCAGBHit *b)
Definition: PndCAGBHit.h:123
bool IsUsed() const
Definition: PndCAGBHit.h:129
int fPndDetID
Definition: PndCAGBHit.h:160
double fX
Definition: PndCAGBHit.h:136
void SetGlobalX(float v)
Definition: PndCAGBHit.h:73
float fErrX12
Definition: PndCAGBHit.h:142
float Err2A() const
Definition: PndCAGBHit.h:59
double fC[3][3]
Definition: PndCAGBHit.h:145
void SetYW(float v)
Definition: PndCAGBHit.h:95
void SetTubeR(float v)
Definition: PndCAGBHit.h:98
double fY
Definition: PndCAGBHit.h:137
void SetErr2X0(float v)
Definition: PndCAGBHit.h:82
static bool Compare(const PndCAGBHit &a, const PndCAGBHit &b)
Hits reordering in accordance with the geometry and the track-finder needs: Hits are sorted by sector...
Definition: PndCAGBHit.h:165
float ErrX12() const
Definition: PndCAGBHit.h:51
__m128 v
Definition: P4_F32vec4.h:3
unsigned int i
Definition: P4_F32vec4.h:21
float GlobalY() const
Definition: PndCAGBHit.h:40
void SetGlobalY(float v)
Definition: PndCAGBHit.h:74
double fTubeR
Definition: PndCAGBHit.h:158
double fZW
Definition: PndCAGBHit.h:156
float XW() const
Definition: PndCAGBHit.h:64
void SetZW(float v)
Definition: PndCAGBHit.h:96
int PndDetID() const
Definition: PndCAGBHit.h:70
void SetErrX12(float v)
Definition: PndCAGBHit.h:84
float Err2X0() const
Definition: PndCAGBHit.h:49
float YW() const
Definition: PndCAGBHit.h:65
void SetPndDetID(int v)
Definition: PndCAGBHit.h:109
void SetC(float v, int i1, int i2)
Definition: PndCAGBHit.h:101
void SetErr2X1(float v)
Definition: PndCAGBHit.h:83
double fXW
Definition: PndCAGBHit.h:154
float GlobalX() const
Definition: PndCAGBHit.h:39
double fPhi
Definition: PndCAGBHit.h:150
double fErr2R
Definition: PndCAGBHit.h:152
void SetR(float v)
Definition: PndCAGBHit.h:90
bool fIsLeft
Definition: PndCAGBHit.h:153
float ZW() const
Definition: PndCAGBHit.h:66
void SetZ(float v)
Definition: PndCAGBHit.h:75
void SetErr2X(float v)
Definition: PndCAGBHit.h:76
int IRow() const
Definition: PndCAGBHit.h:54
void SetAngle(float v)
Definition: PndCAGBHit.h:87
friend std::ostream & operator<<(std::ostream &out, const PndCAGBHit &a)
static bool CompareRowDown(const PndCAGBHit &a, const PndCAGBHit &b)
Hits reordering in accordance with the geometry and the track-finder needs: Hits are sorted by sector...
Definition: PndCAGBHit.h:117
float Err2X2() const
Definition: PndCAGBHit.h:52
float fErr2X0
Definition: PndCAGBHit.h:140
void SetTubeHalfLength(float v)
Definition: PndCAGBHit.h:99
void SetID(int v)
Definition: PndCAGBHit.h:80
double fZ
Definition: PndCAGBHit.h:138
double fYW
Definition: PndCAGBHit.h:155
float Err2Z() const
Definition: PndCAGBHit.h:45
double fHalfLength
Definition: PndCAGBHit.h:158
float Err2X() const
Definition: PndCAGBHit.h:43
void SetAsUsed()
Definition: PndCAGBHit.h:130
float Err2R() const
Definition: PndCAGBHit.h:58
int PndHitID() const
Definition: PndCAGBHit.h:71
bool IsLeft() const
Definition: PndCAGBHit.h:62
void SetIsLeft(bool v)
Definition: PndCAGBHit.h:92
float Err2Y() const
Definition: PndCAGBHit.h:44
void SetXW(float v)
Definition: PndCAGBHit.h:94
void SetC(const TMatrixT< Double_t > c)
Definition: PndCAGBHit.h:102
float Err2X1() const
Definition: PndCAGBHit.h:50
void SetErr2X2(float v)
Definition: PndCAGBHit.h:85
float Angle() const
Definition: PndCAGBHit.h:88
double fR
Definition: PndCAGBHit.h:152
void SetIRow(int v)
Definition: PndCAGBHit.h:79
void SetErr2R(float v)
Definition: PndCAGBHit.h:91
float C(int i1, int i2) const
Definition: PndCAGBHit.h:68
float R() const
Definition: PndCAGBHit.h:57
float Z() const
Definition: PndCAGBHit.h:41
void SetErr2Z(float v)
Definition: PndCAGBHit.h:78
void SetPndHitID(int v)
Definition: PndCAGBHit.h:110
int ID() const
Definition: PndCAGBHit.h:55
void GetLocalX0X1X2(float &x0, float &x1, float &x2) const
float fErr2X1
Definition: PndCAGBHit.h:141
void SetErr2Y(float v)
Definition: PndCAGBHit.h:77
int fPndHitID
Definition: PndCAGBHit.h:161
float fErr2X2
Definition: PndCAGBHit.h:143