StRoot  1
VectorConversion.h
1 #ifndef VECTOR_CONVERSION_H
2 #define VECTOR_CONVERSION_H
3 // garren@fnal.gov, January 2007
5 //
6 // This example converts from ThreeVector and FourVector to
7 // CLHEP::Hep3Vector and CLHEP::HepLorentzVector
8 // Similar (or perhaps templated) conversion methods could be added to
9 // any vector class.
10 //
12
13 #include "HepMC/SimpleVector.h"
14 #include "CLHEP/Vector/LorentzVector.h"
19
21 inline CLHEP::Hep3Vector convertTo( const HepMC::ThreeVector& v )
22  { return CLHEP::Hep3Vector( v.x(), v.y(), v.z() ); }
23
25 inline CLHEP::HepLorentzVector convertTo( const HepMC::FourVector& v )
26  { return CLHEP::HepLorentzVector( v.x(), v.y(), v.z(), v.t() ); }
27
28 #endif // VECTOR_CONVERSION_H
double z() const
return z
Definition: SimpleVector.h:157
double x() const
return x
Definition: SimpleVector.h:155
double z() const
return z
Definition: SimpleVector.h:77
double y() const
return y
Definition: SimpleVector.h:76
double y() const
return y
Definition: SimpleVector.h:156
ThreeVector is a simple representation of a position or displacement 3 vector.
Definition: SimpleVector.h:131
double x() const
return x
Definition: SimpleVector.h:75
FourVector is a simple representation of a physics 4 vector.
Definition: SimpleVector.h:42
double t() const
return t
Definition: SimpleVector.h:78