00001 //-------------------------------------------------------------------------- 00002 // File and Version Information: 00003 // $Id: TrkHotList.h,v 1.3 2010/09/26 00:39:00 zhangy Exp $ 00004 // 00005 // Description: List of hits (as HitOnTrk objects) associated with a 00006 // reconstructed track. Abstract base class. 00007 // 00008 // Environment: 00009 // Software developed for the BaBar Detector at the SLAC B-Factory. 00010 // 00011 // Author(s): Steve Schaffner 00012 // 00013 //------------------------------------------------------------------------ 00014 #ifndef TRKHOTLIST_HH 00015 #define TRKHOTLIST_HH 00016 00017 class TrkFundHit; 00018 class TrkHitOnTrk; 00019 class TrkRep; 00020 class TrkView; 00021 #include <iosfwd> 00022 #include <vector> 00023 #include "TrkBase/TrkHitOnTrkIter.h" 00024 #include "TrkBase/TrkEnums.h" 00025 #include "TrkBase/TrkFunctors.h" 00026 #include "TrkBase/TrkFundHit.h" 00027 #include "GaudiKernel/DataObject.h" 00028 00029 // Class interface // 00030 class TrkHotList : public DataObject { 00031 private: 00032 struct iterator_traits; 00033 struct const_iterator_traits; 00034 public: 00035 00036 // constructors and such 00037 TrkHotList(); 00038 virtual TrkHotList* clone(TrkBase::Functors::cloneHot) const = 0; 00039 // this Hotlist is about to be usurped by a new TrkRep... 00040 virtual TrkHotList* resetParent(TrkBase::Functors::setParent); 00041 virtual ~TrkHotList(); 00042 00043 typedef TrkHitOnTrkIter<TrkHotList::const_iterator_traits> hot_iterator; 00044 hot_iterator begin() const { return hot_iterator(hotlist().begin()); } 00045 hot_iterator end() const { return hot_iterator(hotlist().end()); } 00046 00047 typedef TrkHitOnTrkIter<TrkHotList::iterator_traits> nc_hot_iterator; 00048 nc_hot_iterator begin() { return nc_hot_iterator(hotlist().begin()); } 00049 nc_hot_iterator end() { return nc_hot_iterator(hotlist().end()); } 00050 00051 virtual bool hitCapable() const = 0; 00052 virtual int nActive(TrkEnums::TrkViewInfo view=TrkEnums::bothView) const = 0; 00053 virtual int nMdc(TrkEnums::TrkViewInfo view=TrkEnums::bothView) const = 0; 00054 virtual int nSvt(TrkEnums::TrkViewInfo view=TrkEnums::bothView) const = 0; 00055 virtual int nHit(TrkEnums::TrkViewInfo view=TrkEnums::bothView) const = 0; 00056 virtual bool hasSvtView(TrkEnums::TrkViewInfo view, int layer) const; 00057 virtual TrkView svtView(int layer) const = 0; 00058 virtual unsigned firstMdcLayer() const = 0; 00059 virtual unsigned lastMdcLayer() const = 0; 00060 virtual double startFoundRange() const = 0; 00061 virtual double endFoundRange() const = 0; 00062 virtual bool isActive(unsigned ihot) const =0; 00063 00064 virtual void append(TrkHitOnTrk* ) = 0; 00065 virtual void remove(TrkHitOnTrk* ) = 0; 00066 virtual void updateHots() = 0; 00067 virtual TrkHitOnTrk* findHot(const TrkFundHit*) const = 0; 00068 virtual void sort(); 00069 00070 void print(std::ostream &o) const; 00071 void printAll(std::ostream &o) const; 00072 00073 protected: 00074 friend struct iterator_traits; // these two want access to hotlist_t... 00075 friend struct const_iterator_traits; 00076 typedef std::vector<TrkHitOnTrk*> hotlist_t; 00077 00078 private: 00079 // Preempt: Hots have to be cloned, not naively copied 00080 TrkHotList(const TrkHotList& rhs); 00081 TrkHotList& operator= (const TrkHotList&); 00082 00083 struct iterator_traits { 00084 typedef TrkHitOnTrk iterator_value_type; 00085 typedef hotlist_t::iterator iterator_implementation; 00086 }; 00087 struct const_iterator_traits { 00088 typedef const TrkHitOnTrk iterator_value_type; 00089 typedef hotlist_t::const_iterator iterator_implementation; 00090 }; 00091 00092 friend class TrkHotListUnowned; // these two want access to hotlist() 00093 friend class TrkHotListFull; 00094 virtual const hotlist_t& hotlist() const = 0; 00095 virtual hotlist_t& hotlist() = 0; 00096 }; 00097 00098 #endif