]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TRD/AliTRDtracker.h
Removing DISPLAY
[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;
7b580082 12class TParticle;class TParticlePDG;
46d29e70 13
14class AliTRDgeometry;
46d29e70 15class AliTRDtrack;
7ad19338 16class AliTRDtracklet;
5443e65e 17class AliTRDcluster;
75bd7f81 18class AliTRDseed;
b7a0917f 19class AliESD;
7ad19338 20class TTreeSRedirector;
46d29e70 21
75bd7f81 22///////////////////////////////////////////////////////////////////////////////
23// //
24// The standard TRD tracker //
25// Based on Kalman filltering approach //
26// //
27///////////////////////////////////////////////////////////////////////////////
7ad19338 28
c630aafd 29class AliTRDtracker : public AliTracker {
46d29e70 30
31 public:
32
75bd7f81 33 enum { kMaxLayersPerSector = 1000
34 , kMaxTimeBinIndex = 216
77f5b6fc 35 , kMaxClusterPerTimeBin = 2300
75bd7f81 36 , kZones = 5
37 , kTrackingSectors = 18 };
7ad19338 38
89f05372 39 AliTRDtracker();
5443e65e 40 AliTRDtracker(const TFile *in);
029cd327 41 virtual ~AliTRDtracker();
75bd7f81 42
43 static Int_t Freq(Int_t n, const Int_t *inlist, Int_t *outlist, Bool_t down);
c630aafd 44 Int_t Clusters2Tracks(AliESD* event);
c630aafd 45 Int_t PropagateBack(AliESD* event);
1e9bb598 46 Int_t RefitInward(AliESD* event);
75bd7f81 47
59393e34 48 // transformation
49 Int_t LocalToGlobalID(Int_t lid);
50 Int_t GlobalToLocalID(Int_t gid);
51 Bool_t Transform(AliTRDcluster * cluster);
52 //
c630aafd 53 Int_t LoadClusters(TTree *cTree);
b7a0917f 54 void UnloadClusters();
029cd327 55 AliCluster *GetCluster(Int_t index) const { if (index >= fNclusters) return NULL;
56 return (AliCluster*) fClusters->UncheckedAt(index); };
3551db50 57 Bool_t GetTrackPoint(Int_t index, AliTrackPoint& p) const;
5443e65e 58 virtual void CookLabel(AliKalmanTrack *t,Float_t wrong) const;
59 virtual void UseClusters(const AliKalmanTrack *t, Int_t from=0) const;
60
5443e65e 61 void SetAddTRDseeds() { fAddTRDseeds = kTRUE; }
b8dc2353 62 void SetNoTilt() { fNoTilt = kTRUE; }
5443e65e 63
fd621f36 64 Double_t GetTiltFactor(const AliTRDcluster* c);
65
b7a0917f 66 Int_t ReadClusters(TObjArray *array, TTree *in) const;
029cd327 67 Int_t CookSectorIndex(Int_t gs) const { return kTrackingSectors - 1 - gs; }
7ad19338 68 AliTRDcluster * GetCluster(AliTRDtrack * track, Int_t plane, Int_t timebin, UInt_t &index);
3c625a9b 69 Int_t GetLastPlane(AliTRDtrack * track); //return last updated plane
75bd7f81 70 Int_t FindClusters(Int_t sector, Int_t t0, Int_t t1, AliTRDtrack *track
71 , Int_t *clusters, AliTRDtracklet& tracklet);
5443e65e 72
75bd7f81 73 Int_t GetTimeBinsPerPlane() const { return fTimeBinsPerPlane; }
74 Double_t GetMaxChi2() const { return fgkMaxChi2; }
75 Float_t GetLabelFraction() const { return fgkLabelFraction; }
76 Float_t GetMinClustersInTrack() const { return fgkMinClustersInTrack; }
5443e65e 77
78 // x <-> timebin conversions useful in analysis macros
75bd7f81 79 Double_t GetX(Int_t sec, Int_t plane, Int_t localTB) const;
80 Double_t GetX(Int_t sec, Int_t pl) const
81 { return fTrSec[sec]->GetLayer(pl)->GetX(); }
82 Int_t GetGlobalTimeBin(Int_t sec, Int_t plane, Int_t localTB) const
83 { return fTrSec[sec]->CookTimeBinIndex(plane,localTB); }
84 Double_t GetLayerNumber(Int_t sec, Double_t x) const
85 { return fTrSec[sec]->GetLayerNumber(x); }
86
87 protected:
5443e65e 88
029cd327 89 class AliTRDpropagationLayer {
75bd7f81 90
5443e65e 91 // ***************** internal class *******************
92 public:
75bd7f81 93
5443e65e 94 AliTRDpropagationLayer(Double_t x, Double_t dx, Double_t rho,
59393e34 95 Double_t x0, Int_t tbIndex, Int_t plane);
5443e65e 96
75bd7f81 97 ~AliTRDpropagationLayer() { if(fTimeBinIndex >= 0) { delete[] fClusters; delete[] fIndex; }}
98
99 void InsertCluster(AliTRDcluster *c, UInt_t index);
5443e65e 100 operator Int_t() const {return fN;}
101 AliTRDcluster* operator[](Int_t i) {return fClusters[i];}
102 UInt_t GetIndex(Int_t i) const {return fIndex[i];}
103 Double_t GetX() const { return fX; }
104 Double_t GetdX() const { return fdX; }
5443e65e 105 Int_t GetTimeBinIndex() const { return fTimeBinIndex; }
59393e34 106 Int_t GetPlane() const { return fPlane;}
69b55c55 107 Int_t Find(Float_t y) const;
64a6f6e9 108 Int_t FindNearestCluster(Float_t y, Float_t z, Float_t maxroad, Float_t maxroadz) const;
5443e65e 109 void SetZmax(Int_t cham, Double_t center, Double_t w)
110 { fZc[cham] = center; fZmax[cham] = w; }
3c625a9b 111 void SetZ(Double_t* center, Double_t *w, Double_t *wsensitive);
112 void SetHoles(Bool_t* holes);
113 void SetYmax(Double_t w, Double_t wsensitive) { fYmax = w; fYmaxSensitive = wsensitive; }
5443e65e 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
029cd327 122 Bool_t IsSensitive() const {return (fTimeBinIndex>=0)? kTRUE: kFALSE;}
9c9d2487 123
75bd7f81 124 void Clear() {for(Int_t i=0; i<fN; i++) fClusters[i] = NULL; fN = 0;}
125 Bool_t IsHole(Int_t zone) const { return fIsHole[zone];}
126
5443e65e 127 private:
128
75bd7f81 129 Int_t fN; // this is fN
130 Int_t fSec; // sector mumber
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)
138 Int_t fPlane; // plane number
139 Double_t fZc[kZones]; // Z position of the center for 5 active areas
140 Double_t fZmax[kZones]; // half of active area length in Z
141 Double_t fZmaxSensitive[kZones]; // sensitive area for detection Z
142 Bool_t fIsHole[kZones]; // is hole in given sector
143 Double_t fYmax; // half of active area length in Y
144 Double_t fYmaxSensitive; // half of active area length in Y
145
146 Bool_t fHole; // kTRUE if there is a hole in the layer
147 Double_t fHoleZc; // Z of the center of the hole
148 Double_t fHoleZmax; // half of the hole length in Z
149 Double_t fHoleYc; // Y of the center of the hole
150 Double_t fHoleYmax; // half of the hole length in Y
151 Double_t fHoleRho; // density of the gas in the hole
152 Double_t fHoleX0; // radiation length of the gas in the hole
153
154 };
155
156 class AliTRDtrackingSector {
157
5443e65e 158 public:
75bd7f81 159
59393e34 160 AliTRDtrackingSector(AliTRDgeometry* geo, Int_t gs);
5443e65e 161 ~AliTRDtrackingSector() { for(Int_t i=0; i<fN; i++) delete fLayers[i]; }
75bd7f81 162
5443e65e 163 Int_t GetNumberOfLayers() const { return fN; }
164 Int_t GetNumberOfTimeBins() const;
165 Double_t GetX(Int_t pl) const { return fLayers[pl]->GetX(); }
166 void MapTimeBinLayers();
167 Int_t GetLayerNumber(Double_t x) const;
168 Int_t GetInnerTimeBin() const;
169 Int_t GetOuterTimeBin() const;
170 Int_t GetLayerNumber(Int_t tb) const {return fTimeBinIndex[tb];}
5443e65e 171 Int_t Find(Double_t x) const;
172 void InsertLayer(AliTRDpropagationLayer* pl);
75bd7f81 173
5443e65e 174 // AliTRDpropagationLayer* operator[](Int_t i) { return fLayers[i]; }
175 AliTRDpropagationLayer* GetLayer(Int_t i) { return fLayers[i]; }
029cd327 176 Int_t CookTimeBinIndex(Int_t plane, Int_t localTB) const;
5443e65e 177
178 private:
46d29e70 179
75bd7f81 180 Int_t fN; // total number of layers
181 AliTRDgeometry *fGeom; // geometry
182 AliTRDpropagationLayer *fLayers[kMaxLayersPerSector]; // layers
183 Int_t fTimeBinIndex[kMaxTimeBinIndex]; // time bin index
184 Int_t fGeomSector; // sector # in AliTRDgeometry
185
186 };
187
188 AliTRDgeometry *fGeom; // Pointer to TRD geometry
189 AliTRDtrackingSector *fTrSec[kTrackingSectors]; // array of tracking sectors;
190 Int_t fNclusters; // Number of clusters in TRD
191 TObjArray *fClusters; // List of clusters for all sectors
192 Int_t fNseeds; // Number of track seeds
193 TObjArray *fSeeds; // List of track seeds
194 Int_t fNtracks; // Number of reconstructed tracks
195 TObjArray *fTracks; // List of reconstructed tracks
196 Int_t fTimeBinsPerPlane; // timebins per plane in track prolongation
197
198 static const Double_t fgkMaxChi2; // max increment in track chi2
199 static const Float_t fgkMinClustersInTrack; // min number of clusters in track
200 static const Float_t fgkLabelFraction; // min fraction of same label
201 static const Double_t fgkMaxSnp; // maximal snp for tracking
202 static const Double_t fgkMaxStep; // maximal step for tracking
203
204 Bool_t fAddTRDseeds; // Something else
205 Bool_t fNoTilt; // No tilt, or what?
206 Bool_t fHoles[5][18]; // holes
9c9d2487 207
75bd7f81 208 Bool_t AdjustSector(AliTRDtrack *track);
9c9d2487 209
029cd327 210 private:
029cd327 211
75bd7f81 212 AliTRDtrack *RegisterSeed(AliTRDseed *seeds, Double_t *params);
213 void MakeSeedsMI(Int_t inner, Int_t outer, AliESD *esd=0);
029cd327 214
75bd7f81 215 Int_t FollowBackProlongation(AliTRDtrack& t);
216 Int_t FollowProlongation(AliTRDtrack& t);
217 void CookdEdxTimBin(AliTRDtrack& t);
218 Int_t PropagateToX(AliTRDtrack& t, Double_t xToGo, Double_t maxStep);
219 Double_t ExpectedSigmaY2(Double_t r, Double_t tgl, Double_t pt) const;
220 Double_t ExpectedSigmaZ2(Double_t r, Double_t tgl) const;
9c9d2487 221
75bd7f81 222 TTreeSRedirector *fDebugStreamer; //!debug streamer
46d29e70 223
75bd7f81 224 ClassDef(AliTRDtracker,2) // TRD tracker
46d29e70 225
75bd7f81 226};
46d29e70 227#endif