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