Rev 67 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 67 | Rev 266 | ||
|---|---|---|---|
| Line 4... | Line 4... | ||
| 4 | // garren@fnal.gov, January 2007
|
4 | // garren@fnal.gov, January 2007
|
| 5 | // Example conversion functions
|
- | |
| 6 | // This example converts from ThreeVector and FourVector to CLHEP::HepLorentzVector
|
- | |
| - | 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 | //
|
|
| 7 | //////////////////////////////////////////////////////////////////////////
|
11 | //////////////////////////////////////////////////////////////////////////
|
| 8 | 12 | ||
| 9 | #include "HepMC/SimpleVector.h"
|
13 | #include "HepMC/SimpleVector.h"
|
| 10 | #include "CLHEP/Vector/LorentzVector.h"
|
14 | #include "CLHEP/Vector/LorentzVector.h"
|
| - | 15 | ///
|
|
| - | 16 | /// \namespace CLHEP
|
|
| - | 17 | /// CLHEP Vector classes are used in one of the examples
|
|
| - | 18 | ///
|
|
| 11 | 19 | ||
| 12 | CLHEP::HepLorentzVector SVtoLV( const HepMC::ThreeVector& v ) |
- | |
| 13 | { return CLHEP::HepLorentzVector( v.x(), v.y(), v.z() ); } |
- | |
| - | 20 | /// Convert from HepMC::ThreeVector to CLHEP::Hep3Vector
|
|
| - | 21 | CLHEP::Hep3Vector convertTo( const HepMC::ThreeVector& v ) |
|
| - | 22 | { return CLHEP::Hep3Vector( v.x(), v.y(), v.z() ); } |
|
| 14 | 23 | ||
| 15 | CLHEP::HepLorentzVector SVtoLV( const HepMC::FourVector& v ) |
- | |
| - | 24 | /// Convert from HepMC::FourVector to CLHEP::HepLorentzVector
|
|
| - | 25 | CLHEP::HepLorentzVector convertTo( const HepMC::FourVector& v ) |
|
| 16 | { return CLHEP::HepLorentzVector( v.x(), v.y(), v.z(), v.t() ); } |
26 | { return CLHEP::HepLorentzVector( v.x(), v.y(), v.z(), v.t() ); } |
| 17 | - | ||
| - | 27 | ||
| 18 | #endif // VECTOR_CONVERSION_H
|
28 | #endif // VECTOR_CONVERSION_H
|