ThePEG  1.8.0
SpinOneLorentzRotation.h
1 // -*- C++ -*-
2 //
3 // SpinOneLorentzRotation.h is a part of ThePEG - Toolkit for HEP Event Generation
4 // Copyright (C) 1999-2011 Leif Lonnblad
5 //
6 // ThePEG is licenced under version 2 of the GPL, see COPYING for details.
7 // Please respect the MCnet academic guidelines, see GUIDELINES for details.
8 //
9 #ifndef ThePEG_SpinOneLorentzRotation_H
10 #define ThePEG_SpinOneLorentzRotation_H
11 
12 #include "ThePEG/Helicity/HelicityDefinitions.h"
13 #include "ThePEG/Helicity/LorentzTensor.fh"
14 #include "ThePEG/Helicity/LorentzRSSpinor.fh"
15 #include "ThePEG/Helicity/LorentzRSSpinorBar.fh"
16 #include "ThreeVector.h"
17 #include <vector>
18 
19 namespace ThePEG {
20 
25 public:
26 
29 
34  xx_() = yy_() = zz_() = tt_() = 1.0;
35  }
36 
44  SpinOneLorentzRotation (double bx, double by, double bz, double gamma=-1.)
45  : matrix_(16) {
46  setBoost(bx,by,bz,gamma);
47  }
48 
54  explicit SpinOneLorentzRotation (const Boost & b, double gamma=-1.)
55  : matrix_(16) {
56  setBoost(b.x(), b.y(), b.z(),gamma);
57  }
59 
63  bool isIdentity() const;
64 
69 
73  SpinOneLorentzRotation & invert() { return *this = inverse(); }
74 
78  std::ostream & print( std::ostream & os ) const;
79 
82 
90  SpinOneLorentzRotation & setBoost (double bx, double by, double bz, double gamma=-1.);
91 
97  SpinOneLorentzRotation & setBoost (const Boost & b, double gamma=-1.) {
98  return setBoost(b.x(), b.y(), b.z(),gamma);
99  }
100 
106  SpinOneLorentzRotation & setRotate(double delta, const Axis & axis);
107 
112  SpinOneLorentzRotation & setRotateX (double angle);
113 
118  SpinOneLorentzRotation & setRotateY (double angle);
119 
124  SpinOneLorentzRotation & setRotateZ (double angle);
125 
127 
130 
134  double xx() const { return matrix_[ 0]; }
135 
139  double xy() const { return matrix_[ 1]; }
140 
144  double xz() const { return matrix_[ 2]; }
145 
149  double xt() const { return matrix_[ 3]; }
150 
154  double yx() const { return matrix_[ 4]; }
155 
159  double yy() const { return matrix_[ 5]; }
160 
164  double yz() const { return matrix_[ 6]; }
165 
169  double yt() const { return matrix_[ 7]; }
170 
174  double zx() const { return matrix_[ 8]; }
175 
179  double zy() const { return matrix_[ 9]; }
180 
184  double zz() const { return matrix_[10]; }
185 
189  double zt() const { return matrix_[11]; }
190 
194  double tx() const { return matrix_[12]; }
195 
199  double ty() const { return matrix_[13]; }
200 
204  double tz() const { return matrix_[14]; }
205 
209  double tt() const { return matrix_[15]; }
211 
214 
218  template <typename Value>
220  operator*(const LorentzVector<Value> & v) const {
221  return LorentzVector<Value>
222  (xx()*v.x() + xy()*v.y() + xz()*v.z() + xt()*v.t(),
223  yx()*v.x() + yy()*v.y() + yz()*v.z() + yt()*v.t(),
224  zx()*v.x() + zy()*v.y() + zz()*v.z() + zt()*v.t(),
225  tx()*v.x() + ty()*v.y() + tz()*v.z() + tt()*v.t());
226  }
227 
231  template <typename Value>
233  operator*(const Lorentz5Vector<Value> & v) const {
234  return Lorentz5Vector<Value>
235  (xx()*v.x() + xy()*v.y() + xz()*v.z() + xt()*v.t(),
236  yx()*v.x() + yy()*v.y() + yz()*v.z() + yt()*v.t(),
237  zx()*v.x() + zy()*v.y() + zz()*v.z() + zt()*v.t(),
238  tx()*v.x() + ty()*v.y() + tz()*v.z() + tt()*v.t());
239  }
240 
246 
251  return *this = *this * lt;
252  }
253 
258  return *this = lt * *this;
259  }
260 
264  SpinOneLorentzRotation & rotateX(double delta) {
266  tmp.setRotateX(delta);
267  return *this = tmp * *this;
268  }
269 
273  SpinOneLorentzRotation & rotateY(double delta) {
275  tmp.setRotateY(delta);
276  return *this = tmp * *this;
277  }
278 
282  SpinOneLorentzRotation & rotateZ(double delta) {
284  tmp.setRotateZ(delta);
285  return *this = tmp * *this;
286  }
287 
291  SpinOneLorentzRotation & rotate(double delta, const Axis & axis) {
293  tmp.setRotate(delta, axis);
294  return *this = tmp * *this;
295  }
296 
301  return *this = SpinOneLorentzRotation(beta,0,0) * *this;
302  }
303 
308  return *this = SpinOneLorentzRotation(0,beta,0) * *this;
309  }
310 
315  return *this = SpinOneLorentzRotation(0,0,beta) * *this;
316  }
317 
325  SpinOneLorentzRotation & boost(double bx, double by, double bz,
326  double gamma=-1.) {
327  return *this = SpinOneLorentzRotation(bx,by,bz,gamma) * *this;
328  }
329 
335  SpinOneLorentzRotation & boost(const Boost & b, double gamma=-1.) {
336  return *this = SpinOneLorentzRotation(b.x(),b.y(),b.z(),gamma) * *this;
337  }
339 
340 private:
341 
342  template<typename Value> friend class Helicity::LorentzTensor;
343  template<typename Value> friend class Helicity::LorentzRSSpinor;
344  template<typename Value> friend class Helicity::LorentzRSSpinorBar;
345 
347  vector<double> matrix_;
348 
350  SpinOneLorentzRotation (double xx, double xy, double xz, double xt,
351  double yx, double yy, double yz, double yt,
352  double zx, double zy, double zz, double zt,
353  double tx, double ty, double tz, double tt);
354 
356  double operator()(unsigned int i, unsigned int j) const {
357  return matrix_[4*i + j];
358  }
359 
361 
362  double & xx_() { return matrix_[ 0]; }
363  double & xy_() { return matrix_[ 1]; }
364  double & xz_() { return matrix_[ 2]; }
365  double & xt_() { return matrix_[ 3]; }
366 
367  double & yx_() { return matrix_[ 4]; }
368  double & yy_() { return matrix_[ 5]; }
369  double & yz_() { return matrix_[ 6]; }
370  double & yt_() { return matrix_[ 7]; }
371 
372  double & zx_() { return matrix_[ 8]; }
373  double & zy_() { return matrix_[ 9]; }
374  double & zz_() { return matrix_[10]; }
375  double & zt_() { return matrix_[11]; }
376 
377  double & tx_() { return matrix_[12]; }
378  double & ty_() { return matrix_[13]; }
379  double & tz_() { return matrix_[14]; }
380  double & tt_() { return matrix_[15]; }
382 };
383 
387 inline std::ostream & operator<< ( std::ostream & os,
388  const SpinOneLorentzRotation& lt ) {
389  return lt.print(os);
390 }
391 
392 }
393 
394 #endif /* ThePEG_SpinOneLorentzRotation_H */