BOSS 7.0.7
BESIII Offline Software System
Loading...
Searching...
No Matches
TrkHitList Class Reference

#include <TrkHitList.h>

Public Types

typedef TrkHotList::hot_iterator hot_iterator
 

Public Member Functions

virtual ~TrkHitList ()
 
unsigned nHit () const
 
hot_iterator begin () const
 
hot_iterator end () const
 
const TrkHotListhotList () const
 
bool removeHit (const TrkFundHit *theHit)
 
TrkHitOnTrkappendHot (const TrkHitOnTrk *theHot)
 
TrkHitOnTrkappendHit (const TrkHitUse &theHit)
 
bool append (const TrkHitList &list)
 
void setActivity (const TrkHitOnTrk &)
 
TrkErrCode fit ()
 
bool operator== (const TrkHitList &right) const
 

Friends

class TrkRecoTrk
 

Detailed Description

Definition at line 35 of file TrkHitList.h.

Member Typedef Documentation

◆ hot_iterator

Constructor & Destructor Documentation

◆ ~TrkHitList()

TrkHitList::~TrkHitList ( )
virtual

Definition at line 34 of file TrkHitList.cxx.

35{
36}

Member Function Documentation

◆ append()

bool TrkHitList::append ( const TrkHitList list)

Definition at line 138 of file TrkHitList.cxx.

139{
140 bool x(true);
141 for(TrkHitList::hot_iterator i = list.begin(); i!=list.end();++i) {
142 TrkHitOnTrk* h = appendHot(i.get());
143 x = ( x && h!=0);
144 }
145 return x;
146}
hot_iterator begin() const
Definition: TrkHitList.h:45
TrkHitOnTrk * appendHot(const TrkHitOnTrk *theHot)
Definition: TrkHitList.cxx:91
hot_iterator end() const
Definition: TrkHitList.h:46
double x[1000]

◆ appendHit()

TrkHitOnTrk * TrkHitList::appendHit ( const TrkHitUse theHit)

Definition at line 114 of file TrkHitList.cxx.

115{
116 // Test whether hit already on this track
117 if (theHit.hit().usedOnTrack(_theTrack)) {
118#ifdef MDCPATREC_WARNING
119 cout <<"ErrMsg(warning)"
120 <<"You just tried to add a hit to a track twice."
121 <<" Don't do that. " << endl;
122#endif
123 return 0;
124 }
125 TrkHitOnTrk* defaultHot = 0;
126
127 std::pair<TrkRepIter,TrkRepIter> reps = _theTrack->uniqueReps();
128 for (TrkRepIter i= reps.first; i != reps.second; ++i) {
129 TrkHitOnTrk* h = theHit.createHitOnTrk(*i);
130
131 i->addHot(h);
132 if (i->particleType() == _theTrack->defaultType()) defaultHot = h;
133 }
134 return defaultHot;
135}
bool usedOnTrack(const TrkRecoTrk *t) const
Definition: TrkFundHit.h:67
const TrkFundHit & hit() const
Definition: TrkHitUse.h:35
virtual TrkHitOnTrk * createHitOnTrk(const TrkRep &) const =0
PdtPid::PidType defaultType() const
Definition: TrkRecoTrk.h:78
std::pair< TrkRepIter, TrkRepIter > uniqueReps() const
Definition: TrkRecoTrk.cxx:529

Referenced by MdcSegGrouper::transferHits().

◆ appendHot()

TrkHitOnTrk * TrkHitList::appendHot ( const TrkHitOnTrk theHot)

Definition at line 91 of file TrkHitList.cxx.

92{
93 if (theHot == 0) return 0;
94 // Test whether hit already on this track
95 if (theHot->hit() != 0 && theHot->hit()->usedOnTrack(_theTrack)) {
96#ifdef MDCPATREC_WARNING
97 cout <<"ErrMsg(warning)"
98 << "You just tried to add a hit to a track twice. "
99 <<" Don't do that. "<< endl;
100#endif
101 return 0;
102 }
103 TrkHitOnTrk* defaultHot = 0;
104 std::pair<TrkRepIter,TrkRepIter> reps = _theTrack->uniqueReps();
105 for (TrkRepIter i=reps.first; i != reps.second; ++i) {
106 TrkHitOnTrk* h = theHot->clone(i.get());
107 i->addHot(h);
108 if (i->particleType() == _theTrack->defaultType()) defaultHot = h;
109 }
110 return defaultHot;
111}
virtual TrkHitOnTrk * clone(TrkRep *parentRep, const TrkDifTraj *trkTraj=0) const =0
const TrkFundHit * hit() const
Definition: TrkHitOnTrk.h:75

Referenced by append(), Hough2D::fit(), Hough3D::fit(), MdcxCosmicSewer::MdcxHitsToHots(), and MdcTrackList::pickHits().

◆ begin()

hot_iterator TrkHitList::begin ( ) const
inline

Definition at line 45 of file TrkHitList.h.

45{ return hotList().begin(); }
const TrkHotList & hotList() const
Definition: TrkHitList.cxx:51
hot_iterator begin() const
Definition: TrkHotList.h:44

Referenced by append(), MdcTrackListBase::arbitrateHits(), MdcTrkRecon::fillTrackList(), nHit(), MdcTrackList::pickHits(), MdcTrack::storeTrack(), and TrkOutAvgTimeCalculator::trackTime().

◆ end()

hot_iterator TrkHitList::end ( ) const
inline

◆ fit()

TrkErrCode TrkHitList::fit ( )

Definition at line 59 of file TrkHitList.cxx.

60{
61 _theTrack->_fitNumber[_myHypo]++;
62
63 TrkErrCode err = theRep()->fit();
64 theRep()->hotList()->sort();
65 return err;
66}
virtual void sort()
Definition: TrkHotList.cxx:71
virtual TrkErrCode fit()=0
virtual TrkHotList * hotList()
Definition: TrkRep.h:109

Referenced by MdcTrackListBase::arbitrateHits(), MdcxCosmicSewer::execute(), MdcTrackListCsmc::finish3d(), MdcTrackList::finishCircle(), MdcTrackList::finishHelix(), Hough2D::fit(), and Hough3D::fit().

◆ hotList()

◆ nHit()

◆ operator==()

bool TrkHitList::operator== ( const TrkHitList right) const
inline

Definition at line 66 of file TrkHitList.h.

66{return this == &right;}

◆ removeHit()

bool TrkHitList::removeHit ( const TrkFundHit theHit)

Definition at line 69 of file TrkHitList.cxx.

70{
71 // This would be more efficient if the Rep did the finding of the Hot
72 // (save one search through each hotlist).
73 if (theHit == 0) return false;
74 if (!theHit->usedOnTrack(_theTrack)) {
75#ifdef MDCPATREC_WARNING
76 cout <<"ErrMsg(warning) "<<
77 "TrkHitList: you just deleted a hit that was not on the track." << endl;
78#endif
79 return false;
80 }
81 std::pair<TrkRepIter,TrkRepIter> reps = _theTrack->uniqueReps();
82 for (TrkRepIter i= reps.first; i != reps.second; ++i) {
83 // Find the Hot and ask the Rep to remove it
84 TrkHitOnTrk* h = i->hotList()->findHot(theHit);
85 if (h != 0) i->removeHot(h);
86 }
87 return true;
88}

Referenced by MdcTrackListBase::arbitrateHits(), and MdcTrackList::pickHits().

◆ setActivity()

void TrkHitList::setActivity ( const TrkHitOnTrk )

Friends And Related Function Documentation

◆ TrkRecoTrk

friend class TrkRecoTrk
friend

Definition at line 83 of file TrkHitList.h.


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