ThePEG  1.8.0
epsilon.h
1 // -*- C++ -*-
2 //
3 // epsilon.h is a part of ThePEG - Toolkit for HEP Event Generation
4 // Copyright (C) 2003-2011 Peter Richardson, 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_epsilon_H
10 #define ThePEG_epsilon_H
11 //
12 // This is the declaration of the epsilon class.
13 
14 #include "ThePEG/Vectors/LorentzVector.h"
15 
16 namespace ThePEG {
17 namespace Helicity {
18 
39  template <typename A, typename B, typename C>
40  inline LorentzVector<typename BinaryOpTraits<
41  typename BinaryOpTraits<A,B>::MulT, C>::MulT>
43  const LorentzVector<B> & b,
44  const LorentzVector<C> & c) {
45  typedef typename BinaryOpTraits<A,B>::MulT ABType;
46  typedef typename BinaryOpTraits<ABType, C>::MulT ABCType;
47  typedef LorentzVector<ABCType> ResultType;
48 
49  ABType diffxy = a.x() * b.y() - a.y() * b.x();
50  ABType diffxz = a.x() * b.z() - a.z() * b.x();
51  ABType diffxt = a.x() * b.t() - a.t() * b.x();
52  ABType diffyz = a.y() * b.z() - a.z() * b.y();
53  ABType diffyt = a.y() * b.t() - a.t() * b.y();
54  ABType diffzt = a.z() * b.t() - a.t() * b.z();
55 
56  ResultType result;
57  result.setX( c.z() * diffyt - c.t() * diffyz - c.y() * diffzt);
58  result.setY( c.t() * diffxz - c.z() * diffxt + c.x() * diffzt);
59  result.setZ(-c.t() * diffxy + c.y() * diffxt - c.x() * diffyt);
60  result.setT(-c.z() * diffxy + c.y() * diffxz - c.x() * diffyz);
61 
62  return result;
63  }
64 
65 
66 }
67 }
68 
69 #endif /* ThePEG_epsilon_H */
A 4-component Lorentz vector.
Definition: LorentzVector.h:35
This is the main namespace within which all identifiers in ThePEG are declared.
Definition: FactoryBase.h:28
LorentzVector< typename BinaryOpTraits< typename BinaryOpTraits< A, B >::MulT, C >::MulT > epsilon(const LorentzVector< A > &a, const LorentzVector< B > &b, const LorentzVector< C > &c)
Return the product .
Definition: epsilon.h:42
BinaryOpTraits should be specialized with typdefs called MulT and DivT which gives the type resulting...
Definition: PhysicalQty.h:239