00001 #ifndef RAD_TLorentzVectorC 00002 #define RAD_TLorentzVectorC 00003 00004 #include <complex> 00005 #include "TLorentzVector.h" 00006 00007 class TLorentzVectorC { 00008 protected: 00009 std::complex<double> fx,fy,fz,fe; 00010 public: 00011 TLorentzVectorC(){} 00012 TLorentzVectorC(std::complex<double> x, 00013 std::complex<double> y, 00014 std::complex<double> z, 00015 std::complex<double> e){ 00016 fx = x; fy = y; fz = z; fe = e; 00017 }; 00018 ~TLorentzVectorC(){} 00019 00020 void SetPxPyPzE(std::complex<double> x, 00021 std::complex<double> y, 00022 std::complex<double> z, 00023 std::complex<double> e){ 00024 fx = x; fy = y; fz = z; fe = e; 00025 } 00026 00027 inline std::complex<double> Px() const {return fx;} 00028 inline std::complex<double> Py() const {return fy;} 00029 inline std::complex<double> Pz() const {return fz;} 00030 inline std::complex<double> E() const {return fe;} 00031 inline std::complex<double> X() const {return fx;} 00032 inline std::complex<double> Y() const {return fy;} 00033 inline std::complex<double> Z() const {return fz;} 00034 inline std::complex<double> T() const {return fe;} 00035 00036 inline TLorentzVectorC &operator = (const TLorentzVectorC & q){ 00037 fx = q.Px(); 00038 fy = q.Py(); 00039 fz = q.Pz(); 00040 fe = q.E(); 00041 return *this; 00042 } 00043 00044 00045 inline TLorentzVectorC operator + (const TLorentzVectorC & q) const { 00046 return TLorentzVectorC(fx+q.Px(), fy+q.Py(), fz+q.Pz(), fe+q.E()); 00047 } 00048 00049 inline TLorentzVectorC &operator += (const TLorentzVectorC & q) { 00050 fx += q.Px(); 00051 fy += q.Py(); 00052 fz += q.Pz(); 00053 fe += q.T(); 00054 return *this; 00055 } 00056 00057 inline TLorentzVectorC operator - (const TLorentzVectorC & q) const { 00058 return TLorentzVectorC(fx-q.Px(), fy-q.Py(), fz-q.Pz(), fe-q.E()); 00059 } 00060 00061 inline TLorentzVectorC &operator -= (const TLorentzVectorC & q) { 00062 fx -= q.Px(); 00063 fy -= q.Py(); 00064 fz -= q.Pz(); 00065 fe -= q.T(); 00066 return *this; 00067 } 00068 00069 inline TLorentzVectorC operator - () const { 00070 return TLorentzVectorC(-X(), -Y(), -Z(), -T()); 00071 } 00072 00073 inline TLorentzVectorC& operator *= (double a) { 00074 fx *= a; 00075 fy *= a; 00076 fz *= a; 00077 fe *= a; 00078 return *this; 00079 } 00080 00081 inline TLorentzVectorC operator * (double a) const { 00082 return TLorentzVectorC(a*X(), a*Y(), a*Z(), a*T()); 00083 } 00084 00085 inline TLorentzVectorC& operator *= (std::complex<double> a) { 00086 fx *= a; 00087 fy *= a; 00088 fz *= a; 00089 fe *= a; 00090 return *this; 00091 } 00092 00093 inline TLorentzVectorC operator * (std::complex<double> a) const { 00094 return TLorentzVectorC(a*X(), a*Y(), a*Z(), a*T()); 00095 } 00096 00097 inline std::complex<double> Dot(const TLorentzVectorC & q) const { 00098 return T()*std::conj(q.T()) 00099 - (Z()*std::conj(q.Z()) + Y()*std::conj(q.Y()) + X()*std::conj(q.X())); 00100 } 00101 00102 inline std::complex<double> Dot(const TLorentzVector & q) const { 00103 return T()*q.T() - Z()*q.Z() - Y()*q.Y() - X()*q.X(); 00104 } 00105 00106 inline std::complex<double> operator * (const TLorentzVectorC & q) const { 00107 return Dot(q); 00108 } 00109 00110 inline std::complex<double> operator * (const TLorentzVector & q) const { 00111 return Dot(q); 00112 } 00113 }; 00114 00115 #endif // RAD_TLorentzVectorC