#ifndef FITTER_ABSTRACKREP_H #define FITTER_ABSTRACKREP_H #include "TMatrixT.h" #include "TVector3.h" #include #include #include "FitParams.h" #include "DetPlane.h" class AbsRecoHit; class AbsTrackRep : public TObject{ protected: TMatrixT state; TMatrixT cov; TMatrixT startState; TMatrixT startCov; DetPlane _refPlane; // detector plane where the track parameters are given double startS; double chiSqu; FitParams params; int statusFlag; // 0 means everything's OK bool inverted; // public: AbsTrackRep(int); virtual ~AbsTrackRep(); virtual AbsTrackRep* clone() = 0; virtual AbsTrackRep* prototype() = 0; // TODO: make the following method abstract!! virtual void init(const TVector3& startpoint, const TVector3& startmomentum, const TVector3& locBField); virtual DetPlane getVirtualDetPlane(AbsRecoHit* hit) const; virtual void predict(const DetPlane& plane, TMatrixT& statePred, TMatrixT& covPred, TMatrixT& jacobian)=0; virtual void extrapolate(const DetPlane& plane, TMatrixT& statePred)=0; virtual void extrapolate(const DetPlane& plane); // changes the state of the trkrep! virtual void stepalong(double h)=0; // make step of h cm along the track //virtual void extrapolate(double , double sExtrapolateTo, // const TMatrixT& stateFrom, // TMatrixT& stateResult)=0; virtual void extrapolate(const DetPlane& plane, TMatrixT& statePred, TMatrixT& covPred, TMatrixT& jacobian)=0; virtual int getDim() const =0; virtual void Print() const; inline TMatrixT getState() const { return state; } inline TMatrixT getCov() const { return cov; } bool setInverted(bool f=true){inverted=f;} virtual TVector3 getPos(const DetPlane& pl)=0; virtual TVector3 getMom(const DetPlane& pl)=0; virtual double getCharge()const =0; TVector3 getPos() {return getPos(_refPlane);} TVector3 getMom() {return getMom(_refPlane);} inline TMatrixT getStartState() const { return startState; } inline TMatrixT getStartCov() const { return startCov; } //inline double getS() const { // return s; //} inline double getStartS() const { return startS; } inline double getChiSqu() const { return chiSqu; } inline FitParams* getFitParams() { return ¶ms; } inline void setState(const TMatrixT& aState) { state = aState; } inline void setCov(const TMatrixT& aCov) { cov = aCov; } inline void setStartState(const TMatrixT& aState) { startState = aState; } inline void setStartCov(const TMatrixT& aCov) { startCov = aCov; } virtual void setReferencePlane(const DetPlane& pl)=0; const DetPlane& getReferencePlane() const {return _refPlane;} inline void setStartS(double anS) { startS = anS; } inline void setChiSqu(double aChiSqu) { chiSqu = aChiSqu; } inline void addChiSqu(double aChiSqu) { chiSqu += aChiSqu; } inline void setStatusFlag(int _val) { statusFlag = _val; } inline bool getStatusFlag() { return statusFlag; } virtual void reset(); ClassDef(AbsTrackRep,1) }; #endif // FITTER_ABSTRACKREP_H