]> git.uio.no Git - u/mrichter/AliRoot.git/blame - STEER/AliStrLine.h
Additional comment.
[u/mrichter/AliRoot.git] / STEER / AliStrLine.h
CommitLineData
edc97986 1#ifndef ALISTRLINE_H
2#define ALISTRLINE_H
3/* Copyright(c) 1998-2003, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
6///////////////////////////////////////////////////////////////////
7// //
8// A straight line is coded as a point (3 Double_t) and //
9// 3 direction cosines //
10// //
11///////////////////////////////////////////////////////////////////
12
4e1be1bf 13#include "AliLog.h"
edc97986 14
15class AliStrLine : public TObject {
16
b26b5f2c 17public:
edc97986 18 AliStrLine(); // default constructor
b26b5f2c 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);
22
c48f9ca2 23 AliStrLine(const AliStrLine& source);
24 AliStrLine& operator=(const AliStrLine& source);
edc97986 25 virtual ~AliStrLine(); // destructor
c48f9ca2 26 virtual void Clear(Option_t*){if(fWMatrix)delete[] fWMatrix; fWMatrix = 0;}
edc97986 27 void PrintStatus() const;
c48f9ca2 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];}
4e1be1bf 32 void SetIdPoints(UShort_t id1, UShort_t id2){
33 fIdPoint[0]=id1;
34 fIdPoint[1]=id2;
35 }
36
edc97986 37 void GetP0(Double_t *point) const {for(Int_t i=0;i<3;i++)point[i]=fP0[i];}
28dc94e2 38 void GetSigma2P0(Double_t *sigsq) const {for(Int_t i=0;i<3;i++)sigsq[i]=fSigma2P0[i];}
c48f9ca2 39 void GetWMatrix(Double_t *wmat) const;
edc97986 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;
4e1be1bf 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");
45 return 65535;
46 }
b26b5f2c 47 Int_t IsParallelTo(const AliStrLine *line) const;
48 Int_t Crossrphi(const AliStrLine *line);
edc97986 49 Int_t CrossPoints(AliStrLine *line, Double_t *point1, Double_t *point2);
50 Int_t Cross(AliStrLine *line, Double_t *point);
b26b5f2c 51 Double_t GetDCA(const AliStrLine *line) const;
52 Double_t GetDistFromPoint(const Double_t *point) const;
edc97986 53 protected:
b26b5f2c 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);
edc97986 56 Double_t fP0[3]; // given point
28dc94e2 57 Double_t fSigma2P0[3]; // errors on coordinates of given point
c48f9ca2 58 Double_t *fWMatrix; //[6] weighting matrix
59 /* fWMatrix is a symmetric matrix internally stored as
60 0 --> row = 0, col = 0
61 1 --> 0,1
62 2 --> 0,2
63 3 --> 1,1
64 4 --> 1,2
65 5 --> 2,2
66 The external interface (constructor, getter and setter) is:
67 0 --> row = 0, col = 0
68 1 --> 0,1
69 2 --> 0,2
70 3 --> 1,0
71 4 --> 1,1
72 5 --> 1,2
73 6 --> 2,0
74 7 --> 2,1
75 8 --> 2,2 */
4e1be1bf 76 Double_t fCd[3]; // direction cosines
77 Double_t fTpar; //! parameter
78 UShort_t fIdPoint[2]; // Identifiers of RecPoints defining the line
79
edc97986 80 private:
c48f9ca2 81 void SetPar(const Double_t par){fTpar = par;}
edc97986 82
4e1be1bf 83 ClassDef(AliStrLine,5);
edc97986 84};
85
86#endif