]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TPC/AliTPCtrackerMI.h
New analysis for electron identification
[u/mrichter/AliRoot.git] / TPC / AliTPCtrackerMI.h
CommitLineData
1c53abe2 1#ifndef ALITPCTRACKERMI_H
2#define ALITPCTRACKERMI_H
3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
91162307 6
1c53abe2 7/* $Id$ */
8
9//-------------------------------------------------------
47966a6d 10// TPC tracker
11// Parallel tracker
1c53abe2 12//
13// Origin:
14//-------------------------------------------------------
6d171107 15
81e97e0d 16#include <TError.h>
1c53abe2 17#include "AliTracker.h"
81e97e0d 18#include "AliTPCreco.h"
19#include "AliPID.h"
b9671574 20#include "AliTPCclusterMI.h"
9350f379 21#include "AliTPCtrackerSector.h"
81e97e0d 22
b67e07dc 23
1c53abe2 24class TFile;
25class AliTPCParam;
26class AliTPCseed;
91162307 27class AliTPCTrackerPoint;
af885e0f 28class AliESDEvent;
91162307 29class TTree;
eea478d3 30class AliESDkink;
81e97e0d 31class TTreeSRedirector;
2ccb4dfc 32class AliTrackPoint;
1c53abe2 33
bd26fa83 34
bd26fa83 35
1c53abe2 36class AliTPCtrackerMI : public AliTracker {
37public:
e046d791 38 AliTPCtrackerMI();
d26d9159 39 AliTPCtrackerMI(const AliTPCParam *par);
b67e07dc 40 virtual ~AliTPCtrackerMI();
91162307 41 //
d26d9159 42 void SetIteration(Int_t iteration){fIteration = iteration;}
af885e0f 43 virtual Int_t Clusters2Tracks (AliESDEvent *esd);
44 virtual Int_t RefitInward (AliESDEvent *esd);
d26d9159 45 virtual Int_t LoadClusters (TTree * tree);
47af7ca4 46 virtual Int_t LoadClusters (const TObjArray * arr); // another input
47 virtual Int_t LoadClusters (const TClonesArray * arr); // another input
d26d9159 48 Int_t LoadClusters();
49 void UnloadClusters();
98ee6d31 50 Int_t LoadInnerSectors();
51 Int_t LoadOuterSectors();
002af263 52 virtual void FillClusterArray(TObjArray* array) const;
75fb37cc 53 void Transform(AliTPCclusterMI * cluster);
91162307 54 //
47af7ca4 55 void FillESD(const TObjArray* arr);
91162307 56 void DeleteSeeds();
57 void SetDebug(Int_t debug){ fDebug = debug;}
af885e0f 58 void FindKinks(TObjArray * array, AliESDEvent * esd);
6d493ea0 59 //
47af7ca4 60 void FindCurling(const TObjArray * array, AliESDEvent * esd, Int_t iter);
6d493ea0 61 void FindSplitted(TObjArray * array, AliESDEvent * esd, Int_t iter);
47af7ca4 62 void FindMultiMC(const TObjArray * array, AliESDEvent * esd, Int_t iter);
6d493ea0 63 //
47af7ca4 64 void FindV0s(const TObjArray * array, AliESDEvent * esd);
51ad6848 65 void UpdateKinkQualityM(AliTPCseed * seed);
eea478d3 66 void UpdateKinkQualityD(AliTPCseed * seed);
67 Int_t CheckKinkPoint(AliTPCseed*seed, AliTPCseed &mother, AliTPCseed &daughter, AliESDkink &kink);
68 Int_t RefitKink(AliTPCseed &mother, AliTPCseed &daughter, AliESDkink &kink);
1c53abe2 69 Int_t ReadSeeds(const TFile *in);
47af7ca4 70 TObjArray * GetSeeds() const {return fSeeds;}
91162307 71 //
34acb742 72 AliCluster * GetCluster(Int_t index) const {return (AliCluster*)GetClusterMI(index);}
1c53abe2 73 AliTPCclusterMI *GetClusterMI(Int_t index) const;
f8aae377 74 Int_t Clusters2Tracks();
af32720d 75 virtual void CookLabel(AliKalmanTrack *tk,Float_t wrong) const;
51ad6848 76 virtual Int_t CookLabel(AliTPCseed *t,Float_t wrong, Int_t first,Int_t last ) const;
91162307 77
c9427e08 78 void RotateToLocal(AliTPCseed *seed);
91162307 79
80 Int_t FollowProlongation(AliTPCseed& t, Int_t rf=0, Int_t step=1);
2ccb4dfc 81 Bool_t GetTrackPoint(Int_t index, AliTrackPoint &p ) const;
82
91162307 83 Int_t FollowBackProlongation(AliTPCseed& t, Int_t rf);
84 Int_t FollowToNext(AliTPCseed& t, Int_t nr);
91162307 85 Int_t UpdateClusters(AliTPCseed& t, Int_t nr);
86 Int_t FollowToNextCluster( AliTPCseed& t, Int_t nr);
87
91162307 88 Int_t PropagateBack(TObjArray * arr);
af885e0f 89 Int_t PropagateBack(AliESDEvent * event);
91162307 90 Int_t PropagateBack(AliTPCseed *pt, Int_t row0, Int_t row1);
91 Int_t PropagateForward();
92 Int_t PropagateForward2(TObjArray * arr);
93
47966a6d 94 void SortTracks(TObjArray * arr, Int_t mode) const;
91162307 95
47af7ca4 96 virtual Double_t ErrY2(AliTPCseed* seed, const AliTPCclusterMI * cl = 0);
97 virtual Double_t ErrZ2(AliTPCseed* seed, const AliTPCclusterMI * cl = 0);
1c53abe2 98
47af7ca4 99 Double_t F1(Double_t x1,Double_t y1, Double_t x2,Double_t y2, Double_t x3,Double_t y3) const;
100 Double_t F1old(Double_t x1,Double_t y1, Double_t x2,Double_t y2, Double_t x3,Double_t y3) const;
101 Double_t F2(Double_t x1,Double_t y1, Double_t x2,Double_t y2, Double_t x3,Double_t y3) const;
102 Double_t F2old(Double_t x1,Double_t y1, Double_t x2,Double_t y2, Double_t x3,Double_t y3) const;
91162307 103
47af7ca4 104 Double_t F3(Double_t x1,Double_t y1, Double_t x2,Double_t y2, Double_t z1,Double_t z2) const;
b67e07dc 105 Double_t F3n(Double_t x1,Double_t y1, Double_t x2,Double_t y2, Double_t z1,Double_t z2,
47af7ca4 106 Double_t c) const;
91162307 107 Bool_t GetProlongation(Double_t x1, Double_t x2, Double_t x[5], Double_t &y, Double_t &z);
108
b67e07dc 109 public:
1c53abe2 110
1c53abe2 111
112 Float_t OverlapFactor(AliTPCseed * s1, AliTPCseed * s2, Int_t &sum1, Int_t &sum2);
113 void SignShared(AliTPCseed * s1, AliTPCseed * s2);
91162307 114 void SignShared(TObjArray * arr);
115
51ad6848 116 void RemoveUsed2(TObjArray * arr, Float_t factor1, Float_t factor2, Int_t minimal);
91162307 117
47af7ca4 118 void StopNotActive(const TObjArray * arr, Int_t row0, Float_t th0, Float_t th1, Float_t th2) const;
47966a6d 119 void StopNotActive(AliTPCseed * seed, Int_t row0, Float_t th0, Float_t th1, Float_t th2) const;
00055a22 120 Int_t AcceptCluster(AliTPCseed * seed, AliTPCclusterMI * cluster);
c9427e08 121
1c53abe2 122private:
76d56fd6 123 Bool_t IsFindable(AliTPCseed & t);
6c94f330 124 AliTPCtrackerMI(const AliTPCtrackerMI& r); //dummy copy constructor
125 AliTPCtrackerMI &operator=(const AliTPCtrackerMI& r);//dummy assignment operator
92f513f5 126 void AddCovariance(AliTPCseed * seed); // add covariance
127
bd26fa83 128 inline AliTPCtrackerRow &GetRow(Int_t sec, Int_t row);
5afd7dbd 129 inline Bool_t IsActive(Int_t sec, Int_t row);
47966a6d 130 inline Double_t GetXrow(Int_t row) const;
131 inline Double_t GetMaxY(Int_t row) const;
132 inline Int_t GetRowNumber(Double_t x) const;
eea478d3 133 Int_t GetRowNumber(Double_t x[3]) const;
47966a6d 134 inline Double_t GetPadPitchLength(Double_t x) const;
135 inline Double_t GetPadPitchLength(Int_t row) const;
91162307 136
fd065ea2 137 void GetShape(AliTPCseed * seed, Int_t row);
91162307 138
af885e0f 139 void ReadSeeds(AliESDEvent *event, Int_t direction); //read seeds from the event
1c53abe2 140
91162307 141 void MakeSeeds3(TObjArray * arr, Int_t sec, Int_t i1, Int_t i2, Float_t cuts[4], Float_t deltay = -1, Int_t ddsec=0);
142 void MakeSeeds5(TObjArray * arr, Int_t sec, Int_t i1, Int_t i2, Float_t cuts[4], Float_t deltay = -1);
1627d1c4 143
91162307 144 void MakeSeeds2(TObjArray * arr, Int_t sec, Int_t i1, Int_t i2, Float_t cuts[4], Float_t deltay = -1, Bool_t bconstrain=kTRUE);
145
1c53abe2 146
91162307 147 AliTPCseed *MakeSeed(AliTPCseed *t, Float_t r0, Float_t r1, Float_t r2); //reseed
47af7ca4 148 AliTPCseed *ReSeed(const AliTPCseed *t, Float_t r0, Float_t r1, Float_t r2); //reseed
eea478d3 149 AliTPCseed *ReSeed(AliTPCseed *t, Int_t r0, Bool_t forward); //reseed
91162307 150
151
152
153 AliTPCseed * ReSeed(AliTPCseed *t);
98ee6d31 154 //Int_t LoadInnerSectors();
155 //Int_t LoadOuterSectors();
91162307 156 void UnsignClusters();
47af7ca4 157 void SignClusters(const TObjArray * arr, Float_t fnumber=3., Float_t fdensity=2.);
91162307 158
159 void ParallelTracking(TObjArray * arr, Int_t rfirst, Int_t rlast);
160 void Tracking(TObjArray * arr);
161 TObjArray * Tracking(Int_t seedtype, Int_t i1, Int_t i2, Float_t cuts[4], Float_t dy=-1, Int_t dsec=0);
162 TObjArray * Tracking();
a395b09f 163 TObjArray * TrackingSpecial();
c1ea348f 164 void SumTracks(TObjArray *arr1,TObjArray *&arr2) const;
47966a6d 165 void PrepareForBackProlongation(TObjArray * arr, Float_t fac) const;
166 void PrepareForProlongation(TObjArray * arr, Float_t fac) const;
1c53abe2 167
91162307 168 Int_t UpdateTrack(AliTPCseed *t, Int_t accept); //update trackinfo
1c53abe2 169
19b00333 170 void MakeBitmaps(AliTPCseed *t);
1c53abe2 171
1c53abe2 172 const Int_t fkNIS; //number of inner sectors
9350f379 173 AliTPCtrackerSector *fInnerSec; //array of inner sectors;
1c53abe2 174 const Int_t fkNOS; //number of outer sectors
9350f379 175 AliTPCtrackerSector *fOuterSec; //array of outer sectors;
1c53abe2 176
177 Int_t fN; //number of loaded sectors
9350f379 178 AliTPCtrackerSector *fSectors; //pointer to loaded sectors;
91162307 179 //
180 TTree * fInput; // input tree with clusters
181 TTree * fOutput; // output tree with tracks
182 TTree * fSeedTree; // output tree with seeds - filled in debug mode 1
183 TTree * fTreeDebug; // output with a debug information about track
af885e0f 184 AliESDEvent * fEvent; // output with esd tracks
91162307 185 Int_t fDebug; // debug option
186 Bool_t fNewIO; // indicated if we have data using New IO
1c53abe2 187 Int_t fNtracks; //current number of tracks
188 TObjArray *fSeeds; //array of track seeds
91162307 189 Int_t fIteration; // indicate iteration - 0 - froward -1 back - 2forward - back->forward
1c53abe2 190 // TObjArray * fTrackPointPool; // ! pool with track points
91162307 191 // TObjArray * fSeedPool; //! pool with seeds
192 Double_t fXRow[200]; // radius of the pad row
193 Double_t fYMax[200]; // max y for given pad row
194 Double_t fPadLength[200]; // max y for given pad row
47af7ca4 195 const AliTPCParam *fkParam; //pointer to the parameters
81e97e0d 196 TTreeSRedirector *fDebugStreamer; //!debug streamer
af885e0f 197 ClassDef(AliTPCtrackerMI,2)
1c53abe2 198};
199
91162307 200
bd26fa83 201AliTPCtrackerRow & AliTPCtrackerMI::GetRow(Int_t sec, Int_t row)
91162307 202{
203 //
204 return (row>=fInnerSec->GetNRows()) ? fOuterSec[sec][row-fInnerSec->GetNRows()]:fInnerSec[sec][row];
205}
206
5afd7dbd 207Bool_t AliTPCtrackerMI::IsActive(Int_t sec, Int_t row)
208{
209 //
210 // check if the given sector row is active
211 //
212 return (row>=fInnerSec->GetNRows()) ? fOuterSec[sec][row-fInnerSec->GetNRows()].GetN()>0:fInnerSec[sec][row].GetN()>0;
213}
214
215
47966a6d 216Double_t AliTPCtrackerMI::GetXrow(Int_t row) const {
91162307 217 // return (row>=fInnerSec->GetNRows()) ? fOuterSec->GetX(row-fInnerSec->GetNRows()):fInnerSec->GetX(row);
218 return fXRow[row];
219}
220
47966a6d 221Double_t AliTPCtrackerMI::GetMaxY(Int_t row) const {
91162307 222 //return (row>=fInnerSec->GetNRows()) ? fOuterSec->GetMaxY(row-fInnerSec->GetNRows()):fInnerSec->GetMaxY(row);
223 return fYMax[row];
224}
225
47966a6d 226Int_t AliTPCtrackerMI::GetRowNumber(Double_t x) const
91162307 227{
228 //
229 return (x>133.) ? fOuterSec->GetRowNumber(x)+fInnerSec->GetNRows():fInnerSec->GetRowNumber(x);
230}
231
47966a6d 232Double_t AliTPCtrackerMI::GetPadPitchLength(Double_t x) const
91162307 233{
234 //
235 return (x>133.) ? fOuterSec->GetPadPitchLength(x):fInnerSec->GetPadPitchLength(x);
236 //return fPadLength[row];
237}
238
47966a6d 239Double_t AliTPCtrackerMI::GetPadPitchLength(Int_t row) const
91162307 240{
241 //
242 return fPadLength[row];
243}
244
245
246
1c53abe2 247#endif
248
249