thepeg is hosted by Hepforge, IPPP Durham
ThePEG  2.2.1
epsilon.h
1 // -*- C++ -*-
2 //
3 // epsilon.h is a part of ThePEG - Toolkit for HEP Event Generation
4 // Copyright (C) 2003-2019 Peter Richardson, 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_epsilon_H
10 #define ThePEG_epsilon_H
11 //
12 // This is the declaration of the epsilon class.
13 
15 
16 namespace ThePEG {
17 namespace Helicity {
18 
39  template <typename A, typename B, typename C>
40  auto epsilon(const LorentzVector<A> & a,
41  const LorentzVector<B> & b,
42  const LorentzVector<C> & c)
43  -> LorentzVector<decltype(a.x()*b.y()*c.z())>
44  {
45  auto diffxy = a.x() * b.y() - a.y() * b.x();
46  auto diffxz = a.x() * b.z() - a.z() * b.x();
47  auto diffxt = a.x() * b.t() - a.t() * b.x();
48  auto diffyz = a.y() * b.z() - a.z() * b.y();
49  auto diffyt = a.y() * b.t() - a.t() * b.y();
50  auto diffzt = a.z() * b.t() - a.t() * b.z();
51 
52  using ResultType = LorentzVector<decltype(a.x()*b.x()*c.x())>;
53  ResultType result;
54  result.setX( c.z() * diffyt - c.t() * diffyz - c.y() * diffzt);
55  result.setY( c.t() * diffxz - c.z() * diffxt + c.x() * diffzt);
56  result.setZ(-c.t() * diffxy + c.y() * diffxt - c.x() * diffyt);
57  result.setT(-c.z() * diffxy + c.y() * diffxz - c.x() * diffyz);
58 
59  return result;
60  }
61 
62 
63 }
64 }
65 
66 #endif /* ThePEG_epsilon_H */
A 4-component Lorentz vector.
Definition: LorentzVector.h:35
auto epsilon(const LorentzVector< A > &a, const LorentzVector< B > &b, const LorentzVector< C > &c) -> LorentzVector< decltype(a.x() *b.y() *c.z())>
Return the product .
Definition: epsilon.h:40
This is the main namespace within which all identifiers in ThePEG are declared.
Definition: FactoryBase.h:28
contains the LorentzVector class.