MINT2
LeviCivita.h
Go to the documentation of this file.
1 #ifndef LEVI_CIVITA_HH
2 #define LEVI_CIVITA_HH
3 // author: Jonas Rademacker (Jonas.Rademacker@bristol.ac.uk)
4 // status: Mon 9 Feb 2009 19:18:13 GMT
5 
6 #include "Mint/LorentzMatrix.h"
7 #include "Mint/Utils.h"
8 #include "TLorentzVector.h"
9 #include "TMatrixT.h"
10 //#include <iostream>
11 
12 inline double LeviCivita(const TLorentzVector& p0
13  , const TLorentzVector& p1
14  , const TLorentzVector& p2
15  , const TLorentzVector& p3){
16 
17  // it is the determinant of the matrix made up of p0, p1, p2, p3
18  TMatrixT<double> m(4, 4);
19  for(int i=0; i < 4; i++){
20  // strange indexing, because I have 0th component = E
21  // but Rene has 0th component = px, 3rd component = E:
22  m(0, i)=p0[(i+3)%4];
23  m(1, i)=p1[(i+3)%4];
24  m(2, i)=p2[(i+3)%4];
25  m(3, i)=p3[(i+3)%4];
26  }
27  return m.Determinant();
28 }
29 
30 inline double LeviCivita(const TLorentzVector& p0
31  , const TLorentzVector& p1
32  , const LorentzMatrix& M){
33  double sum=0;
34  for(int a=0; a<4; a++){
35  for(int b=0; b<4; b++){
36  if(a==b) continue;
37  for(int c=0; c<4; c++){
38  if(a==c || b==c) continue;
39  for(int d=0; d<4; d++){
40  if(a==d || b==d || c==d) continue;
41  sum += MINT::LeviCita(a, b, c, d)
42  * p0[ (a + 3)%4 ] // coping with the stupid, stupid
43  * p1[ (b + 3)%4 ] // stupid, stupid convention in TLorentzVector
44  * M[ (c + 3)%4 ][ (d + 3)%4 ] // that index 0 = p_x, 1=py, 2=pz, 3=Energy
45  ; // arrrrgh. ARRRRRRRGH!!! Rene!!! Why????
46  // (0 + 3)%4 = 3, (1+3)%4 = 0, (2+3)%4 = 1 (3+3)%4 = 2
47  }
48  }
49  }
50  }
51  return sum;
52 }
53 
54 inline TLorentzVector LeviCivita(const TLorentzVector& a, const TLorentzVector& b, const TLorentzVector& c){
55 
56  TLorentzVector v;
57 
58  v.SetT( -1.* a.X() * ( b.Y() * c.Z() - b.Z() * c.Y() )
59  - a.Y() * ( b.Z() * c.X() - b.X() * c.Z() )
60  - a.Z() * ( b.X() * c.Y() - b.Y() * c.X() ) );
61 
62  v.SetZ( a.X() * ( b.T() * c.Y() - b.Y() * c.T() )
63  + a.Y() * ( b.X() * c.T() - b.T() * c.X() )
64  + a.T() * ( b.Y() * c.X() - b.X() * c.Y() ) );
65 
66  v.SetY( a.X() * ( b.Z() * c.T() - b.T() * c.Z() )
67  + a.Z() * ( b.T() * c.X() - b.X() * c.T() )
68  + a.T() * ( b.X() * c.Z() - b.Z() * c.X() ) );
69 
70  v.SetX( a.Y() * ( b.T() * c.Z() - b.Z() * c.T() )
71  + a.Z() * ( b.Y() * c.T() - b.T() * c.Y() )
72  + a.T() * ( b.Z() * c.Y() - b.Y() * c.Z() ) );
73 
74  return v;
75 }
76 
77 
78 #endif
79 //
int LeviCita(int a, int b)
Definition: Utils.cpp:41
static const double m
double LeviCivita(const TLorentzVector &p0, const TLorentzVector &p1, const TLorentzVector &p2, const TLorentzVector &p3)
Definition: LeviCivita.h:12