]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITStrackerSA.h
major dielectron update (included also the data and plotting macros for paper)
[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 /* $Id$ */
13
14
15 ////////////////////////////////////////////////////
16 //  Stand alone tracker class                     //
17 //  Origin:  Elisabetta Crescio                   //
18 //  e-mail:  crescio@to.infn.it                   //
19 //  adapted for cosmics by A.Dainese              //
20 ////////////////////////////////////////////////////
21
22 class AliITSclusterTable;
23 class AliITStrackSA;
24 class AliESDVertex;
25 class AliESDEvent;
26 class AliITSVertexer;
27 class TTree;
28 class TArrayD;
29
30 class AliITStrackerSA : public AliITStrackerMI {
31
32
33  public:
34
35   AliITStrackerSA();
36   AliITStrackerSA(const Char_t *geom);
37   AliITStrackerSA(const Char_t *geom,AliESDVertex *vert);
38   AliITStrackerSA(const Char_t *geom,AliITSVertexer *vertexer);
39   virtual ~AliITStrackerSA();  
40   virtual Int_t Clusters2Tracks(AliESDEvent *event);
41   Int_t FindTracks(AliESDEvent* event, Bool_t useAllClusters=kFALSE);
42
43   AliITStrackV2* FitTrack(AliITStrackSA* tr,Double_t* primaryVertex,Bool_t onePoint=kFALSE);
44   void StoreTrack(AliITStrackV2 *t,AliESDEvent *event, Bool_t pureSA) const; 
45   Int_t FindTrackLowChiSquare() const;
46   Int_t LoadClusters(TTree *cf) {Int_t rc=AliITStrackerMI::LoadClusters(cf); SetClusterTree(cf); return rc;}
47   void SetVertex(AliESDVertex *vtx){fVert = vtx;}
48   void SetClusterTree(TTree * itscl){fITSclusters = itscl;}
49
50   void SetOutwardFinding() {fInwardFlag=kFALSE;}
51   void SetInwardFinding() {fInwardFlag=kTRUE;}
52   void SetOuterStartLayer(Int_t osl = 0) {
53     if(osl>(AliITSgeomTGeo::GetNLayers()-2)) AliWarning("Minimum Number of layers is 2. OuterStartLayer set to Nlayers-2");
54     fOuterStartLayer = TMath::Min(AliITSgeomTGeo::GetNLayers()-2,osl);
55   }
56   Int_t GetOuterStartLayer() const {return fOuterStartLayer;}
57   void SetInnerStartLayer(Int_t isl = 5) {
58     if(isl<1) AliWarning("Minimum Number of layers is 2. InnerStartLayer set to 1");
59     fInnerStartLayer = TMath::Max(1,isl);
60   }
61   Int_t GetInnerStartLayer() const {return fInnerStartLayer;}
62
63   void SetSAFlag(Bool_t fl){fITSStandAlone=fl;}  // StandAlone flag setter
64   Bool_t GetSAFlag() const {return fITSStandAlone;} // StandAlone flag getter
65   void SetFixedWindowSizes(Int_t n=46, Double_t *phi=0, Double_t *lam=0);
66   void SetCalculatedWindowSizes(Int_t n=10, Double_t phimin=0.002, Double_t phimax=0.0145, Double_t lambdamin=0.003, Double_t lambdamax=0.008);
67
68   void SetMinNPoints(Int_t np){fMinNPoints=np;}
69   Int_t GetMinNPoints() const {return fMinNPoints;}
70   void SetMinimumChargeSDDSSD(Double_t minq=0.){fMinQ=minq;}
71   enum {kSAflag=0x8000}; //flag to mark clusters used in the SA tracker
72  protected:
73
74   //Initialization
75   void Init();
76   void ResetForFinding();
77   void UpdatePoints();
78   Bool_t SetFirstPoint(Int_t lay, Int_t clu, Double_t* primaryVertex);
79   static Double_t Curvature(Double_t x1,Double_t y1,Double_t x2,Double_t y2,
80                      Double_t x3,Double_t y3);
81
82   Double_t ChoosePoint(Double_t p1, Double_t p2, Double_t pp); 
83
84   static Int_t   FindIntersection(Double_t a1, Double_t b1, Double_t c1, Double_t c2, 
85                            Double_t& x1,Double_t& y1, Double_t& x2, Double_t& y2);
86   static Int_t   FindEquation(Double_t x1, Double_t y1, Double_t x2, Double_t y2, 
87                        Double_t x3, Double_t y3,Double_t& a, Double_t& b, 
88                        Double_t& c);
89  
90   Int_t FindLabel(AliITStrackV2* track);
91   Int_t SearchClusters(Int_t layer,Double_t phiwindow,Double_t lambdawindow, 
92                        AliITStrackSA* trs,Double_t zvertex,Int_t flagp); 
93
94   void GetCoorAngles(AliITSRecPoint* cl,Double_t &phi,Double_t &lambda,Double_t &x,Double_t &y,Double_t &z,Double_t* vertex);
95   void GetCoorErrors(AliITSRecPoint* cl,Double_t &sx,Double_t &sy, Double_t &sz);
96
97   AliITSclusterTable* GetClusterCoord(Int_t layer,Int_t n) const {return (AliITSclusterTable*)fCluCoord[layer]->UncheckedAt(n);}
98   void RemoveClusterCoord(Int_t layer, Int_t n) {fCluCoord[layer]->RemoveAt(n);fCluCoord[layer]->Compress();}
99
100
101   Double_t fPhiEstimate; //Estimation of phi angle on next layer
102   Bool_t fITSStandAlone; //Tracking is performed in the ITS alone if kTRUE
103   Double_t fPoint1[2];   //! coord. of 1-st point to evaluate the curvature
104   Double_t fPoint2[2];   //! coord. of 2-nd point to evaluate the curvature
105   Double_t fPoint3[2];   //! coord. of 3-rd point to evaluate the curvature
106   Double_t fPointc[2];   //! current point coord (for curvature eval.)
107   Double_t fLambdac;    //! current value of the Lambda angle in the window
108   Double_t fPhic;       //! current value of the Phi angle in the window
109   Double_t fCoef1;       //! param. of the equation of the circ. approx a layer
110   Double_t fCoef2;       //! param. of the equation of the circ. approx a layer
111   Double_t fCoef3;       //! param. of the equation of the circ. approx a layer
112   Int_t fNloop;         //  Number of iterqations on phi and lambda windows
113   Double_t *fPhiWin;    // phi window sizes
114   Double_t *fLambdaWin; // lambda window sizes
115   AliESDVertex *fVert;        //! primary vertex
116   AliITSVertexer *fVertexer;  //! vertexer 
117   TClonesArray *fListOfTracks;   //! container for found tracks 
118   TClonesArray *fListOfSATracks; //! container for found SA tracks 
119   TTree *fITSclusters;        //! pointer to ITS tree of clusters
120   Bool_t fInwardFlag;       // set to kTRUE for inward track finding
121   Int_t fOuterStartLayer;     // Outward search for tracks with <6 points: outer layer to start from
122   Int_t fInnerStartLayer;     // Inward search for tracks with <6 points: inner layer to start from
123   Int_t fMinNPoints;        // minimum number of clusters for a track
124   Double_t fMinQ;              // lower cut on cluster charge (SDD and SSD)
125
126   TClonesArray** fCluLayer; //! array with clusters 
127   TClonesArray** fCluCoord; //! array with cluster info
128
129  private:
130   AliITStrackerSA(const AliITStrackerSA& tracker);
131   AliITStrackerSA& operator=(const AliITStrackerSA& source);
132
133   ClassDef(AliITStrackerSA,11)
134 };
135
136 #endif
137
138