Skip to content
Snippets Groups Projects
THcDCTrack.h 2.96 KiB
Newer Older
  • Learn to ignore specific revisions
  • #ifndef ROOT_THcDCTrack
    #define ROOT_THcDCTrack
    
    ///////////////////////////////////////////////////////////////////////////////
    //                                                                           //
    // THcDCTrack                                                             //
    //                                                                           //
    ///////////////////////////////////////////////////////////////////////////////
    
    //#include "THaCluster.h"
    #include "TVector3.h"
    #include "TObject.h"
    
    //class THaVDCCluster;
    class THcDCPlane;
    class THaTrack;
    class THcDCHit;
    
    class THcDCTrack : public TObject {
    
    public:
      THcDCTrack(Int_t nplanes);
      virtual ~THcDCTrack() {};
    
      virtual void AddHit(THcDCHit * hit);
      virtual void AddSpacePoint(Int_t spid);
    
      //Get and Set Functions
      Int_t* GetSpacePoints()               {return fspID;}
      Int_t GetNSpacePoints()         const { return fnSP;}
      Int_t GetSpacePointID(Int_t i)  const {return fspID[i];}
      THcDCHit* GetHit(Int_t i)       const {return fHits[i];}
      Int_t GetNHits()                const {return fNHits;}
      Int_t GetNFree()                const {return fNfree;}
      Double_t GetCoord(Int_t ip)     const {return fCoords[ip];}
      Double_t GetResidual(Int_t ip)     const {return fResiduals[ip];}
      void GetRay(Double_t *ray) const {ray[0]=fX_fp; ray[1]=fY_fp; ray[2]=fXp_fp; ray[3]=fYp_fp;}
    
      Double_t GetX()                 const {return fX_fp;}
      Double_t GetY()                 const {return fY_fp;}
      Double_t GetXP()                 const {return fXp_fp;}
      Double_t GetYP()                 const {return fYp_fp;}
    
      void SetNFree(Int_t nfree)           {fNfree = nfree;}
      void SetCoord(Int_t ip, Double_t coord) {fCoords[ip] = coord;}
      void SetResidual(Int_t ip, Double_t coord) {fResiduals[ip] = coord;}
      void SetDoubleResidual(Int_t ip, Double_t coord) {fDoubleResiduals[ip] = coord;}
      void SetVector(Double_t x, Double_t y, Double_t z,
    		 Double_t xp, Double_t yp) {fX_fp = x; fY_fp=y; fZ_fp=z; fXp_fp=xp; fYp_fp=yp;}
      void SetChisq(Double_t chi2)   {fChi2_fp = chi2;}
    
      virtual void ClearHits( );
    
      // TObject functions redefined
      virtual void Clear( Option_t* opt="" );
    
     protected:
        Int_t fnSP; /* Number of space points in this track */
                    /* Should we have a list of pointers to space points
    		   instead of their indices? */
        Int_t fspID[10];		/* List of space points in this track */
        Int_t fNHits;
        Int_t fNfree;		  /* Number of degrees of freedom */
        std::vector<THcDCHit*> fHits; /* List of hits for this track */
        std::vector<Double_t> fCoords; /* Coordinate on each plane */
        std::vector<Double_t> fResiduals; /* Residual on each plane */
        std::vector<Double_t> fDoubleResiduals; /* Residual on each plane for single stub mode */
        Double_t fX_fp, fY_fp, fZ_fp;
        Double_t fXp_fp, fYp_fp;
        Double_t fChi2_fp;
    
     private:
      // Hide copy ctor and op=
      THcDCTrack( const THcDCTrack& );
      THcDCTrack& operator=( const THcDCTrack& );
    
      ClassDef(THcDCTrack,0)	// DCTrack class
    };
    #endif