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