// example on using with exteral classes (doxygen page) /** \page ExtUsagePage Examples with external Packages

Connection to Linear Algebra classes

It is possible to use the Vector and Rotation classes together with the Linear Algebra classes. It is possiible to construct any 3D or 4D Vector from a Linear Agebra Vector class which implements the operator[]. It is required also to pass the index of the first coordinate in the Lineas Algebra vector. It is then assumed that the other coordinates, will be following contigously.
TVectorD       r2(N)           // %ROOT Linear Algebra Vector containing many vectors
XYZVector      v2(&r2[INDEX])   // construct vector from x=r[INDEX], y=r[INDEX+1], z=r[INDEX+2]


HepVector      c(4)            // CLHEP Linear algebra vector
XYZTVector     q(&c[0])        // construct using px=c[0], py=c[1], pz=c[2], E=c[4]

To construct a Linear Algebra Vector from a 3D or 4D Vector, a method to access the internal data is provided. This is provided only for Vectors and Points based on Cartesian coordinates, where it is garanted that the data are stored contigously in memory. Example:
XYZVector      v(x,y,z);
double * data;
v.GetCoordinates(data);        

TVectorD       r1(3,data);  // create a new Linear Algebra vector copying the data
TVectorD       r2;

Connection to Other Vector classes

The ROOT::Math 3D and 4D vectors can be constructed and assigned from any Vectors which has the following pre-conditions: \item for 3D Vectors and Points must implement the x(), y() ans z() methods \item for LorentzVectors must implement the px(), py(), pz() and e() methods. Example:
 
CLHEP::Hep3Vector hv; 
XYZVector  v1(hv);                              //  create  3D Vector from  CLHEP 3D Vector

HepGeom::Point3D  hp; 
XYZPoint p1(hp);                                // create a 3D Point from CLHEP geom Point

CLHEP::HepLorentzVector  hq; 
LorentzVector q(hq);                            // create a L.V. from CLHEP L.V.
Using the behavior of TVector3 and TLorentzVector as Linear Algebra Vectors (they do implement the operator[] ), we can also create a ROOT::Math Vector from them as we do from a linear algebra vector.
TLorentzVector tq; 
LorentzVector  q;
q.SetCoordinates( &tq[0] );
*/