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