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