18 #ifndef LARCOREOBJ_SIMPLETYPESANDCONSTANTS_GEO_VECTORS_UTILS_TVECTOR_H 19 #define LARCOREOBJ_SIMPLETYPESANDCONSTANTS_GEO_VECTORS_UTILS_TVECTOR_H 27 #include "TLorentzVector.h" 43 template <
typename Vector>
44 TVector3
toTVector3(Vector
const& v) {
return convertTo<TVector3>(v); }
58 template <
typename Stream>
59 void Vector2(Stream&& out, TVector2
const& v)
60 { out <<
"( " << v.X() <<
", " << v.Y() <<
" )"; }
63 template <
typename Stream>
64 void Vector3(Stream&& out, TVector3
const& v)
65 { out <<
"( " << v.X() <<
", " << v.Y() <<
", " << v.Z() <<
" )"; }
68 template <
typename Stream>
71 <<
"( " << v.X() <<
", " << v.Y() <<
", " << v.Z() <<
"; " << v.T()
76 inline std::ostream&
operator<< (std::ostream& out, TVector2
const& v)
77 {
Vector2(out, v);
return out; }
80 inline std::ostream&
operator<< (std::ostream& out, TVector3
const& v)
81 {
Vector3(out, v);
return out; }
84 inline std::ostream&
operator<<
85 (std::ostream& out, TLorentzVector
const& v)
104 using geo::vect::dump::operator<<;
125 #endif // LARCOREOBJ_SIMPLETYPESANDCONSTANTS_GEO_VECTORS_UTILS_TVECTOR_H std::ostream & operator<<(std::ostream &out, TVector2 const &v)
Print a TVector2 to an output stream.
void Vector2(Stream &&out, TVector2 const &v)
Print a TVector2 to an output stream.
void Vector3(Stream &&out, TVector3 const &v)
Print a TVector3 to an output stream.
Utilities to extend the interface of geometry vectors.
void LorentzVector(Stream &&out, TLorentzVector const &v)
Print a TLorentzVector to an output stream.
TVector3 toTVector3(Vector const &v)
Converts a vector into a TVector3.
Namespace collecting geometry-related classes utilities.
auto mag2< TVector2 >(TVector2 const &v)