23 template<
class T>
inline T sqr(
T x){
return x*
x;}
26 template<
class T>
inline T cube(
T x){
return x*x*
x;}
45 const std::vector<double>&
y,
46 double&
m,
double &
c);
57 double LinFit(
const std::vector<double>& x,
58 const std::vector<double>& y,
59 const std::vector<double>&
w,
60 double& m,
double &c);
Filter events based on their run/event numbers.
T cube(T x)
More efficient cube function than pow(x,3)
T sqr(T x)
More efficient square function than pow(x,2)
void LinFitUnweighted(const std::vector< double > &x, const std::vector< double > &y, double &m, double &c)
Simplified version of LinFit.
double pythag(double x, double y)
2D Euclidean distance
double LinFit(const std::vector< double > &x, const std::vector< double > &y, const std::vector< double > &w, double &m, double &c)
Find the best-fit line to a collection of points in 2-D by minimizing the squared vertical distance f...