00001 //-------------------------------------------------------------------------- 00002 // File and Version Information: 00003 // $Id: TrkHotListUnowned.cxx,v 1.1.1.1 2005/04/21 06:01:42 zhangy Exp $ 00004 // 00005 // Description: class TrkHotListUnowned. A copy of TrkHotListUnowned where the 00006 // hots are not owned by this class. This is useful in nested reps like the 00007 // mini-rep. 00008 // 00009 // Environment: 00010 // Software developed for the BaBar Detector at the SLAC B-Factory. 00011 // 00013 // Copyright (C) 2000 Lawrence Berkeley Laboratory 00014 // 00015 // Author List: 00016 // Dave Brown 11/6/00 00017 //------------------------------------------------------------------------ 00018 00019 //#include "BaBar/BaBar.h" 00020 #include "TrkBase/TrkHotListUnowned.h" 00021 #include "TrkBase/TrkView.h" 00022 #include <assert.h> 00023 //#include "ErrLogger/ErrLog.h" 00024 00025 00026 TrkHotListUnowned::TrkHotListUnowned(TrkHotList* other,bool take) : 00027 _hotl(other),_ownhots(take) 00028 { 00029 } 00030 00031 TrkHotList* 00032 TrkHotListUnowned::clone(TrkBase::Functors::cloneHot) const 00033 { 00034 return new TrkHotListUnowned(_hotl); 00035 } 00036 00037 TrkHotListUnowned::~TrkHotListUnowned() 00038 { 00039 if(_ownhots)delete _hotl; 00040 } 00041 00042 void 00043 TrkHotListUnowned::append(TrkHitOnTrk* newHot) 00044 { 00045 _hotl->append(newHot); 00046 } 00047 00048 void 00049 TrkHotListUnowned::remove(TrkHitOnTrk* deadHot) 00050 { 00051 _hotl->remove(deadHot); 00052 } 00053 00054 TrkHitOnTrk* 00055 TrkHotListUnowned::findHot(const TrkFundHit* theHit) const 00056 { 00057 return _hotl->findHot(theHit); 00058 } 00059 00060 int 00061 TrkHotListUnowned::nActive(TrkEnums::TrkViewInfo view) const 00062 { 00063 return _hotl->nActive(view); 00064 } 00065 00066 int 00067 TrkHotListUnowned::nHit(TrkEnums::TrkViewInfo view) const 00068 { 00069 return _hotl->nHit(view); 00070 } 00071 00072 00073 bool 00074 TrkHotListUnowned::hitCapable() const 00075 { 00076 return _hotl->hitCapable(); 00077 } 00078 00079 int 00080 TrkHotListUnowned::nMdc(TrkEnums::TrkViewInfo view) const 00081 { 00082 return _hotl->nMdc(view); 00083 } 00084 00085 int 00086 TrkHotListUnowned::nSvt(TrkEnums::TrkViewInfo view) const 00087 { 00088 return _hotl->nSvt(view); 00089 } 00090 00091 double 00092 TrkHotListUnowned::startFoundRange() const 00093 { 00094 return _hotl->startFoundRange(); 00095 } 00096 00097 double 00098 TrkHotListUnowned::endFoundRange() const 00099 { 00100 return _hotl->endFoundRange(); 00101 } 00102 00103 void 00104 TrkHotListUnowned::updateHots() 00105 { 00106 _hotl->updateHots(); 00107 } 00108 00109 TrkView 00110 TrkHotListUnowned::svtView(int layer) const { 00111 return _hotl->svtView(layer); 00112 } 00113 00114 unsigned 00115 TrkHotListUnowned::firstMdcLayer() const { 00116 return _hotl->firstMdcLayer(); 00117 } 00118 00119 unsigned 00120 TrkHotListUnowned::lastMdcLayer() const 00121 { 00122 return _hotl->lastMdcLayer(); 00123 } 00124 00125 const std::vector<TrkHitOnTrk*>& 00126 TrkHotListUnowned::hotlist() const 00127 { 00128 return _hotl->hotlist(); 00129 } 00130 00131 std::vector<TrkHitOnTrk*>& 00132 TrkHotListUnowned::hotlist() 00133 { 00134 return _hotl->hotlist(); 00135 } 00136 00137 TrkHotList* 00138 TrkHotListUnowned::takeHotList() { 00139 if(_ownhots){ 00140 _ownhots = false; 00141 return _hotl; 00142 } else 00143 return 0; 00144 } 00145 00146 bool 00147 TrkHotListUnowned::isActive(unsigned ihot) const { 00148 return _hotl->isActive(ihot); 00149 } 00150