]>
Commit | Line | Data |
---|---|---|
1 | #ifndef ALITRDTRACKERHLT_H | |
2 | #define ALITRDTRACKERHLT_H | |
3 | ||
4 | /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
5 | * See cxx source for full Copyright notice */ | |
6 | ||
7 | /* $Id$ */ | |
8 | ||
9 | //////////////////////////////////////////////////////////////////////////// | |
10 | // // | |
11 | // The TRD tracker // | |
12 | // // | |
13 | //////////////////////////////////////////////////////////////////////////// | |
14 | ||
15 | #include "AliTracker.h" | |
16 | #include "TObjArray.h" | |
17 | ||
18 | class TFile; | |
19 | class TTree; | |
20 | class TH1D; | |
21 | class TH2D; | |
22 | class TParticle; | |
23 | class TParticlePDG; | |
24 | ||
25 | class AliTRDgeometry; | |
26 | class AliTRDtrack; | |
27 | class AliTRDtracklet; | |
28 | class AliTRDcluster; | |
29 | class AliTRDseed; | |
30 | class AliESDEvent; | |
31 | class TTreeSRedirector; | |
32 | ||
33 | /////////////////////////////////////////////////////////////////////////////// | |
34 | // // | |
35 | // The standard TRD tracker // | |
36 | // Based on Kalman filltering approach // | |
37 | // // | |
38 | /////////////////////////////////////////////////////////////////////////////// | |
39 | ||
40 | namespace AliTRDtrackingHLT { | |
41 | enum { kMaxLayersPerSector = 1000 | |
42 | , kMaxTimeBinIndex = 216 | |
43 | , kMaxClusterPerTimeBin = 2300 | |
44 | , kZones = 5 | |
45 | , kTrackingSectors = 18 }; | |
46 | } | |
47 | ||
48 | class AliTRDpropagationLayerHLT { | |
49 | ||
50 | public: | |
51 | ||
52 | AliTRDpropagationLayerHLT(Double_t x, Double_t dx, Double_t rho | |
53 | , Double_t x0, Int_t tbIndex, Int_t plane); | |
54 | AliTRDpropagationLayerHLT(const AliTRDpropagationLayerHLT &/*p*/); | |
55 | ~AliTRDpropagationLayerHLT() { | |
56 | if (fTimeBinIndex >= 0) { | |
57 | delete[] fClusters; | |
58 | delete[] fIndex; | |
59 | } | |
60 | } | |
61 | AliTRDpropagationLayerHLT &operator=(const AliTRDpropagationLayerHLT &/*p*/) | |
62 | {return *this;} | |
63 | ||
64 | operator Int_t() const {return fN;} | |
65 | AliTRDcluster *operator[](Int_t i) {return fClusters[i];} | |
66 | ||
67 | void SetZmax(Int_t cham, Double_t center, Double_t w) { | |
68 | fZc[cham] = center; | |
69 | fZmax[cham] = w; | |
70 | } | |
71 | void SetYmax(Double_t w, Double_t wsensitive) { | |
72 | fYmax = w; | |
73 | fYmaxSensitive = wsensitive; | |
74 | } | |
75 | ||
76 | void SetZ(Double_t* center, Double_t *w, Double_t *wsensitive); | |
77 | void SetHoles(Bool_t* holes); | |
78 | void SetHole(Double_t Zmax, Double_t Ymax | |
79 | , Double_t rho = 1.29e-3, Double_t x0 = 36.66 | |
80 | , Double_t Yc = 0.0, Double_t Zc = 0.0); | |
81 | ||
82 | Double_t GetYmax() const { return fYmax; } | |
83 | Double_t GetZmax(Int_t c) const { return fZmax[c]; } | |
84 | Double_t GetZc(Int_t c) const { return fZc[c]; } | |
85 | UInt_t GetIndex(Int_t i) const { return fIndex[i]; } | |
86 | Double_t GetX() const { return fX; } | |
87 | Double_t GetdX() const { return fdX; } | |
88 | Int_t GetTimeBinIndex() const { return fTimeBinIndex; } | |
89 | Int_t GetPlane() const { return fPlane; } | |
90 | Bool_t IsHole(Int_t zone) const { return fIsHole[zone]; } | |
91 | Bool_t IsSensitive() const { return (fTimeBinIndex >= 0)? kTRUE : kFALSE;} | |
92 | ||
93 | void Clear() { | |
94 | for (Int_t i = 0; i < fN; i++) fClusters[i] = NULL; | |
95 | fN = 0; | |
96 | } | |
97 | ||
98 | void InsertCluster(AliTRDcluster *c, UInt_t index); | |
99 | Int_t Find(Float_t y) const; | |
100 | Int_t FindNearestCluster(Float_t y, Float_t z, Float_t maxroad, Float_t maxroadz) const; | |
101 | ||
102 | void SetX(Double_t x) {fX = x;} | |
103 | ||
104 | ||
105 | private: | |
106 | ||
107 | Int_t fN; // This is fN | |
108 | Int_t fSec; // Sector mumber | |
109 | AliTRDcluster **fClusters; //! Array of pointers to clusters | |
110 | UInt_t *fIndex; //! Array of cluster indexes | |
111 | Double_t fX; // X coordinate of the middle plane | |
112 | Double_t fdX; // Radial thickness of the time bin | |
113 | Double_t fRho; // Default density of the material | |
114 | Double_t fX0; // Default radiation length | |
115 | Int_t fTimeBinIndex; // Plane * F(local_tb) | |
116 | Int_t fPlane; // Plane number | |
117 | Double_t fZc[AliTRDtrackingHLT::kZones]; // Z position of the center for 5 active areas | |
118 | Double_t fZmax[AliTRDtrackingHLT::kZones]; // Half of active area length in Z | |
119 | Double_t fZmaxSensitive[AliTRDtrackingHLT::kZones]; // Sensitive area for detection Z | |
120 | Bool_t fIsHole[AliTRDtrackingHLT::kZones]; // Is hole in given sector | |
121 | Double_t fYmax; // Half of active area length in Y | |
122 | Double_t fYmaxSensitive; // Half of active area length in Y | |
123 | ||
124 | Bool_t fHole; // kTRUE if there is a hole in the layer | |
125 | Double_t fHoleZc; // Z of the center of the hole | |
126 | Double_t fHoleZmax; // Half of the hole length in Z | |
127 | Double_t fHoleYc; // Y of the center of the hole | |
128 | Double_t fHoleYmax; // Half of the hole length in Y | |
129 | Double_t fHoleRho; // Density of the gas in the hole | |
130 | Double_t fHoleX0; // Radiation length of the gas in the hole | |
131 | ||
132 | }; | |
133 | ||
134 | class AliTRDtrackingSectorHLT { | |
135 | ||
136 | public: | |
137 | ||
138 | AliTRDtrackingSectorHLT(AliTRDgeometry* geo, Int_t gs); | |
139 | AliTRDtrackingSectorHLT(const AliTRDtrackingSectorHLT &/*t*/); | |
140 | ~AliTRDtrackingSectorHLT() { | |
141 | for (Int_t i = 0; i < fN; i++) delete fLayers[i]; | |
142 | } | |
143 | ||
144 | AliTRDtrackingSectorHLT &operator=(const AliTRDtrackingSectorHLT &/*t*/){ return *this;} | |
145 | ||
146 | Int_t GetNumberOfLayers() const { return fN;} | |
147 | Int_t GetNumberOfTimeBins() const; | |
148 | Int_t GetLayerNumber(Double_t x) const; | |
149 | Int_t GetInnerTimeBin() const; | |
150 | Int_t GetOuterTimeBin() const; | |
151 | Int_t GetLayerNumber(Int_t tb) const { return fTimeBinIndex[tb];} | |
152 | Double_t GetX(Int_t pl) const { return fLayers[pl]->GetX();} | |
153 | AliTRDpropagationLayerHLT* GetLayer(Int_t i) { return fLayers[i];} | |
154 | ||
155 | void MapTimeBinLayers(); | |
156 | Int_t Find(Double_t x) const; | |
157 | void InsertLayer(AliTRDpropagationLayerHLT *pl); | |
158 | Int_t CookTimeBinIndex(Int_t plane, Int_t localTB) const; | |
159 | ||
160 | private: | |
161 | ||
162 | Int_t fN; // Total number of layers | |
163 | AliTRDgeometry *fGeom; //! Geometry | |
164 | AliTRDpropagationLayerHLT *fLayers[AliTRDtrackingHLT::kMaxLayersPerSector]; //! Layers | |
165 | Int_t fTimeBinIndex[AliTRDtrackingHLT::kMaxTimeBinIndex]; // Time bin index | |
166 | Int_t fGeomSector; // Sector# in AliTRDgeometry | |
167 | ||
168 | }; | |
169 | ||
170 | class AliTRDtrackerHLT : public AliTracker { | |
171 | ||
172 | // Histograms | |
173 | TH1D *fHBackfit; //! Histogram for back propagation | |
174 | TH1D *fHClSearch; //! Cluster search | |
175 | TH1D *fHRefit; //! | |
176 | ||
177 | TH1D *fHX; //! | |
178 | TH1D *fHNCl; //! | |
179 | TH1D *fHNClTrack; //! | |
180 | TH1D *fHFindCl[4]; //! | |
181 | TH1D *fHMinYPos; //! | |
182 | TH1D *fHMinYNeg; //! | |
183 | TH1D *fHMinZ; //! | |
184 | ||
185 | TH2D *fHMinD; //! | |
186 | TH1D *fHDeltaX; //! | |
187 | ||
188 | TH1D *fHXCl; //! | |
189 | ||
190 | void InitLogHists(); | |
191 | void SaveLogHists(); | |
192 | ||
193 | public: | |
194 | ||
195 | AliTRDtrackerHLT(); | |
196 | AliTRDtrackerHLT(const AliTRDtrackerHLT &t); | |
197 | AliTRDtrackerHLT(const TFile *in); | |
198 | virtual ~AliTRDtrackerHLT(); | |
199 | AliTRDtrackerHLT &operator=(const AliTRDtrackerHLT &/*t*/) { return *this; } | |
200 | ||
201 | void SetAddTRDseeds() { fAddTRDseeds = kTRUE; } | |
202 | void SetNoTilt() { fNoTilt = kTRUE; } | |
203 | ||
204 | Int_t GetTimeBinsPerPlane() const { return fTimeBinsPerPlane; } | |
205 | Double_t GetMaxChi2() const { return fgkMaxChi2; } | |
206 | Float_t GetLabelFraction() const { return fgkLabelFraction; } | |
207 | Float_t GetMinClustersInTrack() const { return fgkMinClustersInTrack; } | |
208 | Int_t GetLastPlane(AliTRDtrack *track); | |
209 | Double_t GetTiltFactor(const AliTRDcluster *c); | |
210 | Bool_t GetTrackPoint(Int_t index, AliTrackPoint& p) const; | |
211 | Double_t GetX(Int_t sec, Int_t plane, Int_t localTB) const; | |
212 | Double_t GetX(Int_t sec, Int_t pl) const { return fTrSec[sec]->GetLayer(pl)->GetX(); } | |
213 | Int_t GetGlobalTimeBin(Int_t sec, Int_t plane, Int_t localTB) const | |
214 | { return fTrSec[sec]->CookTimeBinIndex(plane,localTB); } | |
215 | Double_t GetLayerNumber(Int_t sec, Double_t x) const | |
216 | { return fTrSec[sec]->GetLayerNumber(x); } | |
217 | AliCluster *GetCluster(Int_t index) const { if (index >= fNclusters) return NULL; | |
218 | return (AliCluster *) fClusters->UncheckedAt(index); } | |
219 | ||
220 | static Int_t Freq(Int_t n, const Int_t *inlist, Int_t *outlist, Bool_t down); | |
221 | Int_t Clusters2Tracks(AliESDEvent *event); | |
222 | Int_t PropagateBack(AliESDEvent *event); | |
223 | Int_t RefitInward(AliESDEvent *event); | |
224 | ||
225 | virtual void CookLabel(AliKalmanTrack *t, Float_t wrong) const; | |
226 | ||
227 | Int_t LocalToGlobalID(Int_t lid); | |
228 | Int_t GlobalToLocalID(Int_t gid); | |
229 | Bool_t Transform(AliTRDcluster *cluster); | |
230 | ||
231 | Int_t LoadClusters(TTree *cTree); | |
232 | void UnloadClusters(); | |
233 | virtual void UseClusters(const AliKalmanTrack *t, Int_t from = 0) const; | |
234 | Int_t ReadClusters(TObjArray *array, TTree *in) const; | |
235 | AliTRDcluster *GetCluster(AliTRDtrack *track, Int_t plane, Int_t timebin, UInt_t &index); | |
236 | Int_t FindClusters(Int_t sector, Int_t t0, Int_t t1, AliTRDtrack *track | |
237 | , Int_t *clusters, AliTRDtracklet &tracklet); | |
238 | ||
239 | void MakeSeedsMI(Int_t inner, Int_t outer, AliESDEvent *esd = 0); | |
240 | ||
241 | protected: | |
242 | ||
243 | AliTRDgeometry *fGeom; //! Pointer to TRD geometry | |
244 | AliTRDtrackingSectorHLT *fTrSec[AliTRDtrackingHLT::kTrackingSectors]; //! Array of tracking sectors; | |
245 | Int_t fNclusters; // Number of clusters in TRD | |
246 | TObjArray *fClusters; //! List of clusters for all sectors | |
247 | Int_t fNseeds; // Number of track seeds | |
248 | TObjArray *fSeeds; //! List of track seeds | |
249 | Int_t fNtracks; // Number of reconstructed tracks | |
250 | TObjArray *fTracks; //! List of reconstructed tracks | |
251 | Int_t fTimeBinsPerPlane; // Timebins per plane in track prolongation | |
252 | ||
253 | static const Double_t fgkMaxChi2; // Max increment in track chi2 | |
254 | static const Float_t fgkMinClustersInTrack; // Min number of clusters in track | |
255 | static const Float_t fgkLabelFraction; // Min fraction of same label | |
256 | static const Double_t fgkMaxSnp; // Maximal snp for tracking | |
257 | static const Double_t fgkMaxStep; // Maximal step for tracking | |
258 | ||
259 | Bool_t fAddTRDseeds; // Something else | |
260 | Bool_t fNoTilt; // No tilt, or what? | |
261 | Bool_t fHoles[5][18]; // Holes | |
262 | ||
263 | Bool_t AdjustSector(AliTRDtrack *track); | |
264 | ||
265 | private: | |
266 | ||
267 | AliTRDtrack *RegisterSeed(AliTRDseed *seeds, Double_t *params); | |
268 | ||
269 | Int_t FollowBackProlongation(AliTRDtrack &t); | |
270 | Int_t FollowProlongation(AliTRDtrack &t); | |
271 | void CookdEdxTimBin(AliTRDtrack &t); | |
272 | Int_t PropagateToX(AliTRDtrack &t, Double_t xToGo, Double_t maxStep); | |
273 | Double_t ExpectedSigmaY2(Double_t r, Double_t tgl, Double_t pt) const; | |
274 | Double_t ExpectedSigmaZ2(Double_t r, Double_t tgl) const; | |
275 | ||
276 | TTreeSRedirector *fDebugStreamer; //! Debug streamer | |
277 | ||
278 | ClassDef(AliTRDtrackerHLT,2) // TRD tracker | |
279 | ||
280 | }; | |
281 | ||
282 | #endif |