File: VectorConversion.h

package info (click to toggle)
hepmc 2.06.09-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, wheezy
  • size: 11,524 kB
  • ctags: 1,521
  • sloc: sh: 9,138; cpp: 8,113; ansic: 682; makefile: 240; csh: 6; fortran: 4
file content (28 lines) | stat: -rw-r--r-- 1,026 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#ifndef VECTOR_CONVERSION_H
#define VECTOR_CONVERSION_H
//////////////////////////////////////////////////////////////////////////
// garren@fnal.gov, January 2007
//
// 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.
//
//////////////////////////////////////////////////////////////////////////

#include "HepMC/SimpleVector.h"
#include "CLHEP/Vector/LorentzVector.h"
///
/// \namespace CLHEP
/// CLHEP Vector classes are used in one of the examples
///

/// Convert from HepMC::ThreeVector to CLHEP::Hep3Vector
inline CLHEP::Hep3Vector convertTo( const HepMC::ThreeVector& v )
     { return CLHEP::Hep3Vector( v.x(), v.y(), v.z() ); }

/// Convert from HepMC::FourVector to CLHEP::HepLorentzVector
inline CLHEP::HepLorentzVector convertTo( const HepMC::FourVector& v )
     { return CLHEP::HepLorentzVector( v.x(), v.y(), v.z(), v.t() ); }
 
#endif  // VECTOR_CONVERSION_H