CGEM BOSS 6.6.5.g
BESIII Offline Software System
Loading...
Searching...
No Matches
TrkFundHit Class Referenceabstract

#include <TrkFundHit.h>

+ Inheritance diagram for TrkFundHit:

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_iteratorgetUsedHits () 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< constTrkHitOnTrk * >::iterator iterator_implementation
 
typedef const TrkHitOnTrk iterator_value_type
 

Protected Member Functions

TrkFundHitoperator= (const TrkFundHit &)
 

Protected Attributes

std::vector< const TrkHitOnTrk * > _hitList
 

Friends

class TrkHitOnTrkIter< TrkFundHit >
 

Detailed Description

Definition at line 42 of file TrkFundHit.h.

Member Typedef Documentation

◆ hot_iterator

Definition at line 45 of file TrkFundHit.h.

◆ iterator_implementation

typedef std::vector<constTrkHitOnTrk*>::iterator TrkFundHit::iterator_implementation
protected

Definition at line 94 of file TrkFundHit.h.

◆ iterator_value_type

Definition at line 95 of file TrkFundHit.h.

Constructor & Destructor Documentation

◆ TrkFundHit()

TrkFundHit::TrkFundHit ( )

Definition at line 33 of file TrkFundHit.cxx.

33 {
34 //std::cout << " @ TrkFundHit constructor: " << ++debug_nHit << " addr: " << this << std::endl;
35}

◆ ~TrkFundHit()

TrkFundHit::~TrkFundHit ( )
virtual

Definition at line 37 of file TrkFundHit.cxx.

38{
39 //std::cout << " @ ~TrkFundHit() : " << --debug_nHit << " addr: " << this << std::endl;
40 // hitlist cleanup done in derived classes
41}

Member Function Documentation

◆ begin()

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

Definition at line 113 of file TrkFundHit.h.

114{
115 return TrkFundHit::hot_iterator(const_cast<std::vector<const TrkHitOnTrk*>&>(_hitList).begin());
116}
std::vector< const TrkHitOnTrk * > _hitList
Definition: TrkFundHit.h:97
TrkFundHit::hot_iterator begin() const
Definition: TrkFundHit.h:113
TrkHitOnTrkIter< TrkFundHit > hot_iterator
Definition: TrkFundHit.h:45

Referenced by begin(), HoughTrack::fitHelix(), getHitOnTrack(), getUsedHits(), and printAll().

◆ end()

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

Definition at line 119 of file TrkFundHit.h.

120{
121 return TrkFundHit::hot_iterator(const_cast<std::vector<const TrkHitOnTrk*>&>(_hitList).end());
122}
TrkFundHit::hot_iterator end() const
Definition: TrkFundHit.h:119

Referenced by end(), getHitOnTrack(), getUsedHits(), and printAll().

◆ getHitOnTrack()

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

Definition at line 95 of file TrkFundHit.cxx.

96{
97 hot_iterator i = std::find_if(begin(), end(),
98 std::bind2nd(TrkBase::Predicates::isHotOnTrack(),trk));
99 return (i==end()?0:i.get());
100}
pointer get() const

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

◆ getUsedHits()

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

Definition at line 60 of file TrkFundHit.h.

60 {
61 return std::pair<TrkFundHit::hot_iterator,TrkFundHit::hot_iterator >(begin(),end());
62 }

◆ nUsedHits()

int TrkFundHit::nUsedHits ( ) const

Definition at line 89 of file TrkFundHit.cxx.

90{
91 return _hitList.size();
92}

Referenced by printAll(), and MdcHit::~MdcHit().

◆ operator=()

TrkFundHit & TrkFundHit::operator= ( const TrkFundHit x)
protected

Definition at line 50 of file TrkFundHit.cxx.

51{
52 //std::cout << " @ TrkFundHit operator= : " << debug_nHit << " addr: " << this << std::endl;
53 assert(_hitList.empty());
54 return *this;
55}

◆ printAll()

void TrkFundHit::printAll ( std::ostream &  os) const
virtual

Reimplemented in MdcHit.

Definition at line 103 of file TrkFundHit.cxx.

104{
105// print(os); // Call through to get subclass info
106 os << " used by " << nUsedHits() << " HOTs" << endl;
107 if (usedHit()) {
108 for (hot_iterator i=begin(); i != end(); ++i) {
109 i->printAll(os);//yzhang debug
110// os << "\ttrack " << i->parentTrack()->id() << ": ";
111// i->print(os); // NOTE: includes endl!
112 //yzhang debug
113 std::cout << " parentTrack" << std::endl;//yzhang debug
114 i->parentTrack()->printAll(std::cout);
115 //zhangy debug
116 }
117 os << endl;
118 }
119}
bool usedHit(void) const
Definition: TrkFundHit.h:57
int nUsedHits() const
Definition: TrkFundHit.cxx:89

Referenced by TrkHitOnTrk::print().

◆ setUnusedHit()

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

Definition at line 75 of file TrkFundHit.cxx.

76{
77 //std::cout << " @ setUnusedHit() : " << debug_nHit << " addr: " << this << std::endl;
78 if (_hitList.empty()) return 0;
79 std::vector<const TrkHitOnTrk*>::iterator i=std::find(_hitList.begin(),_hitList.end(),hit);
80 if (i==_hitList.end()) return 0;
81 assert(*i==hit);
82// std::cout << "TrkFundHit setUnusedHit "<<((MdcHit*)(hit->hit()))->layernumber()<<" "<<((MdcHit*)(hit->hit()))->wirenumber()<<endl;
83//this->printAll(std::cout);//yzhang debug
84 _hitList.erase(i);
85 return hit;
86}

Referenced by TrkHitOnTrk::setUnusedHit().

◆ setUsedHit()

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

Definition at line 58 of file TrkFundHit.cxx.

59{
60 // if (hitList->contains(hit)) {
61 // return;
62 // }
63 //FIXME: check hot corresponds to this hit??
64// std::cout << "TrkFundHit setUsedHit "<<((MdcHit*)(hit->hit()))->layernumber()<<" "<<((MdcHit*)(hit->hit()))->wirenumber()<<endl;
65// this->printAll(std::cout);//yzhang debug
66 _hitList.push_back(hit);
67// std::cout << "after push_bak " << std::endl;//yzhang debug
68// printAll(std::cout);//yzhang debug
69
70 return hit;
71}

Referenced by TrkHitOnTrk::setUsedHit().

◆ usedHit()

bool TrkFundHit::usedHit ( void  ) const
inline

Definition at line 57 of file TrkFundHit.h.

57{return !_hitList.empty();}

Referenced by MdcSeg::addHits(), MdcSegList::getSeed(), MdcSegData::loadevent(), MdcTrackList::pickHits(), and printAll().

◆ usedOnTrack()

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

Definition at line 67 of file TrkFundHit.h.

67{return getHitOnTrack(t) != 0;}
const TrkHitOnTrk * getHitOnTrack(const TrkRecoTrk *trk) const
Definition: TrkFundHit.cxx:95
int t()
Definition: t.c:1

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

◆ whatView()

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

Implemented in MdcHit.

Friends And Related Function Documentation

◆ TrkHitOnTrkIter< TrkFundHit >

friend class TrkHitOnTrkIter< TrkFundHit >
friend

Definition at line 89 of file TrkFundHit.h.

Member Data Documentation

◆ _hitList

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

The documentation for this class was generated from the following files: