////////////////////////////////////////////////////////////////////////
// $Id: Track2DSR.h,v 1.23 2006/06/21 19:35:29 musser Exp $
//
// Track2DSR
//
// Author:  R. Lee 2001.02.27
////////////////////////////////////////////////////////////////////////

#ifndef TRACK2DSR_H
#define TRACK2DSR_H

#include "TObject.h"
#include "TObjArray.h"

#include "Conventions/PlaneView.h"
#include "Navigation/XxxItr.h"

class TrackClusterSR;

class Track2DSR  : public TObject
{

public:
  Track2DSR();
  Track2DSR(TrackClusterSR *);
  Track2DSR(const Track2DSR &rhs);              // Real copy-constructor
  virtual ~Track2DSR();

  Bool_t operator==(const Track2DSR& rhs) const;

  void Add(TrackClusterSR *tcluster, Double_t slope);
  void Clear(Option_t* option="");
  void Compress();
  Track2DSR *Dup();
  Bool_t IsBad() const;
  Bool_t IsEquivalent(const TObject *rhs) const;
  void RemoveAt(Int_t);

  Double_t GetBackwardSlope(Int_t i);
  Int_t GetBegPlane() const;
  Double_t GetChi2();
  TrackClusterSR *GetCluster(Int_t i) const;
  Int_t GetDirection() const;
  Int_t GetEndPlane() const;
  Double_t GetForwardSlope(Int_t i) const;
  Bool_t GetHoughExist() const;
  Double_t GetHoughIntercept() const;
  Double_t GetHoughSlope() const;
  Int_t GetLast() const;
  PlaneView::PlaneView_t GetPlaneView() const;
  Double_t GetSlope(Int_t i);
  Double_t GetT0() const;
  Double_t GetTPos0() const;
  Double_t GetZ0() const;
  Bool_t IsFocussed() const;
  void SetCluster(TrackClusterSR *tcluster, Double_t slope, Int_t indx);
  void SetDirection(Int_t idir);
  void SetHoughIntercept(Double_t inter);
  void SetHoughSlope(Double_t slope);
  void SetIsBad(Bool_t isBad);

  Int_t fIterate;                           // gmi:  Why is this public?

private:
  void CalculateBackwardSlope();

  Bool_t fIsBad;                          // flag for marking bad tracks
  TObjArray fTrkClsSlp;
  Double_t fChi2;

  Double_t fZ0;
  Double_t fTPos0;
  Double_t fT0;
  Double_t fCharge;

  Bool_t fModified;

  Double_t fParmTrack2DSlopeWeight;
  Double_t fParmTrk2DAlpha;

  Int_t fDir;

  Double_t fHoughSlope;
  Double_t fHoughInter;
  Bool_t fHoughExist;

ClassDef(Track2DSR,2)
};

XXXITRDEF(Track2DSR)

#endif                                                    // TRACK2DSR_H
