CoordinateTraits.h

Go to the documentation of this file.
00001 #ifndef COORDINATETRAITS_H
00002 #define COORDINATETRAITS_H
00003 
00004 // $Id: CoordinateTraits.h,v 1.1 2005/09/19 14:22:38 brun Exp $
00005 //
00006 // Coordinate System traits useful for testing purposes.
00007 //
00008 // For example, when reporting a problem, it is nice to be able
00009 // to present a human-readable name for the system.
00010 //
00011 // Created by: Mark Fischler  at Mon May 30 12:21:43 2005
00012 //
00013 // Last update: Wed Jun 1  2005
00014 
00015 #include <string>
00016 #include <typeinfo>
00017 #include "Math/GenVector/Cartesian3D.h"
00018 #include "Math/GenVector/Cylindrical3D.h"
00019 #include "Math/GenVector/CylindricalEta3D.h"
00020 #include "Math/GenVector/Polar3D.h"
00021 #include "Math/GenVector/PxPyPzE4D.h"
00022 #include "Math/GenVector/PxPyPzM4D.h"
00023 #include "Math/GenVector/PtEtaPhiE4D.h"
00024 #include "Math/GenVector/PtEtaPhiM4D.h"
00025 
00026 namespace ROOT {
00027 namespace Math {
00028 
00029 template <class C> 
00030 struct CoordinateTraits {
00031   static const std::string name() {
00032     std::string s = "NOT-A-COORDINATE-SYSTEM: ";
00033     s += typeid(C).name();
00034     return s;
00035   }
00036 };
00037 
00038 template <class Scalar>
00039 struct CoordinateTraits < Cartesian3D<Scalar> >{
00040   static const std::string name() {
00041     std::string s = "Cartesian Coordinates <";
00042     s += typeid(Scalar).name();
00043     s += "> (x, y, z)";
00044     return s;
00045   }
00046 };
00047 
00048 template <class Scalar>
00049 struct CoordinateTraits < CylindricalEta3D<Scalar> >{
00050   static const std::string name() {
00051     std::string s = "Cylindrical/Eta Coordinates <";
00052     s += typeid(Scalar).name();
00053     s += "> (rho, eta, phi)";
00054     return s;
00055   }
00056 };
00057 
00058 template <class Scalar>
00059 struct CoordinateTraits < Cylindrical3D<Scalar> >{
00060   static const std::string name() {
00061     std::string s = "Cylindrical Coordinates <";
00062     s += typeid(Scalar).name();
00063     s += "> (rho, z, phi)";
00064     return s;
00065   }
00066 };
00067 
00068 template <class Scalar>
00069 struct CoordinateTraits < Polar3D<Scalar> >{
00070   static const std::string name() {
00071     std::string s = "Polar Coordinates <";
00072     s += typeid(Scalar).name();
00073     s += "> (r, theta, phi)";
00074     return s;
00075   }
00076 };
00077 
00078   // 4D COORDINATES
00079 
00080 template <class Scalar>
00081 struct CoordinateTraits < PxPyPzE4D<Scalar> >{
00082   static const std::string name() {
00083     std::string s = "PxPyPzE4D Coordinates <";
00084     s += typeid(Scalar).name();
00085     s += "> (Px, Py, Pz, E)";
00086     return s;
00087   }
00088 };
00089 
00090 template <class Scalar>
00091 struct CoordinateTraits < PxPyPzM4D<Scalar> >{
00092   static const std::string name() {
00093     std::string s = "PxPyPzM4D Coordinates <";
00094     s += typeid(Scalar).name();
00095     s += "> (Px, Py, Pz, M)";
00096     return s;
00097   }
00098 };
00099 
00100 template <class Scalar>
00101 struct CoordinateTraits < PtEtaPhiE4D<Scalar> >{
00102   static const std::string name() {
00103     std::string s = "PtEtaPhiE4D4D Coordinates <";
00104     s += typeid(Scalar).name();
00105     s += "> (Pt, eta, phi, E)";
00106     return s;
00107   }
00108 };
00109 
00110 template <class Scalar>
00111 struct CoordinateTraits < PtEtaPhiM4D<Scalar> >{
00112   static const std::string name() {
00113     std::string s = "PtEtaPhiM4D4D Coordinates <";
00114     s += typeid(Scalar).name();
00115     s += "> (Pt, eta, phi, mass)";
00116     return s;
00117   }
00118 };
00119 
00120 
00121 } // namespace Math 
00122 } // namespace ROOT 
00123 
00124 #endif // COORDINATETRAITS_H

Generated on Tue Jul 5 14:33:09 2011 for ROOT_528-00b_version by  doxygen 1.5.1