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(Double_t *point, Double_t *cd, Bool_t twopoints=kFALSE, UShort_t id1=65535, UShort_t id2=65535); // standard constructor
20 AliStrLine(Float_t *pointf, Float_t *cdf, Bool_t twopoints=kFALSE, UShort_t id1=65535, UShort_t id2=65535);
21 AliStrLine(Double_t *point, Double_t *sig2point, Double_t *cd, Bool_t twopoints=kFALSE, UShort_t id1=65535, UShort_t id2=65535);
22 AliStrLine(Float_t *pointf, Float_t *sig2point, Float_t *cdf, Bool_t twopoints=kFALSE, UShort_t id1=65535, UShort_t id2=65535);
23 AliStrLine(Double_t *point, Double_t *sig2point, Double_t *wmat, Double_t *cd, Bool_t twopoints=kFALSE, UShort_t id1=65535, UShort_t id2=65535);
24 AliStrLine(Float_t *pointf, Float_t *sig2point, Float_t *wmat, Float_t *cdf, Bool_t twopoints=kFALSE, UShort_t id1=65535, UShort_t id2=65535);
25 AliStrLine(const AliStrLine& source);
26 AliStrLine& operator=(const AliStrLine& source);
27 virtual ~AliStrLine(); // destructor
28 virtual void Clear(Option_t*){if(fWMatrix)delete[] fWMatrix; fWMatrix = 0;}
29 void PrintStatus() const;
30 void SetP0(const Double_t *point) {for(Int_t i=0;i<3;i++)fP0[i]=point[i];}
31 void SetSigma2P0(const Double_t *sigsq) {for(Int_t i=0;i<3;i++)fSigma2P0[i]=sigsq[i];}
32 void SetWMatrix(const Double_t *wmat);
33 void SetCd(const Double_t *cd) {for(Int_t i=0;i<3;i++)fCd[i]=cd[i];}
34 void SetIdPoints(UShort_t id1, UShort_t id2){
39 void GetP0(Double_t *point) const {for(Int_t i=0;i<3;i++)point[i]=fP0[i];}
40 void GetSigma2P0(Double_t *sigsq) const {for(Int_t i=0;i<3;i++)sigsq[i]=fSigma2P0[i];}
41 void GetWMatrix(Double_t *wmat) const;
42 void GetCd(Double_t *cd) const {for(Int_t i=0;i<3;i++)cd[i]=fCd[i];}
43 void GetCurrentPoint(Double_t *point) const;
44 UShort_t GetIdPoint(Int_t i) const {
45 if(i<2) return fIdPoint[i];
46 AliError("Wrong element: only 2 points are stored in AliStrLine");
49 Int_t IsParallelTo(AliStrLine *line) const;
50 Int_t Crossrphi(AliStrLine *line);
51 Int_t CrossPoints(AliStrLine *line, Double_t *point1, Double_t *point2);
52 Int_t Cross(AliStrLine *line, Double_t *point);
53 Double_t GetDCA(AliStrLine *line) const;
54 Double_t GetDistFromPoint(Double_t *point) const;
56 void InitDirection(Double_t *point, Double_t *cd);
57 void InitTwoPoints(Double_t *pA, Double_t *pB);
58 Double_t fP0[3]; // given point
59 Double_t fSigma2P0[3]; // errors on coordinates of given point
60 Double_t *fWMatrix; //[6] weighting matrix
61 /* fWMatrix is a symmetric matrix internally stored as
62 0 --> row = 0, col = 0
68 The external interface (constructor, getter and setter) is:
69 0 --> row = 0, col = 0
78 Double_t fCd[3]; // direction cosines
79 Double_t fTpar; //! parameter
80 UShort_t fIdPoint[2]; // Identifiers of RecPoints defining the line
83 void SetPar(const Double_t par){fTpar = par;}
85 ClassDef(AliStrLine,5);