// Vector3d doxygen page /** \page Vector3DPage Vector3D Classes The following types of Vector are defined by defaults:
XYZVector v1; // create an empty vector (x = 0, y = 0, z = 0) XYZVector v2( 1,2,3); // create a vector with x=1, y = 2, z = 3; Polar3DVector v3( 1, PI/2, PI); // create a vector with r = 1, theta = PI/2 and phi=PI RhoEtaPHiVector v4( 1, 2, PI) // create a vector with rho= 1, eta = 2, phi = PINote that each type of vector is constructed by passing its coordinates representations, so a XYZVector(1,2,3) is different from a Polar3DVector(1,2,3).
In addition the Vector classes can be constructed by any vector, which implements the accessors x(), y() and z(). This con be another Vector3D based on a different coordinate system types or even any vector of a different package, like the CLHEP HepThreeVector that implements the required signatures.
XYZVector v1(1,2,3); RhoEtaPHiVector r2(v1); CLHEP::HepThreeVector q(1,2,3); XYZVector v3(q)
double d[3] = {1.,2.,3.}; XYZVector v; v.SetCoordinates(d); double * d2; v.GetCoordinates(d2);or for example from an std::vector using the iterator
std::vectorw(3); XYZVector v; v.SetCoordinates(w.begin(),w.end()); std::vector w2(3); v.GetCoordinates(w2.begin(),w2.end());
v += q; v -= q; v1 *= a; v1 /= a;And for 3D Vector classes, the following operations are possibles: ( v1 and v2 can be two vectors in different coordinate system. v3 is the same type of v1)
v3 = v1 + v2; v3 = v1 - v2; v2 = a * v1; v2 = v1 * a; v2 = v1 / a;In addition we support the dot and cross products, through the Dot() and Cross() methods. Multiplication between two vectors using the operator * is not supported because is ambigous. */