1 #ifndef ALIITSTRACKERUPGRADE_H
2 #define ALIITSTRACKERUPGRADE_H
4 /* Copyright(c) 1998-2003, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
8 ////////////////////////////////////////////////////
9 // ITS Upgrade Stand alone tracker class //
10 // Authors: A.Mastroserio C.Terrevoli //
11 // e-mail:annalisa.mastroserio@cern.ch //
12 // cristina.terrevoli@ba.infn.it //
13 // tracks are saved as AliITStrackV2 objects //
14 ////////////////////////////////////////////////////
18 #include <TClonesArray.h>
19 #include "AliITSRecPointU.h"
20 #include "AliITStrackerMI.h"
21 #include "AliITSlayerUpgrade.h"
22 #include "AliITStrackU.h"
24 class AliITSclusterTable;
26 class AliITSsegmentationUpgrade;
33 class AliITStrackerUpgrade : public AliITStrackerMI {
38 AliITStrackerUpgrade();
39 AliITStrackerUpgrade(Int_t nLay);
40 AliITStrackerUpgrade(const AliITStrackerUpgrade& tracker);
41 virtual ~AliITStrackerUpgrade();
42 virtual Int_t Clusters2Tracks(AliESDEvent *event);
43 Int_t FindTracks(AliESDEvent* event,Bool_t useAllClusters=kFALSE);
44 Int_t PropagateBack(AliESDEvent *event);
45 Int_t CorrectForPipeMaterial(AliITStrackU *t, TString direction="inward");
46 Int_t RefitInward(AliESDEvent *event);
47 AliCluster *GetCluster(Int_t index) const;
49 AliITStrackV2* FitTrack(AliITStrackU* tr,Double_t* primaryVertex,Bool_t onePoint=kFALSE);
50 void StoreTrack(AliITStrackV2 *t,AliESDEvent *event, Bool_t pureSA) /*const*/;
51 Int_t FindTrackLowChiSquare() const;
52 Int_t LoadClusters(TTree *clusTree);
53 void SetVertex(AliESDVertex *vtx){fVert = vtx;}
54 void SetClusterTree(TTree * itscl){fITSclusters = itscl;}
56 void SetOutwardFinding() {fInwardFlag=kFALSE;}
57 void SetInwardFinding() {fInwardFlag=kTRUE;}
58 void SetOuterStartLayer(Int_t osl = 0) {
59 if(osl>(fNLayers-2)) AliWarning("Minimum Number of layers is 2. OuterStartLayer set to Nlayers-2");
60 fOuterStartLayer = TMath::Min(fNLayers-2,osl);
62 Int_t GetOuterStartLayer() const {return fOuterStartLayer;}
63 void SetInnerStartLayer(Int_t isl = 5) {
64 if(isl<1) AliWarning("Minimum Number of layers is 2. InnerStartLayer set to 1");
65 fInnerStartLayer = TMath::Max(1,isl);
67 Int_t GetInnerStartLayer() const {return fInnerStartLayer;}
68 void SetSAFlag(Bool_t fl){fITSStandAlone=fl;} // StandAlone flag setter
69 Bool_t GetSAFlag() const {return fITSStandAlone;} // StandAlone flag gett
70 void SetFixedWindowSizes(Int_t n=46, Double_t *phi=0, Double_t *lam=0);
71 void SetCalculatedWindowSizes(Int_t n=10, Float_t phimin=0.002, Float_t phimax=0.0145, Float_t lambdamin=0.003, Float_t lambdamax=0.008);
72 void UnloadClusters();
73 void SetMinNPoints(Int_t np){fMinNPoints=np;}
74 Int_t GetMinNPoints() const {return fMinNPoints;}
75 void SetMinimumChargeSDDSSD(Float_t minq=0.){fMinQ=minq;}
76 enum {kSAflag=0x8000}; //flag to mark clusters used in the SA tracker
78 void SetNlayers(Int_t nlay) {fNLayers = nlay;}
84 void CreateLayers(Int_t iEvent);
85 void ResetForFinding();
86 void ResetTrackToFollow(const AliITStrackU &t) {
87 fTrackToFollow.~AliITStrackU();
88 Bool_t trackMI = kTRUE;
89 new(&fTrackToFollow) AliITStrackU(t,trackMI);
94 Bool_t SetFirstPoint(Int_t lay, Int_t clu, Double_t* primaryVertex);
95 static Double_t Curvature(Double_t x1,Double_t y1,Double_t x2,Double_t y2,
96 Double_t x3,Double_t y3);
98 Double_t ChoosePoint(Double_t p1, Double_t p2, Double_t pp);
100 static Int_t FindIntersection(Float_t a1, Float_t b1, Float_t c1, Float_t c2,
101 Float_t& x1,Float_t& y1, Float_t& x2, Float_t& y2);
102 static Int_t FindEquation(Float_t x1, Float_t y1, Float_t x2, Float_t y2,
103 Float_t x3, Float_t y3,Float_t& a, Float_t& b,
106 Int_t FindLabel(AliITStrackV2* track) const;
108 Int_t SearchClusters(Int_t layer,Double_t phiwindow,Double_t lambdawindow,
109 AliITStrackU* trs,Double_t zvertex,Int_t flagp);
111 void GetCoorAngles(AliITSRecPointU* cl,Double_t &phi,Double_t &lambda,Double_t &x,Double_t &y,Double_t &z,Double_t* vertex);
112 void GetCoorErrors(AliITSRecPointU* cl,Float_t &sx,Float_t &sy, Float_t &sz);
113 AliITSclusterTable* GetClusterCoord(Int_t layer,Int_t n) const {return (AliITSclusterTable*)fCluCoord[layer]->UncheckedAt(n);}
114 void RemoveClusterCoord(Int_t layer, Int_t n) {fCluCoord[layer]->RemoveAt(n);fCluCoord[layer]->Compress();}
115 Bool_t RefitAtBase(Double_t x, AliITStrackU *track,
116 const Int_t *clusters);
117 Int_t UpdateMI(AliITStrackU* track, const AliITSRecPointU* cl,Double_t chi2,Int_t layer) const;
118 Int_t CorrectForLayerMaterial(AliITStrackU *t, Int_t layerindex, Double_t oldGlobXYZ[3], TString direction="inward");
119 Double_t GetPredictedChi2MI(AliITStrackU* track, const AliITSRecPointU *cluster,Int_t layer);
120 static Int_t GetError(Int_t layer,const AliITSRecPointU *cl,
121 Float_t tgl,Float_t tgphitr,Float_t expQ,
122 Float_t &erry,Float_t &errz,Float_t &covyz,
123 Bool_t addMisalErr=kTRUE);
125 static Int_t GetErrorOrigRecPoint(const AliITSRecPointU*cl,
126 Float_t &erry,Float_t &errz,Float_t &covyz);
127 // static void GetNTeor(Int_t layer,const AliITSRecPointU* cl,
128 // Float_t tgl,Float_t tgphitr,
129 // Float_t &ny,Float_t &nz);
131 static const Int_t fgMaxNLayer = 8; //max number of layers in ITSUpgrade
132 Int_t fNLayers;//number of layer in ITSUpgrade
133 Double_t fPhiEstimate; //Estimation of phi angle on next layer
134 Bool_t fITSStandAlone; //Tracking is performed in the ITS alone if kTRUE
135 Float_t fPoint1[2]; //! coord. of 1-st point to evaluate the curvature
136 Float_t fPoint2[2]; //! coord. of 2-nd point to evaluate the curvature
137 Float_t fPoint3[2]; //! coord. of 3-rd point to evaluate the curvature
138 Float_t fPointc[2]; //! current point coord (for curvature eval.)
139 Double_t fLambdac; //! current value of the Lambda angle in the window
140 Double_t fPhic; //! current value of the Phi angle in the window
141 Float_t fCoef1; //! param. of the equation of the circ. approx a layer
142 Float_t fCoef2; //! param. of the equation of the circ. approx a layer
143 Float_t fCoef3; //! param. of the equation of the circ. approx a layer
144 Int_t fNloop; // Number of iterqations on phi and lambda windows
145 Double_t *fPhiWin; // phi window sizes
146 Double_t *fLambdaWin; // lambda window sizes
147 AliESDVertex *fVert; //! primary vertex
148 AliITSVertexer *fVertexer; //! vertexer
149 TClonesArray *fListOfTracks; //! container for found tracks
150 TClonesArray *fListOfUTracks; //! container for found SA tracks
151 TTree *fITSclusters; //! pointer to ITS tree of clusters
152 Bool_t fInwardFlag; // set to kTRUE for inward track finding
153 Int_t fOuterStartLayer; // Outward search for tracks with <6 points: outer layer to start from
154 Int_t fInnerStartLayer; // Inward search for tracks with <6 points: inner layer to start from
155 Int_t fMinNPoints; // minimum number of clusters for a track
156 Float_t fMinQ; // lower cut on cluster charge (SDD and SSD)
157 AliITStrackU fTrackToFollow;
159 AliITSlayerUpgrade** fLayers;
160 AliITSsegmentationUpgrade *fSegmentation;
162 TClonesArray** fCluLayer; //! array with clusters
163 TClonesArray** fCluCoord; //! array with cluster info
166 AliITStrackerUpgrade &operator=(const AliITStrackerUpgrade &tr);
168 ClassDef(AliITStrackerUpgrade,2)