TrkFundHit Class Reference

#include <TrkFundHit.h>

Inheritance diagram for TrkFundHit:

ContainedObject MdcHit List of all members.

Public Types

typedef TrkHitOnTrkIter< TrkFundHithot_iterator

Public Member Functions

 TrkFundHit ()
virtual ~TrkFundHit ()
int nUsedHits () const
bool usedHit (void) const
std::pair< TrkFundHit::hot_iterator,
TrkFundHit::hot_iterator
getUsedHits () const
TrkFundHit::hot_iterator begin () const
TrkFundHit::hot_iterator end () const
bool usedOnTrack (const TrkRecoTrk *t) const
const TrkHitOnTrkgetHitOnTrack (const TrkRecoTrk *trk) const
const TrkHitOnTrksetUsedHit (const TrkHitOnTrk *hit)
const TrkHitOnTrksetUnusedHit (const TrkHitOnTrk *hit)
virtual TrkEnums::TrkViewInfo whatView () const =0
virtual void printAll (std::ostream &os) const

Protected Types

typedef std::vector< const
TrkHitOnTrk * >::iterator 
iterator_implementation
typedef const TrkHitOnTrk iterator_value_type

Protected Member Functions

TrkFundHitoperator= (const TrkFundHit &)

Protected Attributes

std::vector< const TrkHitOnTrk * > _hitList

Private Member Functions

 TrkFundHit (const TrkFundHit &)

Friends

class TrkHitOnTrkIter< TrkFundHit >

Detailed Description

Definition at line 42 of file TrkFundHit.h.


Member Typedef Documentation

typedef TrkHitOnTrkIter<TrkFundHit> TrkFundHit::hot_iterator

Definition at line 45 of file TrkFundHit.h.

typedef std::vector<const TrkHitOnTrk*>::iterator TrkFundHit::iterator_implementation [protected]

Definition at line 94 of file TrkFundHit.h.

typedef const TrkHitOnTrk TrkFundHit::iterator_value_type [protected]

Definition at line 95 of file TrkFundHit.h.


Constructor & Destructor Documentation

TrkFundHit::TrkFundHit (  ) 

Definition at line 33 of file TrkFundHit.cxx.

00033                        {
00034   //std::cout << " @ TrkFundHit constructor: " << ++debug_nHit << " addr: " << this << std::endl;
00035 }

TrkFundHit::~TrkFundHit (  )  [virtual]

Definition at line 37 of file TrkFundHit.cxx.

00038 {
00039   //std::cout << " @ ~TrkFundHit() : " << --debug_nHit << " addr: " << this << std::endl;
00040   // hitlist cleanup done in derived classes
00041 }

TrkFundHit::TrkFundHit ( const TrkFundHit  )  [private]

Definition at line 43 of file TrkFundHit.cxx.

References _hitList.

00044 {
00045   assert(_hitList.empty());
00046   //std::cout << " @ TrkFundHit copy constructor : " << ++debug_nHit << " addr: " << this << std::endl;
00047 }


Member Function Documentation

TrkFundHit::hot_iterator TrkFundHit::begin (  )  const [inline]

Definition at line 113 of file TrkFundHit.h.

References _hitList.

Referenced by getHitOnTrack(), and getUsedHits().

00114 {
00115         return TrkFundHit::hot_iterator(const_cast<std::vector<const TrkHitOnTrk*>&>(_hitList).begin());
00116 }

TrkFundHit::hot_iterator TrkFundHit::end (  )  const [inline]

Definition at line 119 of file TrkFundHit.h.

References _hitList.

Referenced by getHitOnTrack(), and getUsedHits().

00120 {
00121         return TrkFundHit::hot_iterator(const_cast<std::vector<const TrkHitOnTrk*>&>(_hitList).end());
00122 }

const TrkHitOnTrk * TrkFundHit::getHitOnTrack ( const TrkRecoTrk trk  )  const

Definition at line 95 of file TrkFundHit.cxx.

References begin(), end(), and genRecEmupikp::i.

Referenced by MdcTrackList::pickHits(), and usedOnTrack().

00096 {
00097   hot_iterator i = std::find_if(begin(), end(),
00098                                 std::bind2nd(TrkBase::Predicates::isHotOnTrack(),trk));
00099   return (i==end()?0:i.get());
00100 }

std::pair<TrkFundHit::hot_iterator, TrkFundHit::hot_iterator > TrkFundHit::getUsedHits (  )  const [inline]

Definition at line 60 of file TrkFundHit.h.

References begin(), and end().

00060                                                          {
00061         return std::pair<TrkFundHit::hot_iterator,TrkFundHit::hot_iterator >(begin(),end());
00062   }

int TrkFundHit::nUsedHits (  )  const

Definition at line 89 of file TrkFundHit.cxx.

References _hitList.

Referenced by MdcHit::~MdcHit().

00090 {
00091   return _hitList.size();
00092 }

TrkFundHit & TrkFundHit::operator= ( const TrkFundHit  )  [protected]

Definition at line 50 of file TrkFundHit.cxx.

References _hitList.

00051 {
00052   //std::cout << " @ TrkFundHit operator= : " << debug_nHit << " addr: " << this << std::endl;
00053   assert(_hitList.empty()); 
00054   return *this;
00055 }

virtual void TrkFundHit::printAll ( std::ostream os  )  const [virtual]

Reimplemented in MdcHit.

const TrkHitOnTrk * TrkFundHit::setUnusedHit ( const TrkHitOnTrk hit  ) 

Definition at line 75 of file TrkFundHit.cxx.

References _hitList, and genRecEmupikp::i.

Referenced by TrkHitOnTrk::setUnusedHit().

00076 {
00077   //std::cout << " @ setUnusedHit() : " << debug_nHit << " addr: " << this << std::endl;
00078   if (_hitList.empty()) return 0;
00079   std::vector<const TrkHitOnTrk*>::iterator i=std::find(_hitList.begin(),_hitList.end(),hit);
00080   if (i==_hitList.end()) return 0;
00081   assert(*i==hit);
00082 //  std::cout << "TrkFundHit setUnusedHit "<<((MdcHit*)(hit->hit()))->layernumber()<<" "<<((MdcHit*)(hit->hit()))->wirenumber()<<endl;
00083 //this->printAll(std::cout);//yzhang debug
00084   _hitList.erase(i);
00085   return hit;
00086 }

const TrkHitOnTrk * TrkFundHit::setUsedHit ( const TrkHitOnTrk hit  ) 

Definition at line 58 of file TrkFundHit.cxx.

References _hitList.

Referenced by TrkHitOnTrk::setUsedHit().

00059 {
00060   //  if (hitList->contains(hit)) {
00061   //    return;
00062   //  }
00063   //FIXME: check hot corresponds to this hit??
00064 //      std::cout << "TrkFundHit setUsedHit "<<((MdcHit*)(hit->hit()))->layernumber()<<" "<<((MdcHit*)(hit->hit()))->wirenumber()<<endl;
00065 //      this->printAll(std::cout);//yzhang debug
00066   _hitList.push_back(hit);
00067 //        std::cout << "after push_bak " << std::endl;//yzhang debug
00068 //        printAll(std::cout);//yzhang debug
00069           
00070   return hit;
00071 }

bool TrkFundHit::usedHit ( void   )  const [inline]

Definition at line 57 of file TrkFundHit.h.

References _hitList.

Referenced by MdcTrackList::pickHits().

00057 {return !_hitList.empty();}

bool TrkFundHit::usedOnTrack ( const TrkRecoTrk t  )  const [inline]

Definition at line 67 of file TrkFundHit.h.

References getHitOnTrack(), and t().

Referenced by TrkHitList::appendHit(), TrkHitList::appendHot(), and TrkHitList::removeHit().

00067 {return getHitOnTrack(t) != 0;}

virtual TrkEnums::TrkViewInfo TrkFundHit::whatView (  )  const [pure virtual]

Implemented in MdcHit.


Friends And Related Function Documentation

friend class TrkHitOnTrkIter< TrkFundHit > [friend]

Definition at line 92 of file TrkFundHit.h.


Member Data Documentation

std::vector<const TrkHitOnTrk*> TrkFundHit::_hitList [protected]

Definition at line 97 of file TrkFundHit.h.

Referenced by begin(), end(), nUsedHits(), operator=(), setUnusedHit(), setUsedHit(), TrkFundHit(), usedHit(), and MdcHit::~MdcHit().


Generated on Tue Nov 29 23:36:14 2016 for BOSS_7.0.2 by  doxygen 1.4.7