]> git.uio.no Git - u/mrichter/AliRoot.git/blame - STEER/AliStrLine.h
Base class (AliMisaligner); each detector will provide its derived class,
[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
17 public:
18 AliStrLine(); // default constructor
4e1be1bf 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);
c48f9ca2 25 AliStrLine(const AliStrLine& source);
26 AliStrLine& operator=(const AliStrLine& source);
edc97986 27 virtual ~AliStrLine(); // destructor
c48f9ca2 28 virtual void Clear(Option_t*){if(fWMatrix)delete[] fWMatrix; fWMatrix = 0;}
edc97986 29 void PrintStatus() const;
c48f9ca2 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];}
4e1be1bf 34 void SetIdPoints(UShort_t id1, UShort_t id2){
35 fIdPoint[0]=id1;
36 fIdPoint[1]=id2;
37 }
38
edc97986 39 void GetP0(Double_t *point) const {for(Int_t i=0;i<3;i++)point[i]=fP0[i];}
28dc94e2 40 void GetSigma2P0(Double_t *sigsq) const {for(Int_t i=0;i<3;i++)sigsq[i]=fSigma2P0[i];}
c48f9ca2 41 void GetWMatrix(Double_t *wmat) const;
edc97986 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;
4e1be1bf 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");
47 return 65535;
48 }
edc97986 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);
2c9641ee 53 Double_t GetDCA(AliStrLine *line) const;
54 Double_t GetDistFromPoint(Double_t *point) const;
edc97986 55 protected:
24a0c65f 56 void InitDirection(Double_t *point, Double_t *cd);
57 void InitTwoPoints(Double_t *pA, Double_t *pB);
edc97986 58 Double_t fP0[3]; // given point
28dc94e2 59 Double_t fSigma2P0[3]; // errors on coordinates of given point
c48f9ca2 60 Double_t *fWMatrix; //[6] weighting matrix
61 /* fWMatrix is a symmetric matrix internally stored as
62 0 --> row = 0, col = 0
63 1 --> 0,1
64 2 --> 0,2
65 3 --> 1,1
66 4 --> 1,2
67 5 --> 2,2
68 The external interface (constructor, getter and setter) is:
69 0 --> row = 0, col = 0
70 1 --> 0,1
71 2 --> 0,2
72 3 --> 1,0
73 4 --> 1,1
74 5 --> 1,2
75 6 --> 2,0
76 7 --> 2,1
77 8 --> 2,2 */
4e1be1bf 78 Double_t fCd[3]; // direction cosines
79 Double_t fTpar; //! parameter
80 UShort_t fIdPoint[2]; // Identifiers of RecPoints defining the line
81
edc97986 82 private:
c48f9ca2 83 void SetPar(const Double_t par){fTpar = par;}
edc97986 84
4e1be1bf 85 ClassDef(AliStrLine,5);
edc97986 86};
87
88#endif