]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TPC/AliTPCtrackerMI.h
TPC HV dip status
[u/mrichter/AliRoot.git] / TPC / AliTPCtrackerMI.h
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
6
7 /* $Id$ */
8
9 //-------------------------------------------------------
10 //                       TPC tracker
11 //   Parallel tracker 
12 //
13 //   Origin: 
14 //-------------------------------------------------------
15
16 #include <TArrayI.h>
17 #include "AliTracker.h"
18 #include "AliTPCreco.h"
19 #include "AliTPCclusterMI.h"
20 #include "AliTPCtrackerSector.h"
21
22
23 class TFile;
24 class AliTPCParam;
25 class AliTPCseed;
26 class AliTPCTrackerPoint;
27 class AliESDEvent;
28 class AliESDtrack;
29 class TTree;
30 class AliESDkink;
31 class TTreeSRedirector;
32 class AliTrackPoint;
33 class AliClonesPool;
34 class AliDCSSensorArray;
35 class AliDCSSensor;
36
37
38 class AliTPCtrackerMI : public AliTracker {
39 public:
40   AliTPCtrackerMI();
41   AliTPCtrackerMI(const AliTPCParam *par); 
42   virtual ~AliTPCtrackerMI();
43   //
44   void SetIteration(Int_t iteration){fIteration = iteration;}
45   virtual Int_t Clusters2Tracks (AliESDEvent *const esd);
46   virtual Int_t RefitInward (AliESDEvent *esd);
47   virtual Int_t LoadClusters (TTree * const tree);
48   virtual Int_t LoadClusters (const TObjArray * arr); // another input
49   virtual Int_t LoadClusters (const TClonesArray * arr); // another input
50   virtual Int_t PostProcess(AliESDEvent *esd); 
51   Int_t  LoadClusters();
52   void   UnloadClusters();
53   Int_t LoadInnerSectors();
54   Int_t LoadOuterSectors();
55   virtual void FillClusterArray(TObjArray* array) const;
56   void   Transform(AliTPCclusterMI * cluster);
57   //
58   void FillESD(const TObjArray* arr);
59   void DeleteSeeds();
60   void SetDebug(Int_t debug){ fDebug = debug;}
61   void FindKinks(TObjArray * array, AliESDEvent * esd);
62   //
63   void FindCurling(const TObjArray * array, AliESDEvent * esd, Int_t iter);     
64   void FindSplitted(TObjArray * array, AliESDEvent * esd, Int_t iter);       
65   void FindMultiMC(const TObjArray * array, AliESDEvent * esd, Int_t iter);     
66   //
67   void UpdateKinkQualityM(AliTPCseed * seed);
68   void UpdateKinkQualityD(AliTPCseed * seed);
69   Int_t CheckKinkPoint(AliTPCseed*seed, AliTPCseed &mother, AliTPCseed &daughter, const AliESDkink &kink);
70   Int_t RefitKink(AliTPCseed &mother, AliTPCseed &daughter, const AliESDkink &kink);
71    Int_t ReadSeeds(const TFile *in);
72    TObjArray * GetSeeds() const {return fSeeds;}
73    //   
74    AliCluster * GetCluster(Int_t index) const {return (AliCluster*)GetClusterMI(index);}
75    AliTPCclusterMI *GetClusterMI(Int_t index) const;
76    Int_t Clusters2Tracks();
77    virtual void  CookLabel(AliKalmanTrack *tk,Float_t wrong) const; 
78    virtual Int_t   CookLabel(AliTPCseed *const t,Float_t wrong, Int_t first,Int_t last ) const; 
79    
80    void RotateToLocal(AliTPCseed *seed);
81    
82    Int_t FollowProlongation(AliTPCseed& t, Int_t rf=0, Int_t step=1, Bool_t fromSeeds=0);
83    Bool_t GetTrackPoint(Int_t index, AliTrackPoint &p ) const; 
84
85    Int_t FollowBackProlongation(AliTPCseed& t, Int_t rf, Bool_t fromSeeds=0);
86    Int_t FollowToNext(AliTPCseed& t, Int_t nr);
87    Int_t UpdateClusters(AliTPCseed& t,  Int_t nr);
88    Int_t FollowToNextCluster( AliTPCseed& t, Int_t nr);
89
90    Int_t PropagateBack(const TObjArray *const arr);
91    Int_t PropagateBack(AliESDEvent * event);
92    Int_t PropagateBack(AliTPCseed *const pt, Int_t row0, Int_t row1);   
93    Int_t PropagateForward();
94    Int_t PropagateForward2(const TObjArray *const arr);
95
96    void SortTracks(TObjArray * arr, Int_t mode) const;
97   
98    virtual Double_t ErrY2(AliTPCseed* seed, const AliTPCclusterMI * cl = 0);
99    virtual Double_t ErrZ2(AliTPCseed* seed, const AliTPCclusterMI * cl = 0);   
100
101    Double_t F1(Double_t x1,Double_t y1, Double_t x2,Double_t y2, Double_t x3,Double_t y3) const; 
102    Double_t F1old(Double_t x1,Double_t y1, Double_t x2,Double_t y2, Double_t x3,Double_t y3) const; 
103    Double_t F2(Double_t x1,Double_t y1, Double_t x2,Double_t y2, Double_t x3,Double_t y3) const; 
104    Double_t F2old(Double_t x1,Double_t y1, Double_t x2,Double_t y2, Double_t x3,Double_t y3) const; 
105
106    Double_t F3(Double_t x1,Double_t y1, Double_t x2,Double_t y2, Double_t z1,Double_t z2) const; 
107    Double_t F3n(Double_t x1,Double_t y1, Double_t x2,Double_t y2, Double_t z1,Double_t z2, 
108                 Double_t c) const; 
109    Bool_t GetProlongation(Double_t x1, Double_t x2, Double_t x[5], Double_t &y, Double_t &z) const;
110    //
111  public:
112    void SetUseHLTClusters(Int_t useHLTClusters) {fUseHLTClusters = useHLTClusters;} // set usage from HLT clusters from rec.C options
113
114    Float_t OverlapFactor(AliTPCseed * s1, AliTPCseed * s2, Int_t &sum1, Int_t &sum2);
115    void  SignShared(AliTPCseed * s1, AliTPCseed * s2);
116    void  SignShared(TObjArray * arr);
117
118    void  RemoveUsed2(TObjArray * arr, Float_t factor1, Float_t factor2, Int_t minimal);
119
120    Int_t AcceptCluster(AliTPCseed * seed, AliTPCclusterMI * cluster);
121
122    Bool_t IsTPCHVDipEvent(AliESDEvent const *esdEvent);
123
124 private:
125   Bool_t IsFindable(AliTPCseed & t);
126   AliTPCtrackerMI(const AliTPCtrackerMI& r);           //dummy copy constructor
127   AliTPCtrackerMI &operator=(const AliTPCtrackerMI& r);//dummy assignment operator
128   void AddCovariance(AliTPCseed * seed);               // add covariance
129   void AddCovarianceAdd(AliTPCseed * seed);               // add covariance
130
131    inline AliTPCtrackerRow &GetRow(Int_t sec, Int_t row);
132    inline Bool_t     IsActive(Int_t sec, Int_t row);
133    inline Double_t  GetXrow(Int_t row) const;
134    inline Double_t  GetMaxY(Int_t row) const;
135    inline Int_t GetRowNumber(Double_t x) const;
136    Int_t GetRowNumber(Double_t x[3]) const;
137    inline Double_t GetPadPitchLength(Double_t x) const;
138    inline Double_t GetPadPitchLength(Int_t row) const;
139
140     void GetShape(AliTPCseed * seed, Int_t row);
141  
142    void ReadSeeds(const AliESDEvent *const event, Int_t direction);  //read seeds from the event
143
144    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); 
145    void MakeSeeds5(TObjArray * arr, Int_t sec, Int_t i1, Int_t i2, Float_t cuts[4], Float_t deltay = -1);
146
147    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);
148   
149
150    AliTPCseed *MakeSeed(AliTPCseed *const track, Float_t r0, Float_t r1, Float_t r2); //reseed
151    AliTPCseed *ReSeed(const AliTPCseed *t, Float_t r0, Float_t r1, Float_t r2); //reseed
152    AliTPCseed *ReSeed(AliTPCseed *t, Int_t r0, Bool_t forward); //reseed
153
154
155   
156    AliTPCseed * ReSeed(AliTPCseed *t);
157    //Int_t LoadInnerSectors();
158    //Int_t LoadOuterSectors();
159    void DumpClusters(Int_t iter, TObjArray *trackArray);
160    void UnsignClusters();
161    void SignClusters(const TObjArray * arr, Float_t fnumber=3., Float_t fdensity=2.);  
162
163    void ParallelTracking(TObjArray *const arr, Int_t rfirst, Int_t rlast);
164    void Tracking(TObjArray * arr);
165    TObjArray * Tracking(Int_t seedtype, Int_t i1, Int_t i2, Float_t cuts[4], Float_t dy=-1, Int_t dsec=0);
166    TObjArray * Tracking();
167    TObjArray * TrackingSpecial();
168    void SumTracks(TObjArray *arr1,TObjArray *&arr2);
169    void PrepareForBackProlongation(const TObjArray *const arr, Float_t fac) const;
170    void PrepareForProlongation(TObjArray *const arr, Float_t fac) const;
171
172    Int_t UpdateTrack(AliTPCseed *t, Int_t accept); //update trackinfo
173
174    void MakeESDBitmaps(AliTPCseed *t, AliESDtrack *esd);
175
176    const Int_t fkNIS;        //number of inner sectors
177    AliTPCtrackerSector *fInnerSec;  //array of inner sectors;
178    const Int_t fkNOS;        //number of outer sectors
179    AliTPCtrackerSector *fOuterSec;  //array of outer sectors;
180
181    Int_t fN;               //number of loaded sectors
182    AliTPCtrackerSector *fSectors; //pointer to loaded sectors;
183    //
184    TTree * fInput;       // input tree with clusters
185    TTree * fOutput;      // output tree with tracks
186    TTree * fSeedTree;    // output tree with seeds - filled in debug mode 1
187    TTree * fTreeDebug;   // output with a debug information about track
188    AliESDEvent * fEvent;      // output with esd tracks
189    Int_t    fDebug;      // debug option        
190    Bool_t   fNewIO;      // indicated if we have data using New IO 
191    Int_t fNtracks;                     //current number of tracks
192    TObjArray *fSeeds;                  //array of track seeds
193    Int_t fIteration;                   // indicate iteration - 0 - froward -1 back - 2forward - back->forward
194    //   TObjArray * fTrackPointPool;        // ! pool with track points
195    Double_t fXRow[200];                // radius of the pad row
196    Double_t fYMax[200];                // max y for given pad row
197    Double_t fPadLength[200];                // max y for given pad row
198    const AliTPCParam *fkParam;          //pointer to the parameters
199    TTreeSRedirector *fDebugStreamer;     //!debug streamer
200    Int_t  fUseHLTClusters;              // use HLT clusters instead of offline clusters
201    //
202    AliClonesPool* fSeedsPool;            //! pool of seeds. Note: Owned by reconstruction pools (if exist)
203    AliClonesPool* fKinksPool;            //! pool of kinks. Note: Owned by reconstruction pools (if exist)
204
205    //
206    ClassDef(AliTPCtrackerMI,3) 
207 };
208
209
210 AliTPCtrackerRow & AliTPCtrackerMI::GetRow(Int_t sec, Int_t row)
211 {
212   //
213   return (row>=fInnerSec->GetNRows()) ? fOuterSec[sec][row-fInnerSec->GetNRows()]:fInnerSec[sec][row];
214 }
215
216 Bool_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
225 Double_t  AliTPCtrackerMI::GetXrow(Int_t row) const {
226   //  return (row>=fInnerSec->GetNRows()) ? fOuterSec->GetX(row-fInnerSec->GetNRows()):fInnerSec->GetX(row);
227   return fXRow[row];
228 }
229
230 Double_t  AliTPCtrackerMI::GetMaxY(Int_t row) const {
231   //return (row>=fInnerSec->GetNRows()) ? fOuterSec->GetMaxY(row-fInnerSec->GetNRows()):fInnerSec->GetMaxY(row);
232   return fYMax[row];
233 }
234
235 Int_t AliTPCtrackerMI::GetRowNumber(Double_t x) const
236 {
237   //
238   return (x>133.) ? fOuterSec->GetRowNumber(x)+fInnerSec->GetNRows():fInnerSec->GetRowNumber(x);
239 }
240
241 Double_t  AliTPCtrackerMI::GetPadPitchLength(Double_t x) const
242 {
243   //
244   return (x>133.) ? fOuterSec->GetPadPitchLength(x):fInnerSec->GetPadPitchLength(x);
245   //return fPadLength[row];
246 }
247
248 Double_t  AliTPCtrackerMI::GetPadPitchLength(Int_t row) const
249 {
250   //
251   return fPadLength[row];
252 }
253
254
255
256 #endif
257
258