#include <TLine0.h>
Inheritance diagram for TLine0:
Public Member Functions | |
TLine0 () | |
Constructor. | |
TLine0 (const AList< TMLink > &) | |
Constructor. | |
virtual | ~TLine0 () |
Destructor. | |
virtual unsigned | objectType (void) const |
returns type. | |
void | dump (const std::string &message=std::string(""), const std::string &prefix=std::string("")) const |
dumps debug information. | |
double | a (void) const |
returns coefficient a. | |
double | b (void) const |
returns coefficient b. | |
double | chi2 (void) const |
returns chi2. | |
double | reducedChi2 (void) const |
returns reduced-chi2. | |
double | distance (const TMLink &) const |
returns distance to a position of TMLink itself. (not to a wire) | |
int | fit2 () |
fits itself using isolated hits. Error was happened if return value is not zero. | |
int | fit2s () |
fits itself using single hits in a wire-layer. Error was happened if return value is not zero. | |
int | fit2p () |
fits itself using isolated hits. Error was happened if return value is not zero. | |
int | fit2sp () |
fits itself using single hits in a wire-layer. Error was happened if return value is not zero. | |
void | removeChits () |
remove extremly bad points. | |
void | refine (AList< TMLink > &list, float maxSigma) |
remove bad points by chi2. Bad points are returned in a 'list'. fit() should be called before calling this function. | |
void | removeSLY (AList< TMLink > &list) |
void | appendSLY (AList< TMLink > &list) |
void | appendByszdistance (AList< TMLink > &list, unsigned isl, float maxSigma) |
void | property (double a, double b, double det) |
sets circle properties. | |
virtual unsigned | type (void) const |
returns type. Definition is depending on an object class. | |
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 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 | |
TMLink * | operator[] (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 Attributes | |
bool | _fittedUpdated |
double | _a |
double | _b |
double | _det |
double | _chi2 |
double | _reducedChi2 |
Static Private Attributes | |
static const TLineFitter | _fitter = TLineFitter("TLine0 Default Line Fitter") |
Definition at line 30 of file TLine0.h.
TLine0::TLine0 | ( | ) |
Constructor.
Definition at line 23 of file TLine0.cxx.
References _fitter, and TTrackBase::fitter().
00024 : TTrackBase(), 00025 _a(0.), 00026 _b(0.), 00027 _det(0.), 00028 _fittedUpdated(false), 00029 _chi2(0.), 00030 _reducedChi2(0.) { 00031 00032 //...Set a defualt fitter... 00033 fitter(& TLine0::_fitter); 00034 }
TLine0::TLine0 | ( | const AList< TMLink > & | ) |
Constructor.
Definition at line 36 of file TLine0.cxx.
References _fitter, and TTrackBase::fitter().
00037 : TTrackBase(a), 00038 _a(0.), 00039 _b(0.), 00040 _det(0.), 00041 _fittedUpdated(false), 00042 _chi2(0.), 00043 _reducedChi2(0.) { 00044 00045 //...Set a defualt fitter... 00046 fitter(& TLine0::_fitter); 00047 }
TLine0::~TLine0 | ( | ) | [virtual] |
double TLine0::a | ( | void | ) | const [inline] |
returns coefficient a.
Definition at line 127 of file TLine0.h.
References _a, and TTrackBase::_fitted.
Referenced by TBuilderCosmic::buildStereo(), and TBuilder0::buildStereo0().
00127 { 00128 #ifdef TRKRECO_DEBUG 00129 if (! _fitted) std::cout << "TLine0::a !!! fit not performed" << std::endl; 00130 #endif 00131 return _a; 00132 }
void TTrackBase::append | ( | const AList< TMLink > & | ) | [inherited] |
appends TMLinks.
Definition at line 384 of file TTrackBase.cxx.
References TTrackBase::_fitted, TTrackBase::_fittedWithCathode, TTrackBase::_links, TTrackBase::_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 & | ) | [inherited] |
appends a TMLink.
Definition at line 362 of file TTrackBase.cxx.
References TTrackBase::_fitted, TTrackBase::_fittedWithCathode, TTrackBase::_links, TTrackBase::_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 | |||
) | [inherited] |
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 TTrackBase::_fitted, TTrackBase::_links, TTrackBase::_updated, TTrackBase::approach(), TTrackBase::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 | |||
) | [inherited] |
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 }
void TLine0::appendByszdistance | ( | AList< TMLink > & | list, | |
unsigned | isl, | |||
float | maxSigma | |||
) |
Definition at line 565 of file TLine0.cxx.
References TTrackBase::_fitted, _fittedUpdated, TTrackBase::_links, check_raw_filter::dist, distance(), and genRecEmupikp::i.
00565 { 00566 00567 //... intialize 00568 unsigned nb = _links.length(); 00569 00570 //....Select good hit 00571 unsigned n = list.length(); 00572 for (unsigned i = 0; i < n; i++) { 00573 TMLink & l = * list[i]; 00574 if(l.hit()->wire()->superLayerId() == isl){ 00575 double dist = distance(l); 00576 if (dist < maxSigma) { 00577 _links.append(l); 00578 } 00579 } 00580 } 00581 00582 unsigned na = _links.length(); 00583 if(nb != na){ 00584 AList<TMLink> bad; 00585 //... remove duplicated hits 00586 for(unsigned i = 0; i<na ;i++){ 00587 TMLink & l = * _links[i]; 00588 if(i < na - 1) { 00589 TMLink & lnext = * _links[i+1]; 00590 if(l.hit()->wire()->layerId() == lnext.hit()->wire()->layerId() ){ 00591 if(l.hit()->wire()->localId() == lnext.hit()->wire()->localId()){ 00592 bad.append(l); 00593 } 00594 } 00595 } 00596 } 00597 if(bad.length() > 0) _links.remove(bad); 00598 _fitted = false; 00599 _fittedUpdated = false; 00600 } 00601 }
void TLine0::appendSLY | ( | AList< TMLink > & | list | ) |
Definition at line 558 of file TLine0.cxx.
References TTrackBase::_fitted, _fittedUpdated, and TTrackBase::_links.
00558 { 00559 _links.append(list); 00560 _fitted = false; 00561 _fittedUpdated = false; 00562 }
int TTrackBase::approach | ( | TMLink & | ) | const [virtual, inherited] |
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 TTrackBase::appendByApproach(), and TTrackBase::testByApproach().
00095 { 00096 std::cout << "TTrackBase::approach !!! not implemented" << std::endl; 00097 return -1; 00098 }
double TLine0::b | ( | void | ) | const [inline] |
returns coefficient b.
Definition at line 136 of file TLine0.h.
References _b, and TTrackBase::_fitted.
Referenced by TBuilderCosmic::buildStereo().
00136 { 00137 #ifdef TRKRECO_DEBUG 00138 if (! _fitted) std::cout << "TLine0::b !!! fit not performed" << std::endl; 00139 #endif 00140 return _b; 00141 }
double TLine0::chi2 | ( | void | ) | const |
returns chi2.
Definition at line 113 of file TLine0.cxx.
References _a, _b, _chi2, TTrackBase::_fitted, _fittedUpdated, TTrackBase::_links, genRecEmupikp::i, and x.
Referenced by reducedChi2().
00113 { 00114 #ifdef TRKRECO_DEBUG_DETAIL 00115 if (! _fitted) std::cout << "TLine0::chi2 !!! fit not performed" << std::endl; 00116 #endif 00117 00118 if (_fittedUpdated) return _chi2; 00119 _chi2 = 0.; 00120 unsigned n = _links.length(); 00121 for (unsigned i = 0; i < n; i++) { 00122 TMLink & l = * _links[i]; 00123 00124 double x = l.position().x(); 00125 double y = l.position().y(); 00126 double c = y - _a * x - _b; 00127 _chi2 += c * c; 00128 } 00129 _fittedUpdated = true; 00130 return _chi2; 00131 }
const AList< TMLink > & TTrackBase::cores | ( | unsigned | mask = 0 |
) | const [inherited] |
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 TTrackBase::_cores, TTrackBase::_updated, and TTrackBase::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 TLine0::distance | ( | const TMLink & | ) | const [inline, virtual] |
returns distance to a position of TMLink itself. (not to a wire)
Reimplemented from TTrackBase.
Definition at line 145 of file TLine0.h.
References _a, _b, TTrackBase::_fitted, and TMLink::position().
Referenced by appendByszdistance(), and refine().
00145 { 00146 #ifdef TRKRECO_DEBUG 00147 if (! _fitted) std::cout << "TLine0::distance !!! fit not performed" << std::endl; 00148 #endif 00149 double dy = fabs(_a * l.position().x() + _b - l.position().y()); 00150 double invCos = sqrt(1. + _a * _a); 00151 return dy / invCos; 00152 }
int TTrackBase::DropWorst | ( | ) | [virtual, inherited] |
Definition at line 212 of file TTrackBase.cxx.
References TTrackBase::_fitted, TTrackBase::_links, TTrackBase::_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 TLine0::dump | ( | const std::string & | message = std::string("") , |
|
const std::string & | prefix = std::string("") | |||
) | const [virtual] |
dumps debug information.
Reimplemented from TTrackBase.
Definition at line 53 of file TLine0.cxx.
References _a, _b, _det, TTrackBase::_links, TTrackBase::dump(), and RealDBUtil::npos.
00053 { 00054 bool def = false; 00055 if (msg == "") def = true; 00056 00057 if (def || msg.find("line") != std::string::npos || msg.find("detail") != std::string::npos) { 00058 std::cout << pre; 00059 std::cout << "#links=" << _links.length(); 00060 std::cout << ",a=" << _a; 00061 std::cout << ",b=" << _b; 00062 std::cout << ",det=" << _det; 00063 std::cout << std::endl; 00064 } 00065 if (! def) TTrackBase::dump(msg, pre); 00066 }
void TTrackBase::falseFit | ( | ) | [inline, inherited] |
false Fit
Definition at line 229 of file TTrackBase.h.
References TTrackBase::_fitted, and TTrackBase::_fittedWithCathode.
00229 { 00230 _fitted = false; 00231 _fittedWithCathode = false; 00232 }
int TTrackBase::fit | ( | void | ) | [virtual, inherited] |
fits itself by a default fitter. Error was happened if return value is not zero.
Definition at line 357 of file TTrackBase.cxx.
References TTrackBase::_fitter, and TMFitter::fit().
Referenced by TBuilder0::buildRphi(), TBuilder::buildRphi(), TBuilderCosmic::buildStereo(), TBuilder0::buildStereo0(), and TConformalFinder::expand().
int TLine0::fit2 | ( | ) |
fits itself using isolated hits. Error was happened if return value is not zero.
Definition at line 173 of file TLine0.cxx.
References _a, _b, _det, TTrackBase::_fitted, TTrackBase::_links, abs, TMLink::hit(), genRecEmupikp::i, ganga-rec::j, TMDCWire::layerId(), RealDBUtil::npos, TMLink::position(), s, t(), TMDCWireHit::wire(), and x.
00173 { 00174 // if (_fitted) return 0; 00175 00176 unsigned n = _links.length(); 00177 int mask[100] = {0}; 00178 int nsl[11] = {64,80,96,128,144,160,176,208,240,256,288}; 00179 int npos = 0, nneg = 0; 00180 for (unsigned i = 0; i < n -1 ; i++) { 00181 TMLink & l = * _links[i]; 00182 for (unsigned j = i+1; j < n ; j++) { 00183 TMLink & s = * _links[j]; 00184 if(l.hit()->wire()->layerId() == s.hit()->wire()->layerId()){ 00185 //... Check 3 consective hits 00186 if(i > 0 && (mask[i-1] == 1 && mask[j] == 1) ){ 00187 TMLink & t = * _links[i-1]; 00188 if(l.hit()->wire()->layerId() == t.hit()->wire()->layerId()){ 00189 mask[i] = 1; 00190 } 00191 } 00192 int ilast = nsl[l.hit()->wire()->superLayerId()]-1; 00193 int ilocal = l.hit()->wire()->localId(); 00194 int jlocal = s.hit()->wire()->localId(); 00195 if(ilocal > 0 && ilocal < ilast){ 00196 if(abs(jlocal-ilocal) > 1 ) { 00197 mask[i] = 1; 00198 mask[j] = 1; 00199 } 00200 }else if(ilocal == 0){ 00201 if(jlocal > 1 && jlocal < ilast){ 00202 mask[i] = 1; 00203 mask[j] = 1; 00204 } 00205 }else if(ilocal == ilast){ 00206 if(jlocal > 0 && jlocal < ilast-1){ 00207 mask[i] = 1; 00208 mask[j] = 1; 00209 } 00210 } 00211 } 00212 } 00213 //... 00214 if(mask[i] == 0){ 00215 if(l.position().y() >= 0) npos += 1; 00216 if(l.position().y() < 0) nneg += 1; 00217 } 00218 } 00219 00220 //.... 00221 double sumX = 0., sumY = 0., sumX2 = 0., sumXY = 0., sumY2 = 0.; 00222 int nused = 0; 00223 int lyid[2]; 00224 for (unsigned i = 0; i < n; i++) { 00225 00226 if(mask[i] == 1) continue; 00227 00228 TMLink & l = * _links[i]; 00229 00230 double x = l.position().x(); 00231 double y = l.position().y(); 00232 if(abs(npos-nneg) > 3){ 00233 if(npos > nneg && y < 0 ) continue; 00234 if(npos < nneg && y > 0 ) continue; 00235 } 00236 sumX += x; 00237 sumY += y; 00238 sumX2 += x * x; 00239 sumXY += x * y; 00240 sumY2 += y * y; 00241 if(nused < 2){ 00242 lyid[nused] = l.hit()->wire()->layerId(); 00243 } 00244 nused += 1; 00245 } 00246 00247 if(nused < 2 || (nused == 2 && lyid[0]==lyid[1])) { 00248 return -2; 00249 } 00250 double sum = double(nused); 00251 _det = sum * sumX2 - sumX * sumX; 00252 if(_det == 0.) { 00253 return -1; 00254 } 00255 _a = (sumXY * sum - sumX * sumY) / _det; 00256 _b = (sumX2 * sumY - sumX * sumXY) / _det; 00257 00258 _fitted = true; 00259 return 0; 00260 }
int TLine0::fit2p | ( | ) |
fits itself using isolated hits. Error was happened if return value is not zero.
Definition at line 401 of file TLine0.cxx.
References _a, _b, _det, TTrackBase::_fitted, TTrackBase::_links, abs, TMLink::hit(), genRecEmupikp::i, ganga-rec::j, TMDCWire::layerId(), TMLink::position(), s, t(), TMDCWireHit::wire(), and x.
Referenced by TBuilder0::buildStereo0().
00401 { 00402 // if (_fitted) return 0; 00403 00404 unsigned n = _links.length(); 00405 int mask[100] = {0}; 00406 int nsl[11] = {64,80,96,128,144,160,176,208,240,256,288}; 00407 double phi_ave = 0.; 00408 int nphi = 0; 00409 double Crad = 180./3.141592; 00410 for (unsigned i = 0; i < n -1 ; i++) { 00411 TMLink & l = * _links[i]; 00412 for (unsigned j = i+1; j < n ; j++) { 00413 TMLink & s = * _links[j]; 00414 if(l.hit()->wire()->layerId() == s.hit()->wire()->layerId()){ 00415 //... Check 3 consective hits 00416 if(i > 0 && (mask[i-1] == 1 && mask[j] == 1) ){ 00417 TMLink & t = * _links[i-1]; 00418 if(l.hit()->wire()->layerId() == t.hit()->wire()->layerId()){ 00419 mask[i] = 1; 00420 } 00421 } 00422 int ilast = nsl[l.hit()->wire()->superLayerId()]-1; 00423 int ilocal = l.hit()->wire()->localId(); 00424 int jlocal = s.hit()->wire()->localId(); 00425 if(ilocal > 0 && ilocal < ilast){ 00426 if(abs(jlocal-ilocal) > 1 ) { 00427 mask[i] = 1; 00428 mask[j] = 1; 00429 } 00430 }else if(ilocal == 0){ 00431 if(jlocal > 1 && jlocal < ilast){ 00432 mask[i] = 1; 00433 mask[j] = 1; 00434 } 00435 }else if(ilocal == ilast){ 00436 if(jlocal > 0 && jlocal < ilast-1){ 00437 mask[i] = 1; 00438 mask[j] = 1; 00439 } 00440 } 00441 } 00442 } 00443 //... 00444 //... 00445 if(mask[i] != 1){ 00446 double phi = Crad*atan2(l.position().y(), l.position().x()); 00447 phi_ave += phi; 00448 nphi += 1; 00449 } 00450 } 00451 00452 //... 00453 if(mask[n-1] != 1){ 00454 TMLink & l = * _links[n-1]; 00455 double phi = Crad*atan2(l.position().y(), l.position().x()); 00456 phi_ave += phi; 00457 nphi += 1; 00458 } 00459 double phi_max = 0.; 00460 double phi_min = 0.; 00461 if(nphi> 0){ 00462 phi_max = phi_ave/n + 40; 00463 phi_min = phi_ave/n - 40; 00464 } 00465 00466 //.... 00467 double sumX = 0., sumY = 0., sumX2 = 0., sumXY = 0., sumY2 = 0.; 00468 int nused = 0; 00469 int lyid[2]; 00470 for (unsigned i = 0; i < n; i++) { 00471 00472 if(mask[i] == 1) continue; 00473 00474 TMLink & l = * _links[i]; 00475 00476 double x = l.position().x(); 00477 double y = l.position().y(); 00478 double phi = Crad*atan2(l.position().y(), l.position().x()); 00479 if(phi > phi_max && phi<phi_min ) continue; 00480 00481 sumX += x; 00482 sumY += y; 00483 sumX2 += x * x; 00484 sumXY += x * y; 00485 sumY2 += y * y; 00486 if(nused < 2){ 00487 lyid[nused] = l.hit()->wire()->layerId(); 00488 } 00489 nused += 1; 00490 } 00491 00492 if(nused < 2 || (nused == 2 && lyid[0]==lyid[1])) { 00493 return -2; 00494 } 00495 double sum = double(nused); 00496 _det = sum * sumX2 - sumX * sumX; 00497 if(_det == 0.) { 00498 return -1; 00499 } 00500 _a = (sumXY * sum - sumX * sumY) / _det; 00501 _b = (sumX2 * sumY - sumX * sumXY) / _det; 00502 00503 _fitted = true; 00504 return 0; 00505 }
int TLine0::fit2s | ( | ) |
fits itself using single hits in a wire-layer. Error was happened if return value is not zero.
Definition at line 263 of file TLine0.cxx.
References _a, _b, _det, TTrackBase::_fitted, TTrackBase::_links, genRecEmupikp::i, ganga-rec::j, RealDBUtil::npos, TMLink::position(), s, and x.
00263 { 00264 // if (_fitted) return 0; 00265 00266 unsigned n = _links.length(); 00267 int mask[100] = {0}; 00268 int npos = 0, nneg = 0; 00269 for (unsigned i = 0; i < n -1 ; i++) { 00270 TMLink & l = * _links[i]; 00271 for (unsigned j = i+1; j < n ; j++) { 00272 TMLink & s = * _links[j]; 00273 if(l.hit()->wire()->layerId() == s.hit()->wire()->layerId()){ 00274 mask[i] = 1; 00275 mask[j] = 1; 00276 } 00277 } 00278 //... 00279 if(mask[i] == 0){ 00280 if(l.position().y() >= 0) npos += 1; 00281 if(l.position().y() < 0) nneg += 1; 00282 } 00283 } 00284 00285 //.... 00286 double sumX = 0., sumY = 0., sumX2 = 0., sumXY = 0., sumY2 = 0.; 00287 int nused = 0; 00288 int lyid[2]; 00289 for (unsigned i = 0; i < n; i++) { 00290 00291 if(mask[i] == 1) continue; 00292 00293 TMLink & l = * _links[i]; 00294 00295 double x = l.position().x(); 00296 double y = l.position().y(); 00297 if(npos > nneg && y < 0 ) continue; 00298 if(npos < nneg && y > 0 ) continue; 00299 00300 sumX += x; 00301 sumY += y; 00302 sumX2 += x * x; 00303 sumXY += x * y; 00304 sumY2 += y * y; 00305 nused += 1; 00306 } 00307 00308 if(nused < 4) { 00309 return -2; 00310 } 00311 double sum = double(nused); 00312 _det = sum * sumX2 - sumX * sumX; 00313 if(_det == 0.) { 00314 return -1; 00315 } 00316 _a = (sumXY * sum - sumX * sumY) / _det; 00317 _b = (sumX2 * sumY - sumX * sumXY) / _det; 00318 00319 _fitted = true; 00320 return 0; 00321 }
int TLine0::fit2sp | ( | ) |
fits itself using single hits in a wire-layer. Error was happened if return value is not zero.
Definition at line 323 of file TLine0.cxx.
References _a, _b, _det, TTrackBase::_fitted, TTrackBase::_links, genRecEmupikp::i, ganga-rec::j, TMLink::position(), s, and x.
Referenced by TBuilder0::buildStereo0().
00323 { 00324 // if (_fitted) return 0; 00325 00326 unsigned n = _links.length(); 00327 int mask[100] = {0}; 00328 double phi_ave = 0.; 00329 int nphi = 0; 00330 double Crad = 180./3.141592; 00331 for (unsigned i = 0; i < n -1 ; i++) { 00332 TMLink & l = * _links[i]; 00333 for (unsigned j = i+1; j < n ; j++) { 00334 TMLink & s = * _links[j]; 00335 if(l.hit()->wire()->layerId() == s.hit()->wire()->layerId()){ 00336 mask[i] = 1; 00337 mask[j] = 1; 00338 } 00339 } 00340 //... 00341 if(mask[i] != 1){ 00342 double phi = Crad*atan2(l.position().y(), l.position().x()); 00343 phi_ave += phi; 00344 nphi += 1; 00345 } 00346 } 00347 00348 //... 00349 if(mask[n-1] != 1){ 00350 TMLink & l = * _links[n-1]; 00351 double phi = Crad*atan2(l.position().y(), l.position().x()); 00352 phi_ave += phi; 00353 nphi += 1; 00354 } 00355 double phi_max = 0.; 00356 double phi_min = 0.; 00357 if(nphi> 0){ 00358 phi_max = phi_ave/n + 40; 00359 phi_min = phi_ave/n - 40; 00360 } 00361 00362 //.... 00363 double sumX = 0., sumY = 0., sumX2 = 0., sumXY = 0., sumY2 = 0.; 00364 int nused = 0; 00365 int lyid[2]; 00366 for (unsigned i = 0; i < n; i++) { 00367 00368 if(mask[i] == 1) continue; 00369 00370 TMLink & l = * _links[i]; 00371 00372 double x = l.position().x(); 00373 double y = l.position().y(); 00374 double phi = Crad*atan2(l.position().y(), l.position().x()); 00375 if(phi > phi_max && phi<phi_min ) continue; 00376 00377 sumX += x; 00378 sumY += y; 00379 sumX2 += x * x; 00380 sumXY += x * y; 00381 sumY2 += y * y; 00382 nused += 1; 00383 } 00384 00385 if(nused < 4) { 00386 return -2; 00387 } 00388 double sum = double(nused); 00389 _det = sum * sumX2 - sumX * sumX; 00390 if(_det == 0.) { 00391 return -1; 00392 } 00393 _a = (sumXY * sum - sumX * sumY) / _det; 00394 _b = (sumX2 * sumY - sumX * sumXY) / _det; 00395 00396 _fitted = true; 00397 return 0; 00398 }
bool TTrackBase::fitted | ( | void | ) | const [inline, inherited] |
returns true if fitted.
Definition at line 222 of file TTrackBase.h.
References TTrackBase::_fitted.
Referenced by TCosmicFitter::fit(), TBuilder::searchLine(), and TMSelector::select().
00222 { 00223 return _fitted; 00224 }
bool TTrackBase::fittedWithCathode | ( | void | ) | const [inline, inherited] |
returns true if fitted with cathode hits(TEMPORARY).
Definition at line 243 of file TTrackBase.h.
References TTrackBase::_fittedWithCathode.
00243 { 00244 return _fittedWithCathode; 00245 }
sets a default fitter.
Definition at line 261 of file TTrackBase.h.
References TTrackBase::_fitted, and TTrackBase::_fitter.
const TMFitter *const TTrackBase::fitter | ( | void | ) | const [inline, inherited] |
returns a pointer to a default fitter.
Definition at line 255 of file TTrackBase.h.
References TTrackBase::_fitter.
Referenced by T3DLine::T3DLine(), TCircle::TCircle(), TLine0(), TMLine::TMLine(), TRunge::TRunge(), and TTrack::TTrack().
00255 { 00256 return _fitter; 00257 }
const TTrackHEP *const TTrackBase::hep | ( | void | ) | const [inherited] |
returns TTrackHEP.
Definition at line 407 of file TTrackBase.cxx.
References TTrackBase::_hep, TTrackBase::_links, TTrackBase::_nHeps, genRecEmupikp::i, ganga-rec::j, max, and TTrackBase::mc().
Referenced by TTrackBase::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 [inherited] |
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 TTrackBase::_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, inherited] |
returns a pointer to TTrackMC.
Definition at line 249 of file TTrackBase.h.
References TTrackBase::_mc.
Referenced by TTrackBase::dump(), and TTrackBase::hep().
00249 { 00250 return _mc; 00251 }
unsigned TTrackBase::nCores | ( | unsigned | mask = 0 |
) | const [inherited] |
returns # of masked TMLinks for fit. 'mask' will be applied if mask is not 0.
Definition at line 325 of file TTrackBase.cxx.
References TTrackBase::_cores, TTrackBase::_updated, and TTrackBase::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 [inherited] |
returns # of contributed TTrackHEP tracks.
Definition at line 443 of file TTrackBase.cxx.
References TTrackBase::_nHeps, and TTrackBase::hep().
unsigned TTrackBase::nLinks | ( | unsigned | mask = 0 |
) | const [inherited] |
returns # of masked TMLinks assigned to this track object.
Definition at line 305 of file TTrackBase.cxx.
References TTrackBase::_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 TLine0::objectType | ( | void | ) | const [inline, virtual] |
returns type.
Reimplemented from TTrackBase.
Definition at line 164 of file TLine0.h.
References Line.
00164 { 00165 return Line; 00166 }
TMLink * TTrackBase::operator[] | ( | unsigned | i | ) | const [inline, inherited] |
void TLine0::property | ( | double | a, | |
double | b, | |||
double | det | |||
) | [inline] |
double TLine0::reducedChi2 | ( | void | ) | const |
returns reduced-chi2.
Definition at line 604 of file TLine0.cxx.
References _a, _b, TTrackBase::_fitted, _fittedUpdated, TTrackBase::_links, _reducedChi2, chi2(), showlog::err, genRecEmupikp::i, and x.
00604 { 00605 #ifdef TRKRECO_DEBUG_DETAIL 00606 if (! _fitted) std::cout << "TLine0::reducedChi2 !!! fit not performed" << std::endl; 00607 #endif 00608 00609 if (_fittedUpdated) return _reducedChi2; 00610 double chi2 = 0.; 00611 double scale = 20.; 00612 unsigned n = _links.length(); 00613 for (unsigned i = 0; i < n; i++) { 00614 TMLink & l = * _links[i]; 00615 00616 double x = l.position().x(); 00617 double y = l.position().y(); 00618 double c = y - _a * x - _b; 00619 double err = scale * l.hit()->dDrift(); 00620 chi2 += c * c / err / err; 00621 } 00622 00623 _reducedChi2 = chi2/(n-2); 00624 _fittedUpdated = true; 00625 return _reducedChi2; 00626 }
void TTrackBase::refine | ( | double | maxSigma | ) | [virtual, inherited] |
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 TTrackBase::_fitted, TTrackBase::_updated, Dump(), and TTrackBase::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, inherited] |
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 TTrackBase::_fitted, TTrackBase::_links, TTrackBase::_updated, Dump(), and TTrackBase::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 }
void TLine0::refine | ( | AList< TMLink > & | list, | |
float | maxSigma | |||
) |
remove bad points by chi2. Bad points are returned in a 'list'. fit() should be called before calling this function.
Definition at line 134 of file TLine0.cxx.
References TTrackBase::_fitted, _fittedUpdated, TTrackBase::_links, check_raw_filter::dist, distance(), genRecEmupikp::i, and SortByWireId().
Referenced by TBuilder0::buildStereo0().
00134 { 00135 AList<TMLink> bad; 00136 unsigned n = _links.length(); 00137 for (unsigned i = 0; i < n; i++) { 00138 TMLink & l = * _links[i]; 00139 double dist = distance(l); 00140 if (dist > maxSigma) bad.append(l); 00141 } 00142 00143 #ifdef TRKRECO_DEBUG_DETAIL 00144 std::cout << " TLine0::refine ... rejected hits:max distance=" << maxSigma; 00145 std::cout << std::endl; 00146 bad.sort(SortByWireId); 00147 for (unsigned i = 0; i < bad.length(); i++) { 00148 TMLink & l = * _links[i]; 00149 std::cout << " "; 00150 std::cout << l.wire()->layerId() << "-"; 00151 std::cout << l.wire()->localId(); 00152 std::cout << "("; 00153 if (l.hit()->mc()) { 00154 if (l.hit()->mc()->hep()) std::cout << l.hit()->mc()->hep()->id(); 00155 else std::cout << "0"; 00156 } 00157 std::cout << "),"; 00158 std::cout << l.position() << "," << distance(l); 00159 if (distance(l) > maxSigma) std::cout << " X"; 00160 std::cout << std::endl; 00161 } 00162 #endif 00163 00164 if (bad.length()) { 00165 _links.remove(bad); 00166 list.append(bad); 00167 _fitted = false; 00168 _fittedUpdated = false; 00169 } 00170 }
void TTrackBase::remove | ( | const AList< TMLink > & | ) | [inline, inherited] |
removes TMLinks.
Definition at line 213 of file TTrackBase.h.
References TTrackBase::_fitted, TTrackBase::_fittedWithCathode, TTrackBase::_links, and TTrackBase::_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, inherited] |
removes a TMLink.
Definition at line 204 of file TTrackBase.h.
References TTrackBase::_fitted, TTrackBase::_fittedWithCathode, TTrackBase::_links, and TTrackBase::_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 TLine0::removeChits | ( | ) |
remove extremly bad points.
Definition at line 508 of file TLine0.cxx.
References TTrackBase::_fitted, _fittedUpdated, TTrackBase::_links, abs, genRecEmupikp::i, and RealDBUtil::npos.
Referenced by TBuilder0::buildStereo0().
00508 { 00509 00510 unsigned n = _links.length(); 00511 int nlyr[50] = {0}; 00512 int nneg = 0, npos = 0; 00513 for (unsigned i = 0; i < n -1 ; i++) { 00514 TMLink & l = * _links[i]; 00515 nlyr[l.hit()->wire()->layerId()] += 1; 00516 if(l.position().y() < 0.){ 00517 nneg += 1; 00518 }else { 00519 npos += 1; 00520 } 00521 } 00522 00523 //... 00524 AList<TMLink> bad; 00525 for (unsigned i = 0; i < n; i++) { 00526 00527 TMLink & l = * _links[i]; 00528 00529 //...if # of hits in a wire layer, don't use... 00530 if (nlyr[l.hit()->wire()->layerId()] > 3) { 00531 bad.append(l); 00532 continue; 00533 } 00534 //...remove extremely bad poinits 00535 if(abs(nneg - npos) > 3) { 00536 if(npos > nneg && l.position().y() < 0 ) bad.append(l); 00537 if(npos < nneg && l.position().y() > 0 ) bad.append(l); 00538 } 00539 } 00540 //... 00541 if (bad.length() > 0 && bad.length() < n) { 00542 _links.remove(bad); 00543 } 00544 00545 //... For the next fit 00546 _fitted = false; 00547 _fittedUpdated = false; 00548 }
void TTrackBase::removeLinks | ( | void | ) | [virtual, inherited] |
Definition at line 189 of file TTrackBase.cxx.
References TTrackBase::_links.
Referenced by TBuilderCosmic::buildStereo(), and TrkReco::execute().
00189 { 00190 _links.removeAll(); 00191 }
void TLine0::removeSLY | ( | AList< TMLink > & | list | ) |
Definition at line 551 of file TLine0.cxx.
References TTrackBase::_fitted, _fittedUpdated, and TTrackBase::_links.
00551 { 00552 _links.remove(list); 00553 _fitted = false; 00554 _fittedUpdated = false; 00555 }
unsigned TTrackBase::testByApproach | ( | const AList< TMLink > & | list, | |
double | sigma | |||
) | const [inherited] |
Definition at line 240 of file TTrackBase.cxx.
References genRecEmupikp::i, and TTrackBase::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 [inherited] |
returns # of good hits to be appended.
Definition at line 255 of file TTrackBase.cxx.
References TTrackBase::approach(), TMDCWireHit::dDrift(), TMLink::distance(), TTrackBase::distance(), TMDCWireHit::drift(), TMLink::dump(), showlog::err, TMLink::hit(), and TMLink::pull().
Referenced by TTrackBase::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, inherited] |
returns type. Definition is depending on an object class.
Reimplemented in TTrack.
Definition at line 274 of file TTrackBase.h.
void TTrackBase::update | ( | void | ) | const [inherited] |
update cache.
Reimplemented in TSegment, and TSegment0.
Definition at line 75 of file TTrackBase.cxx.
References TTrackBase::_cores, TTrackBase::_links, TTrackBase::_updated, genRecEmupikp::i, TMDCWireHit::state(), WireHitFittingValid, and WireHitInvalidForFit.
Referenced by TTrackBase::cores(), TTrackBase::dump(), and TTrackBase::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 }
double TLine0::_a [private] |
Definition at line 104 of file TLine0.h.
Referenced by a(), chi2(), distance(), dump(), fit2(), fit2p(), fit2s(), fit2sp(), property(), and reducedChi2().
double TLine0::_b [private] |
Definition at line 105 of file TLine0.h.
Referenced by b(), chi2(), distance(), dump(), fit2(), fit2p(), fit2s(), fit2sp(), property(), and reducedChi2().
double TLine0::_chi2 [mutable, private] |
double TLine0::_det [private] |
bool TTrackBase::_fitted [mutable, protected, inherited] |
Definition at line 162 of file TTrackBase.h.
Referenced by TMLine::a(), a(), TTrackBase::append(), TTrackBase::appendByApproach(), TMLine::appendByszdistance(), appendByszdistance(), TMLine::appendSLY(), appendSLY(), TMLine::b(), b(), TCircle::center(), TCircle::charge(), TTrack::chi2(), TMLine::chi2(), chi2(), TSegment0::direction(), TSegment::direction(), TMLine::distance(), distance(), TTrackBase::DropWorst(), TSegment0::dump(), TSegment::dump(), TCircle::dump(), TTrackBase::falseFit(), THelixFitter::fit(), TCosmicFitter::fit(), TMLine::fit2(), fit2(), TMLine::fit2p(), fit2p(), TMLine::fit2s(), fit2s(), TMLine::fit2sp(), fit2sp(), TCircle::fitForCurl(), TTrackBase::fitted(), TTrackBase::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(), reducedChi2(), TTrackBase::refine(), TMLine::refine(), refine(), TTrack::refine2D(), TTrackBase::remove(), TMLine::removeChits(), removeChits(), TMLine::removeSLY(), removeSLY(), T3DLine::T3DLine(), TRunge::TRunge(), TSegment::TSegment(), TSegment0::TSegment0(), TTrack::TTrack(), TSegment0::update(), TSegment::update(), TSegment0::updateType(), and TSegment::updateType().
bool TLine0::_fittedUpdated [mutable, private] |
Definition at line 101 of file TLine0.h.
Referenced by appendByszdistance(), appendSLY(), chi2(), reducedChi2(), refine(), removeChits(), and removeSLY().
bool TTrackBase::_fittedWithCathode [mutable, protected, inherited] |
Definition at line 163 of file TTrackBase.h.
Referenced by TTrackBase::append(), TTrackBase::falseFit(), TTrackBase::fittedWithCathode(), TTrackBase::remove(), T3DLine::T3DLine(), TRunge::TRunge(), and TTrack::TTrack().
const TLineFitter TLine0::_fitter = TLineFitter("TLine0 Default Line Fitter") [static, private] |
AList<TMLink> TTrackBase::_links [protected, inherited] |
Definition at line 161 of file TTrackBase.h.
Referenced by TTrackBase::append(), TTrackBase::appendByApproach(), TMLine::appendByszdistance(), appendByszdistance(), TMLine::appendSLY(), appendSLY(), TTrack::assign(), TBuilderCurl::buildStereo(), TMLine::chi2(), chi2(), TTrackBase::DropWorst(), TTrackBase::dump(), TTrack::dump(), TSegment0::dump(), TSegment::dump(), TMLine::dump(), dump(), TCircle::dump(), TSegment::expandSeg(), TMLine::fit2(), fit2(), TTrack::fit2D(), TMLine::fit2p(), fit2p(), TMLine::fit2s(), fit2s(), TMLine::fit2sp(), fit2sp(), TCircle::fitForCurl(), TTrackBase::hep(), TTrackBase::links(), TTrack::movePivot(), TTrackBase::nLinks(), TTrackBase::operator[](), TSegment0::rangeX(), TSegment::rangeX(), TMLine::reducedChi2(), reducedChi2(), TTrackBase::refine(), TMLine::refine(), refine(), TTrack::refine2D(), TTrackBase::refineMain(), TTrackBase::remove(), TMLine::removeChits(), removeChits(), TTrackBase::removeLinks(), TMLine::removeSLY(), 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(), TTrackBase::update(), TSegment0::update(), TSegment::update(), TSegment0::updateDuality(), TSegment::updateDuality(), TSegment0::updateType(), and TSegment::updateType().
TTrackMC* TTrackBase::_mc [protected, inherited] |
double TLine0::_reducedChi2 [mutable, private] |