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

#include <SpinHelper.h>

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

Public Member Functions

__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 makeZero ()
 

Protected Attributes

gpuLVec _v [4]
 

Detailed Description

Definition at line 115 of file SpinHelper.h.

Constructor & Destructor Documentation

◆ LorentzMatrix() [1/3]

__device__ GooFit::LorentzMatrix::LorentzMatrix ( )
default

◆ LorentzMatrix() [2/3]

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

Definition at line 132 of file SpinHelper.h.

132  {
133  for(int i = 0; i < 4; i++)
134  _v[i] = p[i];
135  }

◆ LorentzMatrix() [3/3]

__device__ GooFit::LorentzMatrix::LorentzMatrix ( const LorentzMatrix other)
inline

Definition at line 136 of file SpinHelper.h.

References _v.

136  {
137  for(int i = 0; i < 4; i++)
138  _v[i] = other._v[i];
139  }

Member Function Documentation

◆ add()

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

Definition at line 153 of file SpinHelper.h.

References _v.

153  {
154  for(int i = 0; i < 4; i++)
155  _v[i] += other._v[i];
156 
157  return *this;
158  }

◆ div()

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

Definition at line 171 of file SpinHelper.h.

171  {
172  for(auto &i : _v)
173  i *= (1. / s);
174 
175  return *this;
176  }

◆ E() [1/2]

__device__ const gpuLVec& GooFit::LorentzMatrix::E ( ) const
inline

Definition at line 143 of file SpinHelper.h.

Referenced by GooFit::SymmLorentzMatrix::Contract_1(), and GooFit::SymmLorentzMatrix::Contract_2().

143 { return _v[3]; }

◆ E() [2/2]

__device__ gpuLVec& GooFit::LorentzMatrix::E ( )
inline

Definition at line 148 of file SpinHelper.h.

148 { return _v[3]; }

◆ makeZero()

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

Definition at line 119 of file SpinHelper.h.

119  {
120  X().SetXYZE(0, 0, 0, 0);
121  Y().SetXYZE(0, 0, 0, 0);
122  Z().SetXYZE(0, 0, 0, 0);
123  E().SetXYZE(0, 0, 0, 0);
124  return true;
125  }
__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__ LorentzMatrix& GooFit::LorentzMatrix::mult ( fptype  s)
inline

Definition at line 165 of file SpinHelper.h.

165  {
166  for(auto &i : _v)
167  i *= s;
168 
169  return *this;
170  }

◆ operator*()

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

Definition at line 198 of file SpinHelper.h.

198  {
199  LorentzMatrix returnVal(*this);
200  returnVal *= rhs;
201  return returnVal;
202  }
__device__ LorentzMatrix()=default

◆ operator*=()

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

Definition at line 179 of file SpinHelper.h.

179 { return mult(rhs); }
__device__ LorentzMatrix & mult(fptype s)
Definition: SpinHelper.h:165

◆ operator+()

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

Definition at line 188 of file SpinHelper.h.

188  {
189  LorentzMatrix returnVal(*this);
190  returnVal += rhs;
191  return returnVal;
192  }
__device__ LorentzMatrix()=default

◆ operator+=()

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

Definition at line 178 of file SpinHelper.h.

178 { return add(rhs); }
__device__ LorentzMatrix & add(const LorentzMatrix &other)
Definition: SpinHelper.h:153

◆ operator-()

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

Definition at line 193 of file SpinHelper.h.

193  {
194  LorentzMatrix returnVal(*this);
195  returnVal -= rhs;
196  return returnVal;
197  }
__device__ LorentzMatrix()=default

◆ operator-=()

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

Definition at line 180 of file SpinHelper.h.

180 { return subtract(rhs); }
__device__ LorentzMatrix & subtract(const LorentzMatrix &other)
Definition: SpinHelper.h:159

◆ operator/()

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

Definition at line 203 of file SpinHelper.h.

203  {
204  LorentzMatrix returnVal(*this);
205  returnVal /= rhs;
206  return returnVal;
207  }
__device__ LorentzMatrix()=default

◆ operator/=()

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

Definition at line 181 of file SpinHelper.h.

181 { return div(rhs); }
__device__ LorentzMatrix & div(fptype s)
Definition: SpinHelper.h:171

◆ operator=()

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

Definition at line 182 of file SpinHelper.h.

References _v.

182  {
183  for(int i = 0; i < 4; i++)
184  _v[i] = other._v[i];
185 
186  return *this;
187  }

◆ operator[]() [1/2]

__device__ const gpuLVec& GooFit::LorentzMatrix::operator[] ( int  i) const
inline

Definition at line 150 of file SpinHelper.h.

150 { return _v[i]; }

◆ operator[]() [2/2]

__device__ gpuLVec& GooFit::LorentzMatrix::operator[] ( int  i)
inline

Definition at line 151 of file SpinHelper.h.

151 { return _v[i]; }

◆ subtract()

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

Definition at line 159 of file SpinHelper.h.

References _v.

159  {
160  for(int i = 0; i < 4; i++)
161  _v[i] -= other._v[i];
162 
163  return *this;
164  }

◆ v()

__device__ const gpuLVec& GooFit::LorentzMatrix::v ( int  i) const
inline

Definition at line 128 of file SpinHelper.h.

Referenced by GooFit::ZTspin2::operator=().

128 { return _v[i]; }

◆ X() [1/2]

__device__ const gpuLVec& GooFit::LorentzMatrix::X ( ) const
inline

Definition at line 140 of file SpinHelper.h.

Referenced by GooFit::SymmLorentzMatrix::Contract_1(), and GooFit::SymmLorentzMatrix::Contract_2().

140 { return _v[0]; }

◆ X() [2/2]

__device__ gpuLVec& GooFit::LorentzMatrix::X ( )
inline

Definition at line 145 of file SpinHelper.h.

145 { return _v[0]; }

◆ Y() [1/2]

__device__ const gpuLVec& GooFit::LorentzMatrix::Y ( ) const
inline

Definition at line 141 of file SpinHelper.h.

Referenced by GooFit::SymmLorentzMatrix::Contract_1(), and GooFit::SymmLorentzMatrix::Contract_2().

141 { return _v[1]; }

◆ Y() [2/2]

__device__ gpuLVec& GooFit::LorentzMatrix::Y ( )
inline

Definition at line 146 of file SpinHelper.h.

146 { return _v[1]; }

◆ Z() [1/2]

__device__ const gpuLVec& GooFit::LorentzMatrix::Z ( ) const
inline

Definition at line 142 of file SpinHelper.h.

Referenced by GooFit::SymmLorentzMatrix::Contract_1(), and GooFit::SymmLorentzMatrix::Contract_2().

142 { return _v[2]; }

◆ Z() [2/2]

__device__ gpuLVec& GooFit::LorentzMatrix::Z ( )
inline

Definition at line 147 of file SpinHelper.h.

147 { return _v[2]; }

Member Data Documentation

◆ _v

gpuLVec GooFit::LorentzMatrix::_v[4]
protected

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