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