]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliESDtrack.h
Transient pointer of ESDtrack back to the event introduced.
[u/mrichter/AliRoot.git] / STEER / AliESDtrack.h
index a7ff877e14dcc3a80570d6af966e1ce6cb0cd755..5fae811c7ee32d14eeebc4c2cf050956a72d6270 100644 (file)
 //      
 //         Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch 
 //-------------------------------------------------------------------------
+/*****************************************************************************
+ *  Use GetExternalParameters() and GetExternalCovariance() to access the    *
+ *      track information regardless of its internal representation.         *
+ * This formation is now fixed in the following way:                         *
+ *      external param0:   local Y-coordinate of a track (cm)                *
+ *      external param1:   local Z-coordinate of a track (cm)                *
+ *      external param2:   local sine of the track momentum azimuthal angle  *
+ *      external param3:   tangent of the track momentum dip angle           *
+ *      external param4:   1/pt (1/(GeV/c))                                  *
+ *                                                                           *
+ * The Get*Label() getters return the label of the associated MC particle.   *
+ * The absolute value of this label is the index of the particle within the  *
+ * MC stack. If the label is negative, this track was assigned a certain     *
+ * number of clusters that did not in fact belong to this track.             *
+ *****************************************************************************/
 
 #include <TBits.h>
-#include <TObject.h>
+#include "AliExternalTrackParam.h"
+#include "AliVTrack.h"
+#include "AliPID.h"
+#include "AliESDfriendTrack.h"
+
+class TParticle;
+class AliESDVertex;
+class AliESDEvent;
 class AliKalmanTrack;
+class AliTrackPointArray;
+class TPolyMarker3D;
 
-class AliESDtrack : public TObject {
+class AliESDtrack : public AliExternalTrackParam {
 public:
+  enum {
+    kITSin=0x0001,kITSout=0x0002,kITSrefit=0x0004,kITSpid=0x0008,
+    kTPCin=0x0010,kTPCout=0x0020,kTPCrefit=0x0040,kTPCpid=0x0080,
+    kTRDin=0x0100,kTRDout=0x0200,kTRDrefit=0x0400,kTRDpid=0x0800,
+    kTOFin=0x1000,kTOFout=0x2000,kTOFrefit=0x4000,kTOFpid=0x8000,
+    kHMPIDout=0x10000,kHMPIDpid=0x20000,
+    kEMCALmatch=0x40000,
+    kTRDbackup=0x80000,
+    kTRDStop=0x20000000,
+    kESDpid=0x40000000,
+    kTIME=0x80000000,
+    kGlobalMerge=0x08000000,
+    kITSpureSA=0x10000000
+  }; 
+  enum {
+    kTRDnPlanes = 6,
+    kEMCALNoMatch = -4096
+  };
   AliESDtrack();
   AliESDtrack(const AliESDtrack& track);
-  virtual ~AliESDtrack();  
+  AliESDtrack(const AliVTrack* track);
+  AliESDtrack(TParticle * part);
+  virtual ~AliESDtrack();
+  virtual void Copy(TObject &obj) const;
+  const AliESDfriendTrack *GetFriendTrack() const {return fFriendTrack;}
+  void SetFriendTrack(const AliESDfriendTrack *t) {
+    delete fFriendTrack; fFriendTrack=new AliESDfriendTrack(*t);
+  }
+  void ReleaseESDfriendTrack() { delete fFriendTrack;  fFriendTrack=0; }
+  void AddCalibObject(TObject * object);     // add calib object to the list
+  TObject *  GetCalibObject(Int_t index);    // return calib objct at given position
+  void MakeMiniESDtrack();
+  void SetID(Int_t id) { fID =id;}
+  Int_t GetID() const { return fID;}
+  void SetVertexID(Char_t id) { fVertexID=id;}
+  Char_t GetVertexID() const { return fVertexID;}
   void SetStatus(ULong_t flags) {fFlags|=flags;}
   void ResetStatus(ULong_t flags) {fFlags&=~flags;}
   Bool_t UpdateTrackParams(const AliKalmanTrack *t, ULong_t flags);
@@ -28,230 +85,392 @@ public:
   void SetIntegratedTimes(const Double_t *times);
   void SetESDpid(const Double_t *p);
   void GetESDpid(Double_t *p) const;
-  
+  virtual const Double_t *PID() const { return fR; }
+
+  Bool_t IsOn(Int_t mask) const {return (fFlags&mask)>0;}
   ULong_t GetStatus() const {return fFlags;}
   Int_t GetLabel() const {return fLabel;}
-  Double_t GetAlpha() const {return fRalpha;}
+  void SetLabel(Int_t label) {fLabel = label;}
+
   void GetExternalParameters(Double_t &x, Double_t p[5]) const;
-  Bool_t GetExternalParametersAt(Double_t x, Double_t p[5]) const;
   void GetExternalCovariance(Double_t cov[15]) const;
+
   Double_t GetIntegratedLength() const {return fTrackLength;}
   void GetIntegratedTimes(Double_t *times) const;
   Double_t GetMass() const;
-  Double_t GetP() const;
-  void GetPxPyPz(Double_t *p) const;
-  void GetXYZ(Double_t *r) const;
-  void GetCovariance(Double_t cov[21]) const;
-  Int_t GetSign() const {return (fRp[4]>0) ? 1 : -1;} 
-
-  void SetConstrainedTrackParams(const AliKalmanTrack *t, Double_t chi2);
+  Double_t M() const { return GetMass(); }
+  Double_t E() const;
+  Double_t Y() const;
 
-  Double_t GetConstrainedAlpha() const {return fCalpha;}
+  Bool_t GetConstrainedPxPyPz(Double_t *p) const {
+    if (!fCp) return kFALSE;
+    return fCp->GetPxPyPz(p);
+  }
+  Bool_t GetConstrainedXYZ(Double_t *r) const {
+    if (!fCp) return kFALSE;
+    return fCp->GetXYZ(r);
+  }
+  const AliExternalTrackParam *GetConstrainedParam() const {return fCp;}
+  Bool_t GetConstrainedExternalParameters
+              (Double_t &alpha, Double_t &x, Double_t p[5]) const;
+  Bool_t GetConstrainedExternalCovariance(Double_t cov[15]) const;
   Double_t GetConstrainedChi2() const {return fCchi2;}
-  void GetConstrainedExternalParameters(Double_t &x, Double_t p[5]) const;
-  void GetConstrainedExternalCovariance(Double_t cov[15]) const;
+  //
+  
+  // global track chi2
+  void SetGlobalChi2(Double_t chi2) {fGlobalChi2 = chi2;}
+  Double_t GetGlobalChi2() const {return fGlobalChi2;}
+
+  Bool_t GetInnerPxPyPz(Double_t *p) const {
+    if (!fIp) return kFALSE;
+    return fIp->GetPxPyPz(p);
+  }
+  const AliExternalTrackParam * GetInnerParam() const { return fIp;}
+  const AliExternalTrackParam * GetTPCInnerParam() const {return fTPCInner;}
+  Bool_t FillTPCOnlyTrack(AliESDtrack &track);
+  Bool_t GetInnerXYZ(Double_t *r) const {
+    if (!fIp) return kFALSE;
+    return fIp->GetXYZ(r);
+  }
+  Bool_t GetInnerExternalParameters
+        (Double_t &alpha, Double_t &x, Double_t p[5]) const;
+  Bool_t GetInnerExternalCovariance(Double_t cov[15]) const;
+  void SetOuterParam(const AliExternalTrackParam *p, ULong_t flags);
 
-  void GetConstrainedPxPyPz(Double_t *p) const;
-  void GetConstrainedXYZ(Double_t *r) const;
+  void SetOuterHmpParam(const AliExternalTrackParam *p, ULong_t flags);
 
-  void GetInnerPxPyPz(Double_t *p) const;
-  void GetInnerXYZ(Double_t *r) const;
-  void GetInnerExternalParameters(Double_t &x, Double_t p[5]) const;//skowron
-  void GetInnerExternalCovariance(Double_t cov[15]) const;//skowron
-  Double_t GetInnerAlpha() const {return fIalpha;}
+  const AliExternalTrackParam * GetOuterParam() const { return fOp;}
+
+  const AliExternalTrackParam * GetOuterHmpParam() const { return fHMPIDp;}
   
+  Bool_t GetOuterPxPyPz(Double_t *p) const {
+    if (!fOp) return kFALSE;
+    return fOp->GetPxPyPz(p);
+  }
+  Bool_t GetOuterHmpPxPyPz(Double_t *p) const {
+    if (!fHMPIDp) return kFALSE;
+    return fHMPIDp->GetPxPyPz(p);
+  }
   
-  void GetOuterPxPyPzPHOS(Double_t *p) const;
-  void GetOuterPxPyPzEMCAL(Double_t *p) const;
-  void GetOuterXYZPHOS(Double_t *r) const;
-  void GetOuterXYZEMCAL(Double_t *r) const;
-
-  void SetITSpid(const Double_t *p);
-  void SetITSChi2MIP(const Float_t *chi2mip);
-  void SetITStrack(AliKalmanTrack * track){fITStrack=track;}
-  void GetITSpid(Double_t *p) const;
-  Float_t GetITSsignal() const {return fITSsignal;}
-  Float_t GetITSchi2() const {return fITSchi2;}
-  Int_t GetITSclusters(UInt_t *idx) const;
-  Int_t GetITSLabel() const {return fITSLabel;}
-  Float_t GetITSFakeRatio() const {return fITSFakeRatio;}
-  AliKalmanTrack * GetITStrack(){return fITStrack;}
-
-  void SetTPCpid(const Double_t *p);
-  void GetTPCpid(Double_t *p) const;
-  Float_t GetTPCsignal() const {return fTPCsignal;}
-  Float_t GetTPCchi2() const {return fTPCchi2;}
-  Int_t GetTPCclusters(Int_t *idx) const;
-  Int_t GetTPCLabel() const {return fTPCLabel;}
+  Bool_t GetOuterXYZ(Double_t *r) const {
+    if (!fOp) return kFALSE;
+    return fOp->GetXYZ(r);
+  }
+    Bool_t GetOuterHmpXYZ(Double_t *r) const {
+    if (!fHMPIDp) return kFALSE;
+    return fHMPIDp->GetXYZ(r);
+  }
+
+  Bool_t GetOuterExternalParameters
+        (Double_t &alpha, Double_t &x, Double_t p[5]) const;
+  Bool_t GetOuterExternalCovariance(Double_t cov[15]) const;
+
+  Bool_t GetOuterHmpExternalParameters
+        (Double_t &alpha, Double_t &x, Double_t p[5]) const;
+  Bool_t GetOuterHmpExternalCovariance(Double_t cov[15]) const;
+
+  
+  Int_t GetNcls(Int_t idet) const;
+  Int_t GetClusters(Int_t idet, Int_t *idx) const;
+  void    SetITSpid(const Double_t *p);
+  void    GetITSpid(Double_t *p) const;
+
+  Double_t GetITSsignal() const {return fITSsignal;}
+  void    SetITSdEdxSamples(const Double_t s[4]);
+  void    GetITSdEdxSamples(Double_t *s) const;
+
+  Double_t GetITSchi2() const {return fITSchi2;}
+  Char_t   GetITSclusters(Int_t *idx) const;
+  UChar_t GetITSClusterMap() const {return fITSClusterMap;}
+  void    SetITSModuleIndex(Int_t ilayer,Int_t idx) {fITSModule[ilayer]=idx;}
+  Int_t   GetITSModuleIndex(Int_t ilayer) const {return fITSModule[ilayer];}
+  Bool_t  GetITSModuleIndexInfo(Int_t ilayer,Int_t &idet,Int_t &status,
+                               Float_t &xloc,Float_t &zloc) const;
+  Int_t   GetITSLabel() const {return fITSLabel;}
+  void    SetITStrack(AliKalmanTrack * track){
+     fFriendTrack->SetITStrack(track);
+  }
+  AliKalmanTrack *GetITStrack(){
+     return fFriendTrack->GetITStrack();
+  }
+  Bool_t  HasPointOnITSLayer(Int_t i) const {return TESTBIT(fITSClusterMap,i);}
+
+  void    SetTPCpid(const Double_t *p);
+  void    GetTPCpid(Double_t *p) const;
+  void    SetTPCPoints(Float_t points[4]){
+     for (Int_t i=0;i<4;i++) fTPCPoints[i]=points[i];
+  }
+  void    SetTPCPointsF(UChar_t  findable){fTPCnclsF = findable;}
+  UShort_t   GetTPCNcls() const { return fTPCncls;}
+  UShort_t   GetTPCNclsF() const { return fTPCnclsF;}
+  Double_t GetTPCPoints(Int_t i) const {return fTPCPoints[i];}
+  void    SetKinkIndexes(Int_t points[3]) {
+     for (Int_t i=0;i<3;i++) fKinkIndexes[i] = points[i];
+  }
+  void    SetV0Indexes(Int_t points[3]) {
+     for (Int_t i=0;i<3;i++) fV0Indexes[i] = points[i];
+  }
+  void    SetTPCsignal(Float_t signal, Float_t sigma, UChar_t npoints){ 
+     fTPCsignal = signal; fTPCsignalS = sigma; fTPCsignalN = npoints;
+  }
+  Double_t GetTPCsignal() const {return fTPCsignal;}
+  Double_t GetTPCsignalSigma() const {return fTPCsignalS;}
+  UShort_t GetTPCsignalN() const {return fTPCsignalN;}
+  Double_t GetTPCchi2() const {return fTPCchi2;}
+  UShort_t   GetTPCclusters(Int_t *idx) const;
+  Double_t GetTPCdensity(Int_t row0, Int_t row1) const;
+  Int_t   GetTPCLabel() const {return fTPCLabel;}
+  Int_t   GetKinkIndex(Int_t i) const { return fKinkIndexes[i];}
+  Int_t   GetV0Index(Int_t i) const { return fV0Indexes[i];}
   const TBits& GetTPCClusterMap() const {return fTPCClusterMap;}
+  const TBits& GetTPCSharedMap() const {return fTPCSharedMap;}
+  void    SetTPCClusterMap(const TBits amap) {fTPCClusterMap = amap;}
+  void    SetTPCSharedMap(const TBits amap) {fTPCSharedMap = amap;}
+
+  void    SetTRDpid(const Double_t *p);
   
-  void SetTRDpid(const Double_t *p);
-  void SetTRDtrack(AliKalmanTrack * track){fTRDtrack=track;}
-  void GetTRDpid(Double_t *p) const;
-  Float_t GetTRDsignal() const {return fTRDsignal;}
-  Float_t GetTRDchi2() const {return fTRDchi2;}
-  Int_t GetTRDclusters(UInt_t *idx) const;
+// A.Bercuci
+  void    SetTRDntracklets(UChar_t q){fTRDntracklets = q;}
+  UChar_t GetTRDntracklets() const {return (fTRDntracklets>>3)&7;}
+  UChar_t GetTRDntrackletsPID() const {return fTRDntracklets&7;}
+  // TEMPORARY alias asked by the HFE group to allow 
+  // reading of the v4-16-Release data with TRUNK related software (A.Bercuci@Apr 30th 09) 
+  UChar_t GetTRDpidQuality() const {return GetTRDntrackletsPID();}
+// end A.Bercuci
+
+  void     SetNumberOfTRDslices(Int_t n);
+  Int_t    GetNumberOfTRDslices() const;
+  void     SetTRDslice(Double_t q, Int_t plane, Int_t slice);
+  void     SetTRDmomentum(Double_t p, Int_t plane, Double_t *sp=0x0);
+  Double_t GetTRDslice(Int_t plane, Int_t slice=-1) const;
+  Double_t GetTRDmomentum(Int_t plane, Double_t *sp=0x0) const;
+       
+  void    SetTRDQuality(Float_t quality){fTRDQuality=quality;}
+  Double_t GetTRDQuality()const {return fTRDQuality;}
+  void    SetTRDBudget(Float_t budget){fTRDBudget=budget;}
+  Double_t GetTRDBudget()const {return fTRDBudget;}
+
+  void    SetTRDTimBin(Int_t timbin, Int_t i) {fTRDTimBin[i]=timbin;}
+  void    GetTRDpid(Double_t *p) const;
+  Double_t GetTRDsignal() const {return fTRDsignal;}
+
+  Char_t   GetTRDTimBin(Int_t i) const {return fTRDTimBin[i];}
+  Double_t GetTRDchi2() const {return fTRDchi2;}
+  UChar_t   GetTRDclusters(Int_t *idx) const;
+  UChar_t   GetTRDncls() const {return fTRDncls;}
+  UChar_t   GetTRDncls0() const {return fTRDncls0;}
+  UChar_t   GetTRDtracklets(Int_t *idx) const;
   void    SetTRDpid(Int_t iSpecies, Float_t p);
-  Float_t GetTRDpid(Int_t iSpecies) const;
-  Int_t GetTRDLabel() const {return fTRDLabel;}
-  void GetTRDExternalParameters(Double_t &x, Double_t &alpha, Double_t p[5], Double_t cov[15]) const;//MI
-  AliKalmanTrack * GetTRDtrack(){return fTRDtrack;}
-
-  void SetTOFsignal(Double_t tof) {fTOFsignal=tof;}
-  Float_t GetTOFsignal() const {return fTOFsignal;}
-  Float_t GetTOFchi2() const {return fTOFchi2;}
+  Double_t GetTRDpid(Int_t iSpecies) const;
+  Int_t   GetTRDLabel() const {return fTRDLabel;}
+
+  void    SetTRDtrack(AliKalmanTrack * track){
+     fFriendTrack->SetTRDtrack(track);
+  }
+  AliKalmanTrack *GetTRDtrack(){
+     return fFriendTrack->GetTRDtrack();
+  }
+
+  void    SetTOFsignal(Double_t tof) {fTOFsignal=tof;}
+  Double_t GetTOFsignal() const {return fTOFsignal;}
+  void    SetTOFsignalToT(Double_t ToT) {fTOFsignalToT=ToT;}
+  Double_t GetTOFsignalToT() const {return fTOFsignalToT;}
+  void    SetTOFsignalRaw(Double_t tof) {fTOFsignalRaw=tof;}
+  Double_t GetTOFsignalRaw() const {return fTOFsignalRaw;}
+  void    SetTOFsignalDz(Double_t dz) {fTOFsignalDz=dz;}
+  Double_t GetTOFsignalDz() const {return fTOFsignalDz;}
+  void    SetTOFsignalDx(Double_t dx) {fTOFsignalDx=dx;}
+  Double_t GetTOFsignalDx() const {return fTOFsignalDx;}
+  Double_t GetTOFchi2() const {return fTOFchi2;}
   void    SetTOFpid(const Double_t *p);
+  void    SetTOFLabel(const Int_t *p);
   void    GetTOFpid(Double_t *p) const;
-  UInt_t  GetTOFcluster() const {return fTOFindex;}
-  void  SetTOFcluster(UInt_t index) {fTOFindex=index;}
-  
-  void    SetRICHsignal(Double_t beta) {fRICHsignal=beta;}
-  Float_t GetRICHsignal() const {return fRICHsignal;}
-  void    SetRICHpid(const Double_t *p);
-  void    GetRICHpid(Double_t *p) const;
-  
-  void SetPHOSposition(const Double_t *pos)  {
-    fPHOSpos[0] = pos[0]; fPHOSpos[1]=pos[1]; fPHOSpos[2]=pos[2];
+  void    GetTOFLabel(Int_t *p) const;
+  void    GetTOFInfo(Float_t *info) const;
+  void    SetTOFInfo(Float_t *info);
+  Int_t   GetTOFCalChannel() const {return fTOFCalChannel;}
+  Int_t   GetTOFcluster() const {return fTOFindex;}
+  void    SetTOFcluster(Int_t index) {fTOFindex=index;}
+  void    SetTOFCalChannel(Int_t index) {fTOFCalChannel=index;}
+
+// HMPID methodes +++++++++++++++++++++++++++++++++ (kir)
+  void    SetHMPIDsignal(Double_t theta) {fHMPIDsignal=theta;}
+  Double_t GetHMPIDsignal() const {return fHMPIDsignal;}
+  void    SetHMPIDpid(const Double_t *p);
+  void    GetHMPIDpid(Double_t *p) const;  
+  void    SetHMPIDchi2(Double_t chi2) {fHMPIDchi2=chi2;}
+  Double_t GetHMPIDchi2() const {return fHMPIDchi2;}
+  void    SetHMPIDcluIdx(Int_t ch,Int_t idx) {fHMPIDcluIdx=ch*1000000+idx;}
+  Int_t   GetHMPIDcluIdx() const {return fHMPIDcluIdx;}
+  void    SetHMPIDtrk(Float_t  x, Float_t  y, Float_t  th, Float_t  ph) {
+     fHMPIDtrkX=x; fHMPIDtrkY=y; fHMPIDtrkTheta=th; fHMPIDtrkPhi=ph;
   }
-  void SetPHOSsignal(Double_t ene) {fPHOSsignal = ene; }
-  void SetPHOSpid(const Double_t *p);
-  void GetPHOSposition(Double_t *pos) const {
-    pos[0]=fPHOSpos[0]; pos[1]=fPHOSpos[1]; pos[2]=fPHOSpos[2];
+  void    GetHMPIDtrk(Float_t &x, Float_t &y, Float_t &th, Float_t &ph) const {
+     x=fHMPIDtrkX; y=fHMPIDtrkY; th=fHMPIDtrkTheta; ph=fHMPIDtrkPhi;
   }
-  Float_t GetPHOSsignal() const {return fPHOSsignal;}
-  void GetPHOSpid(Double_t *p) const;  
-
-  void SetEMCALposition(const Double_t *pos)  {
-    fEMCALpos[0] = pos[0]; fEMCALpos[1]=pos[1]; fEMCALpos[2]=pos[2];
+  void    SetHMPIDmip(Float_t  x, Float_t  y, Int_t q, Int_t nph=0) {
+     fHMPIDmipX=x; fHMPIDmipY=y; fHMPIDqn=1000000*nph+q;
   }
-  void SetEMCALsignal(Double_t ene) {fEMCALsignal = ene; }
-  void SetEMCALpid(const Double_t *p);
-  void GetEMCALposition(Double_t *pos) const {
-    pos[0]=fEMCALpos[0]; pos[1]=fEMCALpos[1]; pos[2]=fEMCALpos[2];
+  void    GetHMPIDmip(Float_t &x,Float_t &y,Int_t &q,Int_t &nph) const {
+     x=fHMPIDmipX; y=fHMPIDmipY; q=fHMPIDqn%1000000; nph=fHMPIDqn/1000000;
   }
-  Float_t GetEMCALsignal() const {return fEMCALsignal;}
-  void GetEMCALpid(Double_t *p) const;  
+  Bool_t  IsHMPID() const {return fFlags&kHMPIDpid;}
+  Bool_t  IsPureITSStandalone() const {return fFlags&kITSpureSA;}
 
-  Bool_t IsOn(Int_t mask) const {return (fFlags&mask)>0;}
-  Bool_t IsRICH()  const {return fFlags&kRICHpid;}
-  Bool_t IsPHOS()  const {return fFlags&kPHOSpid;}
-  Bool_t IsEMCAL() const {return fFlags&kEMCALpid;}
 
-  virtual void Print(Option_t * opt) const ; 
+  Int_t GetEMCALcluster() {return fEMCALindex;}
+  void SetEMCALcluster(Int_t index) {fEMCALindex=index;}
+  Bool_t IsEMCAL() const {return fFlags&kEMCALmatch;}
+
+  void SetTrackPointArray(AliTrackPointArray *points) {
+    fFriendTrack->SetTrackPointArray(points);
+  }
+  const AliTrackPointArray *GetTrackPointArray() const {
+    return fFriendTrack->GetTrackPointArray(); 
+  }
+  Bool_t RelateToVertexTPC(const AliESDVertex *vtx, Double_t b, Double_t maxd,
+                           AliExternalTrackParam *cParam=0);
+  Bool_t 
+  RelateToVertexTPCBxByBz(const AliESDVertex *vtx, Double_t b[3],Double_t maxd,
+                           AliExternalTrackParam *cParam=0);
+  void GetImpactParametersTPC(Float_t &xy,Float_t &z) const {xy=fdTPC; z=fzTPC;}
+  void GetImpactParametersTPC(Float_t p[2], Float_t cov[3]) const {
+    p[0]=fdTPC; p[1]=fzTPC; cov[0]=fCddTPC; cov[1]=fCdzTPC; cov[2]=fCzzTPC;
+  }
+  Double_t GetConstrainedChi2TPC() const {return fCchi2TPC;}
+
+  Bool_t RelateToVertex(const AliESDVertex *vtx, Double_t b, Double_t maxd,
+                        AliExternalTrackParam *cParam=0);
+  Bool_t 
+  RelateToVertexBxByBz(const AliESDVertex *vtx, Double_t b[3], Double_t maxd,
+                        AliExternalTrackParam *cParam=0);
+  void GetImpactParameters(Float_t &xy,Float_t &z) const {xy=fD; z=fZ;}
+  void GetImpactParameters(Float_t p[2], Float_t cov[3]) const {
+    p[0]=fD; p[1]=fZ; cov[0]=fCdd; cov[1]=fCdz; cov[2]=fCzz;
+  }
+  virtual void Print(Option_t * opt) const ;
+  AliESDEvent* GetESDEvent() const {return fESDEvent;}
+  void         SetESDEvent(AliESDEvent* evt) {fESDEvent = evt;}  
+  //
+  // visualization (M. Ivanov)
+  //
+  void FillPolymarker(TPolyMarker3D *pol, Float_t magf, Float_t minR, Float_t maxR, Float_t stepR);
 
-  enum {
-    kITSin=0x0001,kITSout=0x0002,kITSrefit=0x0004,kITSpid=0x0008,
-    kTPCin=0x0010,kTPCout=0x0020,kTPCrefit=0x0040,kTPCpid=0x0080,
-    kTRDin=0x0100,kTRDout=0x0200,kTRDrefit=0x0400,kTRDpid=0x0800,
-    kTOFin=0x1000,kTOFout=0x2000,kTOFrefit=0x4000,kTOFpid=0x8000,
-    kPHOSpid=0x10000, kRICHpid=0x20000, kEMCALpid=0x40000,
-    kTRDbackup=0x80000,
-    kTRDStop=0x20000000,
-    kESDpid=0x40000000,
-    kTIME=0x80000000
-  }; 
-  enum {
-    kSPECIES=5, // Number of particle species recognized by the PID
-    kSPECIESN=10, //  Number of charged+neutral particle species recognized by the PHOS/EMCAL PID
-    kElectron=0, kMuon=1, kPion=2, kKaon=3, kProton=4, kPhoton=5, 
-    kPi0=6, kNeutron=7, kKaon0=8, kEleCon=9 // PHOS/EMCAL definition
-  };
 protected:
-  ULong_t   fFlags;        // Reconstruction status flags 
-  Int_t     fLabel;        // Track label
-
-  Float_t   fTrackLength;         // Track length
-  Float_t   fTrackTime[kSPECIES]; // TOFs estimated by the tracking
-  Float_t   fR[kSPECIES];         // combined "detector response probability"
-
-  Int_t     fStopVertex;          // Index of stop vertex
-
-//Running track parameters
-  Double_t fRalpha;  // track rotation angle
-  Double_t fRx;      // X-coordinate of the track reference plane 
-  Double_t fRp[5];   // external track parameters  
-  Double_t fRc[15];  // external cov. matrix of the track parameters
-
-//Track parameters constrained to the primary vertex
-  Double_t fCalpha;   // Track rotation angle
-  Double_t fCx;       // x-coordinate of the track reference plane
-  Double_t fCp[5];    // external track parameters
-  Double_t fCc[15];   // external cov. matrix of the track parameters
-  Double_t fCchi2; //chi2 at the primary vertex
-
-//Track parameters at the inner wall of the TPC
-  Double_t fIalpha;   // Track rotation angle
-  Double_t fIx;       // x-coordinate of the track reference plane
-  Double_t fIp[5];    // external track parameters
-  Double_t fIc[15];   // external cov. matrix of the track parameters
-//Track parameters at the inner wall of the TRD 
-  Double_t fTalpha;   // Track rotation angle
-  Double_t fTx;       // x-coordinate of the track reference plane
-  Double_t fTp[5];    // external track parameters
-  Double_t fTc[15];   // external cov. matrix of the track parameters
-
-//Track parameters at the radius of the PHOS
-  Double_t fOalpha;   //! Track rotation angle
-  Double_t fOx;       //! x-coordinate of the track reference plane
-  Double_t fOp[5];    //! external track parameters
-  Double_t fOc[15];   //! external cov. matrix of the track parameters
-
-//Track parameters at the radius of the EMCAL
-  Double_t fXalpha;   //! Track rotation angle
-  Double_t fXx;       //! x-coordinate of the track reference plane
-  Double_t fXp[5];    //! external track parameters
-  Double_t fXc[15];   //! external cov. matrix of the track parameters
-
-  // ITS related track information
-  Float_t fITSchi2;        // chi2 in the ITS
-  Float_t fITSchi2MIP[12];     // chi2s in the ITS
-  Int_t   fITSncls;        // number of clusters assigned in the ITS
-  UInt_t  fITSindex[6];    //! indices of the assigned ITS clusters
-  Float_t fITSsignal;      // detector's PID signal
-  Float_t fITSr[kSPECIES]; // "detector response probabilities" (for the PID)
-  Int_t   fITSLabel;       // label according TPC
-  Float_t fITSFakeRatio;   // ration of fake tracks
-  AliKalmanTrack * fITStrack; //! OWNER: pointer to the ITS track -- currently for debug purpose
   
-  // TPC related track information
-  Float_t fTPCchi2;        // chi2 in the TPC
-  Int_t   fTPCncls;        // number of clusters assigned in the TPC
-  UInt_t  fTPCindex[180];  //! indices of the assigned TPC clusters
-  TBits   fTPCClusterMap;  // Map of clusters, one bit per padrow; 1 if has a cluster on given padrow
-  Float_t fTPCsignal;      // detector's PID signal
-  Float_t fTPCr[kSPECIES]; // "detector response probabilities" (for the PID)
-  Int_t   fTPCLabel;       // label according TPC
-  // TRD related track information
-  Float_t fTRDchi2;        // chi2 in the TRD
-  Int_t   fTRDncls;        // number of clusters assigned in the TRD
-  Int_t   fTRDncls0;       // number of clusters assigned in the TRD before first material cross
-  UInt_t  fTRDindex[130];   //! indices of the assigned TRD clusters
-  Float_t fTRDsignal;      // detector's PID signal
-  Float_t fTRDr[kSPECIES]; // "detector response probabilities" (for the PID)
-  Int_t   fTRDLabel;       // label according TRD
-  AliKalmanTrack * fTRDtrack; //! OWNER: pointer to the TRD track -- currently for debug purpose
-  // TOF related track information
-  Float_t fTOFchi2;        // chi2 in the TOF
-  UInt_t  fTOFindex;       // index of the assigned TOF cluster
-  Float_t fTOFsignal;      // detector's PID signal
-  Float_t fTOFr[kSPECIES]; // "detector response probabilities" (for the PID)
-
-  // PHOS related track information 
-  Float_t fPHOSpos[3]; //position localised by PHOS in global coordinate system
-  Float_t fPHOSsignal; // energy measured by PHOS
-  Float_t fPHOSr[kSPECIESN]; // PID information from PHOS
-
-  // EMCAL related track information 
-  Float_t fEMCALpos[3]; //position localised by EMCAL in global coordinate system
-  Float_t fEMCALsignal; // energy measured by EMCAL
-  Float_t fEMCALr[kSPECIESN]; // PID information from EMCAL
-
-  // HMPID related track information
-  Float_t fRICHsignal;     // detector's PID signal (beta for RICH)
-  Float_t fRICHr[kSPECIES];// "detector response probabilities" (for the PID)
-       
-  ClassDef(AliESDtrack,8)  //ESDtrack 
+  AliExternalTrackParam *fCp; // Track parameters constrained to the primary vertex
+  AliExternalTrackParam *fIp; // Track parameters estimated at the inner wall of TPC
+  AliExternalTrackParam *fTPCInner; // Track parameters estimated at the inner wall of TPC using the TPC stand-alone 
+  AliExternalTrackParam *fOp; // Track parameters estimated at the point of maximal radial coordinate reached during the tracking
+  AliExternalTrackParam *fHMPIDp; // Track parameters at HMPID
+  AliESDfriendTrack *fFriendTrack; //! All the complementary information
+
+  TBits    fTPCClusterMap; // Map of clusters, one bit per padrow; 1 if has a cluster on given padrow
+  TBits    fTPCSharedMap;  // Map of clusters, one bit per padrow; 1 if has a shared cluster on given padrow
+
+
+
+  ULong_t   fFlags;          // Reconstruction status flags 
+  Int_t     fID;             // Unique ID of the track
+  Int_t     fLabel;          // Track label
+  Int_t     fITSLabel;       // label according ITS
+  Int_t     fITSModule[12];  // modules crossed by the track in the ITS 
+  Int_t     fTPCLabel;       // label according TPC
+  Int_t     fTRDLabel;       // label according TRD
+  Int_t     fTOFLabel[3];    // TOF label 
+  Int_t     fTOFCalChannel;  // Channel Index of the TOF Signal 
+  Int_t     fTOFindex;       // index of the assigned TOF cluster
+  Int_t     fHMPIDqn;         // 1000000*number of photon clusters + QDC
+  Int_t     fHMPIDcluIdx;     // 1000000*chamber id + cluster idx of the assigned MIP cluster
+  Int_t     fEMCALindex;     // index of associated EMCAL cluster (AliESDCaloCluster)
+
+
+  Int_t     fKinkIndexes[3]; // array of indexes of posible kink candidates 
+  Int_t     fV0Indexes[3];   // array of indexes of posible kink candidates 
+
+  Double32_t   fR[AliPID::kSPECIES]; //[0.,0.,8] combined "detector response probability"
+  Double32_t   fITSr[AliPID::kSPECIES]; //[0.,0.,8] "detector response probabilities" (for the PID)
+  Double32_t   fTPCr[AliPID::kSPECIES]; //[0.,0.,8] "detector response probabilities" (for the PID)
+  Double32_t   fTRDr[AliPID::kSPECIES]; //[0.,0.,8] "detector response probabilities" (for the PID)  
+  Double32_t   fTOFr[AliPID::kSPECIES]; //[0.,0.,8] "detector response probabilities" (for the PID)
+  Double32_t   fHMPIDr[AliPID::kSPECIES];//[0.,0.,8] "detector response probabilities" (for the PID)
+
+  Double32_t fHMPIDtrkTheta;//[-2*pi,2*pi,16] theta of the track extrapolated to the HMPID, LORS
+  // how much of this is needed?
+  Double32_t fHMPIDtrkPhi;     //[-2*pi,2*pi,16] phi of the track extrapolated to the HMPID, LORS
+  Double32_t fHMPIDsignal;  // HMPID PID signal (Theta ckov, rad)
+
+  Double32_t   fTrackTime[AliPID::kSPECIES]; // TOFs estimated by the tracking
+  Double32_t   fTrackLength;   // Track length
+
+  Double32_t   fdTPC;          // TPC-only impact parameter in XY plane
+  Double32_t   fzTPC;          // TPC-only impact parameter in Z
+  Double32_t   fCddTPC,fCdzTPC,fCzzTPC; // Covariance matrix of the TPC-only impact parameters 
+  Double32_t   fCchi2TPC;      // [0.,0.,8] TPC-only chi2 at the primary vertex
+
+  Double32_t   fD;             // Impact parameter in XY plane
+  Double32_t   fZ;             // Impact parameter in Z
+  Double32_t   fCdd,fCdz,fCzz; // Covariance matrix of the impact parameters 
+  Double32_t   fCchi2;          // [0.,0.,8] chi2 at the primary vertex
+
+  Double32_t   fITSchi2;        // [0.,0.,8] chi2 in the ITS
+  Double32_t   fTPCchi2;        // [0.,0.,8] chi2 in the TPC
+  Double32_t   fTRDchi2;        // [0.,0.,8] chi2 in the TRD
+  Double32_t   fTOFchi2;        // [0.,0.,8] chi2 in the TOF
+  Double32_t fHMPIDchi2;        // [0.,0.,8] chi2 in the HMPID
+
+  Double32_t fGlobalChi2;       // [0.,0.,8] chi2 of the global track
+
+  Double32_t  fITSsignal;     // [0.,0.,10] detector's PID signal
+  Double32_t  fITSdEdxSamples[4]; // [0.,0.,10] ITS dE/dx samples
+
+  Double32_t  fTPCsignal;     // [0.,0.,10] detector's PID signal
+  Double32_t  fTPCsignalS;    // [0.,0.,10] RMS of dEdx measurement
+  Double32_t  fTPCPoints[4];  // [0.,0.,10] TPC points -first, max. dens, last and max density
+
+  Double32_t fTRDsignal;      // detector's PID signal
+  Double32_t fTRDQuality;     // trd quality factor for TOF
+  Double32_t fTRDBudget;      // trd material budget
+
+  Double32_t fTOFsignal;      // detector's PID signal
+  Double32_t fTOFsignalToT;   // detector's ToT signal
+  Double32_t fTOFsignalRaw;   // detector's uncorrected time signal
+  Double32_t fTOFsignalDz;    // local z  of track's impact on the TOF pad 
+  Double32_t fTOFsignalDx;    // local x  of track's impact on the TOF pad 
+  Double32_t fTOFInfo[10];    //! TOF informations
+
+  Double32_t fHMPIDtrkX;       // x of the track impact, LORS 
+  Double32_t fHMPIDtrkY;       // y of the track impact, LORS 
+  Double32_t fHMPIDmipX;       // x of the MIP in LORS
+  Double32_t fHMPIDmipY;       // y of the MIP in LORS
+
+
+  UShort_t fTPCncls;       // number of clusters assigned in the TPC
+  UShort_t fTPCnclsF;      // number of findable clusters in the TPC
+  UShort_t fTPCsignalN;    // number of points used for dEdx
+
+  Char_t  fITSncls;        // number of clusters assigned in the ITS
+  UChar_t fITSClusterMap;  // map of clusters, one bit per a layer
+  UChar_t fTRDncls;        // number of clusters assigned in the TRD
+  UChar_t fTRDncls0;       // number of clusters assigned in the TRD before first material cross
+  UChar_t fTRDntracklets;  // number of TRD tracklets used for tracking/PID
+
+  Int_t fTRDnSlices;     // number of slices used for PID in the TRD
+  Double32_t *fTRDslices;  //[fTRDnSlices] 
+
+  Char_t  fTRDTimBin[kTRDnPlanes];   // Time bin of Max cluster from all six planes
+  Char_t  fVertexID; // ID of the primary vertex this track belongs to
+  AliESDEvent*   fESDEvent; //!Pointer back to event to which the track belongs
+  
+ private:
+
+  AliESDtrack & operator=(const AliESDtrack & );
+  ClassDef(AliESDtrack,54)  //ESDtrack 
 };
 
+
+
 #endif