TTrackBase Class Reference

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

#include <TTrackBase.h>

Inheritance diagram for TTrackBase:

T3DLine TCircle TLine0 TMLine TRunge TSegment TSegment0 TTrack List of all members.

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).

Protected Attributes

AList< TMLink_links
bool _fitted
bool _fittedWithCathode
TTrackMC_mc

Private Member Functions

AList< TMLinkrefineMain (double maxSigma)
 refine core part.

Private Attributes

bool _updated
AList< TMLink_cores
const TTrackHEP_hep
unsigned _nHeps
const TMFitter_fitter
float _time

Friends

class TMFitter
class THelixFitter
class TCosmicFitter

Detailed Description

A virtual class for a track class in tracking.

Definition at line 46 of file TTrackBase.h.


Constructor & Destructor Documentation

TTrackBase::TTrackBase (  ) 

Constructor.

Definition at line 40 of file TTrackBase.cxx.

00041 : _mc(0),
00042 //    _superLayer(0),
00043 //    _nSuperLayers(0),
00044   _fitter(0),
00045   _updated(true),
00046   _fitted(false),
00047   _time(0.) {
00048 //      _layer[0] = 0;
00049 //      _layer[1] = 0;
00050 //      _nLayers[0] = 0;
00051 //      _nLayers[1] = 0;
00052 }

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

Constructor.

Definition at line 24 of file TTrackBase.cxx.

00025 : _links(a),
00026   _mc(0),
00027 //    _superLayer(0),
00028 //    _nSuperLayers(0),
00029   _fitter(0),
00030   _updated(false),
00031   _fitted(false),
00032   _time(0.) {
00033 //      _layer[0] = 0;
00034 //      _layer[1] = 0;
00035 //      _nLayers[0] = 0;
00036 //      _nLayers[1] = 0;
00037 //    update();
00038 }

TTrackBase::~TTrackBase (  )  [virtual]

Destructor.

Definition at line 54 of file TTrackBase.cxx.

00054                         {
00055 }


Member Function Documentation

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

appends TMLinks.

Definition at line 384 of file TTrackBase.cxx.

References _fitted, _fittedWithCathode, _links, _updated, genRecEmupikp::i, and WireHitUsed.

00384                                           {
00385     AList<TMLink> tmp;
00386     for (unsigned i = 0; i < a.length(); i++) {
00387         if ((_links.hasMember(a[i])) || (a[i]->hit()->state() & WireHitUsed)) {
00388 #ifdef TRKRECO_DEBUG_DETAIL
00389             std::cout << "    TTrackBase::append(list) !!! ";
00390             std::cout << a[i]->wire()->name();
00391             std::cout << " Hey!, this is already used! Don't mess with me.";
00392             std::cout << std::endl;
00393 #endif
00394             continue;
00395         }
00396         else {
00397             tmp.append(a[i]);
00398         }
00399     }
00400     _links.append(tmp);
00401     _updated = false;
00402     _fitted = false;
00403     _fittedWithCathode = false; // added by matsu ( 1999/05/24 )
00404 }

void TTrackBase::append ( TMLink  ) 

appends a TMLink.

Definition at line 362 of file TTrackBase.cxx.

References _fitted, _fittedWithCathode, _links, _updated, TMLink::hit(), TMDCWire::name(), TMDCWireHit::state(), TMLink::wire(), and WireHitUsed.

Referenced by TBuilderCosmic::buildStereo(), TBuilder0::buildStereo(), TBuilder::buildStereo(), TBuilder0::buildStereo0(), TBuilderCurl::buildStereoMC(), TBuilder::buildStereoNew(), THistogram::clusters(), THistogram::clusters0(), TCurlFinder::dividing2DTrack(), TrkReco::execute(), TConformalFinder::link(), TCurlFinder::make2DTrack(), TTrackManager::merge(), TTrackManager::salvageAssociateHits(), TSegment0::splitAV(), TSegment::splitAV(), TSegment0::splitParallel(), TSegment::splitParallel(), and TConformalFinder0::standardFinding().

00362                              {
00363     if ((a.hit()->state() & WireHitUsed)) {
00364 #ifdef TRKRECO_DEBUG_DETAIL
00365         std::cout << "TTrackBase::append !!! " << a.wire()->name()
00366                   << " this is already used by another track!" << std::endl;
00367 #endif
00368         return;
00369     }
00370     if (_links.hasMember(a)) {
00371 #ifdef TRKRECO_DEBUG_DETAIL
00372         std::cout << "TTrackBase::append !!! " << a.wire()->name()
00373                   << " this is already included in this track!" << std::endl;
00374 #endif
00375         return;
00376     }
00377     _links.append(a);
00378     _updated = false;
00379     _fitted = false;
00380     _fittedWithCathode = false; // added by matsu ( 1999/05/24 )
00381 }

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.

References _fitted, _links, _updated, approach(), distance(), showlog::err, genRecEmupikp::i, and WireHitUsed.

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

00101                                                                   {
00102 #ifdef TRKRECO_DEBUG_DETAIL
00103     std::cout << "    TTrackBase::appendByApproach ... sigma=" << maxSigma << std::endl;
00104 #endif
00105 
00106     AList<TMLink> unused;
00107     unsigned n = list.length();
00108     for (unsigned i = 0; i < n; i++) {
00109         TMLink & l = * list[i];
00110 
00111         if ((_links.hasMember(l)) || (l.hit()->state() & WireHitUsed))
00112             continue;
00113 
00114         //...Calculate closest approach...
00115         int err = approach(l);
00116         if (err < 0) {
00117             unused.append(l);
00118             continue;
00119         }
00120 
00121         //...Calculate sigma...
00122         float distance = (l.positionOnWire() - l.positionOnTrack()).mag();
00123         float diff = fabs(distance - l.drift());
00124         float sigma = diff / l.dDrift();
00125 
00126         //...For debug...
00127 #ifdef TRKRECO_DEBUG_DETAIL
00128         std::cout << "    sigma=" << sigma;
00129         std::cout << ",dist=" << distance;
00130         std::cout << ",diff=" << diff;
00131         std::cout << ",err=" << l.hit()->dDrift() << ",";
00132         if (sigma < maxSigma) std::cout << "ok,";
00133         else                  std::cout << "X,";
00134         l.dump("mc");
00135 #endif
00136                 
00137         //...Make sigma cut...
00138         if (sigma > maxSigma) {
00139             unused.append(l);
00140             continue;
00141         }
00142 
00143         //...OK...
00144         _links.append(l);
00145         _updated = false;
00146         _fitted = false;
00147     }
00148     list.remove(unused);
00149 }

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.

00152                                                                {
00153     std::cout << "TTrackBase::appendByDistance !!! not implemented" << std::endl;
00154     list.removeAll();
00155 }

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.

Definition at line 95 of file TTrackBase.cxx.

Referenced by appendByApproach(), and testByApproach().

00095                                    {
00096     std::cout << "TTrackBase::approach !!! not implemented" << std::endl;
00097     return -1;
00098 }

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.

References _cores, _updated, and update().

Referenced by TBuilder::buildStereoNew(), TConformalFinder::expand(), TTrack::movePivot(), TRunge::SetFlightLength(), and TTrack::szPosition().

00317                                      {
00318     if (mask)
00319         std::cout << "TTrackBase::cores !!! mask is not supported" << std::endl;
00320     if (! _updated) update();
00321     return _cores;
00322 }

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

returns distance to a position of TMLink in TMLink space.

Reimplemented in TLine0, and TMLine.

Definition at line 89 of file TTrackBase.cxx.

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

00089                                          {
00090     std::cout << "TTrackBase::distance !!! not implemented" << std::endl;
00091     return 0.;
00092 }

int TTrackBase::DropWorst (  )  [virtual]

Definition at line 212 of file TTrackBase.cxx.

References _fitted, _links, _updated, and genRecEmupikp::i.

Referenced by TrkReco::execute().

00212                       {
00213   AList<TMLink> bad;
00214   int jbad=-1;
00215   double sigma=0;
00216   unsigned n = _links.length();
00217   double chi2=0;
00218   for (unsigned i = 0; i < n; i++){
00219    // if(g_sigmalyr1)g_sigmalyr1->fill(sqrt(_links[i]->pull()),_links[i]->wire()->layerId());
00220     chi2+=_links[i]->pull();
00221     if (_links[i]->pull() > sigma){
00222       jbad=i; 
00223       sigma = _links[i]->pull();
00224     }
00225   }
00226         
00227   chi2=chi2/n;
00228   //if(sigma>9){bad.append(_links[jbad]);if(g_sigmalyr)g_sigmalyr->fill(sqrt(sigma),_links[jbad]->wire()->layerId());}
00229 //  if(sigma>20.25&&chi2>2.08){bad.append(_links[jbad]);}
00230   if(sigma>9){bad.append(_links[jbad]);}
00231   if (bad.length()) {
00232     _links.remove(bad);
00233     _fitted = false;
00234     _updated = false;
00235   }
00236   return bad.length();
00237 }

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, and TTrack.

Definition at line 58 of file TTrackBase.cxx.

References _links, _updated, Dump(), mc(), RealDBUtil::npos, and update().

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

00058                                                                    {
00059     bool mc = (msg.find("mc") != std::string::npos);
00060     bool pull = (msg.find("pull") != std::string::npos);
00061     bool flag = (msg.find("flag") != std::string::npos);
00062     bool detail = (msg.find("detail") != std::string::npos);
00063     if (detail)
00064         mc = pull = flag = true;
00065 
00066     if (detail || (msg.find("layer") != std::string::npos)) {
00067         if (! _updated) update();
00068     }
00069     if (detail || (msg.find("hits") != std::string::npos)) {
00070         Dump(_links, msg, pre);
00071     }
00072 }

void TTrackBase::falseFit (  )  [inline]

false Fit

Definition at line 229 of file TTrackBase.h.

References _fitted, and _fittedWithCathode.

00229                     {
00230     _fitted = false;
00231     _fittedWithCathode = false;
00232 }

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.

References _fitter, and TMFitter::fit().

Referenced by TBuilder0::buildRphi(), TBuilder::buildRphi(), TBuilderCosmic::buildStereo(), TBuilder0::buildStereo0(), and TConformalFinder::expand().

00357                     {
00358     return _fitter->fit(* this);
00359 }

bool TTrackBase::fitted ( void   )  const [inline]

returns true if fitted.

Definition at line 222 of file TTrackBase.h.

References _fitted.

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

00222                              {
00223     return _fitted;
00224 }

bool TTrackBase::fittedWithCathode ( void   )  const [inline]

returns true if fitted with cathode hits(TEMPORARY).

Definition at line 243 of file TTrackBase.h.

References _fittedWithCathode.

00243                                         {
00244     return _fittedWithCathode;
00245 }

const TMFitter *const TTrackBase::fitter ( const TMFitter  )  [inline]

sets a default fitter.

Definition at line 261 of file TTrackBase.h.

References _fitted, and _fitter.

00261                                      {
00262     _fitted = false;
00263     return _fitter = a;
00264 }

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

returns a pointer to a default fitter.

Definition at line 255 of file TTrackBase.h.

References _fitter.

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

00255                              {
00256     return _fitter;
00257 }

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

returns TTrackHEP.

Definition at line 407 of file TTrackBase.cxx.

References _hep, _links, _nHeps, genRecEmupikp::i, ganga-rec::j, max, and mc().

Referenced by nHeps().

00407                           {
00408     unsigned n = _links.length();
00409     CAList<TTrackHEP> hepList;
00410     CList<unsigned> hepCounter;
00411     for (unsigned i = 0; i < n; i++) {
00412         const TTrackHEP * hep = _links[i]->hit()->mc()->hep();
00413         unsigned nH = hepList.length();
00414         bool found = false;
00415         for (unsigned j = 0; j < nH; j++) {
00416             if (hepList[j] == hep) {
00417                 found = true;
00418                 ++(* hepCounter[j]);
00419             }
00420         }
00421 
00422         if (! found) {
00423             hepList.append(hep);
00424             unsigned c = 0;
00425             hepCounter.append(c);
00426         }
00427     }
00428 
00429     _nHeps = hepList.length();
00430     _hep = 0;
00431     unsigned max = 0;
00432     for (unsigned i = 0; i < _nHeps; i++) {
00433         if ((* hepCounter[i]) > max) {
00434             max = (* hepCounter[i]);
00435             _hep = hepList[i];
00436         }
00437     }
00438 
00439     return _hep;
00440 }

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.

Definition at line 297 of file TTrackBase.cxx.

References _links.

Referenced by TConformalFinder0::appendCluster(), TBuilder::build(), TBuilderCurl::buildStereo(), TBuilderCosmic::buildStereo(), TBuilder0::buildStereo0(), TBuilderCurl::buildStereoMC(), TBuilder::buildStereoNew(), TBuilderCurl::check(), TCurlFinder::check2DCircle(), TCurlFinder::check3DTrack(), TCurlFinder::dividing2DTrack(), TCurlFinder::dumpType1(), TCurlFinder::dumpType2(), TrkReco::execute(), TConformalFinder0::findCloseClusters(), TFastFinder::findCloseHits(), TConformalFinder0::findCloseHits(), TConformalFinder0::findClusterLink(), TCosmicFitter::fit(), TCurlFinder::fitWDD(), TCurlFinder::make2DTrack(), TCurlFinder::make3DTrack(), TCurlFinder::makeWithMC(), TCurlFinder::mask3DTrack(), TTrackManager::merge(), TTrack::movePivot(), TCurlFinder::plotCircle(), TCurlFinder::plotTrack(), TMSelector::preSelect(), TCurlFinder::removeStereo(), TConformalFinder::salvage(), TCurlFinder::salvage3DTrack(), TBuilder::searchLine(), TMDCTsf::segments(), TBuilderCurl::setArcZ(), TConformalFinder::slowFinding2D(), TSegment0::splitAV(), TSegment::splitAV(), TSegment::splitTsf(), TConformalFinder::stereoSegments(), TSegment0::superLayerId(), TSegment::superLayerId(), TTrack::szPosition(), TCurlFinder::trace2DTrack(), TCurlFinder::trace3DTrack(), and TSegment::width().

00297                                      {
00298     if (mask == 0) return _links;
00299 
00300     std::cout << "TTrackBase::links !!! mask is not supportted yet" << std::endl;
00301     return _links;
00302 }

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

returns a pointer to TTrackMC.

Definition at line 249 of file TTrackBase.h.

References _mc.

Referenced by dump(), and hep().

00249                          {
00250     return _mc;
00251 }

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.

References _cores, _updated, and update().

Referenced by TTrack::dump(), and TConformalFinder::expand().

00325                                       {
00326     if (mask)
00327         std::cout << "TTrackBase::nCores !!! mask is not supported" << std::endl;
00328     if (! _updated) update();
00329     return _cores.length();
00330 }

unsigned TTrackBase::nHeps ( void   )  const

returns # of contributed TTrackHEP tracks.

Definition at line 443 of file TTrackBase.cxx.

References _nHeps, and hep().

00443                             {
00444     hep();
00445     return _nHeps;
00446 }

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

returns # of masked TMLinks assigned to this track object.

Definition at line 305 of file TTrackBase.cxx.

References _links, and genRecEmupikp::i.

Referenced by TBuilderCurl::buildStereo(), TBuilderCurl::buildStereoMC(), TBuilderCurl::check(), TCurlFinder::check2DCircle(), TCurlFinder::check3DTrack(), TSegment0::clusterType(), TSegment::clusterType(), TCurlFinder::dividing2DTrack(), TCurlFinder::dumpType1(), TCurlFinder::dumpType2(), TCurlFinder::make2DTrack(), TCurlFinder::makeWithMC(), TCurlFinder::merge3DTrack(), TCurlFinder::plotCircle(), TCurlFinder::plotTrack(), TMSelector::preSelect(), TCurlFinder::salvage3DTrack(), TBuilderCurl::setArcZ(), TSegment0::splitComplicated(), TSegment::splitComplicated(), TSegment0::splitParallel(), TSegment::splitParallel(), TSegment0::updateType(), and TSegment::updateType().

00305                                       {
00306     unsigned n = _links.length();
00307     if (mask == 0) return n;
00308     unsigned nn = 0;
00309     for (unsigned i = 0; i < n; i++) {
00310         const TMDCWireHit & h = * _links[i]->hit();
00311         if (h.state() & mask) ++nn;
00312     }
00313     return nn;
00314 }

unsigned TTrackBase::objectType ( void   )  const [inline, virtual]

returns object type.

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

Definition at line 268 of file TTrackBase.h.

References TrackBase.

Referenced by TRungeFitter::fit(), TCosmicFitter::fit(), T3DLineFitter::fit(), THelixFitter::main(), and TMSelector::select().

00268                                  {
00269     return TrackBase;
00270 }

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

Definition at line 237 of file TTrackBase.h.

References _links.

00237                                        {
00238     return _links[i];
00239 }

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.

References _fitted, _updated, Dump(), and refineMain().

00194                                {
00195     AList<TMLink> bad = refineMain(sigma);
00196 //      for (unsigned i = 0; i < bad.length(); i++) {
00197 //      const TMDCWireHit * hit = bad[i]->hit();
00198 //      hit->state(hit->state() | WireHitInvalidForFit);
00199 //      }
00200 
00201 #ifdef TRKRECO_DEBUG_DETAIL
00202     std::cout << "    refine ... sigma=" << sigma << std::endl;
00203     Dump(bad, "detail sort", "        ");
00204 #endif
00205 
00206     if (bad.length()) {
00207         _fitted = false;
00208         _updated = false;
00209     }
00210 }

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.

References _fitted, _links, _updated, Dump(), and refineMain().

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

00170                                                      {
00171     AList<TMLink> bad = refineMain(sigma);
00172 #ifdef TRKRECO_DEBUG
00173     std::cout << "    refine ... sigma=" << sigma << ", # of rejected hits=";
00174     std::cout << bad.length() << std::endl;
00175 #endif
00176 #ifdef TRKRECO_DEBUG
00177     Dump(bad, "sort pull mc", "        ");
00178 #endif
00179 
00180     if (bad.length()) {
00181         _links.remove(bad);
00182         list.append(bad);
00183         _fitted = false;
00184         _updated = false;
00185     }
00186 }

AList< TMLink > TTrackBase::refineMain ( double  maxSigma  )  [private]

refine core part.

Definition at line 158 of file TTrackBase.cxx.

References _links, and genRecEmupikp::i.

Referenced by refine().

00158                                    {
00159     AList<TMLink> bad;
00160     unsigned n = _links.length();
00161     for (unsigned i = 0; i < n; i++){
00162 //      std::cout<<" pull of link = "<<_links[i]->pull()<<std::endl;
00163         if (_links[i]->pull() > sigma)
00164             bad.append(_links[i]);
00165     }
00166     return bad;
00167 }

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

removes TMLinks.

Definition at line 213 of file TTrackBase.h.

References _fitted, _fittedWithCathode, _links, and _updated.

00213                                           {
00214     _links.remove(a);
00215     _updated = false;
00216     _fitted = false;
00217     _fittedWithCathode = false; // mod. by matsu ( 1999/05/24 )
00218 }

void TTrackBase::remove ( TMLink a  )  [inline]

removes a TMLink.

Definition at line 204 of file TTrackBase.h.

References _fitted, _fittedWithCathode, _links, and _updated.

Referenced by TConformalFinder0::appendClusters2(), TBuilder::buildStereoNew(), TCurlFinder::dividing2DTrack(), TCurlFinder::makeWithMC(), TTrackManager::maskCurl(), TTrackManager::maskNormal(), TCurlFinder::removeStereo(), TBuilder::searchLine(), TConformalFinder0::specialFinding(), TSegment0::splitComplicated(), and TSegment::splitComplicated().

00204                              {
00205     _links.remove(a);
00206     _updated = false;
00207     _fitted = false;
00208     _fittedWithCathode = false; // mod. by matsu ( 1999/05/24 )
00209 }

void TTrackBase::removeLinks ( void   )  [virtual]

Definition at line 189 of file TTrackBase.cxx.

References _links.

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

00189                            {
00190   _links.removeAll();
00191 }

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

Definition at line 240 of file TTrackBase.cxx.

References genRecEmupikp::i, and testByApproach().

00240                                                                             {
00241 #ifdef TRKRECO_DEBUG_DETAIL
00242     std::cout << "    TTrackBase::testByApproach ... sigma=" << maxSigma << std::endl;
00243 #endif
00244 
00245     unsigned nOK = 0;
00246     unsigned n = list.length();
00247     for (unsigned i = 0; i < n; i++) {
00248         TMLink & l = * list[i];
00249         nOK += testByApproach(l, maxSigma);
00250     }
00251     return nOK;
00252 }

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

returns # of good hits to be appended.

Definition at line 255 of file TTrackBase.cxx.

References approach(), TMDCWireHit::dDrift(), TMLink::distance(), distance(), TMDCWireHit::drift(), TMLink::dump(), showlog::err, TMLink::hit(), and TMLink::pull().

Referenced by testByApproach().

00255                                                                      {
00256 #ifdef TRKRECO_DEBUG_DETAIL
00257     std::cout << "    TTrackBase::testByApproach ... sigma=" << maxSigma << std::endl;
00258 #endif
00259     TMLink l = link;
00260 
00261     //...Calculate closest approach...
00262     int err = approach(l);
00263     if (err < 0) return 0;
00264     //...Calculate sigma...
00265     float distance = l.distance();
00266     float diff = fabs(distance - l.hit()->drift());
00267     float sigma = diff / l.hit()->dDrift();
00268     l.pull(sigma * sigma);
00269 
00270     //...For debug...
00271 #ifdef TRKRECO_DEBUG_DETAIL
00272     std::cout << "    sigma=" << sigma;
00273     std::cout << ",dist=" << distance;
00274     std::cout << ",diff=" << diff << ",";
00275     if (sigma < maxSigma) std::cout << "ok,";
00276     else                  std::cout << "X,";
00277     l.dump("mc");
00278 #endif
00279                 
00280     //...Make sigma cut...
00281     if (sigma < maxSigma) return 1;
00282 
00283     return 0;
00284 }

unsigned TTrackBase::type ( void   )  const [inline, virtual]

returns type. Definition is depending on an object class.

Reimplemented in TTrack.

Definition at line 274 of file TTrackBase.h.

00274                            {
00275     return 0;
00276 }

void TTrackBase::update ( void   )  const

update cache.

Reimplemented in TSegment, and TSegment0.

Definition at line 75 of file TTrackBase.cxx.

References _cores, _links, _updated, genRecEmupikp::i, TMDCWireHit::state(), WireHitFittingValid, and WireHitInvalidForFit.

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

00075                              {
00076     _cores.removeAll();
00077     unsigned n = _links.length();
00078     for (unsigned i = 0; i < n; i++) {
00079         TMLink * l = _links[i];
00080         const TMDCWireHit & h = * l->hit();
00081         if (h.state() & WireHitInvalidForFit) continue;
00082         if (! (h.state() & WireHitFittingValid)) continue;
00083         _cores.append(l);
00084     }
00085     _updated = true;
00086 }


Friends And Related Function Documentation

friend class TCosmicFitter [friend]

Reimplemented in TTrack.

Definition at line 183 of file TTrackBase.h.

friend class THelixFitter [friend]

Reimplemented in TTrack.

Definition at line 182 of file TTrackBase.h.

friend class TMFitter [friend]

Definition at line 181 of file TTrackBase.h.


Member Data Documentation

AList<TMLink> TTrackBase::_cores [mutable, private]

Definition at line 171 of file TTrackBase.h.

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

bool TTrackBase::_fitted [mutable, protected]

Definition at line 162 of file TTrackBase.h.

Referenced by TMLine::a(), TLine0::a(), append(), appendByApproach(), TMLine::appendByszdistance(), TLine0::appendByszdistance(), TMLine::appendSLY(), TLine0::appendSLY(), TMLine::b(), TLine0::b(), TCircle::center(), TCircle::charge(), TTrack::chi2(), TMLine::chi2(), TLine0::chi2(), TSegment0::direction(), TSegment::direction(), TMLine::distance(), TLine0::distance(), DropWorst(), TSegment0::dump(), TSegment::dump(), TCircle::dump(), falseFit(), THelixFitter::fit(), TCosmicFitter::fit(), TMLine::fit2(), TLine0::fit2(), TMLine::fit2p(), TLine0::fit2p(), TMLine::fit2s(), TLine0::fit2s(), TMLine::fit2sp(), TLine0::fit2sp(), TCircle::fitForCurl(), fitted(), fitter(), TCircle::impact(), TSegment0::innerMostLayer(), TSegment::innerMostLayer(), TSegment::inners(), TSegment0::innerWidth(), TSegment::innerWidth(), TTrack::ndf(), TSegment0::outerMostLayer(), TSegment::outerMostLayer(), TSegment::outers(), TSegment0::outerWidth(), TSegment::outerWidth(), TSegment0::position(), TSegment::position(), TCircle::pt(), TCircle::radius(), TMLine::reducedChi2(), TLine0::reducedChi2(), refine(), TMLine::refine(), TLine0::refine(), TTrack::refine2D(), remove(), TMLine::removeChits(), TLine0::removeChits(), TMLine::removeSLY(), TLine0::removeSLY(), T3DLine::T3DLine(), TRunge::TRunge(), TSegment::TSegment(), TSegment0::TSegment0(), TTrack::TTrack(), TSegment0::update(), TSegment::update(), TSegment0::updateType(), and TSegment::updateType().

bool TTrackBase::_fittedWithCathode [mutable, protected]

Definition at line 163 of file TTrackBase.h.

Referenced by append(), falseFit(), fittedWithCathode(), remove(), T3DLine::T3DLine(), TRunge::TRunge(), and TTrack::TTrack().

const TMFitter* TTrackBase::_fitter [private]

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

Definition at line 178 of file TTrackBase.h.

Referenced by fit(), and fitter().

const TTrackHEP* TTrackBase::_hep [mutable, private]

Definition at line 174 of file TTrackBase.h.

Referenced by hep().

AList<TMLink> TTrackBase::_links [protected]

Definition at line 161 of file TTrackBase.h.

Referenced by append(), appendByApproach(), TMLine::appendByszdistance(), TLine0::appendByszdistance(), TMLine::appendSLY(), TLine0::appendSLY(), TTrack::assign(), TBuilderCurl::buildStereo(), TMLine::chi2(), TLine0::chi2(), DropWorst(), dump(), TTrack::dump(), TSegment0::dump(), TSegment::dump(), TMLine::dump(), TLine0::dump(), TCircle::dump(), TSegment::expandSeg(), TMLine::fit2(), TLine0::fit2(), TTrack::fit2D(), TMLine::fit2p(), TLine0::fit2p(), TMLine::fit2s(), TLine0::fit2s(), TMLine::fit2sp(), TLine0::fit2sp(), TCircle::fitForCurl(), hep(), links(), TTrack::movePivot(), nLinks(), operator[](), TSegment0::rangeX(), TSegment::rangeX(), TMLine::reducedChi2(), TLine0::reducedChi2(), refine(), TMLine::refine(), TLine0::refine(), TTrack::refine2D(), refineMain(), remove(), TMLine::removeChits(), TLine0::removeChits(), removeLinks(), TMLine::removeSLY(), TLine0::removeSLY(), TSegment::segSalvage(), TSegment0::solveDualHits(), TSegment::solveDualHits(), TSegment::solveLR(), TSegment::solveThreeHits(), TSegment0::splitAV(), TSegment::splitAV(), TSegment0::splitComplicated(), TSegment::splitComplicated(), TSegment0::splitDual(), TSegment::splitDual(), TSegment0::splitParallel(), TSegment::splitParallel(), TSegment::splitTsf(), TSegment::TSegment(), TSegment0::TSegment0(), TTrack::TTrack(), update(), TSegment0::update(), TSegment::update(), TSegment0::updateDuality(), TSegment::updateDuality(), TSegment0::updateType(), and TSegment::updateType().

TTrackMC* TTrackBase::_mc [protected]

Definition at line 165 of file TTrackBase.h.

Referenced by mc().

unsigned TTrackBase::_nHeps [mutable, private]

Definition at line 175 of file TTrackBase.h.

Referenced by hep(), and nHeps().

float TTrackBase::_time [private]

Definition at line 179 of file TTrackBase.h.

bool TTrackBase::_updated [mutable, private]

Definition at line 168 of file TTrackBase.h.

Referenced by append(), appendByApproach(), cores(), DropWorst(), dump(), nCores(), refine(), remove(), and update().


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