]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TRD/AliTRDtracker.h
Removing AliBarrelTrack class (Yu.Belikov)
[u/mrichter/AliRoot.git] / TRD / AliTRDtracker.h
CommitLineData
46d29e70 1#ifndef ALITRDTRACKER_H
2#define ALITRDTRACKER_H
3
4/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
6
5443e65e 7#include "AliTracker.h"
e24ea474 8#include "TObjArray.h"
46d29e70 9
10class TFile;
c630aafd 11class TTree;
bbf92647 12class TParticle;
13class TParticlePDG;
46d29e70 14
15class AliTRDgeometry;
5443e65e 16class AliTRDparameter;
46d29e70 17class AliTRDtrack;
5443e65e 18class AliTRDcluster;
b7a0917f 19class AliESD;
46d29e70 20
029cd327 21const unsigned kMaxLayersPerSector = 1000;
22const unsigned kMaxTimeBinIndex = 216; // (30 drift + 6 ampl) * 6 planes
23const unsigned kMaxClusterPerTimeBin = 7000;
24const unsigned kZones = 5;
25const Int_t kTrackingSectors = 18;
5443e65e 26
c630aafd 27class AliTRDtracker : public AliTracker {
46d29e70 28
29 public:
30
89f05372 31 AliTRDtracker();
5443e65e 32 AliTRDtracker(const TFile *in);
029cd327 33 virtual ~AliTRDtracker();
5443e65e 34
c630aafd 35 Int_t Clusters2Tracks(AliESD* event);
c630aafd 36 Int_t PropagateBack(AliESD* event);
1e9bb598 37 Int_t RefitInward(AliESD* event);
9c9d2487 38
c630aafd 39 Int_t LoadClusters(TTree *cTree);
b7a0917f 40 void UnloadClusters();
029cd327 41 AliCluster *GetCluster(Int_t index) const { if (index >= fNclusters) return NULL;
42 return (AliCluster*) fClusters->UncheckedAt(index); };
5443e65e 43 virtual void CookLabel(AliKalmanTrack *t,Float_t wrong) const;
44 virtual void UseClusters(const AliKalmanTrack *t, Int_t from=0) const;
45
5443e65e 46 void SetAddTRDseeds() { fAddTRDseeds = kTRUE; }
b8dc2353 47 void SetNoTilt() { fNoTilt = kTRUE; }
5443e65e 48
fd621f36 49 Double_t GetTiltFactor(const AliTRDcluster* c);
50
b7a0917f 51 Int_t ReadClusters(TObjArray *array, TTree *in) const;
029cd327 52 Int_t CookSectorIndex(Int_t gs) const { return kTrackingSectors - 1 - gs; }
46e2d86c 53 AliTRDcluster * GetCluster(AliTRDtrack * track, Int_t plane, Int_t timebin);
3c625a9b 54 Int_t GetLastPlane(AliTRDtrack * track); //return last updated plane
5443e65e 55
029cd327 56 Float_t GetSeedGap() const {return fgkSeedGap;}
5443e65e 57 Int_t GetMaxGap() const {return fMaxGap;}
58 Int_t GetTimeBinsPerPlane() const {return fTimeBinsPerPlane;}
029cd327 59 Float_t GetSeedStep() const {return fgkSeedStep;}
60 Float_t GetSeedDepth() const {return fgkSeedDepth;}
61 Float_t GetSkipDepth() const {return fgkSkipDepth;}
62 Double_t GetMaxChi2() const {return fgkMaxChi2;}
63 Float_t GetMaxSeedC() const {return fgkMaxSeedC;}
64 Float_t GetMaxSeedTan() const {return fgkMaxSeedTan;}
65 Double_t GetSeedErrorSY() const {return fgkSeedErrorSY;}
66 Double_t GetSeedErrorSY3() const {return fgkSeedErrorSY3;}
67 Double_t GetSeedErrorSZ() const {return fgkSeedErrorSZ;}
68 Float_t GetLabelFraction() const {return fgkLabelFraction;}
69 Float_t GetWideRoad() const {return fgkWideRoad;}
70
71 Float_t GetMinClustersInTrack() const {return fgkMinClustersInTrack;}
72 Float_t GetMinClustersInSeed() const {return fgkMinClustersInSeed;}
73 Float_t GetMaxSeedDeltaZ() const {return fgkMaxSeedDeltaZ;}
74 Float_t GetMaxSeedVertexZ() const {return fgkMaxSeedVertexZ;}
5443e65e 75
76 // x <-> timebin conversions useful in analysis macros
029cd327 77 Double_t GetX(Int_t sec, Int_t plane, Int_t localTB) const;
5443e65e 78 Double_t GetX(Int_t sec, Int_t pl) const {
79 return fTrSec[sec]->GetLayer(pl)->GetX(); }
029cd327 80 Int_t GetGlobalTimeBin(Int_t sec, Int_t plane, Int_t localTB) const {
81 return fTrSec[sec]->CookTimeBinIndex(plane,localTB); }
5443e65e 82 Double_t GetLayerNumber(Int_t sec, Double_t x) const {
83 return fTrSec[sec]->GetLayerNumber(x); }
84
029cd327 85 class AliTRDpropagationLayer {
5443e65e 86 // ***************** internal class *******************
87 public:
88 AliTRDpropagationLayer(Double_t x, Double_t dx, Double_t rho,
029cd327 89 Double_t x0, Int_t tbIndex);
5443e65e 90
91 ~AliTRDpropagationLayer() {
92 if(fTimeBinIndex >= 0) { delete[] fClusters; delete[] fIndex; }
93 }
029cd327 94 void InsertCluster(AliTRDcluster *c, UInt_t index);
5443e65e 95 operator Int_t() const {return fN;}
96 AliTRDcluster* operator[](Int_t i) {return fClusters[i];}
97 UInt_t GetIndex(Int_t i) const {return fIndex[i];}
98 Double_t GetX() const { return fX; }
99 Double_t GetdX() const { return fdX; }
100 Double_t GetRho() const { return fRho; }
101 Double_t GetX0() const { return fX0; }
102 Int_t GetTimeBinIndex() const { return fTimeBinIndex; }
103 void GetPropagationParameters(Double_t y, Double_t z,
b8dc2353 104 Double_t &dx, Double_t &rho, Double_t &x0,
5443e65e 105 Bool_t &lookForCluster) const;
3c625a9b 106 Int_t GetZone( Double_t z) const;
5443e65e 107 Int_t Find(Double_t y) const;
108 void SetZmax(Int_t cham, Double_t center, Double_t w)
109 { fZc[cham] = center; fZmax[cham] = w; }
3c625a9b 110 void SetZ(Double_t* center, Double_t *w, Double_t *wsensitive);
111 void SetHoles(Bool_t* holes);
112 void SetYmax(Double_t w, Double_t wsensitive) { fYmax = w; fYmaxSensitive = wsensitive; }
5443e65e 113 Double_t GetYmax() const { return fYmax; }
114 Double_t GetZmax(Int_t c) const { return fZmax[c]; }
115 Double_t GetZc(Int_t c) const { return fZc[c]; }
116
117 void SetHole(Double_t Zmax, Double_t Ymax,
b8dc2353 118 Double_t rho = 1.29e-3, Double_t x0 = 36.66,
119 Double_t Yc = 0, Double_t Zc = 0);
120
029cd327 121 Bool_t IsSensitive() const {return (fTimeBinIndex>=0)? kTRUE: kFALSE;}
9c9d2487 122
5443e65e 123 void Clear() {for(Int_t i=0; i<fN; i++) fClusters[i] = NULL; fN = 0;}
3c625a9b 124 Bool_t IsHole(Int_t zone) const { return fIsHole[zone];}
5443e65e 125 private:
126
029cd327 127 Int_t fN; // this is fN
3c625a9b 128 Int_t fSec; // sector mumber
5443e65e 129 AliTRDcluster **fClusters; // array of pointers to clusters
130 UInt_t *fIndex; // array of cluster indexes
131 Double_t fX; // x coordinate of the middle plane
132 Double_t fdX; // radial thickness of the time bin
133 Double_t fRho; // default density of the material
134 Double_t fX0; // default radiation length
135 Int_t fTimeBinIndex; // plane * F(local_tb)
029cd327 136 Double_t fZc[kZones]; // Z position of the center for 5 active areas
137 Double_t fZmax[kZones]; // half of active area length in Z
3c625a9b 138 Double_t fZmaxSensitive[kZones]; //sensitive area for detection Z
139 Bool_t fIsHole[kZones]; //is hole in given sector
5443e65e 140 Double_t fYmax; // half of active area length in Y
3c625a9b 141 Double_t fYmaxSensitive; // half of active area length in Y
5443e65e 142
143 Bool_t fHole; // kTRUE if there is a hole in the layer
144 Double_t fHoleZc; // Z of the center of the hole
145 Double_t fHoleZmax; // half of the hole length in Z
146 Double_t fHoleYc; // Y of the center of the hole
147 Double_t fHoleYmax; // half of the hole length in Y
148 Double_t fHoleRho; // density of the gas in the hole
149 Double_t fHoleX0; // radiation length of the gas in the hole
150 };
151
152 class AliTRDtrackingSector {
153 public:
154 AliTRDtrackingSector(AliTRDgeometry* geo, Int_t gs, AliTRDparameter* par);
155 ~AliTRDtrackingSector() { for(Int_t i=0; i<fN; i++) delete fLayers[i]; }
156 Int_t GetNumberOfLayers() const { return fN; }
157 Int_t GetNumberOfTimeBins() const;
158 Double_t GetX(Int_t pl) const { return fLayers[pl]->GetX(); }
159 void MapTimeBinLayers();
160 Int_t GetLayerNumber(Double_t x) const;
161 Int_t GetInnerTimeBin() const;
162 Int_t GetOuterTimeBin() const;
163 Int_t GetLayerNumber(Int_t tb) const {return fTimeBinIndex[tb];}
164 Float_t GetTzeroShift() const { return fTzeroShift; }
165 Int_t Find(Double_t x) const;
166 void InsertLayer(AliTRDpropagationLayer* pl);
167 // AliTRDpropagationLayer* operator[](Int_t i) { return fLayers[i]; }
168 AliTRDpropagationLayer* GetLayer(Int_t i) { return fLayers[i]; }
029cd327 169 Int_t CookTimeBinIndex(Int_t plane, Int_t localTB) const;
5443e65e 170
171 private:
172 Int_t fN; // total number of layers
029cd327 173 AliTRDgeometry *fGeom; // geometry
174 AliTRDparameter *fPar; // parameter
175 AliTRDpropagationLayer *fLayers[kMaxLayersPerSector]; // layers
176 Int_t fTimeBinIndex[kMaxTimeBinIndex]; // time bin index
5443e65e 177 Float_t fTzeroShift; // T0 shift in cm
178 Int_t fGeomSector; // sector # in AliTRDgeometry
179 };
180
46d29e70 181 protected:
182
5443e65e 183 AliTRDgeometry *fGeom; // Pointer to TRD geometry
029cd327 184 AliTRDparameter *fPar; // Pointer to TRD parameter
bbf92647 185
029cd327 186 AliTRDtrackingSector *fTrSec[kTrackingSectors]; // array of tracking sectors;
46d29e70 187 Int_t fNclusters; // Number of clusters in TRD
188 TObjArray *fClusters; // List of clusters for all sectors
189
190 Int_t fNseeds; // Number of track seeds
191 TObjArray *fSeeds; // List of track seeds
192
193 Int_t fNtracks; // Number of reconstructed tracks
194 TObjArray *fTracks; // List of reconstructed tracks
195
a819a5f7 196 Float_t fSY2corr; // Correction coefficient for
197 // cluster SigmaY2
198
5443e65e 199 Float_t fSZ2corr; // Correction coefficient for
200 // cluster SigmaZ2
201
029cd327 202 static const Float_t fgkSeedGap; // Distance between inner and outer
0a29d0f1 203 // time bin in seeding
b8dc2353 204 // (fraction of all time bins)
bbf92647 205
029cd327 206 static const Float_t fgkSeedStep; // Step in iterations
207 static const Float_t fgkSeedDepth; // Fraction of TRD allocated for seeding
208 static const Float_t fgkSkipDepth; // Fraction of TRD which can be skipped
c630aafd 209 // in track prolongation
5443e65e 210 Int_t fTimeBinsPerPlane; // number of sensitive timebins per plane
211 Int_t fMaxGap; // max gap (in time bins) in the track
c630aafd 212 // in track prolongation
5443e65e 213
029cd327 214 static const Double_t fgkMaxChi2; // max increment in track chi2
c630aafd 215
029cd327 216 static const Float_t fgkMinClustersInTrack; // min number of clusters in track
217 // out of total timebins
218
219 static const Float_t fgkMinFractionOfFoundClusters; // min found clusters
220 // out of expected
221
222 static const Float_t fgkMinClustersInSeed; // min fraction of clusters in seed
223 static const Float_t fgkMaxSeedDeltaZ; // max dZ in MakeSeeds
224 static const Float_t fgkMaxSeedDeltaZ12; // max abs(z1-z2) in MakeSeeds
225 static const Float_t fgkMaxSeedC; // max initial curvature in MakeSeeds
226 static const Float_t fgkMaxSeedTan; // max initial Tangens(lambda) in MakeSeeds
227 static const Float_t fgkMaxSeedVertexZ; // max vertex Z in MakeSeeds
228 static const Double_t fgkSeedErrorSY; // sy parameter in MakeSeeds
229 static const Double_t fgkSeedErrorSY3; // sy3 parameter in MakeSeeds
230 static const Double_t fgkSeedErrorSZ; // sz parameter in MakeSeeds
231 static const Float_t fgkLabelFraction; // min fraction of same label
232 static const Float_t fgkWideRoad; // max road width in FindProlongation
233
234 Bool_t fVocal; // Whatever...
235 Bool_t fAddTRDseeds; // Something else
236
237 Bool_t fNoTilt; // No tilt, or what?
3c625a9b 238 Bool_t fHoles[5][18]; // holes
9c9d2487 239
240 Bool_t AdjustSector(AliTRDtrack *track);
241
242
243 // Barrel tracks [SR, 03.04.2003]
244
029cd327 245 static const Int_t fgkFirstPlane; // Id of the first (innermost) reference plane
246 static const Int_t fgkLastPlane; // Id of the last (outermost) reference plane
029cd327 247
248 private:
249
029cd327 250 virtual void MakeSeeds(Int_t inner, Int_t outer, Int_t turn);
251
252 Int_t FollowProlongation(AliTRDtrack& t, Int_t rf);
253 Int_t FollowBackProlongation(AliTRDtrack& t);
1e9bb598 254 Int_t Refit(AliTRDtrack& t, Int_t rf);
eab5961e 255 void CookdEdxTimBin(AliTRDtrack& t);
029cd327 256
257 Int_t PropagateToTPC(AliTRDtrack& t);
258 Int_t PropagateToOuterPlane(AliTRDtrack& t, Double_t x);
9c9d2487 259
029cd327 260 void SetSY2corr(Float_t w) {fSY2corr = w;}
261 void SetSZ2corr(Float_t w) {fSZ2corr = w;}
262 Double_t ExpectedSigmaY2(Double_t r, Double_t tgl, Double_t pt) const;
263 Double_t ExpectedSigmaZ2(Double_t r, Double_t tgl) const;
9c9d2487 264
24de2d6d 265 ClassDef(AliTRDtracker,2) // manager base class
46d29e70 266
267};
268
269#endif