source: HiSusy/trunk/hepmc/x86_64-slc5-gcc41-opt/share/HepMC/examples/VectorConversion.h @ 1

Last change on this file since 1 was 1, checked in by zerwas, 11 years ago

first import of structure, PYTHIA8 and DELPHES

File size: 1.0 KB
Line 
1#ifndef VECTOR_CONVERSION_H
2#define VECTOR_CONVERSION_H
3//////////////////////////////////////////////////////////////////////////
4// 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//
11//////////////////////////////////////////////////////////////////////////
12
13#include "HepMC/SimpleVector.h"
14#include "CLHEP/Vector/LorentzVector.h"
15///
16/// \namespace CLHEP
17/// CLHEP Vector classes are used in one of the examples
18///
19
20/// Convert from HepMC::ThreeVector to CLHEP::Hep3Vector
21inline CLHEP::Hep3Vector convertTo( const HepMC::ThreeVector& v )
22     { return CLHEP::Hep3Vector( v.x(), v.y(), v.z() ); }
23
24/// Convert from HepMC::FourVector to CLHEP::HepLorentzVector
25inline 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
Note: See TracBrowser for help on using the repository browser.