thepeg is hosted by Hepforge, IPPP Durham
ThePEG  2.2.1
SpinOneLorentzRotation.h
1 // -*- C++ -*-
2 //
3 // SpinOneLorentzRotation.h is a part of ThePEG - Toolkit for HEP Event Generation
4 // Copyright (C) 1999-2019 Leif Lonnblad
5 //
6 // ThePEG is licenced under version 3 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 
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  {
46  setBoost(bx,by,bz,gamma);
47  }
48 
54  explicit SpinOneLorentzRotation (const Boost & b, double gamma=-1.)
55  {
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  array<double,16> 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 */
double yy() const
The yy component.
SpinOneLorentzRotation & boostZ(double beta)
Pure boost along the z-axis; equivalent to LT = BoostX(beta) * LT.
A 4-component Lorentz vector.
Definition: LorentzVector.h:35
bool isIdentity() const
Returns true if the Identity matrix.
SpinOneLorentzRotation & boost(const Boost &b, double gamma=-1.)
boost equivalent to LT = Boost(bv) * LT
double xy() const
The xy component.
double zt() const
The zt component.
SpinOneLorentzRotation & rotateZ(double delta)
Rotation around the z-axis; equivalent to LT = RotationZ(delta) * LT.
This file contains enumerations used by LorentzSpinor and LorentzSpinorBar classes.
A 3-component vector.
Definition: ThreeVector.h:34
LorentzVector< Value > operator*(const LorentzVector< Value > &v) const
Product with a LorentzVector simply returns the rotated vector.
SpinOneLorentzRotation & setRotateX(double angle)
Specify a rotation by the given angle about the x-axis.
SpinOneLorentzRotation & operator*=(const SpinOneLorentzRotation &lt)
Multiply by and assign a*=b becomes a= a*b.
SpinOneLorentzRotation & rotateX(double delta)
Rotation around the x-axis; equivalent to LT = RotationX(delta) * LT.
This is the main namespace within which all identifiers in ThePEG are declared.
Definition: FactoryBase.h:28
SpinOneLorentzRotation(double bx, double by, double bz, double gamma=-1.)
Constructor giving the components of a Lorentz boost.
SpinOneLorentzRotation & transform(const SpinOneLorentzRotation &lt)
Transform (similar to *= but a.transform(b) becomes a = b*a.
SpinOneLorentzRotation & invert()
Inverts the SpinOneLorentzRotation matrix.
double operator()(unsigned int i, unsigned int j) const
Component access by index: x=0, t=3.
SpinOneLorentzRotation()
Default constructor.
SpinOneLorentzRotation & boostX(double beta)
Pure boost along the x-axis; equivalent to LT = BoostX(beta) * LT.
The LorentzRSSpinor class is designed to store a Rarita-Schwinger spinor for a spin-3/2 particle...
SpinOneLorentzRotation & setRotate(double delta, const Axis &axis)
Specify a rotation about a general axis by the angle given.
Lorentz5Vector< Value > operator*(const Lorentz5Vector< Value > &v) const
Product with a Lorentz5Vector simply returns the rotated vector.
double zy() const
The zy component.
std::ostream & print(std::ostream &os) const
output operator
contains the ThreeVector class.
SpinOneLorentzRotation & boost(double bx, double by, double bz, double gamma=-1.)
boost equivalent to LT = Boost(bx,by,bz) * LT
SpinOneLorentzRotation & rotateY(double delta)
Rotation around the y-axis; equivalent to LT = RotationY(delta) * LT.
SpinOneLorentzRotation & boostY(double beta)
Pure boost along the y-axis; equivalent to LT = BoostX(beta) * LT.
The SpinOneLorentzRotation class is ...
double xt() const
The xt component.
SpinOneLorentzRotation & rotate(double delta, const Axis &axis)
Rotation around specified vector - LT = Rotation(delta,axis)*LT.
array< double, 16 > matrix_
Matrix components, order: .
double xz() const
The xz component.
double yt() const
The yt component.
double yx() const
The yx component.
double tz() const
The tz component.
Value x() const
Component access.
The Lorentz5Vector inherits from the LorentzVector class.
SpinOneLorentzRotation & setBoost(const Boost &b, double gamma=-1.)
Specify a Lorentz Boost as a vector.
double tx() const
The tx component.
The LorentzRSSpinorBar class implements the storage of a barred Lorentz Rarita-Schwinger Spinor for a...
double ty() const
The ty component.
vector< T > & operator<<(vector< T > &tv, const U &u)
Overload the left shift operator for vector to push_back objects to a vector.
Definition: Containers.h:179
The LorentzTensor class is designed to implement the storage of a complex tensor to be used to repres...
Definition: LorentzTensor.h:21
double zz() const
The zz component.
SpinOneLorentzRotation inverse() const
Return the inverse.
double xx() const
The xx component.
double yz() const
The yz component.
double tt() const
The tt component.
SpinOneLorentzRotation(const Boost &b, double gamma=-1.)
Constructor giving the vector for a Lorentz boost.
SpinOneLorentzRotation & setRotateZ(double angle)
Specify a rotation by the given angle about the z-axis.
SpinOneLorentzRotation & setRotateY(double angle)
Specify a rotation by the given angle about the y-axis.
SpinOneLorentzRotation & setBoost(double bx, double by, double bz, double gamma=-1.)
Specify the components of a Lorentz Boost.
double zx() const
The zx component.