| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

MathCore2Clhep.h

Go to the documentation of this file.
00001 // $Id: MathCore2Clhep.h,v 1.2 2007/06/22 16:22:13 gcorti Exp $
00002 #ifndef CLHEPTOOLS_MATHCORE2CLHEP_H 
00003 #define CLHEPTOOLS_MATHCORE2CLHEP_H 1
00004 
00005 // Include files
00006 // MathLib
00007 #include "GaudiKernel/Point3DTypes.h"
00008 #include "GaudiKernel/Vector3DTypes.h"
00009 #include "GaudiKernel/Transform3DTypes.h"
00010 #include "CLHEP/Geometry/Point3D.h"
00011 #include "CLHEP/Geometry/Vector3D.h"
00012 #include "CLHEP/Geometry/Transform3D.h"
00013 
00020 namespace LHCb {
00021 
00022   namespace math2clhep 
00023   {
00024     static HepGeom::Transform3D transform3D(const Gaudi::Transform3D& tr) {
00025         using namespace CLHEP;
00026         double xx, xy, xz, dx, yx, yy, yz, dy, zx, zy, zz, dz;
00027         
00028         tr.GetComponents(xx, xy, xz, dx, yx, yy, yz, dy, zx, zy, zz, dz );
00029 
00030         return HepGeom::Transform3D(HepRotation( HepRep3x3(xx, xy, xz,
00031                                                            yx, yy, yz,
00032                                                            zx, zy, zz) ),
00033                                     Hep3Vector(dx, dy, dz) );
00034     }
00035 
00036     template<class aVector>
00037     static HepGeom::Vector3D<double> vector3D(const aVector& v) {
00038       return HepGeom::Vector3D<double>( v.x(), v.y(), v.z() );
00039     }
00040 
00041     template<class aPoint>
00042     static HepGeom::Point3D<double> point3D(const aPoint& p) {
00043       return HepGeom::Point3D<double>( p.x(), p.y(), p.z() );
00044     }
00045     
00046   }
00047   
00048 
00049 };
00050 
00051 
00052 #endif // CLHEPTOOLS_MATHCORE2CLHEP_H
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Mon Apr 11 20:00:05 2011 for ClhepTools by doxygen 1.4.7