#include <TMLine.h>
Inheritance diagram for TMLine:
Public Member Functions | |
TMLine () | |
Constructor. | |
TMLine (const AList< TMLink > &) | |
Constructor. | |
virtual | ~TMLine () |
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) | |
double | distance (const HepPoint3D &) const |
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("TMLine Default Line Fitter") |
Definition at line 40 of file TMLine.h.
TMLine::TMLine | ( | ) |
Constructor.
Definition at line 23 of file TMLine.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(& TMLine::_fitter); 00034 }
TMLine::TMLine | ( | const AList< TMLink > & | ) |
Constructor.
Definition at line 36 of file TMLine.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(& TMLine::_fitter); 00047 }
TMLine::~TMLine | ( | ) | [virtual] |
double TMLine::a | ( | void | ) | const [inline] |
returns coefficient a.
Definition at line 147 of file TMLine.h.
References _a, and TTrackBase::_fitted.
Referenced by TBuilder::build(), TBuilderCurl::buildStereo(), and TBuilder::buildStereo().
00147 { 00148 #ifdef TRKRECO_DEBUG 00149 if (! _fitted) std::cout << "TMLine::a !!! fit not performed" << std::endl; 00150 #endif 00151 return _a; 00152 }
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 TMLine::appendByszdistance | ( | AList< TMLink > & | list, | |
unsigned | isl, | |||
float | maxSigma | |||
) |
Definition at line 568 of file TMLine.cxx.
References TTrackBase::_fitted, _fittedUpdated, TTrackBase::_links, check_raw_filter::dist, distance(), and genRecEmupikp::i.
00568 { 00569 00570 //... intialize 00571 unsigned nb = _links.length(); 00572 00573 //....Select good hit 00574 unsigned n = list.length(); 00575 for (unsigned i = 0; i < n; i++) { 00576 TMLink & l = * list[i]; 00577 if(l.hit()->wire()->superLayerId() == isl){ 00578 double dist = distance(l); 00579 if (dist < maxSigma) { 00580 _links.append(l); 00581 } 00582 } 00583 } 00584 00585 unsigned na = _links.length(); 00586 if(nb != na){ 00587 AList<TMLink> bad; 00588 //... remove duplicated hits 00589 for(unsigned i = 0; i<na ;i++){ 00590 TMLink & l = * _links[i]; 00591 if(i < na - 1) { 00592 TMLink & lnext = * _links[i+1]; 00593 if(l.hit()->wire()->layerId() == lnext.hit()->wire()->layerId() ){ 00594 if(l.hit()->wire()->localId() == lnext.hit()->wire()->localId()){ 00595 bad.append(l); 00596 } 00597 } 00598 } 00599 } 00600 if(bad.length() > 0) _links.remove(bad); 00601 _fitted = false; 00602 _fittedUpdated = false; 00603 } 00604 }
void TMLine::appendSLY | ( | AList< TMLink > & | list | ) |
Definition at line 561 of file TMLine.cxx.
References TTrackBase::_fitted, _fittedUpdated, and TTrackBase::_links.
00561 { 00562 _links.append(list); 00563 _fitted = false; 00564 _fittedUpdated = false; 00565 }
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 TMLine::b | ( | void | ) | const [inline] |
returns coefficient b.
Definition at line 156 of file TMLine.h.
References _b, and TTrackBase::_fitted.
Referenced by TBuilder::build(), TBuilderCurl::buildStereo(), and TBuilder::buildStereo().
00156 { 00157 #ifdef TRKRECO_DEBUG 00158 if (! _fitted) std::cout << "TMLine::b !!! fit not performed" << std::endl; 00159 #endif 00160 return _b; 00161 }
double TMLine::chi2 | ( | void | ) | const |
returns chi2.
Definition at line 113 of file TMLine.cxx.
References _a, _b, _chi2, TTrackBase::_fitted, _fittedUpdated, TTrackBase::_links, genRecEmupikp::i, and x.
Referenced by reducedChi2().
00113 { 00114 #ifdef TRKRECO_DEBUG 00115 if (! _fitted) 00116 std::cout << "TMLine::chi2 !!! fit not performed" << std::endl; 00117 #endif 00118 00119 if (_fittedUpdated) return _chi2; 00120 _chi2 = 0.; 00121 unsigned n = _links.length(); 00122 for (unsigned i = 0; i < n; i++) { 00123 TMLink & l = * _links[i]; 00124 00125 double x = l.position().x(); 00126 double y = l.position().y(); 00127 double c = y - _a * x - _b; 00128 _chi2 += c * c; 00129 } 00130 _fittedUpdated = true; 00131 return _chi2; 00132 }
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 TMLine::distance | ( | const HepPoint3D & | ) | const [inline] |
Definition at line 176 of file TMLine.h.
References _a, _b, and TTrackBase::_fitted.
00176 { 00177 #ifdef TRKRECO_DEBUG 00178 if (! _fitted) std::cout << "TMLine::distance !!! fit not performed" << std::endl; 00179 #endif 00180 double dy = fabs(_a * p.x() + _b - p.y()); 00181 double invCos = sqrt(1. + _a * _a); 00182 return dy / invCos; 00183 }
double TMLine::distance | ( | const TMLink & | ) | const [inline, virtual] |
returns distance to a position of TMLink itself. (not to a wire)
Reimplemented from TTrackBase.
Definition at line 165 of file TMLine.h.
References _a, _b, TTrackBase::_fitted, and TMLink::position().
Referenced by appendByszdistance(), TBuilder::buildStereo(), refine(), and TBuilder::searchLine().
00165 { 00166 #ifdef TRKRECO_DEBUG 00167 if (! _fitted) std::cout << "TMLine::distance !!! fit not performed" << std::endl; 00168 #endif 00169 double dy = fabs(_a * l.position().x() + _b - l.position().y()); 00170 double invCos = sqrt(1. + _a * _a); 00171 return dy / invCos; 00172 }
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 TMLine::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 TMLine.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 TMLine::fit2 | ( | ) |
fits itself using isolated hits. Error was happened if return value is not zero.
Definition at line 174 of file TMLine.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.
00174 { 00175 std::cout<<" "<<__FILE__<<" "<<__LINE__<<" ERROR : nsl"<<std::endl; 00176 // if (_fitted) return 0; 00177 00178 unsigned n = _links.length(); 00179 int mask[100] = {0}; 00180 int nsl[11] = {64,80,96,128,144,160,192,208,240,256,288}; 00181 int npos = 0, nneg = 0; 00182 for (unsigned i = 0; i < n -1 ; i++) { 00183 TMLink & l = * _links[i]; 00184 for (unsigned j = i+1; j < n ; j++) { 00185 TMLink & s = * _links[j]; 00186 if(l.hit()->wire()->layerId() == s.hit()->wire()->layerId()){ 00187 //... Check 3 consective hits 00188 if(i > 0 && (mask[i-1] == 1 && mask[j] == 1) ){ 00189 TMLink & t = * _links[i-1]; 00190 if(l.hit()->wire()->layerId() == t.hit()->wire()->layerId()){ 00191 mask[i] = 1; 00192 } 00193 } 00194 int ilast = nsl[l.hit()->wire()->superLayerId()]-1; 00195 int ilocal = l.hit()->wire()->localId(); 00196 int jlocal = s.hit()->wire()->localId(); 00197 if(ilocal > 0 && ilocal < ilast){ 00198 if(abs(jlocal-ilocal) > 1 ) { 00199 mask[i] = 1; 00200 mask[j] = 1; 00201 } 00202 }else if(ilocal == 0){ 00203 if(jlocal > 1 && jlocal < ilast){ 00204 mask[i] = 1; 00205 mask[j] = 1; 00206 } 00207 }else if(ilocal == ilast){ 00208 if(jlocal > 0 && jlocal < ilast-1){ 00209 mask[i] = 1; 00210 mask[j] = 1; 00211 } 00212 } 00213 } 00214 } 00215 //... 00216 if(mask[i] == 0){ 00217 if(l.position().y() >= 0) npos += 1; 00218 if(l.position().y() < 0) nneg += 1; 00219 } 00220 } 00221 00222 //.... 00223 double sumX = 0., sumY = 0., sumX2 = 0., sumXY = 0., sumY2 = 0.; 00224 int nused = 0; 00225 int lyid[2]; 00226 for (unsigned i = 0; i < n; i++) { 00227 00228 if(mask[i] == 1) continue; 00229 00230 TMLink & l = * _links[i]; 00231 00232 double x = l.position().x(); 00233 double y = l.position().y(); 00234 if(abs(npos-nneg) > 3){ 00235 if(npos > nneg && y < 0 ) continue; 00236 if(npos < nneg && y > 0 ) continue; 00237 } 00238 sumX += x; 00239 sumY += y; 00240 sumX2 += x * x; 00241 sumXY += x * y; 00242 sumY2 += y * y; 00243 if(nused < 2){ 00244 lyid[nused] = l.hit()->wire()->layerId(); 00245 } 00246 nused += 1; 00247 } 00248 00249 if(nused < 2 || (nused == 2 && lyid[0]==lyid[1])) { 00250 return -2; 00251 } 00252 double sum = double(nused); 00253 _det = sum * sumX2 - sumX * sumX; 00254 if(_det == 0.) { 00255 return -1; 00256 } 00257 _a = (sumXY * sum - sumX * sumY) / _det; 00258 _b = (sumX2 * sumY - sumX * sumXY) / _det; 00259 00260 _fitted = true; 00261 return 0; 00262 }
int TMLine::fit2p | ( | ) |
fits itself using isolated hits. Error was happened if return value is not zero.
Definition at line 403 of file TMLine.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.
00403 { 00404 // if (_fitted) return 0; 00405 00406 std::cout<<" "<<__FILE__<<" "<<__LINE__<<" ERROR : nsl"<<std::endl; 00407 unsigned n = _links.length(); 00408 int mask[100] = {0}; 00409 int nsl[11] = {64,80,96,128,144,160,192,208,240,256,288}; 00410 double phi_ave = 0.; 00411 int nphi = 0; 00412 double Crad = 180./3.141592; 00413 for (unsigned i = 0; i < n -1 ; i++) { 00414 TMLink & l = * _links[i]; 00415 for (unsigned j = i+1; j < n ; j++) { 00416 TMLink & s = * _links[j]; 00417 if(l.hit()->wire()->layerId() == s.hit()->wire()->layerId()){ 00418 //... Check 3 consective hits 00419 if(i > 0 && (mask[i-1] == 1 && mask[j] == 1) ){ 00420 TMLink & t = * _links[i-1]; 00421 if(l.hit()->wire()->layerId() == t.hit()->wire()->layerId()){ 00422 mask[i] = 1; 00423 } 00424 } 00425 int ilast = nsl[l.hit()->wire()->superLayerId()]-1; 00426 int ilocal = l.hit()->wire()->localId(); 00427 int jlocal = s.hit()->wire()->localId(); 00428 if(ilocal > 0 && ilocal < ilast){ 00429 if(abs(jlocal-ilocal) > 1 ) { 00430 mask[i] = 1; 00431 mask[j] = 1; 00432 } 00433 }else if(ilocal == 0){ 00434 if(jlocal > 1 && jlocal < ilast){ 00435 mask[i] = 1; 00436 mask[j] = 1; 00437 } 00438 }else if(ilocal == ilast){ 00439 if(jlocal > 0 && jlocal < ilast-1){ 00440 mask[i] = 1; 00441 mask[j] = 1; 00442 } 00443 } 00444 } 00445 } 00446 //... 00447 //... 00448 if(mask[i] != 1){ 00449 double phi = Crad*atan2(l.position().y(), l.position().x()); 00450 phi_ave += phi; 00451 nphi += 1; 00452 } 00453 } 00454 00455 //... 00456 if(mask[n-1] != 1){ 00457 TMLink & l = * _links[n-1]; 00458 double phi = Crad*atan2(l.position().y(), l.position().x()); 00459 phi_ave += phi; 00460 nphi += 1; 00461 } 00462 double phi_max = 0.; 00463 double phi_min = 0.; 00464 if(nphi> 0){ 00465 phi_max = phi_ave/n + 40; 00466 phi_min = phi_ave/n - 40; 00467 } 00468 00469 //.... 00470 double sumX = 0., sumY = 0., sumX2 = 0., sumXY = 0., sumY2 = 0.; 00471 int nused = 0; 00472 int lyid[2]; 00473 for (unsigned i = 0; i < n; i++) { 00474 00475 if(mask[i] == 1) continue; 00476 00477 TMLink & l = * _links[i]; 00478 00479 double x = l.position().x(); 00480 double y = l.position().y(); 00481 double phi = Crad*atan2(l.position().y(), l.position().x()); 00482 if(phi > phi_max && phi<phi_min ) continue; 00483 00484 sumX += x; 00485 sumY += y; 00486 sumX2 += x * x; 00487 sumXY += x * y; 00488 sumY2 += y * y; 00489 if(nused < 2){ 00490 lyid[nused] = l.hit()->wire()->layerId(); 00491 } 00492 nused += 1; 00493 } 00494 00495 if(nused < 2 || (nused == 2 && lyid[0]==lyid[1])) { 00496 return -2; 00497 } 00498 double sum = double(nused); 00499 _det = sum * sumX2 - sumX * sumX; 00500 if(_det == 0.) { 00501 return -1; 00502 } 00503 _a = (sumXY * sum - sumX * sumY) / _det; 00504 _b = (sumX2 * sumY - sumX * sumXY) / _det; 00505 00506 _fitted = true; 00507 return 0; 00508 }
int TMLine::fit2s | ( | ) |
fits itself using single hits in a wire-layer. Error was happened if return value is not zero.
Definition at line 265 of file TMLine.cxx.
References _a, _b, _det, TTrackBase::_fitted, TTrackBase::_links, genRecEmupikp::i, ganga-rec::j, RealDBUtil::npos, TMLink::position(), s, and x.
00265 { 00266 // if (_fitted) return 0; 00267 00268 unsigned n = _links.length(); 00269 int mask[100] = {0}; 00270 int npos = 0, nneg = 0; 00271 for (unsigned i = 0; i < n -1 ; i++) { 00272 TMLink & l = * _links[i]; 00273 for (unsigned j = i+1; j < n ; j++) { 00274 TMLink & s = * _links[j]; 00275 if(l.hit()->wire()->layerId() == s.hit()->wire()->layerId()){ 00276 mask[i] = 1; 00277 mask[j] = 1; 00278 } 00279 } 00280 //... 00281 if(mask[i] == 0){ 00282 if(l.position().y() >= 0) npos += 1; 00283 if(l.position().y() < 0) nneg += 1; 00284 } 00285 } 00286 00287 //.... 00288 double sumX = 0., sumY = 0., sumX2 = 0., sumXY = 0., sumY2 = 0.; 00289 int nused = 0; 00290 int lyid[2]; 00291 for (unsigned i = 0; i < n; i++) { 00292 00293 if(mask[i] == 1) continue; 00294 00295 TMLink & l = * _links[i]; 00296 00297 double x = l.position().x(); 00298 double y = l.position().y(); 00299 if(npos > nneg && y < 0 ) continue; 00300 if(npos < nneg && y > 0 ) continue; 00301 00302 sumX += x; 00303 sumY += y; 00304 sumX2 += x * x; 00305 sumXY += x * y; 00306 sumY2 += y * y; 00307 nused += 1; 00308 } 00309 00310 if(nused < 4) { 00311 return -2; 00312 } 00313 double sum = double(nused); 00314 _det = sum * sumX2 - sumX * sumX; 00315 if(_det == 0.) { 00316 return -1; 00317 } 00318 _a = (sumXY * sum - sumX * sumY) / _det; 00319 _b = (sumX2 * sumY - sumX * sumXY) / _det; 00320 00321 _fitted = true; 00322 return 0; 00323 }
int TMLine::fit2sp | ( | ) |
fits itself using single hits in a wire-layer. Error was happened if return value is not zero.
Definition at line 325 of file TMLine.cxx.
References _a, _b, _det, TTrackBase::_fitted, TTrackBase::_links, genRecEmupikp::i, ganga-rec::j, TMLink::position(), s, and x.
00325 { 00326 // if (_fitted) return 0; 00327 00328 unsigned n = _links.length(); 00329 int mask[100] = {0}; 00330 double phi_ave = 0.; 00331 int nphi = 0; 00332 double Crad = 180./3.141592; 00333 for (unsigned i = 0; i < n -1 ; i++) { 00334 TMLink & l = * _links[i]; 00335 for (unsigned j = i+1; j < n ; j++) { 00336 TMLink & s = * _links[j]; 00337 if(l.hit()->wire()->layerId() == s.hit()->wire()->layerId()){ 00338 mask[i] = 1; 00339 mask[j] = 1; 00340 } 00341 } 00342 //... 00343 if(mask[i] != 1){ 00344 double phi = Crad*atan2(l.position().y(), l.position().x()); 00345 phi_ave += phi; 00346 nphi += 1; 00347 } 00348 } 00349 00350 //... 00351 if(mask[n-1] != 1){ 00352 TMLink & l = * _links[n-1]; 00353 double phi = Crad*atan2(l.position().y(), l.position().x()); 00354 phi_ave += phi; 00355 nphi += 1; 00356 } 00357 double phi_max = 0.; 00358 double phi_min = 0.; 00359 if(nphi> 0){ 00360 phi_max = phi_ave/n + 40; 00361 phi_min = phi_ave/n - 40; 00362 } 00363 00364 //.... 00365 double sumX = 0., sumY = 0., sumX2 = 0., sumXY = 0., sumY2 = 0.; 00366 int nused = 0; 00367 int lyid[2]; 00368 for (unsigned i = 0; i < n; i++) { 00369 00370 if(mask[i] == 1) continue; 00371 00372 TMLink & l = * _links[i]; 00373 00374 double x = l.position().x(); 00375 double y = l.position().y(); 00376 double phi = Crad*atan2(l.position().y(), l.position().x()); 00377 if(phi > phi_max && phi<phi_min ) continue; 00378 00379 sumX += x; 00380 sumY += y; 00381 sumX2 += x * x; 00382 sumXY += x * y; 00383 sumY2 += y * y; 00384 nused += 1; 00385 } 00386 00387 if(nused < 4) { 00388 return -2; 00389 } 00390 double sum = double(nused); 00391 _det = sum * sumX2 - sumX * sumX; 00392 if(_det == 0.) { 00393 return -1; 00394 } 00395 _a = (sumXY * sum - sumX * sumY) / _det; 00396 _b = (sumX2 * sumY - sumX * sumXY) / _det; 00397 00398 _fitted = true; 00399 return 0; 00400 }
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::TLine0(), 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 TMLine::objectType | ( | void | ) | const [inline, virtual] |
returns type.
Reimplemented from TTrackBase.
Definition at line 195 of file TMLine.h.
References Line.
00195 { 00196 return Line; 00197 }
TMLink * TTrackBase::operator[] | ( | unsigned | i | ) | const [inline, inherited] |
void TMLine::property | ( | double | a, | |
double | b, | |||
double | det | |||
) | [inline] |
double TMLine::reducedChi2 | ( | void | ) | const |
returns reduced-chi2.
Definition at line 607 of file TMLine.cxx.
References _a, _b, TTrackBase::_fitted, _fittedUpdated, TTrackBase::_links, _reducedChi2, chi2(), showlog::err, genRecEmupikp::i, and x.
00607 { 00608 #ifdef TRKRECO_DEBUG 00609 if (! _fitted) 00610 std::cout << "TMLine::reducedChi2 !!! fit not performed" << std::endl; 00611 #endif 00612 00613 if (_fittedUpdated) return _reducedChi2; 00614 double chi2 = 0.; 00615 double scale = 20.; 00616 unsigned n = _links.length(); 00617 for (unsigned i = 0; i < n; i++) { 00618 TMLink & l = * _links[i]; 00619 00620 double x = l.position().x(); 00621 double y = l.position().y(); 00622 double c = y - _a * x - _b; 00623 double err = 1.; 00624 if (l.hit()) err = scale * l.hit()->dDrift(); 00625 chi2 += c * c / err / err; 00626 } 00627 00628 _reducedChi2 = chi2/(n-2); 00629 _fittedUpdated = true; 00630 return _reducedChi2; 00631 }
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 TMLine::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 135 of file TMLine.cxx.
References TTrackBase::_fitted, _fittedUpdated, TTrackBase::_links, check_raw_filter::dist, distance(), genRecEmupikp::i, and SortByWireId().
00135 { 00136 AList<TMLink> bad; 00137 unsigned n = _links.length(); 00138 for (unsigned i = 0; i < n; i++) { 00139 TMLink & l = * _links[i]; 00140 double dist = distance(l); 00141 if (dist > maxSigma) bad.append(l); 00142 } 00143 00144 #ifdef TRKRECO_DEBUG_DETAIL 00145 std::cout << " TMLine::refine ... rejected hits:max distance=" << maxSigma; 00146 std::cout << std::endl; 00147 bad.sort(SortByWireId); 00148 for (unsigned i = 0; i < bad.length(); i++) { 00149 TMLink & l = * _links[i]; 00150 std::cout << " "; 00151 std::cout << l.wire()->layerId() << "-"; 00152 std::cout << l.wire()->localId(); 00153 std::cout << "("; 00154 if (l.hit()->mc()) { 00155 if (l.hit()->mc()->hep()) std::cout << l.hit()->mc()->hep()->id(); 00156 else std::cout << "0"; 00157 } 00158 std::cout << "),"; 00159 std::cout << l.position() << "," << distance(l); 00160 if (distance(l) > maxSigma) std::cout << " X"; 00161 std::cout << std::endl; 00162 } 00163 #endif 00164 00165 if (bad.length()) { 00166 _links.remove(bad); 00167 list.append(bad); 00168 _fitted = false; 00169 _fittedUpdated = false; 00170 } 00171 }
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 TMLine::removeChits | ( | ) |
remove extremly bad points.
Definition at line 511 of file TMLine.cxx.
References TTrackBase::_fitted, _fittedUpdated, TTrackBase::_links, abs, genRecEmupikp::i, and RealDBUtil::npos.
00511 { 00512 00513 unsigned n = _links.length(); 00514 int nlyr[50] = {0}; 00515 int nneg = 0, npos = 0; 00516 for (unsigned i = 0; i < n -1 ; i++) { 00517 TMLink & l = * _links[i]; 00518 nlyr[l.hit()->wire()->layerId()] += 1; 00519 if(l.position().y() < 0.){ 00520 nneg += 1; 00521 }else { 00522 npos += 1; 00523 } 00524 } 00525 00526 //... 00527 AList<TMLink> bad; 00528 for (unsigned i = 0; i < n; i++) { 00529 00530 TMLink & l = * _links[i]; 00531 00532 //...if # of hits in a wire layer, don't use... 00533 if (nlyr[l.hit()->wire()->layerId()] > 3) { 00534 bad.append(l); 00535 continue; 00536 } 00537 //...remove extremely bad poinits 00538 if(abs(nneg - npos) > 3) { 00539 if(npos > nneg && l.position().y() < 0 ) bad.append(l); 00540 if(npos < nneg && l.position().y() > 0 ) bad.append(l); 00541 } 00542 } 00543 //... 00544 if (bad.length() > 0 && bad.length() < n) { 00545 _links.remove(bad); 00546 } 00547 00548 //... For the next fit 00549 _fitted = false; 00550 _fittedUpdated = false; 00551 }
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 TMLine::removeSLY | ( | AList< TMLink > & | list | ) |
Definition at line 554 of file TMLine.cxx.
References TTrackBase::_fitted, _fittedUpdated, and TTrackBase::_links.
00554 { 00555 _links.remove(list); 00556 _fitted = false; 00557 _fittedUpdated = false; 00558 }
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 TMLine::_a [private] |
Definition at line 115 of file TMLine.h.
Referenced by a(), chi2(), distance(), dump(), fit2(), fit2p(), fit2s(), fit2sp(), property(), and reducedChi2().
double TMLine::_b [private] |
Definition at line 116 of file TMLine.h.
Referenced by b(), chi2(), distance(), dump(), fit2(), fit2p(), fit2s(), fit2sp(), property(), and reducedChi2().
double TMLine::_chi2 [mutable, private] |
double TMLine::_det [private] |
bool TTrackBase::_fitted [mutable, protected, inherited] |
Definition at line 162 of file TTrackBase.h.
Referenced by a(), TLine0::a(), TTrackBase::append(), TTrackBase::appendByApproach(), appendByszdistance(), TLine0::appendByszdistance(), appendSLY(), TLine0::appendSLY(), b(), TLine0::b(), TCircle::center(), TCircle::charge(), TTrack::chi2(), chi2(), TLine0::chi2(), TSegment0::direction(), TSegment::direction(), distance(), TLine0::distance(), TTrackBase::DropWorst(), TSegment0::dump(), TSegment::dump(), TCircle::dump(), TTrackBase::falseFit(), THelixFitter::fit(), TCosmicFitter::fit(), fit2(), TLine0::fit2(), fit2p(), TLine0::fit2p(), fit2s(), TLine0::fit2s(), fit2sp(), TLine0::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(), reducedChi2(), TLine0::reducedChi2(), TTrackBase::refine(), refine(), TLine0::refine(), TTrack::refine2D(), TTrackBase::remove(), removeChits(), TLine0::removeChits(), removeSLY(), TLine0::removeSLY(), T3DLine::T3DLine(), TRunge::TRunge(), TSegment::TSegment(), TSegment0::TSegment0(), TTrack::TTrack(), TSegment0::update(), TSegment::update(), TSegment0::updateType(), and TSegment::updateType().
bool TMLine::_fittedUpdated [mutable, private] |
Definition at line 112 of file TMLine.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 TMLine::_fitter = TLineFitter("TMLine 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(), appendByszdistance(), TLine0::appendByszdistance(), appendSLY(), TLine0::appendSLY(), TTrack::assign(), TBuilderCurl::buildStereo(), chi2(), TLine0::chi2(), TTrackBase::DropWorst(), TTrackBase::dump(), TTrack::dump(), TSegment0::dump(), TSegment::dump(), dump(), TLine0::dump(), TCircle::dump(), TSegment::expandSeg(), fit2(), TLine0::fit2(), TTrack::fit2D(), fit2p(), TLine0::fit2p(), fit2s(), TLine0::fit2s(), fit2sp(), TLine0::fit2sp(), TCircle::fitForCurl(), TTrackBase::hep(), TTrackBase::links(), TTrack::movePivot(), TTrackBase::nLinks(), TTrackBase::operator[](), TSegment0::rangeX(), TSegment::rangeX(), reducedChi2(), TLine0::reducedChi2(), TTrackBase::refine(), refine(), TLine0::refine(), TTrack::refine2D(), TTrackBase::refineMain(), TTrackBase::remove(), removeChits(), TLine0::removeChits(), TTrackBase::removeLinks(), 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(), TTrackBase::update(), TSegment0::update(), TSegment::update(), TSegment0::updateDuality(), TSegment::updateDuality(), TSegment0::updateType(), and TSegment::updateType().
TTrackMC* TTrackBase::_mc [protected, inherited] |
double TMLine::_reducedChi2 [mutable, private] |