31 {
32 const TrkHitList* hotlist = trk.
hits();
33 std::vector<ws> l;
34 ws sum;
36 {
37 double hottime, hottimeerr;
38 if ( !
useHot( *i ) || !i->timeResid( hottime, hottimeerr ) )
continue;
39 hottime *= 1e9;
40 hottimeerr *= 1e9;
41 ws
x( hottime,
double( 1 ) / ( hottimeerr * hottimeerr ) );
44 }
45 if ( _maxpull > 0 && sum.n() > 2 && sum.isPhysical() )
46 {
47 std::vector<ws>::iterator worst = l.end();
48 do {
49 worst = l.end();
50 double worstPull = _maxpull;
51 for ( std::vector<ws>::iterator i = l.begin(); i != l.end(); ++i )
52 {
53 ws u( sum );
54 u -= *i;
55 if ( !u.isPhysical() )
56 {
57#ifdef MDCPATREC_WARNING
58 std::cout << "ErrMsg(warning) rounding problem?" << std::endl;
59#endif
60 continue;
61 }
62 double p = fabs( u.pull( *i ) );
63 if ( p > worstPull )
64 {
65 worstPull = p;
66 worst = i;
67 }
68 }
69 if ( worst != l.end() )
70 {
71 sum -= *worst;
72 l.erase( worst );
73 }
74 } while ( sum.isPhysical() && sum.n() > 2 && worst != l.end() );
75 }
76 if ( sum.isPhysical() )
77 {
79 ;
80 timeerr = sum.sigma() * 1e-9;
81 nHotsUsed = sum.n();
82 return true;
83 }
84 return false;
85}
hot_iterator begin() const
TrkHotList::hot_iterator hot_iterator
bool useHot(const TrkHitOnTrk &x) const