00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef TRKREP_HH
00017 #define TRKREP_HH
00018 #include <memory>
00019 #include "MdcRecoUtil/PdtPid.h"
00020 #include "TrkBase/TrkDirection.h"
00021 #include "TrkBase/TrkFitStatus.h"
00022 #include "TrkBase/TrkFit.h"
00023 #include "TrkBase/TrkHotList.h"
00024 #include "TrkBase/TrkHitOnTrkUpdater.h"
00025
00026 #include "MdcRecoUtil/BesVectorErr.h"
00027 #include "MdcRecoUtil/BesPointErr.h"
00028 #include "CLHEP/Vector/ThreeVector.h"
00029
00030 #include "ProbTools/ChisqConsistency.h"
00031
00032 class TrkHitOnTrk;
00033 #include <iosfwd>
00034 class TrkDifTraj;
00035 class TrkErrCode;
00036 class TrkExchangePar;
00037 class TrkRecoTrk;
00038 class TrkVolume;
00039 class IfdKey;
00040 class TrkContext;
00041
00042
00043 class TrkRep : public TrkFitStatus, public TrkFit, public TrkHitOnTrkUpdater {
00044
00045 public:
00046
00047
00048
00049
00050
00051 TrkRep(const TrkHotList& inHots, TrkRecoTrk* trk,
00052 PdtPid::PidType hypo);
00053 TrkRep(TrkHotList& inHots, TrkRecoTrk* trk,
00054 PdtPid::PidType hypo, bool stealHots=false);
00055
00056
00057 TrkRep(const TrkHotList* inHots, TrkRecoTrk* trk,
00058 PdtPid::PidType hypo);
00059 TrkRep(TrkHotList* inHots, TrkRecoTrk* trk,
00060 PdtPid::PidType hypo, bool takeownership=false);
00061
00062 TrkRep(TrkRecoTrk* trk, PdtPid::PidType hypo, int nAct, int nSvt,
00063 int nMdc, double startFoundRange, double endFoundRange);
00064
00065 TrkRep(TrkRecoTrk* trk, PdtPid::PidType hypo, bool createHotList=false);
00066
00067 TrkRep(const TrkRep& oldRep, TrkRecoTrk* trk, PdtPid::PidType hypo);
00068 virtual ~TrkRep();
00069
00070 virtual TrkRep* clone(TrkRecoTrk* newTrack) const = 0;
00071 virtual TrkRep* cloneNewHypo(PdtPid::PidType hypo) = 0;
00072 bool operator== (const TrkRep&);
00073
00074
00075
00076
00077 virtual ChisqConsistency chisqConsistency() const;
00078 virtual int nActive() const;
00079 virtual int nSvt() const;
00080 virtual int nMdc() const;
00081 virtual PdtPid::PidType particleType() const;
00082 TrkRecoTrk* parentTrack() {return _parentTrack;}
00083 const TrkRecoTrk* parentTrack() const {return _parentTrack;}
00084 double startValidRange() const;
00085 double endValidRange() const;
00086 virtual double startFoundRange() const;
00087 virtual double endFoundRange() const;
00088 virtual const IfdKey& myKey() const;
00089 double trackT0() const;
00090
00091
00092
00093
00094 virtual HepPoint3D position(double fltL) const;
00095 virtual Hep3Vector direction(double fltL) const;
00096 virtual double arrivalTime(double fltL) const;
00097 virtual BesPointErr positionErr(double fltL) const;
00098 virtual BesVectorErr directionErr(double fltL) const;
00099
00100
00101
00102
00103
00104
00105 virtual void addHot(TrkHitOnTrk *theHot);
00106 virtual void removeHot(TrkHitOnTrk *theHot);
00107 virtual void activateHot(TrkHitOnTrk *theHot);
00108 virtual void deactivateHot(TrkHitOnTrk *theHot);
00109 virtual TrkHotList* hotList() {return _hotList.get();}
00110 virtual const TrkHotList* hotList() const {return _hotList.get();}
00111 virtual void updateHots();
00112 virtual bool resid(const TrkHitOnTrk *theHot,
00113 double &residual, double &residErr,
00114 bool exclude=false) const;
00115
00116
00117
00118 bool hitCapable() const {return hotList()->hitCapable();}
00119
00120
00121
00122
00123
00124 virtual TrkErrCode fit() = 0;
00125
00126 protected:
00127 TrkRep& operator= (const TrkRep&);
00128 const TrkContext& trkContext() const;
00129
00130
00131 std::auto_ptr<TrkHotList> _hotList;
00132
00133 private:
00134 void init(TrkRecoTrk* trk, PdtPid::PidType hypo);
00135
00136 PdtPid::PidType _partHypo;
00137 TrkRecoTrk* _parentTrack;
00138 mutable double _betainv;
00139 };
00140
00141 #endif