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