1 #ifndef ALITRDTRACKER_H
2 #define ALITRDTRACKER_H
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
9 ////////////////////////////////////////////////////////////////////////////
13 ////////////////////////////////////////////////////////////////////////////
15 #ifndef ROOT_TObjArray
16 #include "TObjArray.h"
20 #include "AliTracker.h"
23 #ifndef ALITRDPROPAGATIONLAYER_H
24 #include "AliTRDpropagationLayer.h"
33 class TTreeSRedirector;
41 class AliTRDpropagationLayer;
43 ///////////////////////////////////////////////////////////////////////////////
45 // The standard TRD tracker //
46 // Based on Kalman filltering approach //
48 ///////////////////////////////////////////////////////////////////////////////
50 class AliTRDtracker : public AliTracker {
57 enum { kMaxLayersPerSector = 1000
58 , kMaxTimeBinIndex = 216
59 , kTrackingSectors = 18 };
62 AliTRDtracker(const AliTRDtracker &t);
63 AliTRDtracker(const TFile *in);
64 virtual ~AliTRDtracker();
65 AliTRDtracker &operator=(const AliTRDtracker &/*t*/) { return *this; }
67 void SetAddTRDseeds() { fAddTRDseeds = kTRUE; }
68 void SetNoTilt() { fNoTilt = kTRUE; }
70 Int_t GetTimeBinsPerPlane() const { return fTimeBinsPerPlane; }
71 Double_t GetMaxChi2() const { return fgkMaxChi2; }
72 Float_t GetLabelFraction() const { return fgkLabelFraction; }
73 Float_t GetMinClustersInTrack() const { return fgkMinClustersInTrack; }
74 Int_t GetLastPlane(AliTRDtrack *track);
75 Double_t GetTiltFactor(const AliTRDcluster *c);
76 virtual Bool_t GetTrackPoint(Int_t index, AliTrackPoint& p) const;
77 Double_t GetX(Int_t sec, Int_t plane, Int_t localTB) const;
78 Double_t GetX(Int_t sec, Int_t pl) const
79 { return fTrSec[sec]->GetLayer(pl)->GetX(); }
80 Int_t GetGlobalTimeBin(Int_t sec, Int_t plane, Int_t localTB) const
81 { return fTrSec[sec]->CookTimeBinIndex(plane,localTB); }
82 Double_t GetLayerNumber(Int_t sec, Double_t x) const
83 { return fTrSec[sec]->GetLayerNumber(x); }
84 AliCluster *GetCluster(Int_t index) const { if (index >= fNclusters) return NULL;
85 return (AliCluster *) fClusters->UncheckedAt(index); }
87 static Int_t Freq(Int_t n, const Int_t *inlist, Int_t *outlist, Bool_t down);
88 Int_t Clusters2Tracks(AliESDEvent *event);
89 Int_t PropagateBack(AliESDEvent *event);
90 Int_t RefitInward(AliESDEvent *event);
92 virtual void CookLabel(AliKalmanTrack *t, Float_t wrong) const;
94 Int_t LocalToGlobalID(Int_t lid);
95 Int_t GlobalToLocalID(Int_t gid);
97 Int_t LoadClusters(TTree *cTree);
98 void UnloadClusters();
99 virtual void UseClusters(const AliKalmanTrack *t, Int_t from = 0) const;
100 Int_t ReadClusters(TObjArray *array, TTree *in) const;
101 AliTRDcluster *GetCluster(AliTRDtrack *track, Int_t plane, Int_t timebin, UInt_t &index);
102 Int_t FindClusters(Int_t sector, Int_t t0, Int_t t1, AliTRDtrack *track
103 , Int_t *clusters, AliTRDtracklet &tracklet);
107 Bool_t AdjustSector(AliTRDtrack *track);
108 AliTRDtrack *RegisterSeed(AliTRDseed *seeds, Double_t *params);
109 Int_t FollowBackProlongation(AliTRDtrack &t);
110 //void MakeSeedsMI(Int_t inner, Int_t outer, AliESDEvent *esd = 0);
114 //__________________________________________________________________________________________________
115 class AliTRDtrackingSector {
119 AliTRDtrackingSector(AliTRDgeometry* geo, Int_t gs);
120 AliTRDtrackingSector(const AliTRDtrackingSector &/*t*/);
121 ~AliTRDtrackingSector();
123 AliTRDtrackingSector &operator=(const AliTRDtrackingSector &/*t*/) { return *this; }
125 Int_t GetNumberOfLayers() const { return fN; }
126 Int_t GetNumberOfTimeBins() const;
127 Int_t GetLayerNumber(Double_t x) const;
128 Int_t GetInnerTimeBin() const;
129 Int_t GetOuterTimeBin() const;
130 Int_t GetLayerNumber(Int_t tb) const { return fTimeBinIndex[tb]; }
131 Double_t GetX(Int_t pl) const { return fLayers[pl]->GetX(); }
132 AliTRDpropagationLayer* GetLayer(Int_t i) { return fLayers[i]; }
133 Int_t GetSector() const {return fGeomSector;}
135 void MapTimeBinLayers();
136 Int_t Find(Double_t x) const;
137 void InsertLayer(AliTRDpropagationLayer *pl);
138 Int_t CookTimeBinIndex(Int_t plane, Int_t localTB) const;
142 Int_t fN; // Total number of layers
143 AliTRDgeometry *fGeom; // Geometry
144 AliTRDpropagationLayer *fLayers[kMaxLayersPerSector]; // Layers
145 Int_t fTimeBinIndex[kMaxTimeBinIndex]; // Time bin index
146 Int_t fGeomSector; // Sector# in AliTRDgeometry
152 AliTRDgeometry *fGeom; // Pointer to TRD geometry
153 AliTRDtrackingSector *fTrSec[kTrackingSectors]; // Array of tracking sectors;
154 Int_t fNclusters; // Number of clusters in TRD
155 TObjArray *fClusters; // List of clusters for all sectors
156 Int_t fNseeds; // Number of track seeds
157 TObjArray *fSeeds; // List of track seeds
158 Int_t fNtracks; // Number of reconstructed tracks
159 TObjArray *fTracks; // List of reconstructed tracks
160 Int_t fTimeBinsPerPlane; // Timebins per plane in track prolongation
162 static const Double_t fgkMaxChi2; // Max increment in track chi2
163 static const Float_t fgkMinClustersInTrack; // Min number of clusters in track
164 static const Float_t fgkLabelFraction; // Min fraction of same label
165 static const Double_t fgkMaxSnp; // Maximal snp for tracking
166 static const Double_t fgkMaxStep; // Maximal step for tracking
168 Bool_t fAddTRDseeds; // Something else
169 Bool_t fNoTilt; // No tilt, or what?
172 TH1D *fHBackfit; // QA histogram
173 TH1D *fHClSearch; // QA histogram
174 TH1D *fHRefit; // QA histogram
175 TH1D *fHX; // QA histogram
176 TH1D *fHNCl; // QA histogram
177 TH1D *fHNClTrack; // QA histogram
178 TH1D *fHFindCl[4]; // QA histogram
179 TH1D *fHMinYPos; // QA histogram
180 TH1D *fHMinYNeg; // QA histogram
181 TH1D *fHMinZ; // QA histogram
182 TH2D *fHMinD; // QA histogram
183 TH1D *fHDeltaX; // QA histogram
184 TH1D *fHXCl; // QA histogram
188 Int_t FollowProlongation(AliTRDtrack &t);
189 Int_t PropagateToX(AliTRDtrack &t, Double_t xToGo, Double_t maxStep);
190 Double_t ExpectedSigmaY2(Double_t r, Double_t tgl, Double_t pt) const;
191 Double_t ExpectedSigmaZ2(Double_t r, Double_t tgl) const;
194 TTreeSRedirector *fDebugStreamer; //!Debug streamer
196 ClassDef(AliTRDtracker, 4) // TRD tracker