]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - HLT/TPCLib/AliHLTTPCTrack.h
Bugfix, comparison of string -sorted was not correct.
[u/mrichter/AliRoot.git] / HLT / TPCLib / AliHLTTPCTrack.h
index 40b8ac5385b13bad64c466f26e7a4742afac33f5..5c1f8f37d8d9f158977c415f91ece28458c166a8 100644 (file)
@@ -1,20 +1,62 @@
+// XEmacs -*-C++-*-
 // @(#) $Id$
-// Original: AliL3Track.h,v 1.18 2005/03/31 04:48:58 cvetan 
+// Original: AliHLTTrack.h,v 1.18 2005/03/31 04:48:58 cvetan 
+
 #ifndef ALIHLTTPCTRACK_H
 #define ALIHLTTPCTRACK_H
 
+//* This file is property of and copyright by the ALICE HLT Project        * 
+//* ALICE Experiment at CERN, All rights reserved.                         *
+//* See cxx source for full Copyright notice                               *
+
+/** @file   AliHLTTPCTrack.h
+    @author Anders Vestbo, Uli Frankenfeld, maintained by Matthias Richter
+    @date   
+    @brief  HLT TPC track base class (conformal mapping)
+*/
+
+#include "AliTPCtrack.h"
+
 class AliHLTTPCVertex;
 class AliHLTTPCSpacePointData;
 
-class AliHLTTPCTrack {
+/**
+ * @class AliHLTTPCTrack
+ * This class implements the representation of a TPC track, used by the
+ * HLT conformal mapping track finder. <br>
+ * It was originally separated from the offline TPC track class, but in
+ * order to adjust the output format to the offline ESD, AliHLTTPCTrack
+ * now inherits from AliHLTtrack.
+ *
+ * @ingroup alihlt_tpc
+ */
+class AliHLTTPCTrack : public AliTPCtrack {
 
  public:
   
   AliHLTTPCTrack();
   virtual ~AliHLTTPCTrack();
   
-  virtual void Set(AliHLTTPCTrack* track);
+  /**
+   * Copy track parameters.
+   * @param track   pointer to source track
+   */
+  virtual void Copy(AliHLTTPCTrack* track);
+  using AliTPCtrack::Copy;  //TODO: Check if "virtual void Copy(TObject*)" does what it is supposed to do.
+
+  /**
+   * Compare two tracks by the number of hits
+   * @return 0 if equal number of hits, 
+   *         1 if this > track
+   *        -1 if this < track
+   */
   virtual Int_t Compare(const AliHLTTPCTrack *track) const;
+  using AliTPCtrack::Compare;  //TODO: Check if "virtual Int_t Compare(TObject*)" does what it is supposed to do.
+
+  /**
+   * Fit the assigned spacepoints to a helix.
+   * The function sets teh track parameters.
+   */
   virtual void CalculateHelix();
   
   Bool_t CalculateReferencePoint(Double_t angle,Double_t radius=132);//Calculate Reference Point
@@ -25,10 +67,11 @@ class AliHLTTPCTrack {
   Bool_t GetCrossingPoint(Int_t padrow,Float_t *xyz);
   Double_t GetDistance(Double_t /*x0*/,Double_t /*x1*/){return 0;}
   void UpdateToFirstPoint();
-  void GetClosestPoint(AliHLTTPCVertex *vertex,Double_t &closest_x,Double_t &closest_y,Double_t &closest_z);
+  void GetClosestPoint(AliHLTTPCVertex *vertex,Double_t &closestX,Double_t &closestY,Double_t &closestZ);
   void Rotate(Int_t slice,Bool_t tolocal=kFALSE);
   Bool_t IsLocal() const {return fIsLocal;}
-  void Print() const;
+  virtual void Print(Option_t* option = "") const;
+  using AliTPCtrack::Print;
 
   // getter
   Double_t GetFirstPointX() const {return fFirstPoint[0];}
@@ -54,7 +97,9 @@ class AliHLTTPCTrack {
   Double_t GetPterr() const {return fPterr;}
   Double_t GetPsierr() const {return fPsierr;}
   Double_t GetTglerr() const {return fTanlerr;}
-  
+  Double_t GetZ0err() const {return fZ0err;}
+  Double_t GetY0err() const {return fY0err;}
+
   Double_t GetKappa() const {return fKappa;}
   Double_t GetRadius() const {return fRadius;}
   Double_t GetCenterX() const {return fCenterX;}
@@ -75,7 +120,9 @@ class AliHLTTPCTrack {
   Int_t GetCharge() const {return fQ;}
   Int_t GetMCid() const {return fMCid;}
   Double_t GetLength() const {return fLength;}
-
+  Double_t GetLengthXY() const ;
+  Double_t GetLengthTot() const;
+  
   Int_t GetFirstRow() const {return fRowRange[0];}
   Int_t GetLastRow()  const {return fRowRange[1];}
   Int_t GetSector()   const {return fSector;}
@@ -87,7 +134,7 @@ class AliHLTTPCTrack {
   void SetMCid(Int_t f) {fMCid = f;}
   void SetFirstPoint(Double_t f,Double_t g,Double_t h) {fFirstPoint[0]=f; fFirstPoint[1]=g; fFirstPoint[2]=h;}
   void SetLastPoint(Double_t f,Double_t g,Double_t h) {fLastPoint[0]=f; fLastPoint[1]=g; fLastPoint[2]=h;}
-  void SetHits(Int_t nhits,UInt_t *hits) {memcpy(fHitNumbers,hits,nhits*sizeof(UInt_t));}
+  void SetHits(Int_t nhits,UInt_t *hits);
   void SetPhi0(Double_t f) {fPhi0 = f;}
   void SetPsi(Double_t f) {fPsi = f;}
   void SetR0(Double_t f) {fR0 = f;}
@@ -98,6 +145,7 @@ class AliHLTTPCTrack {
   void SetPterr(Double_t f) {fPterr = f;}
   void SetPsierr(Double_t f) {fPsierr = f;}
   void SetZ0err(Double_t f) {fZ0err = f;}
+  void SetY0err(Double_t f) {fY0err = f;}  
   void SetTglerr(Double_t f) {fTanlerr = f;}
   void SetKappa(Double_t f) {fKappa = f;}
   void SetNHits(Int_t f) {fNHits = f;}
@@ -109,6 +157,25 @@ class AliHLTTPCTrack {
   void SetCharge(Int_t f) {fQ = f;}
   void ComesFromMainVertex(Bool_t f) {fFromMainVertex = f;}
 
+  /**
+   * Convert all track parameters to the format of AliKalmanTrack
+   * The AliKalmanTrack class implements the track parametrization for offline ITS, TPC
+   * and TRD tracking. The function calculates and sets the parameters of the
+   * parent class (Note: AliHLTTPCTrack inherits from AliTPCtrack and thus
+   * AliKalmanTrack).
+   */
+  int Convert2AliKalmanTrack();
+
+  /**
+   * Check the structure members to be within reasonable limits.
+   */
+  int CheckConsistency();
+
+  /**
+   * Check consistency of a double member
+   */
+  int CheckDoubleMember(double* pMember, double def, const char* name) const;
+
  private:
 
   Int_t fNHits; //Number of hits
@@ -135,6 +202,7 @@ class AliHLTTPCTrack {
   Double_t fPterr;   //error in pt
   Double_t fPsierr;  //error in psi
   Double_t fZ0err;   //error in first point
+  Double_t fY0err;   //error in first point
   Double_t fTanlerr; //error in tanl
 
   Double_t fPhi0; //azimuthal angle of the first point
@@ -150,10 +218,11 @@ class AliHLTTPCTrack {
   Bool_t fIsLocal; //Track given in local coordinates.
 
   Float_t fPID; //pid 
-  UInt_t fHitNumbers[159]; //Array of hit numbers for this track
+  static const int fgkHitArraySize=159; // size of hit array
+  UInt_t fHitNumbers[fgkHitArraySize]; //Array of hit numbers for this track
 
   Bool_t IsPoint(Bool_t ispoint) {fIsPoint = ispoint;return fIsPoint;}
   
-  ClassDef(AliHLTTPCTrack,1) //Base track class
+  ClassDef(AliHLTTPCTrack,2) //Base track class
 };
 #endif