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