]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TRD/AliTRDtracker.h
added protection
[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
ad670fba 7/* $Id$ */
8
9////////////////////////////////////////////////////////////////////////////
10// //
11// The TRD tracker //
12// //
13////////////////////////////////////////////////////////////////////////////
14
e4f2f73d 15#ifndef ROOT_TObjArray
e24ea474 16#include "TObjArray.h"
e4f2f73d 17#endif
46d29e70 18
e4f2f73d 19#ifndef ALITRACKER_H
0c349049 20#include "AliTracker.h"
e4f2f73d 21#endif
22
23#ifndef ALITRDPROPAGATIONLAYER_H
24#include "AliTRDpropagationLayer.h"
25#endif
0c349049 26
46d29e70 27class TFile;
c630aafd 28class TTree;
7e448bcc 29class TH1D;
30class TH2D;
ad670fba 31class TParticle;
32class TParticlePDG;
0c349049 33class TTreeSRedirector;
46d29e70 34
35class AliTRDgeometry;
46d29e70 36class AliTRDtrack;
7ad19338 37class AliTRDtracklet;
5443e65e 38class AliTRDcluster;
75bd7f81 39class AliTRDseed;
af885e0f 40class AliESDEvent;
e4f2f73d 41class AliTRDpropagationLayer;
46d29e70 42
75bd7f81 43///////////////////////////////////////////////////////////////////////////////
44// //
45// The standard TRD tracker //
46// Based on Kalman filltering approach //
47// //
48///////////////////////////////////////////////////////////////////////////////
7ad19338 49
c630aafd 50class AliTRDtracker : public AliTracker {
46d29e70 51
0c349049 52 public:
53
7e448bcc 54 void InitLogHists();
55 void SaveLogHists();
56
75bd7f81 57 enum { kMaxLayersPerSector = 1000
af26ce80 58 , kMaxTimeBinIndex = 216
af26ce80 59 , kTrackingSectors = 18 };
7e448bcc 60
89f05372 61 AliTRDtracker();
ad670fba 62 AliTRDtracker(const AliTRDtracker &t);
5443e65e 63 AliTRDtracker(const TFile *in);
ad670fba 64 virtual ~AliTRDtracker();
af26ce80 65 AliTRDtracker &operator=(const AliTRDtracker &/*t*/) { return *this; }
7e448bcc 66
af26ce80 67 void SetAddTRDseeds() { fAddTRDseeds = kTRUE; }
68 void SetNoTilt() { fNoTilt = kTRUE; }
7e448bcc 69
af26ce80 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);
0906e73e 76 virtual Bool_t GetTrackPoint(Int_t index, AliTrackPoint& p) const;
af26ce80 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); }
7e448bcc 86
af26ce80 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);
7e448bcc 91
ad670fba 92 virtual void CookLabel(AliKalmanTrack *t, Float_t wrong) const;
7e448bcc 93
af26ce80 94 Int_t LocalToGlobalID(Int_t lid);
95 Int_t GlobalToLocalID(Int_t gid);
5443e65e 96
af26ce80 97 Int_t LoadClusters(TTree *cTree);
98 void UnloadClusters();
ad670fba 99 virtual void UseClusters(const AliKalmanTrack *t, Int_t from = 0) const;
af26ce80 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
e4f2f73d 103 , Int_t *clusters, AliTRDtracklet &tracklet);
7e448bcc 104
75bd7f81 105 protected:
af26ce80 106
e4f2f73d 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);
7e448bcc 111
e4f2f73d 112 protected:
113
0c349049 114 //__________________________________________________________________________________________________
75bd7f81 115 class AliTRDtrackingSector {
7e448bcc 116
5443e65e 117 public:
7e448bcc 118
119 AliTRDtrackingSector(AliTRDgeometry* geo, Int_t gs);
120 AliTRDtrackingSector(const AliTRDtrackingSector &/*t*/);
0c349049 121 ~AliTRDtrackingSector();
7e448bcc 122
0c349049 123 AliTRDtrackingSector &operator=(const AliTRDtrackingSector &/*t*/) { return *this; }
7e448bcc 124
0c349049 125 Int_t GetNumberOfLayers() const { return fN; }
7e448bcc 126 Int_t GetNumberOfTimeBins() const;
127 Int_t GetLayerNumber(Double_t x) const;
128 Int_t GetInnerTimeBin() const;
129 Int_t GetOuterTimeBin() const;
0c349049 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]; }
e4f2f73d 133 Int_t GetSector() const {return fGeomSector;}
7e448bcc 134
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;
139
0c349049 140 private:
7e448bcc 141
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
147
75bd7f81 148 };
9c9d2487 149
e4f2f73d 150 protected:
151
7e448bcc 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
161
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
167
168 Bool_t fAddTRDseeds; // Something else
169 Bool_t fNoTilt; // No tilt, or what?
a4cf6278 170
171 // Histograms
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
e4f2f73d 185
0906e73e 186 protected:
e4f2f73d 187
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;
192
e4f2f73d 193
7e448bcc 194 TTreeSRedirector *fDebugStreamer; //!Debug streamer
195
e4f2f73d 196 ClassDef(AliTRDtracker, 4) // TRD tracker
7e448bcc 197
0c349049 198};
e4f2f73d 199
200
46d29e70 201#endif