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