00001 #ifndef TRKHITLIST_H 00002 #define TRKHITLIST_H 00003 //-------------------------------------------------------------------------- 00004 // File and Version Information: 00005 // $Id: TrkHitList.h,v 1.1.1.1 2005/04/21 06:01:42 zhangy Exp $ 00006 // 00007 // Description: 00008 // Provides track users with an interface to the track's list of hits. 00009 // It's really just a split-off piece of the TrkRecoTrk interface, and 00010 // remains intimately connected to TrkRecoTrk. 00011 // Comments: 00012 // Adding or removing a hit adds it to all hypotheses 00013 // Removing a hit destroys any Hots associated with it 00014 // Appending Hots clones them; the track does *not* take 00015 // ownership of the hots passed in. 00016 // 00017 // Environment: 00018 // Software developed for the BaBar Detector at the SLAC B-Factory. 00019 // 00020 // Author(s): Steve Schaffner 00021 //------------------------------------------------------------------------ 00022 00023 #include "MdcRecoUtil/PdtPid.h" 00024 #include "TrkBase/TrkHitOnTrkIter.h" 00025 #include "TrkBase/TrkHotList.h" 00026 00027 class TrkRecoTrk; 00028 class TrkHitOnTrk; 00029 class TrkFundHit; 00030 class TrkRep; 00031 class TrkErrCode; 00032 class TrkHitUse; 00033 00034 // Class interface // 00035 class TrkHitList { 00036 00037 public: 00038 typedef TrkHotList::hot_iterator hot_iterator; 00039 virtual ~TrkHitList(); 00040 00041 //********************************** 00042 // Access to the hits 00043 //********************************** 00044 unsigned nHit() const { return end()-begin();}; 00045 hot_iterator begin() const { return hotList().begin(); } 00046 hot_iterator end() const { return hotList().end(); } 00047 00048 const TrkHotList& hotList() const; 00049 00050 //********************************** 00051 // Modify 00052 //********************************** 00053 bool removeHit(const TrkFundHit *theHit); //ret. false if not found 00054 TrkHitOnTrk* appendHot(const TrkHitOnTrk *theHot); 00055 TrkHitOnTrk* appendHit(const TrkHitUse& theHit); 00056 bool append(const TrkHitList& list); 00057 void setActivity(const TrkHitOnTrk&); 00058 00059 //********************************** 00060 // Fit the track 00061 //********************************** 00062 // Perform the fit; should have no effect on an up-to-date (fitCurrent=true) 00063 // fit 00064 TrkErrCode fit(); 00065 00066 bool operator==(const TrkHitList& right) const {return this == &right;} 00067 private: 00068 // Data 00069 TrkRecoTrk* _theTrack; 00070 PdtPid::PidType _myHypo; 00071 00072 // ctor 00073 TrkHitList(TrkRecoTrk*, PdtPid::PidType hypo); 00074 00075 // Functions 00076 const TrkRep* theRep() const; 00077 TrkRep* theRep(); 00078 00079 // Preempt 00080 TrkHitList& operator= (const TrkHitList&); 00081 TrkHitList(const TrkHitList &); 00082 00083 friend class TrkRecoTrk; 00084 00085 }; 00086 00087 #endif