#ifndef ALITPCTRACKER_H #define ALITPCTRACKER_H /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * * See cxx source for full Copyright notice */ /* $Id$ */ //------------------------------------------------------- // TPC tracker // // Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch //------------------------------------------------------- #include "AliTracker.h" #include "AliTPCtrack.h" #include "AliTPCreco.h" #include "AliTPCcluster.h" class TFile; class TTree; class TBranch; class AliTPCParam; class TObjArray; class TClonesArray; class AliESD; class AliTPCtracker : public AliTracker { public: AliTPCtracker(); AliTPCtracker(const AliTPCParam *par); ~AliTPCtracker(); Int_t ReadSeeds(const TFile *in); Int_t LoadClusters(TTree *c); void UnloadClusters(); AliCluster *GetCluster(Int_t index) const; Int_t Clusters2Tracks(AliESD *event); Int_t PropagateBack(AliESD *event); Int_t RefitInward(AliESD *event); virtual void CookLabel(AliKalmanTrack *t,Float_t wrong) const; public: //**************** Internal tracker class ********************** class AliTPCRow { public: AliTPCRow(): fN(0), fSize(kMaxClusterPerRow/8), fClusterArray(new AliTPCcluster[fSize]), fX(0) {} ~AliTPCRow() {delete[] fClusterArray;} void InsertCluster(const AliTPCcluster *c, Int_t sec, Int_t row); void ResetClusters() {fN=0; delete[] fClusterArray; fClusterArray=0;} operator int() const {return fN;} const AliTPCcluster *operator[](Int_t i) const {return fClusters[i];} const AliTPCcluster *GetUnsortedCluster(Int_t i) const { if ((i < 0) || (i >= fN)) return NULL; return fClusterArray+i; } UInt_t GetIndex(Int_t i) const {return fIndex[i];} Int_t Find(Double_t y) const; void SetX(Double_t x) {fX=x;} Double_t GetX() const {return fX;} private: AliTPCRow(const AliTPCRow& r); //dummy copy constructor AliTPCRow &operator=(const AliTPCRow& r); //dummy assignment operator Int_t fN; //number of clusters const AliTPCcluster *fClusters[kMaxClusterPerRow]; //pointers to clusters Int_t fSize; //size of array of clusters AliTPCcluster *fClusterArray; //array of clusters UInt_t fIndex[kMaxClusterPerRow]; //indeces of clusters Double_t fX; //X-coordinate of this row }; //**************** Internal tracker class ********************** class AliTPCSector { public: AliTPCSector(): fN(0),fRow(0),fAlpha(0),fAlphaShift(0), fPadPitchWidth(0),f1PadPitchLength(0),f2PadPitchLength(0){} ~AliTPCSector() { delete[] fRow; } AliTPCRow& operator[](Int_t i) const { return *(fRow+i); } Int_t GetNRows() const { return fN; } void Setup(const AliTPCParam *par, Int_t flag); Double_t GetX(Int_t l) const {return fRow[l].GetX();} Double_t GetMaxY(Int_t l) const { return GetX(l)*TMath::Tan(0.5*GetAlpha()); } Double_t GetAlpha() const {return fAlpha;} Double_t GetAlphaShift() const {return fAlphaShift;} Int_t GetRowNumber(Double_t x) const { //return pad row number for this x Double_t r; if (fN < 64){ r=fRow[fN-1].GetX(); if (x > r) return fN; r=fRow[0].GetX(); if (x < r) return -1; return Int_t((x-r)/f1PadPitchLength + 0.5);} else{ r=fRow[fN-1].GetX(); if (x > r) return fN; r=fRow[0].GetX(); if (x < r) return -1; Double_t r1=fRow[64].GetX(); if(x