29 namespace OrcaKinFit {
37 inline double getX()
const;
38 inline double getY()
const;
40 inline double getMag2()
const;
41 inline double getMag()
const;
43 inline double getPhi()
const;
45 inline double getComponent(
int i)
const;
47 inline TwoVector& setValues(
double x_,
double y_);
51 inline TwoVector& operator*= (
double rhs);
57 TwoVector::TwoVector()
61 TwoVector::TwoVector(
double x_,
double y_)
65 double TwoVector::getX()
const {
return x; }
66 double TwoVector::getY()
const {
return y; }
68 double TwoVector::getMag2()
const {
return x * x + y * y; }
69 double TwoVector::getMag()
const {
return std::sqrt(getMag2()); }
71 double TwoVector::getPhi()
const {
return std::atan2(y, x); }
73 double TwoVector::getComponent(
int i)
const
76 case 0:
return getX();
77 case 1:
return getY();
82 TwoVector& TwoVector::setValues(
double x_,
double y_)
90 TwoVector& TwoVector::operator+= (
const TwoVector& rhs)
97 TwoVector& TwoVector::operator-= (
const TwoVector& rhs)
104 TwoVector& TwoVector::operator*= (
double rhs)
111 inline TwoVector operator+ (
const TwoVector& lhs,
const TwoVector& rhs)
113 return TwoVector(lhs.getX() + rhs.getX(), lhs.getY() + rhs.getY());
116 inline TwoVector operator- (
const TwoVector& lhs,
const TwoVector& rhs)
118 return TwoVector(lhs.getX() - rhs.getX(), lhs.getY() - rhs.getY());
121 inline TwoVector operator- (
const TwoVector& rhs)
123 return TwoVector(-rhs.getX(), -rhs.getY());
126 inline double operator* (
const TwoVector& lhs,
const TwoVector& rhs)
128 return lhs.getX() * rhs.getX() + lhs.getY() * rhs.getY();
131 inline TwoVector operator* (
double lhs,
const TwoVector& rhs)
133 return TwoVector(lhs * rhs.getX(), lhs * rhs.getY());
136 inline std::ostream& operator<< (std::ostream& out,
const TwoVector& v)
138 out <<
"(" << v.getX() <<
", " << v.getY() <<
")";
Abstract base class for different kinds of events.