GooFit  v2.1.3
Public Member Functions | Protected Member Functions | List of all members
GooFit::SymmLorentzMatrix Class Reference

#include <SpinHelper.h>

Inheritance diagram for GooFit::SymmLorentzMatrix:
GooFit::LorentzMatrix GooFit::ZTspin2

Public Member Functions

__device__ void makeGmunu ()
 
__device__ const SymmLorentzMatrixgmunu ()
 
__device__ SymmLorentzMatrix ()
 
__device__ SymmLorentzMatrix (const gpuLVec p[4])
 
__device__ SymmLorentzMatrix (const gpuLVec p)
 
__device__ SymmLorentzMatrix (const SymmLorentzMatrix &other)=default
 
__device__ SymmLorentzMatrixadd (const SymmLorentzMatrix &other)
 
__device__ SymmLorentzMatrixsubtract (const SymmLorentzMatrix &other)
 
__device__ SymmLorentzMatrixmult (fptype s)
 
__device__ SymmLorentzMatrixdiv (fptype s)
 
__device__ gpuLVec Contract (const gpuLVec &vec)
 
__device__ LorentzMatrix Contract_1 (const SymmLorentzMatrix &M)
 
__device__ fptype Contract_2 (const SymmLorentzMatrix &M)
 
__device__ SymmLorentzMatrixoperator+= (const SymmLorentzMatrix &rhs)
 
__device__ SymmLorentzMatrixoperator*= (fptype rhs)
 
__device__ SymmLorentzMatrixoperator-= (const SymmLorentzMatrix &rhs)
 
__device__ SymmLorentzMatrixoperator/= (fptype rhs)
 
__device__ SymmLorentzMatrixoperator= (const SymmLorentzMatrix &other)
 
__device__ SymmLorentzMatrix operator+ (const SymmLorentzMatrix &rhs) const
 
__device__ SymmLorentzMatrix operator- (const SymmLorentzMatrix &rhs) const
 
__device__ SymmLorentzMatrix operator* (fptype rhs) const
 
__device__ SymmLorentzMatrix operator/ (fptype rhs) const
 
- Public Member Functions inherited from GooFit::LorentzMatrix
__device__ const gpuLVec & v (int i) const
 
__device__ LorentzMatrix ()=default
 
__device__ LorentzMatrix (const gpuLVec p[4])
 
__device__ LorentzMatrix (const LorentzMatrix &other)
 
__device__ const gpuLVec & X () const
 
__device__ const gpuLVec & Y () const
 
__device__ const gpuLVec & Z () const
 
__device__ const gpuLVec & E () const
 
__device__ gpuLVec & X ()
 
__device__ gpuLVec & Y ()
 
__device__ gpuLVec & Z ()
 
__device__ gpuLVec & E ()
 
__device__ const gpuLVec & operator[] (int i) const
 
__device__ gpuLVec & operator[] (int i)
 
__device__ LorentzMatrixadd (const LorentzMatrix &other)
 
__device__ LorentzMatrixsubtract (const LorentzMatrix &other)
 
__device__ LorentzMatrixmult (fptype s)
 
__device__ LorentzMatrixdiv (fptype s)
 
__device__ LorentzMatrixoperator+= (const LorentzMatrix &rhs)
 
__device__ LorentzMatrixoperator*= (fptype rhs)
 
__device__ LorentzMatrixoperator-= (const LorentzMatrix &rhs)
 
__device__ LorentzMatrixoperator/= (fptype rhs)
 
__device__ LorentzMatrixoperator= (const LorentzMatrix &other)
 
__device__ LorentzMatrix operator+ (const LorentzMatrix &rhs) const
 
__device__ LorentzMatrix operator- (const LorentzMatrix &rhs) const
 
__device__ LorentzMatrix operator* (fptype rhs) const
 
__device__ LorentzMatrix operator/ (fptype rhs) const
 

Protected Member Functions

__device__ bool symmetrize ()
 
__device__ bool makeZero ()
 
- Protected Member Functions inherited from GooFit::LorentzMatrix
__device__ bool makeZero ()
 

Additional Inherited Members

- Protected Attributes inherited from GooFit::LorentzMatrix
gpuLVec _v [4]
 

Detailed Description

Definition at line 210 of file SpinHelper.h.

Constructor & Destructor Documentation

◆ SymmLorentzMatrix() [1/4]

__device__ GooFit::SymmLorentzMatrix::SymmLorentzMatrix ( )
inline

Definition at line 250 of file SpinHelper.h.

251  : LorentzMatrix() {}
__device__ LorentzMatrix()=default

◆ SymmLorentzMatrix() [2/4]

__device__ GooFit::SymmLorentzMatrix::SymmLorentzMatrix ( const gpuLVec  p[4])
inline

Definition at line 252 of file SpinHelper.h.

253  : LorentzMatrix(p){};
__device__ LorentzMatrix()=default

◆ SymmLorentzMatrix() [3/4]

__device__ GooFit::SymmLorentzMatrix::SymmLorentzMatrix ( const gpuLVec  p)
inline

Definition at line 255 of file SpinHelper.h.

255  {
256  X().SetX(p.GetX() * p.GetX());
257  X().SetY(p.GetX() * p.GetY());
258  X().SetZ(p.GetX() * p.GetZ());
259  X().SetE(p.GetX() * p.GetE());
260 
261  Y().SetX(p.GetY() * p.GetX());
262  Y().SetY(p.GetY() * p.GetY());
263  Y().SetZ(p.GetY() * p.GetZ());
264  Y().SetE(p.GetY() * p.GetE());
265 
266  Z().SetX(p.GetZ() * p.GetX());
267  Z().SetY(p.GetZ() * p.GetY());
268  Z().SetZ(p.GetZ() * p.GetZ());
269  Z().SetE(p.GetZ() * p.GetE());
270 
271  E().SetX(p.GetE() * p.GetX());
272  E().SetY(p.GetE() * p.GetY());
273  E().SetZ(p.GetE() * p.GetZ());
274  E().SetE(p.GetE() * p.GetE());
275  }
__device__ const gpuLVec & Y() const
Definition: SpinHelper.h:141
__device__ const gpuLVec & E() const
Definition: SpinHelper.h:143
__device__ const gpuLVec & X() const
Definition: SpinHelper.h:140
__device__ const gpuLVec & Z() const
Definition: SpinHelper.h:142

◆ SymmLorentzMatrix() [4/4]

__device__ GooFit::SymmLorentzMatrix::SymmLorentzMatrix ( const SymmLorentzMatrix other)
default

Member Function Documentation

◆ add()

__device__ SymmLorentzMatrix& GooFit::SymmLorentzMatrix::add ( const SymmLorentzMatrix other)
inline

Definition at line 278 of file SpinHelper.h.

References GooFit::LorentzMatrix::_v.

278  {
279  for(int i = 0; i < 4; i++)
280  _v[i] += other._v[i];
281 
282  return *this;
283  }

◆ Contract()

__device__ gpuLVec GooFit::SymmLorentzMatrix::Contract ( const gpuLVec &  vec)
inline

Definition at line 302 of file SpinHelper.h.

302  {
303  // M^{mu nu} g_{nu alpha} v^{alpha}
304  // M^{mu nu} v_{alpha}
305  return vec.GetE() * E() - vec.GetX() * X() - vec.GetY() * Y() - vec.GetZ() * Z();
306  }
__device__ const gpuLVec & Y() const
Definition: SpinHelper.h:141
__device__ const gpuLVec & E() const
Definition: SpinHelper.h:143
__device__ const gpuLVec & X() const
Definition: SpinHelper.h:140
__device__ const gpuLVec & Z() const
Definition: SpinHelper.h:142

◆ Contract_1()

__device__ LorentzMatrix GooFit::SymmLorentzMatrix::Contract_1 ( const SymmLorentzMatrix M)
inline

Definition at line 307 of file SpinHelper.h.

References GooFit::LorentzMatrix::E(), GooFit::LorentzMatrix::X(), GooFit::LorentzMatrix::Y(), and GooFit::LorentzMatrix::Z().

307  {
308  // One pair of indices gets contracted. Since
309  // both matrices are symmetric, it doesnt matter which.
310  //
311  // O^{mu alpha} g_{alpha beta} M^{beta nu} = R^{mu nu}
312  // O^{mu alpha} M_{beta}^{nu}
313  LorentzMatrix R;
314  R.X() = this->Contract(M.X());
315  R.Y() = this->Contract(M.Y());
316  R.Z() = this->Contract(M.Z());
317  R.E() = this->Contract(M.E()); // signs?
318 
319  return R;
320  }
__device__ LorentzMatrix()=default
__device__ gpuLVec Contract(const gpuLVec &vec)
Definition: SpinHelper.h:302

◆ Contract_2()

__device__ fptype GooFit::SymmLorentzMatrix::Contract_2 ( const SymmLorentzMatrix M)
inline

Definition at line 321 of file SpinHelper.h.

References GooFit::LorentzMatrix::E(), GooFit::LorentzMatrix::X(), GooFit::LorentzMatrix::Y(), and GooFit::LorentzMatrix::Z().

321  {
322  // Both pairs of indices are contracted.
323  // since the matrices are symmetric, it does
324  // not matter which index from this with which form M.
325  //
326  // O^{mu alpha} g_{alpha beta} M^{beta nu} g_{mu nu}
328  // R^{mu nu} R_{mu nu}
329  fptype xx = R.X().GetX(); // Dot(R.X());
330  fptype yy = R.Y().GetY(); // Dot(R.Y());
331  fptype zz = R.Z().GetZ(); // Dot(R.Z());
332  fptype tt = R.E().GetE(); // Dot(R.E());
333 
334  return tt - xx - yy - zz; // signs?
335  }
double fptype
__device__ LorentzMatrix()=default
__device__ LorentzMatrix Contract_1(const SymmLorentzMatrix &M)
Definition: SpinHelper.h:307

◆ div()

__device__ SymmLorentzMatrix& GooFit::SymmLorentzMatrix::div ( fptype  s)
inline

Definition at line 296 of file SpinHelper.h.

296  {
297  for(auto &i : _v)
298  i *= (1. / s);
299 
300  return *this;
301  }

◆ gmunu()

__device__ const SymmLorentzMatrix& GooFit::SymmLorentzMatrix::gmunu ( )

◆ makeGmunu()

__device__ void GooFit::SymmLorentzMatrix::makeGmunu ( )
inline

Definition at line 243 of file SpinHelper.h.

243  {
244  X().SetXYZE(-1, 0, 0, 0);
245  Y().SetXYZE(0, -1, 0, 0);
246  Z().SetXYZE(0, 0, -1, 0);
247  E().SetXYZE(0, 0, 0, 1);
248  }
__device__ const gpuLVec & Y() const
Definition: SpinHelper.h:141
__device__ const gpuLVec & E() const
Definition: SpinHelper.h:143
__device__ const gpuLVec & X() const
Definition: SpinHelper.h:140
__device__ const gpuLVec & Z() const
Definition: SpinHelper.h:142

◆ makeZero()

__device__ bool GooFit::SymmLorentzMatrix::makeZero ( )
inlineprotected

Definition at line 234 of file SpinHelper.h.

234  {
235  X().SetXYZE(0, 0, 0, 0);
236  Y().SetXYZE(0, 0, 0, 0);
237  Z().SetXYZE(0, 0, 0, 0);
238  E().SetXYZE(0, 0, 0, 0);
239  return true;
240  }
__device__ const gpuLVec & Y() const
Definition: SpinHelper.h:141
__device__ const gpuLVec & E() const
Definition: SpinHelper.h:143
__device__ const gpuLVec & X() const
Definition: SpinHelper.h:140
__device__ const gpuLVec & Z() const
Definition: SpinHelper.h:142

◆ mult()

__device__ SymmLorentzMatrix& GooFit::SymmLorentzMatrix::mult ( fptype  s)
inline

Definition at line 290 of file SpinHelper.h.

290  {
291  for(auto &i : _v)
292  i *= s;
293 
294  return *this;
295  }

◆ operator*()

__device__ SymmLorentzMatrix GooFit::SymmLorentzMatrix::operator* ( fptype  rhs) const
inline

Definition at line 357 of file SpinHelper.h.

357  {
358  SymmLorentzMatrix returnVal(*this);
359  returnVal *= rhs;
360  return returnVal;
361  }
__device__ SymmLorentzMatrix()
Definition: SpinHelper.h:250

◆ operator*=()

__device__ SymmLorentzMatrix& GooFit::SymmLorentzMatrix::operator*= ( fptype  rhs)
inline

Definition at line 338 of file SpinHelper.h.

338 { return mult(rhs); }
__device__ SymmLorentzMatrix & mult(fptype s)
Definition: SpinHelper.h:290

◆ operator+()

__device__ SymmLorentzMatrix GooFit::SymmLorentzMatrix::operator+ ( const SymmLorentzMatrix rhs) const
inline

Definition at line 347 of file SpinHelper.h.

347  {
348  SymmLorentzMatrix returnVal(*this);
349  returnVal += rhs;
350  return returnVal;
351  }
__device__ SymmLorentzMatrix()
Definition: SpinHelper.h:250

◆ operator+=()

__device__ SymmLorentzMatrix& GooFit::SymmLorentzMatrix::operator+= ( const SymmLorentzMatrix rhs)
inline

Definition at line 337 of file SpinHelper.h.

337 { return add(rhs); }
__device__ SymmLorentzMatrix & add(const SymmLorentzMatrix &other)
Definition: SpinHelper.h:278

◆ operator-()

__device__ SymmLorentzMatrix GooFit::SymmLorentzMatrix::operator- ( const SymmLorentzMatrix rhs) const
inline

Definition at line 352 of file SpinHelper.h.

352  {
353  SymmLorentzMatrix returnVal(*this);
354  returnVal -= rhs;
355  return returnVal;
356  }
__device__ SymmLorentzMatrix()
Definition: SpinHelper.h:250

◆ operator-=()

__device__ SymmLorentzMatrix& GooFit::SymmLorentzMatrix::operator-= ( const SymmLorentzMatrix rhs)
inline

Definition at line 339 of file SpinHelper.h.

339 { return subtract(rhs); }
__device__ SymmLorentzMatrix & subtract(const SymmLorentzMatrix &other)
Definition: SpinHelper.h:284

◆ operator/()

__device__ SymmLorentzMatrix GooFit::SymmLorentzMatrix::operator/ ( fptype  rhs) const
inline

Definition at line 362 of file SpinHelper.h.

362  {
363  SymmLorentzMatrix returnVal(*this);
364  returnVal /= rhs;
365  return returnVal;
366  }
__device__ SymmLorentzMatrix()
Definition: SpinHelper.h:250

◆ operator/=()

__device__ SymmLorentzMatrix& GooFit::SymmLorentzMatrix::operator/= ( fptype  rhs)
inline

Definition at line 340 of file SpinHelper.h.

340 { return div(rhs); }
__device__ SymmLorentzMatrix & div(fptype s)
Definition: SpinHelper.h:296

◆ operator=()

__device__ SymmLorentzMatrix& GooFit::SymmLorentzMatrix::operator= ( const SymmLorentzMatrix other)
inline

Definition at line 341 of file SpinHelper.h.

References GooFit::LorentzMatrix::_v.

341  {
342  for(int i = 0; i < 4; i++)
343  _v[i] = other._v[i];
344 
345  return *this;
346  }

◆ subtract()

__device__ SymmLorentzMatrix& GooFit::SymmLorentzMatrix::subtract ( const SymmLorentzMatrix other)
inline

Definition at line 284 of file SpinHelper.h.

References GooFit::LorentzMatrix::_v.

284  {
285  for(int i = 0; i < 4; i++)
286  _v[i] -= other._v[i];
287 
288  return *this;
289  }

◆ symmetrize()

__device__ bool GooFit::SymmLorentzMatrix::symmetrize ( )
inlineprotected

Definition at line 215 of file SpinHelper.h.

215  {
216  // clumsy but save
217  X().SetY(Y().GetX());
218  X().SetZ(Z().GetX());
219  X().SetE(E().GetX());
220 
221  Y().SetX(X().GetY());
222  Y().SetZ(Z().GetY());
223  Y().SetE(E().GetY());
224 
225  Z().SetX(X().GetZ());
226  Z().SetY(Y().GetZ());
227  Z().SetE(E().GetZ());
228 
229  E().SetX(X().GetE());
230  E().SetY(Y().GetE());
231  E().SetZ(Z().GetE());
232  return true;
233  }
__device__ const gpuLVec & Y() const
Definition: SpinHelper.h:141
__device__ const gpuLVec & E() const
Definition: SpinHelper.h:143
__device__ const gpuLVec & X() const
Definition: SpinHelper.h:140
__device__ const gpuLVec & Z() const
Definition: SpinHelper.h:142

The documentation for this class was generated from the following file: