]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITSAlignmentTrack.h
Casting to eliminate constructor ambiguity
[u/mrichter/AliRoot.git] / ITS / AliITSAlignmentTrack.h
1 #ifndef ALIITSALIGNMENTTRACK_H
2 #define ALIITSALIGNMENTTRACK_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5 /* $Id$ */
6 /* $Author$ */
7 /* $Date$ */
8 /* $Name$ */
9 /* $Header$ */
10 /*
11    $Log$
12    Revision 1.1.2.4  2000/06/04 16:35:24  nilsen
13    One more try to fix log comments.
14
15    Revision 1.1.2.3  2000/03/12 16:05:55  nilsen
16    Fixed but in $Log$
17    Fixed but in Revision 1.1.2.4  2000/06/04 16:35:24  nilsen
18    Fixed but in One more try to fix log comments.
19    Fixed but in, hopefully.
20   
21    Revision 1.1.2.2  2000/03/04 23:40:19  nilsen
22    Fixed the logs???
23   
24    Revision 1.1.2.1  2000/03/02 20:14:25  nilsen
25    A new class useful for ITS detector alignment studdies. 
26 */
27 /*   $Revision$ */
28
29 // Standard C & C++ libraries
30
31 // Standard Root Libraries
32 #include <TObject.h>
33 #include <TParticle.h>
34
35 // ITS libraries
36 #include "AliITSgeom.h"
37
38 struct TClustAl_sl{
39     Int_t   findex;
40     Float_t fxg[3],fExg[3][3];
41     Float_t fxl[3],fExl[3][3];
42 };
43
44
45
46 class AliITSAlignmentTrack : public TObject{
47 ///////////////////////////////////////////////////////////////////////////
48 //      A track class define exclusively for the use in doing ITS detector
49 // alignment studdies. Not intended for general use.
50 // Author: B. S. Nilsen
51 // Date:   January 17 2000
52 ///////////////////////////////////////////////////////////////////////////
53
54  protected:
55
56     Int_t        ftrack,fnclust,fnclustMax;
57     TClustAl_sl  *fclust;
58     Int_t        ffunc;
59     Double_t     fpar[10];
60     Float_t      fChi2;
61     Float_t      fpx,fpy,fpz,fp,fpt;
62     // x=fp[0]+fp[1]*z and y=fp[2]+fp[3]*z                 : ffunc = 0
63     //
64     // x=fp[0]+fp[1]*y and z=fp[2]+fp[3]*y                 : ffunc = 1
65     //
66     // x=fp[0]+fp[2]*cos(th), y=fp[1]+fp[2]*sin(th),
67     // and z=fp[3]+f[4]*th   th[i]=atan2(y[i]-y0,x[i]-x0)  : ffunc = 2
68
69  public:
70
71     AliITSAlignmentTrack();
72     virtual ~AliITSAlignmentTrack();
73
74     void CreatePoints(Int_t n){fclust = new TClustAl_sl[n];fnclustMax=n;
75                   fnclust=0;for(Int_t j=0;j<fnclustMax;j++)
76                   for(Int_t i=0;i<3;i++)fclust[j].fxl[i]=fclust[j].fxg[i]=0.0;}
77     Int_t AddPointL(Int_t n,Int_t indx,Float_t *lp,Float_t **lep){
78         if(n>=fnclustMax)return 0;fclust[n].findex=indx;
79         for(Int_t i=0;i<3;i++){fclust[n].fxl[i]=lp[i];for(Int_t j=0;j<3;j++)
80             fclust[n].fExl[i][j]=lep[i][j];}return -1;}
81     Int_t AddPointLastL(Int_t indx,Float_t *lp,Float_t **lep){
82         if(++fnclust>=fnclustMax)return 0;//+first
83         fclust[fnclust].findex=indx;
84         for(Int_t i=0;i<3;i++){fclust[fnclust].fxl[i]=lp[i];
85            for(Int_t j=0;j<3;j++)fclust[fnclust].fExl[i][j]=lep[i][j];
86         }return -1;}
87     Int_t GetPointL(Int_t n,Float_t *lp){if(n>=fnclustMax)return 0;
88                        for(Int_t i=0;i<3;i++)
89                            lp[i]=fclust[n].fxl[i];return -1;}
90     Int_t GetPointL(Int_t n,Double_t *lp){if(n>=fnclustMax)return 0;
91                        for(Int_t i=0;i<3;i++)
92                            lp[i]=(Double_t)fclust[n].fxl[i];return -1;}
93     Int_t GetPointG(Int_t n,Float_t *gp){if(n>=fnclustMax)return 0;
94                        for(Int_t i=0;i<3;i++)
95                            gp[i]=fclust[n].fxg[i];return -1;}
96     Int_t GetPointG(Int_t n,Double_t *gp){if(n>=fnclustMax)return 0;
97                        for(Int_t i=0;i<3;i++)
98                            gp[i]=(Double_t)fclust[n].fxg[i];return -1;}
99     Int_t GetErrorG(Int_t n,Float_t **gp){if(n>=fnclustMax)return 0;
100                        for(Int_t i=0;i<3;i++)for(Int_t j=0;j<3;j++)
101                            gp[i][j]=fclust[n].fExg[i][j];return -1;}
102     Int_t GetErrorG(Int_t n,Double_t **gp){if(n>=fnclustMax)return 0;
103                        for(Int_t i=0;i<3;i++)for(Int_t j=0;j<3;j++)
104                            gp[i][j]=(Double_t)fclust[n].fExg[i][j];return -1;}
105     Int_t GetErrorL(Int_t n,Float_t **gp){if(n>=fnclustMax)return 0;
106                        for(Int_t i=0;i<3;i++)for(Int_t j=0;j<3;j++)
107                            gp[i][j]=fclust[n].fExl[i][j];return -1;}
108     Int_t GetErrorL(Int_t n,Double_t **gp){if(n>=fnclustMax)return 0;
109                        for(Int_t i=0;i<3;i++)for(Int_t j=0;j<3;j++)
110                            gp[i][j]=(Double_t)fclust[n].fExl[i][j];return -1;}
111     Int_t GetIndex(Int_t n,Int_t &indx){if(n>=fnclustMax)return 0;
112                                               indx=fclust[n].findex;return -1;}
113
114     void SetGlobalPosition(AliITSgeom *gm){
115         for(Int_t i=0;i<fnclust;i++){
116             gm->LtoG(fclust[i].findex,fclust[i].fxl,fclust[i].fxg);
117          gm->LtoGErrorMatrix(fclust[i].findex,(Double_t **) fclust[i].fExl,
118                              (Double_t **) fclust[i].fExg);}}
119     void SetTrackNumber(Int_t trk) {ftrack=trk;}
120     void SetTParticle(TParticle *prt){fpx=prt->Px();fpy=prt->Py();
121                                       fpz=prt->Pz();fp=prt->P();fpt=prt->Pt();}
122     void SetPx(Float_t px) {fpx=px;}
123     void SetPy(Float_t py) {fpy=py;}
124     void SetPz(Float_t pz) {fpz=pz;}
125     void SetP(Float_t p) {fp=p;}
126     void SetPt(Float_t pt) {fpt=pt;}
127     void SetParameter(Int_t n,Double_t a) {if(n>=0&&n<10);fpar[n]=a;}
128     void SetChi2(Float_t chi2) {fChi2=chi2;}
129     void SetFunctionNumber(Int_t fn) {ffunc = fn;}
130
131     Int_t GetTrackNumber() {return ftrack;}
132     Int_t GetNumberOfClustersSl() {return fnclust;}
133     Float_t GetPx() {return fpx;}
134     Float_t GetPy() {return fpy;}
135     Float_t GetPz() {return fpz;}
136     Float_t GetP() {return fp;}
137     Float_t GetPt() {return fpt;}
138     Double_t GetParameter(Int_t n) {if(n>=0&&n<10) return fpar[n]; return -1.;}
139     Float_t GetChi2() {return fChi2;}
140     Int_t   GetfunID() {return ffunc;}
141
142     void FitToFunction(Int_t n,AliITSgeom *gm);
143     void func(Double_t *go,Double_t *gi);
144     void func0(Double_t *go,Double_t *gi);
145     void func1(Double_t *go,Double_t *gi);
146     void func2(Double_t *go,Double_t *gi);
147     Int_t FitTrackToLineG();
148     Int_t FitTrackToLineL(AliITSgeom *gm);
149     Int_t FindCircleCenter(Double_t *xc,Double_t *x1,
150                            Double_t *x2,Double_t *x3);
151
152     private:
153     Double_t ComputeChi2();
154
155     ClassDef(AliITSAlignmentTrack,1) // Track class for ITS Alignment
156
157 };
158 #endif