]>
Commit | Line | Data |
---|---|---|
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" |
9c9d2487 | 9 | #include "AliBarrelTrack.h" |
c630aafd | 10 | #include "AliESD.h" |
46d29e70 | 11 | |
12 | class TFile; | |
c630aafd | 13 | class TTree; |
bbf92647 | 14 | class TParticle; |
15 | class TParticlePDG; | |
46d29e70 | 16 | |
17 | class AliTRDgeometry; | |
5443e65e | 18 | class AliTRDparameter; |
46d29e70 | 19 | class AliTRDtrack; |
5443e65e | 20 | class AliTRDcluster; |
bbf92647 | 21 | class AliTRDmcTrack; |
46d29e70 | 22 | |
5443e65e | 23 | const unsigned kMAX_LAYERS_PER_SECTOR = 1000; |
24 | const unsigned kMAX_TIME_BIN_INDEX = 216; // (30 drift + 6 ampl) * 6 planes | |
b8dc2353 | 25 | const unsigned kMAX_CLUSTER_PER_TIME_BIN = 7000; |
5443e65e | 26 | const unsigned kZONES = 5; |
27 | const Int_t kTRACKING_SECTORS = 18; | |
28 | ||
c630aafd | 29 | class AliTRDtracker : public AliTracker { |
46d29e70 | 30 | |
31 | public: | |
32 | ||
5443e65e | 33 | AliTRDtracker():AliTracker() {} |
34 | AliTRDtracker(const TFile *in); | |
35 | ~AliTRDtracker(); | |
36 | ||
37 | Int_t Clusters2Tracks(const TFile *in, TFile *out); | |
c630aafd | 38 | Int_t Clusters2Tracks(AliESD* event); |
5443e65e | 39 | Int_t PropagateBack(const TFile *in, TFile *out); |
c630aafd | 40 | Int_t PropagateBack(AliESD* event); |
73ae7b59 | 41 | Int_t RefitInward(AliESD* /*event*/) {return 0;} |
9c9d2487 | 42 | |
c630aafd | 43 | Int_t LoadClusters(TTree *cTree); |
44 | void UnloadClusters(){UnloadEvent();} | |
45 | AliCluster *GetCluster(Int_t index) const { if (index >= fNclusters) return NULL; return (AliCluster*) fClusters->UncheckedAt(index); }; | |
5443e65e | 46 | virtual void CookLabel(AliKalmanTrack *t,Float_t wrong) const; |
47 | virtual void UseClusters(const AliKalmanTrack *t, Int_t from=0) const; | |
48 | ||
5443e65e | 49 | void SetAddTRDseeds() { fAddTRDseeds = kTRUE; } |
b8dc2353 | 50 | void SetNoTilt() { fNoTilt = kTRUE; } |
5443e65e | 51 | |
fd621f36 | 52 | Double_t GetTiltFactor(const AliTRDcluster* c); |
53 | ||
5443e65e | 54 | void ReadClusters(TObjArray *array, const Char_t *filename); |
c630aafd | 55 | Int_t ReadClusters(TObjArray *array, TTree *in); |
5443e65e | 56 | Int_t CookSectorIndex(Int_t gs) { return kTRACKING_SECTORS - 1 - gs; } |
57 | ||
58 | ||
c630aafd | 59 | Float_t GetSeedGap() const {return fSeedGap;} |
5443e65e | 60 | Int_t GetMaxGap() const {return fMaxGap;} |
61 | Int_t GetTimeBinsPerPlane() const {return fTimeBinsPerPlane;} | |
c630aafd | 62 | Float_t GetSeedStep() const {return fSeedStep;} |
63 | Float_t GetSeedDepth() const {return fSeedDepth;} | |
64 | Float_t GetSkipDepth() const {return fSkipDepth;} | |
65 | Double_t GetMaxChi2() const {return fMaxChi2;} | |
66 | Float_t GetMaxSeedC() const {return fMaxSeedC;} | |
67 | Float_t GetMaxSeedTan() const {return fMaxSeedTan;} | |
68 | Double_t GetSeedErrorSY() const {return fSeedErrorSY;} | |
69 | Double_t GetSeedErrorSY3() const {return fSeedErrorSY3;} | |
70 | Double_t GetSeedErrorSZ() const {return fSeedErrorSZ;} | |
71 | Float_t GetLabelFraction() const {return fLabelFraction;} | |
72 | Float_t GetWideRoad() const {return fWideRoad;} | |
73 | ||
74 | Float_t GetMinClustersInTrack() const {return fMinClustersInTrack;} | |
75 | Float_t GetMinClustersInSeed() const {return fMinClustersInSeed;} | |
76 | Float_t GetMaxSeedDeltaZ() const {return fMaxSeedDeltaZ;} | |
77 | Float_t GetMaxSeedVertexZ() const {return fMaxSeedVertexZ;} | |
5443e65e | 78 | |
79 | // x <-> timebin conversions useful in analysis macros | |
80 | Double_t GetX(Int_t sec, Int_t plane, Int_t local_tb) const; | |
81 | Double_t GetX(Int_t sec, Int_t pl) const { | |
82 | return fTrSec[sec]->GetLayer(pl)->GetX(); } | |
83 | Int_t GetGlobalTimeBin(Int_t sec, Int_t plane, Int_t local_tb) const { | |
84 | return fTrSec[sec]->CookTimeBinIndex(plane,local_tb); } | |
85 | Double_t GetLayerNumber(Int_t sec, Double_t x) const { | |
86 | return fTrSec[sec]->GetLayerNumber(x); } | |
87 | ||
88 | public: | |
89 | class AliTRDpropagationLayer { | |
90 | // ***************** internal class ******************* | |
91 | public: | |
92 | AliTRDpropagationLayer(Double_t x, Double_t dx, Double_t rho, | |
b8dc2353 | 93 | Double_t x0, Int_t tb_index); |
5443e65e | 94 | |
95 | ~AliTRDpropagationLayer() { | |
96 | if(fTimeBinIndex >= 0) { delete[] fClusters; delete[] fIndex; } | |
97 | } | |
98 | void InsertCluster(AliTRDcluster*, UInt_t); | |
99 | operator Int_t() const {return fN;} | |
100 | AliTRDcluster* operator[](Int_t i) {return fClusters[i];} | |
101 | UInt_t GetIndex(Int_t i) const {return fIndex[i];} | |
102 | Double_t GetX() const { return fX; } | |
103 | Double_t GetdX() const { return fdX; } | |
104 | Double_t GetRho() const { return fRho; } | |
105 | Double_t GetX0() const { return fX0; } | |
106 | Int_t GetTimeBinIndex() const { return fTimeBinIndex; } | |
107 | void GetPropagationParameters(Double_t y, Double_t z, | |
b8dc2353 | 108 | Double_t &dx, Double_t &rho, Double_t &x0, |
5443e65e | 109 | Bool_t &lookForCluster) const; |
110 | Int_t Find(Double_t y) const; | |
111 | void SetZmax(Int_t cham, Double_t center, Double_t w) | |
112 | { fZc[cham] = center; fZmax[cham] = w; } | |
113 | void SetYmax(Double_t w) { fYmax = w; } | |
114 | Double_t GetYmax() const { return fYmax; } | |
115 | Double_t GetZmax(Int_t c) const { return fZmax[c]; } | |
116 | Double_t GetZc(Int_t c) const { return fZc[c]; } | |
117 | ||
118 | void SetHole(Double_t Zmax, Double_t Ymax, | |
b8dc2353 | 119 | Double_t rho = 1.29e-3, Double_t x0 = 36.66, |
120 | Double_t Yc = 0, Double_t Zc = 0); | |
121 | ||
9c9d2487 | 122 | Bool_t IsSensitive() {return (fTimeBinIndex>=0)? kTRUE: kFALSE;} |
123 | ||
5443e65e | 124 | void Clear() {for(Int_t i=0; i<fN; i++) fClusters[i] = NULL; fN = 0;} |
125 | ||
126 | private: | |
127 | ||
128 | Int_t fN; | |
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) | |
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 | |
138 | Double_t fYmax; // half of active area length in Y | |
139 | ||
140 | Bool_t fHole; // kTRUE if there is a hole in the layer | |
141 | Double_t fHoleZc; // Z of the center of the hole | |
142 | Double_t fHoleZmax; // half of the hole length in Z | |
143 | Double_t fHoleYc; // Y of the center of the hole | |
144 | Double_t fHoleYmax; // half of the hole length in Y | |
145 | Double_t fHoleRho; // density of the gas in the hole | |
146 | Double_t fHoleX0; // radiation length of the gas in the hole | |
147 | }; | |
148 | ||
149 | class AliTRDtrackingSector { | |
150 | public: | |
151 | AliTRDtrackingSector(AliTRDgeometry* geo, Int_t gs, AliTRDparameter* par); | |
152 | ~AliTRDtrackingSector() { for(Int_t i=0; i<fN; i++) delete fLayers[i]; } | |
153 | Int_t GetNumberOfLayers() const { return fN; } | |
154 | Int_t GetNumberOfTimeBins() const; | |
155 | Double_t GetX(Int_t pl) const { return fLayers[pl]->GetX(); } | |
156 | void MapTimeBinLayers(); | |
157 | Int_t GetLayerNumber(Double_t x) const; | |
158 | Int_t GetInnerTimeBin() const; | |
159 | Int_t GetOuterTimeBin() const; | |
160 | Int_t GetLayerNumber(Int_t tb) const {return fTimeBinIndex[tb];} | |
161 | Float_t GetTzeroShift() const { return fTzeroShift; } | |
162 | Int_t Find(Double_t x) const; | |
163 | void InsertLayer(AliTRDpropagationLayer* pl); | |
164 | // AliTRDpropagationLayer* operator[](Int_t i) { return fLayers[i]; } | |
165 | AliTRDpropagationLayer* GetLayer(Int_t i) { return fLayers[i]; } | |
166 | Int_t CookTimeBinIndex(Int_t plane, Int_t local_tb) const; | |
167 | ||
168 | private: | |
169 | Int_t fN; // total number of layers | |
170 | AliTRDgeometry *fGeom; | |
171 | AliTRDparameter *fPar; | |
172 | AliTRDpropagationLayer *fLayers[kMAX_LAYERS_PER_SECTOR]; | |
173 | Int_t fTimeBinIndex[kMAX_TIME_BIN_INDEX]; | |
174 | Float_t fTzeroShift; // T0 shift in cm | |
175 | Int_t fGeomSector; // sector # in AliTRDgeometry | |
176 | }; | |
177 | ||
178 | private: | |
179 | ||
180 | void LoadEvent(); | |
181 | void UnloadEvent(); | |
182 | ||
183 | virtual void MakeSeeds(Int_t inner, Int_t outer, Int_t turn); | |
184 | ||
185 | Int_t FollowProlongation(AliTRDtrack& t, Int_t rf); | |
186 | Int_t FollowBackProlongation(AliTRDtrack& t); | |
9c9d2487 | 187 | //Int_t FolowRefitInward(AliTRDtrack *seed, AliTPCtrack *track); |
5443e65e | 188 | |
189 | Int_t PropagateToTPC(AliTRDtrack& t); | |
190 | Int_t PropagateToOuterPlane(AliTRDtrack& t, Double_t x); | |
191 | ||
192 | Int_t WriteTracks(); | |
c630aafd | 193 | void ReadClusters(TObjArray *array, const TFile *in=0); |
5443e65e | 194 | |
195 | void SetSY2corr(Float_t w) {fSY2corr = w;} | |
196 | void SetSZ2corr(Float_t w) {fSZ2corr = w;} | |
197 | Double_t ExpectedSigmaY2(Double_t r, Double_t tgl, Double_t pt); | |
198 | Double_t ExpectedSigmaZ2(Double_t r, Double_t tgl); | |
199 | ||
46d29e70 | 200 | |
201 | protected: | |
202 | ||
5443e65e | 203 | AliTRDgeometry *fGeom; // Pointer to TRD geometry |
204 | AliTRDparameter *fPar; | |
bbf92647 | 205 | |
5443e65e | 206 | AliTRDtrackingSector *fTrSec[kTRACKING_SECTORS]; |
207 | // array of tracking sectors; | |
208 | ||
46d29e70 | 209 | Int_t fNclusters; // Number of clusters in TRD |
210 | TObjArray *fClusters; // List of clusters for all sectors | |
211 | ||
212 | Int_t fNseeds; // Number of track seeds | |
213 | TObjArray *fSeeds; // List of track seeds | |
214 | ||
215 | Int_t fNtracks; // Number of reconstructed tracks | |
216 | TObjArray *fTracks; // List of reconstructed tracks | |
217 | ||
a819a5f7 | 218 | Float_t fSY2corr; // Correction coefficient for |
219 | // cluster SigmaY2 | |
220 | ||
5443e65e | 221 | Float_t fSZ2corr; // Correction coefficient for |
222 | // cluster SigmaZ2 | |
223 | ||
c630aafd | 224 | static const Float_t fSeedGap; // Distance between inner and outer |
0a29d0f1 | 225 | // time bin in seeding |
b8dc2353 | 226 | // (fraction of all time bins) |
bbf92647 | 227 | |
c630aafd | 228 | static const Float_t fSeedStep; // Step in iterations |
229 | static const Float_t fSeedDepth; // Fraction of TRD allocated for seeding | |
230 | static const Float_t fSkipDepth; // Fraction of TRD which can be skipped | |
231 | // in track prolongation | |
5443e65e | 232 | Int_t fTimeBinsPerPlane; // number of sensitive timebins per plane |
233 | Int_t fMaxGap; // max gap (in time bins) in the track | |
c630aafd | 234 | // in track prolongation |
5443e65e | 235 | |
c630aafd | 236 | static const Double_t fMaxChi2; // max increment in track chi2 |
237 | ||
238 | static const Float_t fMinClustersInTrack; // min number of clusters in track | |
5443e65e | 239 | // out of total timebins |
240 | ||
c630aafd | 241 | static const Float_t fMinFractionOfFoundClusters; // min found clusters |
5443e65e | 242 | // out of expected |
243 | ||
c630aafd | 244 | static const Float_t fMinClustersInSeed; // min fraction of clusters in seed |
245 | static const Float_t fMaxSeedDeltaZ; // max dZ in MakeSeeds | |
246 | static const Float_t fMaxSeedDeltaZ12; // max abs(z1-z2) in MakeSeeds | |
247 | static const Float_t fMaxSeedC; // max initial curvature in MakeSeeds | |
248 | static const Float_t fMaxSeedTan; // max initial Tangens(lambda) in MakeSeeds | |
249 | static const Float_t fMaxSeedVertexZ; // max vertex Z in MakeSeeds | |
250 | static const Double_t fSeedErrorSY; // sy parameter in MakeSeeds | |
251 | static const Double_t fSeedErrorSY3; // sy3 parameter in MakeSeeds | |
252 | static const Double_t fSeedErrorSZ; // sz parameter in MakeSeeds | |
253 | static const Float_t fLabelFraction; // min fraction of same label | |
254 | static const Float_t fWideRoad; // max road width in FindProlongation | |
5443e65e | 255 | |
256 | Bool_t fVocal; | |
257 | Bool_t fAddTRDseeds; | |
c630aafd | 258 | |
b8dc2353 | 259 | Bool_t fNoTilt; |
bbf92647 | 260 | |
9c9d2487 | 261 | |
262 | Bool_t AdjustSector(AliTRDtrack *track); | |
263 | ||
264 | ||
265 | // Barrel tracks [SR, 03.04.2003] | |
266 | ||
267 | static const Int_t kFirstPlane; // Id of the first (innermost) reference plane | |
268 | static const Int_t kLastPlane; // Id of the last (outermost) reference plane | |
269 | ||
270 | void SetBarrelTree(const char *mode); | |
271 | void StoreBarrelTrack(AliTRDtrack *ps, Int_t refPlane, Int_t isIn); | |
272 | ||
273 | TFile *fBarrelFile; | |
274 | TTree *fBarrelTree; | |
275 | TClonesArray *fBarrelArray; | |
276 | AliBarrelTrack *fBarrelTrack; | |
277 | ||
278 | ||
46d29e70 | 279 | ClassDef(AliTRDtracker,1) // manager base class |
280 | ||
281 | }; | |
282 | ||
283 | #endif |