FairRoot/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::ostream;
20 using std::istream;
21 
30 {
31  public:
33  : fX( 0 ), fY( 0 ), fZ( 0 ), fErr2X0( 0 ), fErr2X1( 0 ), fErrX12( 0 ), fErr2X2( 0 ),
34  fIRow( 0 ), fID( 0 ), fPhi( 0 )
35 #if defined(DRIFT_TUBES)
36  , fR( 0 ), fErr2R( 0 ), fIsLeft( false ), fIsPileuped( false ), fXW(0), fYW(0), fZW(0),
37  fTubeR( 0 ), fHalfLength( 0 ), fEX( 0 ), fEY( 0 ), fEZ( 0 )
38 #endif
39  {}
40 
41  float X() const { return fX; }
42  float Y() const { return fY; }
43  float Z() const { return fZ; }
44 
45  float Err2X() const { return fErr2X0; }
46  float Err2Y() const { return fErr2X1; }
47  float Err2Z() const { return fErr2X2; }
48 
49  void GetLocalX0X1X2( float& x0, float& x1, float &x2 ) const;
50 
51  float Err2X0() const { return fErr2X0; }
52  float Err2X1() const { return fErr2X1; }
53  float ErrX12() const { return fErrX12; }
54  float Err2X2() const { return fErr2X2; }
55 
56  int IRow() const { return fIRow; }
57  int ID() const { return fID; }
58 
59 #if defined(DRIFT_TUBES)
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  float DistanceFromWireToPoint( float x, float y, float z ) const {
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  for( int i=0; i<3; i++ )
111  for( int j=0; j<3; j++) fC[i][j] = c[i][j];
112  }
113 #if defined(DRIFT_TUBES)
114  void SetTubeR( float v ){ fTubeR = v; }
115  void SetTubeHalfLength( float v ){ fHalfLength = v; }
116 
117  void SetR(float v) { fR = v; }
118  void SetErr2R(float v) { fErr2R = v; }
119  void SetIsLeft(bool v) { fIsLeft = v; }
120  void SetIsPileuped(bool b) { fIsPileuped = b; }
121 
122  void SetXW( float v ) { fXW = v; }
123  void SetYW( float v ) { fYW = v; }
124  void SetZW( float v ) { fZW = v; }
125 
126  void SetEX( float v ) { fEX = v; }
127  void SetEY( float v ) { fEY = v; }
128  void SetEZ( float v ) { fEZ = v; }
129 
130  void SetC( float v, int i1, int i2 ) { fC[i1][i2] = v; }
131 #endif
132 
133  static bool Compare( const PndFTSCAGBHit &a, const PndFTSCAGBHit &b );
134 
137 
138  static bool CompareRowDown( const PndFTSCAGBHit &a, const PndFTSCAGBHit &b ) {
139  return ( a.fIRow > b.fIRow );
140 
142  }
143  static bool ComparePRowDown( const PndFTSCAGBHit *a, const PndFTSCAGBHit *b ) {
144  return ( a->fIRow > b->fIRow );
146  }
147 
148  void SetPndDetID( int v ) { fPndDetID = v; }
149  void SetPndHitID( int v ) { fPndHitID = v; }
150  int PndDetID() const { return fPndDetID; }
151  int PndHitID() const { return fPndHitID; }
152 
153  friend ostream& operator<<(ostream& out, const PndFTSCAGBHit &a);
154  friend istream& operator>>(istream& in, PndFTSCAGBHit &a);
155 
156  float point_X;
157  float point_Y;
158  float point_Z;
159  float point_Px;
160  float point_Py;
161  float point_Pz;
162  float point_Qp;
163  int Track_ID;
164 
165  protected:
167 
168  double fX; //* X position
169  double fY; //* Y position
170  double fZ; //* Z position
171 
172  float fErr2X0; //* position error^2 in local c.s. (x0 is perpendicular to station)
173  float fErr2X1;
174  float fErrX12; // covariance
175  float fErr2X2;
176 
177  double fC[3][3]; // cov matrix in global c.s.
178 
179  int fIRow; //* row number
180  int fID; //* external ID (id of AliTPCcluster)
181 
182  double fPhi;
183 
184 #if defined(DRIFT_TUBES)
185  double fR, fErr2R;
186  bool fIsLeft;
187  bool fIsPileuped;
188  double fXW; //* X wire position
189  double fYW; //* Y wire position
190  double fZW; //* Z wire position
191 
192  double fTubeR, fHalfLength;
193  double fEX, fEY, fEZ; // wire direction
194 #endif
197 };
198 
199 inline bool PndFTSCAGBHit::Compare( const PndFTSCAGBHit &a, const PndFTSCAGBHit &b )
200 
201 
204 
205 
206 {
207  //* Comparison function for sorting hits
208  if ( a.fIRow < b.fIRow ) return 1;
209  if ( a.fIRow > b.fIRow ) return 0;
210  return ( a.fZ < b.fZ );
211 }
212 
213 #endif
void SetC(const TMatrixT< Double_t > c)
Double_t x0
Definition: checkhelixhit.C:70
void SetErr2X(float v)
Definition: PndFTSCAGBHit.h:91
double dy
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]
void SetErr2Z(float v)
Definition: PndFTSCAGBHit.h:93
void SetErr2X1(float v)
Definition: PndFTSCAGBHit.h:99
Int_t i
Definition: run_full.C:25
TTree * b
friend F32vec4 sqrt(const F32vec4 &a)
Definition: P4_F32vec4.h:29
void SetPndHitID(int v)
TLorentzVector s
Definition: Pnd2DStar.C:50
int PndDetID() const
int IRow() const
Definition: PndFTSCAGBHit.h:56
float Z() const
Definition: PndFTSCAGBHit.h:43
void SetPndDetID(int v)
void SetFStripP(FTSCAStrip *s)
__m128 v
Definition: P4_F32vec4.h:4
void SetErr2Y(float v)
Definition: PndFTSCAGBHit.h:92
float Y() const
Definition: PndFTSCAGBHit.h:42
float ErrX12() const
Definition: PndFTSCAGBHit.h:53
int Pic_FED Eff_lEE C()
void SetY(float v)
Definition: PndFTSCAGBHit.h:89
FTSCAStrip * FStripP() const
Definition: PndFTSCAGBHit.h:86
Int_t a
Definition: anaLmdDigi.C:126
void SetIRow(int v)
Definition: PndFTSCAGBHit.h:95
basic_ostream< char, char_traits< char > > ostream
float Angle() const
float Err2Y() const
Definition: PndFTSCAGBHit.h:46
int PndHitID() const
FTSCAStrip * fBStripP
friend istream & operator>>(istream &in, PndFTSCAGBHit &a)
Double_t z
int ID() const
Definition: PndFTSCAGBHit.h:57
void SetErrYZ(float v)
Definition: PndFTSCAGBHit.h:94
void SetBStripP(FTSCAStrip *s)
TFile * out
Definition: reco_muo.C:20
basic_istream< char, char_traits< char > > istream
float X() const
Definition: PndFTSCAGBHit.h:41
void GetLocalX0X1X2(float &x0, float &x1, float &x2) const
static bool ComparePRowDown(const PndFTSCAGBHit *a, const PndFTSCAGBHit *b)
FTSCAStrip * BStripP() const
Definition: PndFTSCAGBHit.h:85
double dx
void SetErrX12(float v)
void SetX(float v)
Definition: PndFTSCAGBHit.h:88
FTSCAStrip * fFStripP
Double_t x
float Err2X1() const
Definition: PndFTSCAGBHit.h:52
void SetZ(float v)
Definition: PndFTSCAGBHit.h:90
void SetID(int v)
Definition: PndFTSCAGBHit.h:96
Double_t y
float Err2X2() const
Definition: PndFTSCAGBHit.h:54
void SetAngle(float v)
float Err2Z() const
Definition: PndFTSCAGBHit.h:47
if(fWindowIsBox)
Double_t R
Definition: checkhelixhit.C:61
float Err2X0() const
Definition: PndFTSCAGBHit.h:51
float Err2X() const
Definition: PndFTSCAGBHit.h:45
void SetErr2X0(float v)
Definition: PndFTSCAGBHit.h:98
void SetErr2X2(float v)
friend ostream & operator<<(ostream &out, const PndFTSCAGBHit &a)