3 /* Copyright(c) 1998-2003, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
6 ///////////////////////////////////////////////////////////////////
8 // A straight line is coded as a point (3 Double_t) and //
9 // 3 direction cosines //
11 ///////////////////////////////////////////////////////////////////
15 class AliStrLine : public TObject {
18 AliStrLine(); // default constructor
19 AliStrLine(const Double_t *const point, const Double_t *const cd, Bool_t twopoints=kFALSE, UShort_t id1=65535, UShort_t id2=65535); // standard constructor
20 AliStrLine(const Double_t *const point, const Double_t *const sig2point, const Double_t *const cd, Bool_t twopoints=kFALSE, UShort_t id1=65535, UShort_t id2=65535);
21 AliStrLine(const Double_t *const point, const Double_t *const sig2point, const Double_t *const wmat, const Double_t *const cd, Bool_t twopoints=kFALSE, UShort_t id1=65535, UShort_t id2=65535);
23 AliStrLine(const AliStrLine& source);
24 AliStrLine& operator=(const AliStrLine& source);
25 virtual ~AliStrLine(); // destructor
26 virtual void Clear(Option_t*){if(fWMatrix)delete[] fWMatrix; fWMatrix = 0;}
27 void PrintStatus() const;
28 void SetP0(const Double_t *point) {for(Int_t i=0;i<3;i++)fP0[i]=point[i];}
29 void SetSigma2P0(const Double_t *sigsq) {for(Int_t i=0;i<3;i++)fSigma2P0[i]=sigsq[i];}
30 void SetWMatrix(const Double_t *wmat);
31 void SetCd(const Double_t *cd) {for(Int_t i=0;i<3;i++)fCd[i]=cd[i];}
32 void SetIdPoints(UShort_t id1, UShort_t id2){
37 void GetP0(Double_t *point) const {for(Int_t i=0;i<3;i++)point[i]=fP0[i];}
38 void GetSigma2P0(Double_t *sigsq) const {for(Int_t i=0;i<3;i++)sigsq[i]=fSigma2P0[i];}
39 void GetWMatrix(Double_t *wmat) const;
40 void GetCd(Double_t *cd) const {for(Int_t i=0;i<3;i++)cd[i]=fCd[i];}
41 void GetCurrentPoint(Double_t *point) const;
42 UShort_t GetIdPoint(Int_t i) const {
43 if(i<2) return fIdPoint[i];
44 AliError("Wrong element: only 2 points are stored in AliStrLine");
47 Int_t IsParallelTo(const AliStrLine *line) const;
48 Int_t Crossrphi(const AliStrLine *line);
49 Int_t CrossPoints(AliStrLine *line, Double_t *point1, Double_t *point2);
50 Int_t Cross(AliStrLine *line, Double_t *point);
51 Double_t GetDCA(const AliStrLine *line) const;
52 Double_t GetDistFromPoint(const Double_t *point) const;
54 void InitDirection(const Double_t *const point, const Double_t *const cd);
55 void InitTwoPoints(const Double_t *const pA, const Double_t *const pB);
56 Double_t fP0[3]; // given point
57 Double_t fSigma2P0[3]; // errors on coordinates of given point
58 Double_t *fWMatrix; //[6] weighting matrix
59 /* fWMatrix is a symmetric matrix internally stored as
60 0 --> row = 0, col = 0
66 The external interface (constructor, getter and setter) is:
67 0 --> row = 0, col = 0
76 Double_t fCd[3]; // direction cosines
77 Double_t fTpar; //! parameter
78 UShort_t fIdPoint[2]; // Identifiers of RecPoints defining the line
81 void SetPar(const Double_t par){fTpar = par;}
83 ClassDef(AliStrLine,5);