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