BOSS 7.0.2
BESIII Offline Software System
Loading...
Searching...
No Matches
TTrackBase Class Reference

A virtual class for a track class in tracking. More...

#include <TTrackBase.h>

+ Inheritance diagram for TTrackBase:

Public Member Functions

 TTrackBase ()
 Constructor.
 
 TTrackBase (const AList< TMLink > &links)
 Constructor.
 
virtual ~TTrackBase ()
 Destructor.
 
virtual unsigned objectType (void) const
 returns object type.
 
virtual unsigned type (void) const
 returns type. Definition is depending on an object class.
 
virtual void dump (const std::string &message=std::string(""), const std::string &prefix=std::string("")) const
 dumps debug information.
 
const AList< TMLink > & links (unsigned mask=0) const
 returns a list of masked TMLinks assigned to this track. 'mask' will be applied if mask is not 0.
 
unsigned nLinks (unsigned mask=0) const
 returns # of masked TMLinks assigned to this track object.
 
const AList< TMLink > & cores (unsigned mask=0) const
 returns a list of masked TMLinks for fit. 'mask' will be applied if mask is not 0.
 
unsigned nCores (unsigned mask=0) const
 returns # of masked TMLinks for fit. 'mask' will be applied if mask is not 0.
 
void update (void) const
 update cache.
 
void append (TMLink &)
 appends a TMLink.
 
void append (const AList< TMLink > &)
 appends TMLinks.
 
void appendByApproach (AList< TMLink > &list, double maxSigma)
 appends TMLinks by approach. 'list' is an input. Unappended TMLinks will be removed from 'list' when returned.
 
void appendByDistance (AList< TMLink > &list, double maxDistance)
 appends TMLinks by distance. 'list' is an input. Unappended TMLinks will be removed from 'list' when returned.
 
void remove (TMLink &a)
 removes a TMLink.
 
void remove (const AList< TMLink > &)
 removes TMLinks.
 
virtual void refine (AList< TMLink > &list, double maxSigma)
 removes bad points by pull. The bad points are removed from the track, and are returned in 'list'.
 
virtual void refine (double maxSigma)
 removes bad points by pull. The bad points are masked not to be used in fit.
 
virtual int DropWorst ()
 
virtual void removeLinks (void)
 
virtual double distance (const TMLink &) const
 returns distance to a position of TMLink in TMLink space.
 
virtual int approach (TMLink &) const
 calculates the closest approach to a wire in real space. Results are stored in TMLink. Return value is negative if error happened.
 
unsigned testByApproach (const TMLink &list, double sigma) const
 returns # of good hits to be appended.
 
unsigned testByApproach (const AList< TMLink > &list, double sigma) const
 
virtual int fit (void)
 fits itself by a default fitter. Error was happened if return value is not zero.
 
const TMFitter *const fitter (void) const
 returns a pointer to a default fitter.
 
const TMFitter *const fitter (const TMFitter *)
 sets a default fitter.
 
void falseFit ()
 false Fit
 
TMLinkoperator[] (unsigned i) const
 
const TTrackHEP *const hep (void) const
 returns TTrackHEP.
 
unsigned nHeps (void) const
 returns # of contributed TTrackHEP tracks.
 
const TTrackMC *const mc (void) const
 returns a pointer to TTrackMC.
 
bool fitted (void) const
 returns true if fitted.
 
bool fittedWithCathode (void) const
 returns true if fitted with cathode hits(TEMPORARY).
 
 TTrackBase ()
 Constructor.
 
 TTrackBase (const AList< TMLink > &links)
 Constructor.
 
virtual ~TTrackBase ()
 Destructor.
 
virtual unsigned objectType (void) const
 returns object type.
 
virtual unsigned type (void) const
 returns type. Definition is depending on an object class.
 
virtual void dump (const std::string &message=std::string(""), const std::string &prefix=std::string("")) const
 dumps debug information.
 
const AList< TMLink > & links (unsigned mask=0) const
 returns a list of masked TMLinks assigned to this track. 'mask' will be applied if mask is not 0.
 
unsigned nLinks (unsigned mask=0) const
 returns # of masked TMLinks assigned to this track object.
 
const AList< TMLink > & cores (unsigned mask=0) const
 returns a list of masked TMLinks for fit. 'mask' will be applied if mask is not 0.
 
unsigned nCores (unsigned mask=0) const
 returns # of masked TMLinks for fit. 'mask' will be applied if mask is not 0.
 
void update (void) const
 update cache.
 
void append (TMLink &)
 appends a TMLink.
 
void append (const AList< TMLink > &)
 appends TMLinks.
 
void appendByApproach (AList< TMLink > &list, double maxSigma)
 appends TMLinks by approach. 'list' is an input. Unappended TMLinks will be removed from 'list' when returned.
 
void appendByDistance (AList< TMLink > &list, double maxDistance)
 appends TMLinks by distance. 'list' is an input. Unappended TMLinks will be removed from 'list' when returned.
 
void remove (TMLink &a)
 removes a TMLink.
 
void remove (const AList< TMLink > &)
 removes TMLinks.
 
virtual void refine (AList< TMLink > &list, double maxSigma)
 removes bad points by pull. The bad points are removed from the track, and are returned in 'list'.
 
virtual void refine (double maxSigma)
 removes bad points by pull. The bad points are masked not to be used in fit.
 
virtual int DropWorst ()
 
virtual void removeLinks (void)
 
virtual double distance (const TMLink &) const
 returns distance to a position of TMLink in TMLink space.
 
virtual int approach (TMLink &) const
 calculates the closest approach to a wire in real space. Results are stored in TMLink. Return value is negative if error happened.
 
unsigned testByApproach (const TMLink &list, double sigma) const
 returns # of good hits to be appended.
 
unsigned testByApproach (const AList< TMLink > &list, double sigma) const
 
virtual int fit (void)
 fits itself by a default fitter. Error was happened if return value is not zero.
 
const TMFitter *const fitter (void) const
 returns a pointer to a default fitter.
 
const TMFitter *const fitter (const TMFitter *)
 sets a default fitter.
 
void falseFit ()
 false Fit
 
TMLinkoperator[] (unsigned i) const
 
const TTrackHEP *const hep (void) const
 returns TTrackHEP.
 
unsigned nHeps (void) const
 returns # of contributed TTrackHEP tracks.
 
const TTrackMC *const mc (void) const
 returns a pointer to TTrackMC.
 
bool fitted (void) const
 returns true if fitted.
 
bool fittedWithCathode (void) const
 returns true if fitted with cathode hits(TEMPORARY).
 

Protected Attributes

AList< TMLink_links
 
bool _fitted
 
bool _fittedWithCathode
 
TTrackMC_mc
 

Friends

class TMFitter
 
class THelixFitter
 
class TCosmicFitter
 

Detailed Description

A virtual class for a track class in tracking.

Definition at line 46 of file InstallArea/include/TrkReco/TrkReco/TTrackBase.h.

Constructor & Destructor Documentation

◆ TTrackBase() [1/4]

TTrackBase::TTrackBase ( )

Constructor.

Definition at line 40 of file TTrackBase.cxx.

41: _mc(0),
42// _superLayer(0),
43// _nSuperLayers(0),
44 _fitter(0),
45 _updated(true),
46 _fitted(false),
47 _time(0.) {
48// _layer[0] = 0;
49// _layer[1] = 0;
50// _nLayers[0] = 0;
51// _nLayers[1] = 0;
52}

◆ TTrackBase() [2/4]

TTrackBase::TTrackBase ( const AList< TMLink > &  links)

Constructor.

Definition at line 24 of file TTrackBase.cxx.

25: _links(a),
26 _mc(0),
27// _superLayer(0),
28// _nSuperLayers(0),
29 _fitter(0),
30 _updated(false),
31 _fitted(false),
32 _time(0.) {
33// _layer[0] = 0;
34// _layer[1] = 0;
35// _nLayers[0] = 0;
36// _nLayers[1] = 0;
37// update();
38}

◆ ~TTrackBase() [1/2]

TTrackBase::~TTrackBase ( )
virtual

Destructor.

Definition at line 54 of file TTrackBase.cxx.

54 {
55}

◆ TTrackBase() [3/4]

TTrackBase::TTrackBase ( )

Constructor.

◆ TTrackBase() [4/4]

TTrackBase::TTrackBase ( const AList< TMLink > &  links)

Constructor.

◆ ~TTrackBase() [2/2]

virtual TTrackBase::~TTrackBase ( )
virtual

Destructor.

Member Function Documentation

◆ append() [1/4]

void TTrackBase::append ( const AList< TMLink > &  a)

appends TMLinks.

Definition at line 384 of file TTrackBase.cxx.

384 {
385 AList<TMLink> tmp;
386 for (unsigned i = 0; i < a.length(); i++) {
387 if ((_links.hasMember(a[i])) || (a[i]->hit()->state() & WireHitUsed)) {
388#ifdef TRKRECO_DEBUG_DETAIL
389 std::cout << " TTrackBase::append(list) !!! ";
390 std::cout << a[i]->wire()->name();
391 std::cout << " Hey!, this is already used! Don't mess with me.";
392 std::cout << std::endl;
393#endif
394 continue;
395 }
396 else {
397 tmp.append(a[i]);
398 }
399 }
400 _links.append(tmp);
401 _updated = false;
402 _fitted = false;
403 _fittedWithCathode = false; // added by matsu ( 1999/05/24 )
404}

◆ append() [2/4]

void TTrackBase::append ( const AList< TMLink > &  )

appends TMLinks.

◆ append() [3/4]

void TTrackBase::append ( TMLink a)

appends a TMLink.

Definition at line 362 of file TTrackBase.cxx.

362 {
363 if ((a.hit()->state() & WireHitUsed)) {
364#ifdef TRKRECO_DEBUG_DETAIL
365 std::cout << "TTrackBase::append !!! " << a.wire()->name()
366 << " this is already used by another track!" << std::endl;
367#endif
368 return;
369 }
370 if (_links.hasMember(a)) {
371#ifdef TRKRECO_DEBUG_DETAIL
372 std::cout << "TTrackBase::append !!! " << a.wire()->name()
373 << " this is already included in this track!" << std::endl;
374#endif
375 return;
376 }
377 _links.append(a);
378 _updated = false;
379 _fitted = false;
380 _fittedWithCathode = false; // added by matsu ( 1999/05/24 )
381}
unsigned state(void) const
returns state.
std::string name(void) const
returns name.

Referenced by TBuilder::buildStereo(), TBuilder0::buildStereo(), TBuilderCosmic::buildStereo(), TBuilder0::buildStereo0(), TBuilderCurl::buildStereoMC(), TBuilder::buildStereoNew(), THistogram::clusters(), THistogram::clusters0(), TrkReco::execute(), and TTrackManager::salvageAssociateHits().

◆ append() [4/4]

void TTrackBase::append ( TMLink )

appends a TMLink.

◆ appendByApproach() [1/2]

void TTrackBase::appendByApproach ( AList< TMLink > &  list,
double  maxSigma 
)

appends TMLinks by approach. 'list' is an input. Unappended TMLinks will be removed from 'list' when returned.

Definition at line 101 of file TTrackBase.cxx.

101 {
102#ifdef TRKRECO_DEBUG_DETAIL
103 std::cout << " TTrackBase::appendByApproach ... sigma=" << maxSigma << std::endl;
104#endif
105
106 AList<TMLink> unused;
107 unsigned n = list.length();
108 for (unsigned i = 0; i < n; i++) {
109 TMLink & l = * list[i];
110
111 if ((_links.hasMember(l)) || (l.hit()->state() & WireHitUsed))
112 continue;
113
114 //...Calculate closest approach...
115 int err = approach(l);
116 if (err < 0) {
117 unused.append(l);
118 continue;
119 }
120
121 //...Calculate sigma...
122 float distance = (l.positionOnWire() - l.positionOnTrack()).mag();
123 float diff = fabs(distance - l.drift());
124 float sigma = diff / l.dDrift();
125
126 //...For debug...
127#ifdef TRKRECO_DEBUG_DETAIL
128 std::cout << " sigma=" << sigma;
129 std::cout << ",dist=" << distance;
130 std::cout << ",diff=" << diff;
131 std::cout << ",err=" << l.hit()->dDrift() << ",";
132 if (sigma < maxSigma) std::cout << "ok,";
133 else std::cout << "X,";
134 l.dump("mc");
135#endif
136
137 //...Make sigma cut...
138 if (sigma > maxSigma) {
139 unused.append(l);
140 continue;
141 }
142
143 //...OK...
144 _links.append(l);
145 _updated = false;
146 _fitted = false;
147 }
148 list.remove(unused);
149}
const Int_t n
float dDrift(unsigned) const
returns drift distance error.
virtual int approach(TMLink &) const
calculates the closest approach to a wire in real space. Results are stored in TMLink....
Definition: TTrackBase.cxx:95
virtual double distance(const TMLink &) const
returns distance to a position of TMLink in TMLink space.
Definition: TTrackBase.cxx:89

Referenced by TBuilder0::appendClusters(), and TTrackManager::salvage().

◆ appendByApproach() [2/2]

void TTrackBase::appendByApproach ( AList< TMLink > &  list,
double  maxSigma 
)

appends TMLinks by approach. 'list' is an input. Unappended TMLinks will be removed from 'list' when returned.

◆ appendByDistance() [1/2]

void TTrackBase::appendByDistance ( AList< TMLink > &  list,
double  maxDistance 
)

appends TMLinks by distance. 'list' is an input. Unappended TMLinks will be removed from 'list' when returned.

Definition at line 152 of file TTrackBase.cxx.

152 {
153 std::cout << "TTrackBase::appendByDistance !!! not implemented" << std::endl;
154 list.removeAll();
155}

◆ appendByDistance() [2/2]

void TTrackBase::appendByDistance ( AList< TMLink > &  list,
double  maxDistance 
)

appends TMLinks by distance. 'list' is an input. Unappended TMLinks will be removed from 'list' when returned.

◆ approach() [1/2]

int TTrackBase::approach ( TMLink ) const
virtual

calculates the closest approach to a wire in real space. Results are stored in TMLink. Return value is negative if error happened.

Reimplemented in TTrack, and TTrack.

Definition at line 95 of file TTrackBase.cxx.

95 {
96 std::cout << "TTrackBase::approach !!! not implemented" << std::endl;
97 return -1;
98}

Referenced by appendByApproach(), and testByApproach().

◆ approach() [2/2]

virtual int TTrackBase::approach ( TMLink ) const
virtual

calculates the closest approach to a wire in real space. Results are stored in TMLink. Return value is negative if error happened.

Reimplemented in TTrack, and TTrack.

◆ cores() [1/2]

const AList< TMLink > & TTrackBase::cores ( unsigned  mask = 0) const

returns a list of masked TMLinks for fit. 'mask' will be applied if mask is not 0.

Definition at line 317 of file TTrackBase.cxx.

317 {
318 if (mask)
319 std::cout << "TTrackBase::cores !!! mask is not supported" << std::endl;
320 if (! _updated) update();
321 return _cores;
322}
void update(void) const
update cache.
Definition: TTrackBase.cxx:75

Referenced by TBuilder::buildStereoNew(), TTrack::movePivot(), TTrackManager::setCurlerFlags(), TRunge::SetFlightLength(), and TTrack::szPosition().

◆ cores() [2/2]

const AList< TMLink > & TTrackBase::cores ( unsigned  mask = 0) const

returns a list of masked TMLinks for fit. 'mask' will be applied if mask is not 0.

◆ distance() [1/2]

double TTrackBase::distance ( const TMLink ) const
virtual

returns distance to a position of TMLink in TMLink space.

Reimplemented in TLine0, TMLine, TLine0, and TMLine.

Definition at line 89 of file TTrackBase.cxx.

89 {
90 std::cout << "TTrackBase::distance !!! not implemented" << std::endl;
91 return 0.;
92}

Referenced by appendByApproach(), TTrack::fit2D(), and testByApproach().

◆ distance() [2/2]

virtual double TTrackBase::distance ( const TMLink ) const
virtual

returns distance to a position of TMLink in TMLink space.

Reimplemented in TLine0, TMLine, TLine0, and TMLine.

◆ DropWorst() [1/2]

int TTrackBase::DropWorst ( )
virtual

Definition at line 212 of file TTrackBase.cxx.

212 {
213 AList<TMLink> bad;
214 int jbad=-1;
215 double sigma=0;
216 unsigned n = _links.length();
217 double chi2=0;
218 for (unsigned i = 0; i < n; i++){
219 // if(g_sigmalyr1)g_sigmalyr1->fill(sqrt(_links[i]->pull()),_links[i]->wire()->layerId());
220 chi2+=_links[i]->pull();
221 if (_links[i]->pull() > sigma){
222 jbad=i;
223 sigma = _links[i]->pull();
224 }
225 }
226
227 chi2=chi2/n;
228 //if(sigma>9){bad.append(_links[jbad]);if(g_sigmalyr)g_sigmalyr->fill(sqrt(sigma),_links[jbad]->wire()->layerId());}
229// if(sigma>20.25&&chi2>2.08){bad.append(_links[jbad]);}
230 if(sigma>9){bad.append(_links[jbad]);}
231 if (bad.length()) {
232 _links.remove(bad);
233 _fitted = false;
234 _updated = false;
235 }
236 return bad.length();
237}

Referenced by TrkReco::execute().

◆ DropWorst() [2/2]

virtual int TTrackBase::DropWorst ( )
virtual

◆ dump() [1/2]

void TTrackBase::dump ( const std::string &  message = std::string(""),
const std::string &  prefix = std::string("") 
) const
virtual

dumps debug information.

Reimplemented in TCircle, TLine0, TMLine, TSegment, TSegment0, TTrack, TCircle, TLine0, TMLine, TSegment, TSegment0, and TTrack.

Definition at line 58 of file TTrackBase.cxx.

58 {
59 bool mc = (msg.find("mc") != std::string::npos);
60 bool pull = (msg.find("pull") != std::string::npos);
61 bool flag = (msg.find("flag") != std::string::npos);
62 bool detail = (msg.find("detail") != std::string::npos);
63 if (detail)
64 mc = pull = flag = true;
65
66 if (detail || (msg.find("layer") != std::string::npos)) {
67 if (! _updated) update();
68 }
69 if (detail || (msg.find("hits") != std::string::npos)) {
70 Dump(_links, msg, pre);
71 }
72}
const TTrackMC *const mc(void) const
returns a pointer to TTrackMC.

Referenced by TCircle::dump(), TLine0::dump(), TMLine::dump(), TSegment::dump(), TSegment0::dump(), and TTrack::dump().

◆ dump() [2/2]

virtual void TTrackBase::dump ( const std::string &  message = std::string(""),
const std::string &  prefix = std::string("") 
) const
virtual

dumps debug information.

Reimplemented in TCircle, TLine0, TMLine, TSegment, TSegment0, TTrack, TCircle, TLine0, TMLine, TSegment, TSegment0, and TTrack.

◆ falseFit() [1/2]

void TTrackBase::falseFit ( )
inline

false Fit

Definition at line 229 of file InstallArea/include/TrkReco/TrkReco/TTrackBase.h.

229 {
230 _fitted = false;
231 _fittedWithCathode = false;
232}

◆ falseFit() [2/2]

void TTrackBase::falseFit ( )

false Fit

◆ fit() [1/2]

int TTrackBase::fit ( void  )
virtual

fits itself by a default fitter. Error was happened if return value is not zero.

Definition at line 357 of file TTrackBase.cxx.

357 {
358 return _fitter->fit(* this);
359}
virtual int fit(TTrackBase &) const =0

Referenced by TBuilder::buildRphi(), TBuilder0::buildRphi(), TBuilder0::buildStereo(), TBuilderCosmic::buildStereo(), TBuilder0::buildStereo0(), TBuilderCurl::buildStereoMC(), TBuilder::initialLine1(), TBuilder::searchLines1(), TBuilder::searchLines2(), TBuilder::searchLines3(), TBuilder::searchLines4(), TBuilder::searchLines5(), and TBuilder::searchLines6().

◆ fit() [2/2]

virtual int TTrackBase::fit ( void  )
virtual

fits itself by a default fitter. Error was happened if return value is not zero.

◆ fitted() [1/2]

bool TTrackBase::fitted ( void  ) const
inline

returns true if fitted.

Definition at line 222 of file InstallArea/include/TrkReco/TrkReco/TTrackBase.h.

222 {
223 return _fitted;
224}

Referenced by TCosmicFitter::fit(), TBuilder::searchLine(), and TMSelector::select().

◆ fitted() [2/2]

bool TTrackBase::fitted ( void  ) const

returns true if fitted.

◆ fittedWithCathode() [1/2]

bool TTrackBase::fittedWithCathode ( void  ) const
inline

returns true if fitted with cathode hits(TEMPORARY).

Definition at line 243 of file InstallArea/include/TrkReco/TrkReco/TTrackBase.h.

243 {
244 return _fittedWithCathode;
245}

◆ fittedWithCathode() [2/2]

bool TTrackBase::fittedWithCathode ( void  ) const

returns true if fitted with cathode hits(TEMPORARY).

◆ fitter() [1/4]

const TMFitter *const TTrackBase::fitter ( const TMFitter a)
inline

sets a default fitter.

Definition at line 261 of file InstallArea/include/TrkReco/TrkReco/TTrackBase.h.

261 {
262 _fitted = false;
263 return _fitter = a;
264}

◆ fitter() [2/4]

const TMFitter *const TTrackBase::fitter ( const TMFitter )

sets a default fitter.

◆ fitter() [3/4]

const TMFitter *const TTrackBase::fitter ( void  ) const
inline

returns a pointer to a default fitter.

Definition at line 255 of file InstallArea/include/TrkReco/TrkReco/TTrackBase.h.

255 {
256 return _fitter;
257}

Referenced by T3DLine::T3DLine(), TCircle::TCircle(), TLine0::TLine0(), TMLine::TMLine(), TRunge::TRunge(), and TTrack::TTrack().

◆ fitter() [4/4]

const TMFitter *const TTrackBase::fitter ( void  ) const

returns a pointer to a default fitter.

◆ hep() [1/2]

const TTrackHEP *const TTrackBase::hep ( void  ) const

returns TTrackHEP.

Definition at line 407 of file TTrackBase.cxx.

407 {
408 unsigned n = _links.length();
409 CAList<TTrackHEP> hepList;
410 CList<unsigned> hepCounter;
411 for (unsigned i = 0; i < n; i++) {
412 const TTrackHEP * hep = _links[i]->hit()->mc()->hep();
413 unsigned nH = hepList.length();
414 bool found = false;
415 for (unsigned j = 0; j < nH; j++) {
416 if (hepList[j] == hep) {
417 found = true;
418 ++(* hepCounter[j]);
419 }
420 }
421
422 if (! found) {
423 hepList.append(hep);
424 unsigned c = 0;
425 hepCounter.append(c);
426 }
427 }
428
429 _nHeps = hepList.length();
430 _hep = 0;
431 unsigned max = 0;
432 for (unsigned i = 0; i < _nHeps; i++) {
433 if ((* hepCounter[i]) > max) {
434 max = (* hepCounter[i]);
435 _hep = hepList[i];
436 }
437 }
438
439 return _hep;
440}
const TTrackHEP *const hep(void) const
returns TTrackHEP.
Definition: TTrackBase.cxx:407
A class to represent a GEN_HEPEVT particle in tracking.

Referenced by hep(), and nHeps().

◆ hep() [2/2]

const TTrackHEP *const TTrackBase::hep ( void  ) const

returns TTrackHEP.

◆ links() [1/2]

const AList< TMLink > & TTrackBase::links ( unsigned  mask = 0) const

◆ links() [2/2]

const AList< TMLink > & TTrackBase::links ( unsigned  mask = 0) const

returns a list of masked TMLinks assigned to this track. 'mask' will be applied if mask is not 0.

◆ mc() [1/2]

const TTrackMC *const TTrackBase::mc ( void  ) const
inline

returns a pointer to TTrackMC.

Definition at line 249 of file InstallArea/include/TrkReco/TrkReco/TTrackBase.h.

249 {
250 return _mc;
251}

Referenced by dump().

◆ mc() [2/2]

const TTrackMC *const TTrackBase::mc ( void  ) const

returns a pointer to TTrackMC.

◆ nCores() [1/2]

unsigned TTrackBase::nCores ( unsigned  mask = 0) const

returns # of masked TMLinks for fit. 'mask' will be applied if mask is not 0.

Definition at line 325 of file TTrackBase.cxx.

325 {
326 if (mask)
327 std::cout << "TTrackBase::nCores !!! mask is not supported" << std::endl;
328 if (! _updated) update();
329 return _cores.length();
330}

Referenced by TTrack::dump().

◆ nCores() [2/2]

unsigned TTrackBase::nCores ( unsigned  mask = 0) const

returns # of masked TMLinks for fit. 'mask' will be applied if mask is not 0.

◆ nHeps() [1/2]

unsigned TTrackBase::nHeps ( void  ) const

returns # of contributed TTrackHEP tracks.

Definition at line 443 of file TTrackBase.cxx.

443 {
444 hep();
445 return _nHeps;
446}

◆ nHeps() [2/2]

unsigned TTrackBase::nHeps ( void  ) const

returns # of contributed TTrackHEP tracks.

◆ nLinks() [1/2]

unsigned TTrackBase::nLinks ( unsigned  mask = 0) const

returns # of masked TMLinks assigned to this track object.

Definition at line 305 of file TTrackBase.cxx.

305 {
306 unsigned n = _links.length();
307 if (mask == 0) return n;
308 unsigned nn = 0;
309 for (unsigned i = 0; i < n; i++) {
310 const TMDCWireHit & h = * _links[i]->hit();
311 if (h.state() & mask) ++nn;
312 }
313 return nn;
314}

Referenced by TBuilderCurl::buildStereo(), TBuilderCurl::buildStereoMC(), TSegment::clusterType(), TSegment0::clusterType(), and TMSelector::preSelect().

◆ nLinks() [2/2]

unsigned TTrackBase::nLinks ( unsigned  mask = 0) const

returns # of masked TMLinks assigned to this track object.

◆ objectType() [1/2]

unsigned TTrackBase::objectType ( void  ) const
inlinevirtual

◆ objectType() [2/2]

virtual unsigned TTrackBase::objectType ( void  ) const
virtual

returns object type.

Reimplemented in T3DLine, TCircle, TLine0, TMLine, TRunge, TSegment, TSegment0, TTrack, T3DLine, TCircle, TLine0, TMLine, TRunge, TSegment, TSegment0, and TTrack.

◆ operator[]() [1/2]

TMLink * TTrackBase::operator[] ( unsigned  i) const
inline

Definition at line 237 of file InstallArea/include/TrkReco/TrkReco/TTrackBase.h.

237 {
238 return _links[i];
239}

◆ operator[]() [2/2]

TMLink * TTrackBase::operator[] ( unsigned  i) const

◆ refine() [1/4]

void TTrackBase::refine ( AList< TMLink > &  list,
double  maxSigma 
)
virtual

removes bad points by pull. The bad points are removed from the track, and are returned in 'list'.

Definition at line 170 of file TTrackBase.cxx.

170 {
171 AList<TMLink> bad = refineMain(sigma);
172#ifdef TRKRECO_DEBUG
173 std::cout << " refine ... sigma=" << sigma << ", # of rejected hits=";
174 std::cout << bad.length() << std::endl;
175#endif
176#ifdef TRKRECO_DEBUG
177 Dump(bad, "sort pull mc", " ");
178#endif
179
180 if (bad.length()) {
181 _links.remove(bad);
182 list.append(bad);
183 _fitted = false;
184 _updated = false;
185 }
186}

Referenced by TBuilder0::appendClusters(), TBuilder::buildStereo(), TBuilder0::buildStereo(), TBuilderCosmic::buildStereo(), TBuilderCurl::buildStereo(), TBuilder0::buildStereo0(), and TBuilderCurl::buildStereoMC().

◆ refine() [2/4]

virtual void TTrackBase::refine ( AList< TMLink > &  list,
double  maxSigma 
)
virtual

removes bad points by pull. The bad points are removed from the track, and are returned in 'list'.

◆ refine() [3/4]

void TTrackBase::refine ( double  maxSigma)
virtual

removes bad points by pull. The bad points are masked not to be used in fit.

Definition at line 194 of file TTrackBase.cxx.

194 {
195 AList<TMLink> bad = refineMain(sigma);
196// for (unsigned i = 0; i < bad.length(); i++) {
197// const TMDCWireHit * hit = bad[i]->hit();
198// hit->state(hit->state() | WireHitInvalidForFit);
199// }
200
201#ifdef TRKRECO_DEBUG_DETAIL
202 std::cout << " refine ... sigma=" << sigma << std::endl;
203 Dump(bad, "detail sort", " ");
204#endif
205
206 if (bad.length()) {
207 _fitted = false;
208 _updated = false;
209 }
210}

◆ refine() [4/4]

virtual void TTrackBase::refine ( double  maxSigma)
virtual

removes bad points by pull. The bad points are masked not to be used in fit.

◆ remove() [1/4]

void TTrackBase::remove ( const AList< TMLink > &  a)
inline

removes TMLinks.

Definition at line 213 of file InstallArea/include/TrkReco/TrkReco/TTrackBase.h.

213 {
214 _links.remove(a);
215 _updated = false;
216 _fitted = false;
217 _fittedWithCathode = false; // mod. by matsu ( 1999/05/24 )
218}

◆ remove() [2/4]

void TTrackBase::remove ( const AList< TMLink > &  )

removes TMLinks.

◆ remove() [3/4]

void TTrackBase::remove ( TMLink a)
inline

removes a TMLink.

Definition at line 204 of file InstallArea/include/TrkReco/TrkReco/TTrackBase.h.

204 {
205 _links.remove(a);
206 _updated = false;
207 _fitted = false;
208 _fittedWithCathode = false; // mod. by matsu ( 1999/05/24 )
209}

Referenced by TBuilder::buildStereoNew(), TTrackManager::maskCurl(), TTrackManager::maskNormal(), and TBuilder::searchLine().

◆ remove() [4/4]

void TTrackBase::remove ( TMLink a)

removes a TMLink.

◆ removeLinks() [1/2]

void TTrackBase::removeLinks ( void  )
virtual

Definition at line 189 of file TTrackBase.cxx.

189 {
190 _links.removeAll();
191}

Referenced by TBuilderCosmic::buildStereo(), and TrkReco::execute().

◆ removeLinks() [2/2]

virtual void TTrackBase::removeLinks ( void  )
virtual

◆ testByApproach() [1/4]

unsigned TTrackBase::testByApproach ( const AList< TMLink > &  list,
double  sigma 
) const

Definition at line 240 of file TTrackBase.cxx.

240 {
241#ifdef TRKRECO_DEBUG_DETAIL
242 std::cout << " TTrackBase::testByApproach ... sigma=" << maxSigma << std::endl;
243#endif
244
245 unsigned nOK = 0;
246 unsigned n = list.length();
247 for (unsigned i = 0; i < n; i++) {
248 TMLink & l = * list[i];
249 nOK += testByApproach(l, maxSigma);
250 }
251 return nOK;
252}
unsigned testByApproach(const TMLink &list, double sigma) const
returns # of good hits to be appended.
Definition: TTrackBase.cxx:255

◆ testByApproach() [2/4]

unsigned TTrackBase::testByApproach ( const AList< TMLink > &  list,
double  sigma 
) const

◆ testByApproach() [3/4]

unsigned TTrackBase::testByApproach ( const TMLink list,
double  sigma 
) const

returns # of good hits to be appended.

Definition at line 255 of file TTrackBase.cxx.

255 {
256#ifdef TRKRECO_DEBUG_DETAIL
257 std::cout << " TTrackBase::testByApproach ... sigma=" << maxSigma << std::endl;
258#endif
259 TMLink l = link;
260
261 //...Calculate closest approach...
262 int err = approach(l);
263 if (err < 0) return 0;
264 //...Calculate sigma...
265 float distance = l.distance();
266 float diff = fabs(distance - l.hit()->drift());
267 float sigma = diff / l.hit()->dDrift();
268 l.pull(sigma * sigma);
269
270 //...For debug...
271#ifdef TRKRECO_DEBUG_DETAIL
272 std::cout << " sigma=" << sigma;
273 std::cout << ",dist=" << distance;
274 std::cout << ",diff=" << diff << ",";
275 if (sigma < maxSigma) std::cout << "ok,";
276 else std::cout << "X,";
277 l.dump("mc");
278#endif
279
280 //...Make sigma cut...
281 if (sigma < maxSigma) return 1;
282
283 return 0;
284}
float drift(unsigned) const
returns drift distance.

Referenced by TTrackManager::setCurlerFlags(), and testByApproach().

◆ testByApproach() [4/4]

unsigned TTrackBase::testByApproach ( const TMLink list,
double  sigma 
) const

returns # of good hits to be appended.

◆ type() [1/2]

unsigned TTrackBase::type ( void  ) const
inlinevirtual

returns type. Definition is depending on an object class.

Reimplemented in TTrack, and TTrack.

Definition at line 274 of file InstallArea/include/TrkReco/TrkReco/TTrackBase.h.

274 {
275 return 0;
276}

◆ type() [2/2]

virtual unsigned TTrackBase::type ( void  ) const
virtual

returns type. Definition is depending on an object class.

Reimplemented in TTrack, and TTrack.

◆ update() [1/2]

void TTrackBase::update ( void  ) const

update cache.

Definition at line 75 of file TTrackBase.cxx.

75 {
76 _cores.removeAll();
77 unsigned n = _links.length();
78 for (unsigned i = 0; i < n; i++) {
79 TMLink * l = _links[i];
80 const TMDCWireHit & h = * l->hit();
81 if (h.state() & WireHitInvalidForFit) continue;
82 if (! (h.state() & WireHitFittingValid)) continue;
83 _cores.append(l);
84 }
85 _updated = true;
86}

Referenced by cores(), dump(), and nCores().

◆ update() [2/2]

void TTrackBase::update ( void  ) const

update cache.

Friends And Related Function Documentation

◆ TCosmicFitter

◆ THelixFitter

◆ TMFitter

Member Data Documentation

◆ _fitted

◆ _fittedWithCathode

bool TTrackBase::_fittedWithCathode
mutableprotected

◆ _links

◆ _mc

TTrackMC * TTrackBase::_mc
protected

Definition at line 165 of file InstallArea/include/TrkReco/TrkReco/TTrackBase.h.

Referenced by mc().


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