HepMC Reference Documentation

HepMC

VectorConversion.h

This example converts from ThreeVector and FourVector to CLHEP::Hep3Vector and CLHEP::HepLorentzVector Similar (or perhaps templated) conversion methods could be added to any vector class.

00001 #ifndef VECTOR_CONVERSION_H
00002 #define VECTOR_CONVERSION_H
00004 // garren@fnal.gov, January 2007
00005 //
00006 // This example converts from ThreeVector and FourVector to 
00007 // CLHEP::Hep3Vector and CLHEP::HepLorentzVector
00008 // Similar (or perhaps templated) conversion methods could be added to
00009 // any vector class.
00010 //
00012 
00013 #include "HepMC/SimpleVector.h"
00014 #include "CLHEP/Vector/LorentzVector.h"
00019 
00021 inline CLHEP::Hep3Vector convertTo( const HepMC::ThreeVector& v )
00022      { return CLHEP::Hep3Vector( v.x(), v.y(), v.z() ); }
00023 
00025 inline CLHEP::HepLorentzVector convertTo( const HepMC::FourVector& v )
00026      { return CLHEP::HepLorentzVector( v.x(), v.y(), v.z(), v.t() ); }
00027  
00028 #endif  // VECTOR_CONVERSION_H

Generated on Thu Jan 7 13:10:15 2010 for HepMC by  doxygen 1.4.7