]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITStrackerSA.h
Possibility of skipping layers in trackers MI and SA (A. Dainese)
[u/mrichter/AliRoot.git] / ITS / AliITStrackerSA.h
1 #ifndef ALIITSTRACKERSA_H
2 #define ALIITSTRACKERSA_H 
3
4
5
6 #include "AliITSgeomTGeo.h"
7 #include "AliITStrackerMI.h"
8
9 /* Copyright(c) 1998-2003, ALICE Experiment at CERN, All rights reserved. *
10  * See cxx source for full Copyright notice                               */
11
12 ////////////////////////////////////////////////////
13 //  Stand alone tracker class                     //
14 //  Origin:  Elisabetta Crescio                   //
15 //  e-mail:  crescio@to.infn.it                   //
16 //  adapted for cosmics by A.Dainese              //
17 ////////////////////////////////////////////////////
18
19 class AliITSclusterTable;
20 class AliITStrackSA;
21 class AliESDVertex;
22 class AliESDEvent;
23 class AliITSVertexer;
24 class TTree;
25 class TArrayD;
26
27 class AliITStrackerSA : public AliITStrackerMI {
28
29
30  public:
31
32   AliITStrackerSA();
33   AliITStrackerSA(const Char_t *geom);
34   AliITStrackerSA(const Char_t *geom,AliESDVertex *vert);
35   AliITStrackerSA(const Char_t *geom,AliITSVertexer *vertexer);
36   AliITStrackerSA(const AliITStrackerSA& tracker);
37   AliITStrackerSA& operator=(const AliITStrackerSA& source);
38   virtual ~AliITStrackerSA();  
39   virtual Int_t Clusters2Tracks(AliESDEvent *event);
40   Int_t FindTracks(AliESDEvent* event);
41
42   AliITStrackV2* FitTrack(AliITStrackSA* tr,Double_t* primaryVertex);
43   AliITStrackV2* FitShortTrack(AliITStrackSA* tr,Double_t *primaryVertex,
44                                Int_t innLay);
45   AliITStrackV2* FitJumpyTrack(AliITStrackSA* tr,Double_t *primaryVertex);
46   Int_t FindTrackLowChiSquare(TObjArray* tracklist, Int_t dim) const;
47   Int_t LoadClusters(TTree *cf) {Int_t rc=AliITStrackerMI::LoadClusters(cf); SetClusterTree(cf); SetSixPoints(kTRUE); return rc;}
48   void SetVertex(AliESDVertex *vtx){fVert = vtx;}
49   void SetClusterTree(TTree * itscl){fITSclusters = itscl;}
50   void SetSixPoints(Bool_t sp = kFALSE){fSixPoints = sp;}
51   Bool_t GetSixPoints() const {return fSixPoints;}
52   void SetOuterStartLayer(Int_t osl = 0) {if(osl>(AliITSgeomTGeo::GetNLayers()-2)) osl=AliITSgeomTGeo::GetNLayers()-2; fOuterStartLayer = osl;}
53   Int_t GetOuterStartLayer() const {return fOuterStartLayer;}
54   void SetSAFlag(Bool_t fl){fITSStandAlone=fl;}  // StandAlone flag setter
55   Bool_t GetSAFlag() const {return fITSStandAlone;} // StandAlone flag getter
56   void SetWindowSizes(Int_t n=46, Double_t *phi=0, Double_t *lam=0);
57
58   enum {kSAflag=0x8000}; //flag to mark clusters used in the SA tracker
59
60  protected:
61
62   //Initialization
63   void Init();
64   void ResetForFinding();
65   void UpdatePoints();
66
67   static Double_t Curvature(Double_t x1,Double_t y1,Double_t x2,Double_t y2,
68                      Double_t x3,Double_t y3);
69
70   Double_t ChoosePoint(Double_t p1, Double_t p2, Double_t pp); 
71
72   static Int_t   FindIntersection(Float_t a1, Float_t b1, Float_t c1, Float_t c2, 
73                            Float_t& x1,Float_t& y1, Float_t& x2, Float_t& y2);
74   static Int_t   FindEquation(Float_t x1, Float_t y1, Float_t x2, Float_t y2, 
75                        Float_t x3, Float_t y3,Float_t& a, Float_t& b, 
76                        Float_t& c);
77  
78   static Int_t FindLabel(Int_t l1, Int_t l2, Int_t l3, Int_t l4, Int_t l5, Int_t l6);
79   static Int_t Label(Int_t gl1, Int_t gl2, Int_t gl3, Int_t gl4, Int_t gl5, 
80               Int_t gl6,Int_t gl7, Int_t gl8, Int_t gl9, Int_t gl10,Int_t gl11,
81               Int_t gl12, Int_t gl13, Int_t gl14,Int_t gl15, Int_t gl16, 
82               Int_t gl17, Int_t gl18, Int_t numberofpoints=6);
83  
84   Int_t SearchClusters(Int_t layer,Double_t phiwindow,Double_t lambdawindow, 
85                        AliITStrackSA* trs,Double_t zvertex,Int_t flagp); 
86
87   void GetCoorAngles(AliITSRecPoint* cl,Double_t &phi,Double_t &lambda,Float_t &x,Float_t &y,Float_t &z,Double_t* vertex);
88   void GetCoorErrors(AliITSRecPoint* cl,Float_t &sx,Float_t &sy, Float_t &sz);
89
90   AliITSclusterTable* GetClusterCoord(Int_t layer,Int_t n) const {return (AliITSclusterTable*)fCluCoord[layer]->UncheckedAt(n);}
91   void RemoveClusterCoord(Int_t layer, Int_t n) {fCluCoord[layer]->RemoveAt(n);fCluCoord[layer]->Compress();}
92
93
94   Double_t fPhiEstimate; //Estimation of phi angle on next layer
95   Bool_t fITSStandAlone; //Tracking is performed in the ITS alone if kTRUE
96   Float_t fPoint1[2];   //! coord. of 1-st point to evaluate the curvature
97   Float_t fPoint2[2];   //! coord. of 2-nd point to evaluate the curvature
98   Float_t fPoint3[2];   //! coord. of 3-rd point to evaluate the curvature
99   Float_t fPointc[2];   //! current point coord (for curvature eval.)
100   Double_t fLambdac;    //! current value of the Lambda angle in the window
101   Double_t fPhic;       //! current value of the Phi angle in the window
102   Float_t fCoef1;       //! param. of the equation of the circ. approx a layer
103   Float_t fCoef2;       //! param. of the equation of the circ. approx a layer
104   Float_t fCoef3;       //! param. of the equation of the circ. approx a layer
105   Int_t fNloop;         //  Number of iterqations on phi and lambda windows
106   Double_t *fPhiWin;    // phi window sizes
107   Double_t *fLambdaWin; // lambda window sizes
108   AliESDVertex *fVert;        //! primary vertex
109   AliITSVertexer *fVertexer;  //! vertexer 
110   TObjArray *fListOfTracks;   //! container for found tracks 
111   TTree *fITSclusters;        //! pointer to ITS tree of clusters
112   Bool_t fSixPoints;          // If true 6/6 points are required (default). 5/6 otherwise
113   Int_t fOuterStartLayer;     // Search for tracks with <6 points: outer layer to start from
114
115   TClonesArray** fCluLayer; //! array with clusters 
116   TClonesArray** fCluCoord; //! array with cluster info
117
118   ClassDef(AliITStrackerSA,6)
119 };
120
121 #endif
122