// example on using with exteral classes (doxygen page) /** \page ExtUsagePage Examples with external Packages
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;
CLHEP::Hep3Vector hv; XYZVector v1(hv); // create 3D Vector from CLHEP 3D Vector HepGeom::Point3DUsing 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.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.
TLorentzVector tq; LorentzVector q; q.SetCoordinates( &tq[0] );*/