20#ifndef TRKOUTAVGTIMECALCULATOR_HH
21#define TRKOUTAVGTIMECALCULATOR_HH
23#include "TrkBase/TrkTimeCalculator.h"
33 int& nHotsUsed )
const;
44 ws(
double x = 0,
double w = 0 ) : _w(
w ), _wx(
w * x ), _n(
w > 0 ? 1 : 0 ) {
53 ws& operator-=(
const ws&
x ) {
59 bool operator==(
const ws&
x )
const {
return _w ==
x._w && _wx ==
x._wx && _n ==
x._n; }
60 bool isPhysical()
const {
return _w > 0; }
61 double mean()
const {
return _wx / _w; }
62 double sigma()
const {
return double( 1 ) / sqrt( _w ); }
63 double pull(
const ws&
x )
const {
64 return ( mean() -
x.mean() ) / sqrt( sigma2() +
x.sigma2() );
66 unsigned n()
const {
return _n; }
69 double sigma2()
const {
return double( 1 ) / _w; }
GPStime & operator+=(GPStime &t, const double &dt)
TrkOutAvgTimeCalculator(const TrkHotSelector &selector, double maxpull)
virtual ~TrkOutAvgTimeCalculator()
virtual bool trackTime(const TrkRecoTrk &trk, double &time, double &timeerr, int &nHotsUsed) const