00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef ThePEG_SpinOneLorentzRotation_H
00010 #define ThePEG_SpinOneLorentzRotation_H
00011
00012 #include "ThePEG/Helicity/HelicityDefinitions.h"
00013 #include "ThePEG/Helicity/LorentzTensor.fh"
00014 #include "ThePEG/Helicity/LorentzRSSpinor.fh"
00015 #include "ThePEG/Helicity/LorentzRSSpinorBar.fh"
00016 #include "ThreeVector.h"
00017 #include <vector>
00018
00019 namespace ThePEG {
00020
00024 class SpinOneLorentzRotation {
00025 public:
00026
00029
00033 SpinOneLorentzRotation() : matrix_(16) {
00034 xx_() = yy_() = zz_() = tt_() = 1.0;
00035 }
00036
00044 SpinOneLorentzRotation (double bx, double by, double bz, double gamma=-1.)
00045 : matrix_(16) {
00046 setBoost(bx,by,bz,gamma);
00047 }
00048
00054 explicit SpinOneLorentzRotation (const Boost & b, double gamma=-1.)
00055 : matrix_(16) {
00056 setBoost(b.x(), b.y(), b.z(),gamma);
00057 }
00059
00063 bool isIdentity() const;
00064
00068 SpinOneLorentzRotation inverse() const;
00069
00073 SpinOneLorentzRotation & invert() { return *this = inverse(); }
00074
00078 std::ostream & print( std::ostream & os ) const;
00079
00082
00090 SpinOneLorentzRotation & setBoost (double bx, double by, double bz, double gamma=-1.);
00091
00097 SpinOneLorentzRotation & setBoost (const Boost & b, double gamma=-1.) {
00098 return setBoost(b.x(), b.y(), b.z(),gamma);
00099 }
00100
00106 SpinOneLorentzRotation & setRotate(double delta, const Axis & axis);
00107
00112 SpinOneLorentzRotation & setRotateX (double angle);
00113
00118 SpinOneLorentzRotation & setRotateY (double angle);
00119
00124 SpinOneLorentzRotation & setRotateZ (double angle);
00125
00127
00130
00134 double xx() const { return matrix_[ 0]; }
00135
00139 double xy() const { return matrix_[ 1]; }
00140
00144 double xz() const { return matrix_[ 2]; }
00145
00149 double xt() const { return matrix_[ 3]; }
00150
00154 double yx() const { return matrix_[ 4]; }
00155
00159 double yy() const { return matrix_[ 5]; }
00160
00164 double yz() const { return matrix_[ 6]; }
00165
00169 double yt() const { return matrix_[ 7]; }
00170
00174 double zx() const { return matrix_[ 8]; }
00175
00179 double zy() const { return matrix_[ 9]; }
00180
00184 double zz() const { return matrix_[10]; }
00185
00189 double zt() const { return matrix_[11]; }
00190
00194 double tx() const { return matrix_[12]; }
00195
00199 double ty() const { return matrix_[13]; }
00200
00204 double tz() const { return matrix_[14]; }
00205
00209 double tt() const { return matrix_[15]; }
00211
00214
00218 template <typename Value>
00219 LorentzVector<Value>
00220 operator*(const LorentzVector<Value> & v) const {
00221 return LorentzVector<Value>
00222 (xx()*v.x() + xy()*v.y() + xz()*v.z() + xt()*v.t(),
00223 yx()*v.x() + yy()*v.y() + yz()*v.z() + yt()*v.t(),
00224 zx()*v.x() + zy()*v.y() + zz()*v.z() + zt()*v.t(),
00225 tx()*v.x() + ty()*v.y() + tz()*v.z() + tt()*v.t());
00226 }
00227
00231 template <typename Value>
00232 Lorentz5Vector<Value>
00233 operator*(const Lorentz5Vector<Value> & v) const {
00234 return Lorentz5Vector<Value>
00235 (xx()*v.x() + xy()*v.y() + xz()*v.z() + xt()*v.t(),
00236 yx()*v.x() + yy()*v.y() + yz()*v.z() + yt()*v.t(),
00237 zx()*v.x() + zy()*v.y() + zz()*v.z() + zt()*v.t(),
00238 tx()*v.x() + ty()*v.y() + tz()*v.z() + tt()*v.t());
00239 }
00240
00245 SpinOneLorentzRotation operator * (const SpinOneLorentzRotation & lt) const;
00246
00250 SpinOneLorentzRotation & operator *= (const SpinOneLorentzRotation & lt) {
00251 return *this = *this * lt;
00252 }
00253
00257 SpinOneLorentzRotation & transform (const SpinOneLorentzRotation & lt) {
00258 return *this = lt * *this;
00259 }
00260
00264 SpinOneLorentzRotation & rotateX(double delta) {
00265 SpinOneLorentzRotation tmp;
00266 tmp.setRotateX(delta);
00267 return *this = tmp * *this;
00268 }
00269
00273 SpinOneLorentzRotation & rotateY(double delta) {
00274 SpinOneLorentzRotation tmp;
00275 tmp.setRotateY(delta);
00276 return *this = tmp * *this;
00277 }
00278
00282 SpinOneLorentzRotation & rotateZ(double delta) {
00283 SpinOneLorentzRotation tmp;
00284 tmp.setRotateZ(delta);
00285 return *this = tmp * *this;
00286 }
00287
00291 SpinOneLorentzRotation & rotate(double delta, const Axis & axis) {
00292 SpinOneLorentzRotation tmp;
00293 tmp.setRotate(delta, axis);
00294 return *this = tmp * *this;
00295 }
00296
00300 SpinOneLorentzRotation & boostX(double beta) {
00301 return *this = SpinOneLorentzRotation(beta,0,0) * *this;
00302 }
00303
00307 SpinOneLorentzRotation & boostY(double beta) {
00308 return *this = SpinOneLorentzRotation(0,beta,0) * *this;
00309 }
00310
00314 SpinOneLorentzRotation & boostZ(double beta) {
00315 return *this = SpinOneLorentzRotation(0,0,beta) * *this;
00316 }
00317
00325 SpinOneLorentzRotation & boost(double bx, double by, double bz,
00326 double gamma=-1.) {
00327 return *this = SpinOneLorentzRotation(bx,by,bz,gamma) * *this;
00328 }
00329
00335 SpinOneLorentzRotation & boost(const Boost & b, double gamma=-1.) {
00336 return *this = SpinOneLorentzRotation(b.x(),b.y(),b.z(),gamma) * *this;
00337 }
00339
00340 private:
00341
00342 template<typename Value> friend class Helicity::LorentzTensor;
00343 template<typename Value> friend class Helicity::LorentzRSSpinor;
00344 template<typename Value> friend class Helicity::LorentzRSSpinorBar;
00345
00347 vector<double> matrix_;
00348
00350 SpinOneLorentzRotation (double xx, double xy, double xz, double xt,
00351 double yx, double yy, double yz, double yt,
00352 double zx, double zy, double zz, double zt,
00353 double tx, double ty, double tz, double tt);
00354
00356 double operator()(unsigned int i, unsigned int j) const {
00357 return matrix_[4*i + j];
00358 }
00359
00361
00362 double & xx_() { return matrix_[ 0]; }
00363 double & xy_() { return matrix_[ 1]; }
00364 double & xz_() { return matrix_[ 2]; }
00365 double & xt_() { return matrix_[ 3]; }
00366
00367 double & yx_() { return matrix_[ 4]; }
00368 double & yy_() { return matrix_[ 5]; }
00369 double & yz_() { return matrix_[ 6]; }
00370 double & yt_() { return matrix_[ 7]; }
00371
00372 double & zx_() { return matrix_[ 8]; }
00373 double & zy_() { return matrix_[ 9]; }
00374 double & zz_() { return matrix_[10]; }
00375 double & zt_() { return matrix_[11]; }
00376
00377 double & tx_() { return matrix_[12]; }
00378 double & ty_() { return matrix_[13]; }
00379 double & tz_() { return matrix_[14]; }
00380 double & tt_() { return matrix_[15]; }
00382 };
00383
00387 inline std::ostream & operator<< ( std::ostream & os,
00388 const SpinOneLorentzRotation& lt ) {
00389 return lt.print(os);
00390 }
00391
00392 }
00393
00394 #endif