hepmc - Blame information for rev 419

Subversion Repositories:
Rev:
Rev Author Line No. Line
67 garren 1 #ifndef VECTOR_CONVERSION_H
2 #define VECTOR_CONVERSION_H
3 //////////////////////////////////////////////////////////////////////////
4 // garren@fnal.gov, January 2007
266 garren 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 //
67 garren 11 //////////////////////////////////////////////////////////////////////////
12  
13 #include "HepMC/SimpleVector.h"
14 #include "CLHEP/Vector/LorentzVector.h"
266 garren 15 ///
16 /// \namespace CLHEP
17 /// CLHEP Vector classes are used in one of the examples
18 ///
67 garren 19  
266 garren 20 /// Convert from HepMC::ThreeVector to CLHEP::Hep3Vector
419 garren 21 inline CLHEP::Hep3Vector convertTo( const HepMC::ThreeVector& v )
266 garren 22      { return CLHEP::Hep3Vector( v.x(), v.y(), v.z() ); }
67 garren 23  
266 garren 24 /// Convert from HepMC::FourVector to CLHEP::HepLorentzVector
419 garren 25 inline CLHEP::HepLorentzVector convertTo( const HepMC::FourVector& v )
67 garren 26      { return CLHEP::HepLorentzVector( v.x(), v.y(), v.z(), v.t() ); }
266 garren 27  
67 garren 28 #endif  // VECTOR_CONVERSION_H