Page MenuHomeHEPForge

No OneTemporary

diff --git a/include/HEJ/Tensor.hh b/include/HEJ/Tensor.hh
index 0db7bc0..4227128 100644
--- a/include/HEJ/Tensor.hh
+++ b/include/HEJ/Tensor.hh
@@ -1,211 +1,176 @@
/** \file
* \brief Tensor Template Class declaration.
*
* This file contains the declaration of the Tensor Template class. This
* is used to calculate some of the more complex currents within the
* W+Jets implementation particularly.
*
* \authors The HEJ collaboration (see AUTHORS for details)
* \date 2019
* \copyright GPLv2 or later
*/
#pragma once
#include <array>
#include <complex>
#include <valarray>
namespace CLHEP {
class HepLorentzVector;
}
class CCurrent;
typedef std::complex<double> COM;
///@TODO put in some namespace
template <unsigned int N, unsigned int D>
class Tensor{
public:
//! Constructor
Tensor();
Tensor(COM x);
//! Destructor
virtual ~Tensor();
- /**
- *\brief Returns Rank of Tensor (N in T<N,D>)
- */
+ //! Returns Rank of Tensor (N in T<N,D>)
int rank();
-
- /**
- *\brief Returns dimension of Tensor (D in T<N,D>)
- */
+ //! Returns dimension of Tensor (D in T<N,D>)
int dim();
-
- /**
- *\brief Returns dim of Tensor
- */
+ //! Returns total number of entries
int len();
- /**
- *\brief Value of rank 1 Tensor for given i value.
- */
+ //! Value of rank 1 Tensor for given i value.
COM at(int i);
-
- /**
- *\brief Value of rank 2 Tensor for given (i,j) value.
- */
+ //! Value of rank 2 Tensor for given (i,j) value.
COM at(int i, int j);
-
- /**
- *\brief Value of rank 3 Tensor for given (i,j,k) value.
- */
+ //! Value of rank 3 Tensor for given (i,j,k) value.
COM at(int i, int j, int k);
-
- /**
- *\brief Value of rank 4 Tensor for given (i,j,k,l) value.
- */
+ //! Value of rank 4 Tensor for given (i,j,k,l) value.
COM at(int i,int j, int k,int l);
-
- /**
- *\brief Value of rank 3 Tensor for given (i,j,k,l,m) value.
- */
+ //! Value of rank 3 Tensor for given (i,j,k,l,m) value.
COM at(int i,int j, int k,int l, int m);
- /**
- *\brief Checks that components of Tensor non zero.
- */
+ //! Checks that components of Tensor non zero.
bool isSet();
+ //! Set all entries to x
void Fill(COM x);
- /**
- *\brief Set value of rank 1 Tensor for given i value to x.
- */
+ //! Set value of rank 1 Tensor for given i value to x.
void Set(int i,COM x);
- /**
- *\brief Set value of rank 2 Tensor for given i,j value to x.
- */
+ //! Set value of rank 2 Tensor for given i,j value to x.
void Set(int i, int j, COM x);
- /**
- *\brief Set value of rank 3 Tensor for given i,j,k value to x.
- */
+ //! Set value of rank 3 Tensor for given i,j,k value to x.
void Set(int i, int j, int k, COM x);
- /**
- *\brief Set value of rank 4 Tensor for given i,j,k,l value to x.
- */
+ //! Set value of rank 4 Tensor for given i,j,k,l value to x.
void Set(int i,int j, int k,int l,COM x);
- /**
- *\brief Set value of rank 5 Tensor for given i,j,k,l,m value to x.
- */
+ //! Set value of rank 5 Tensor for given i,j,k,l,m value to x.
void Set(int i,int j, int k,int l, int m, COM x);
Tensor<N,D> operator*(const double x);
Tensor<N,D> operator*(const COM x);
Tensor<N,D> operator/(const double x);
Tensor<N,D> operator/(const COM x);
Tensor<N,D> operator+(const Tensor<N,D> T2);
Tensor<N,D> operator-(const Tensor<N,D> T2);
void operator+=(const Tensor<N,D> T2);
void operator-=(const Tensor<N,D> T2);
/**
* \brief Multiply Tensor from Right: T1^(mu1...mk..mN-1)T2_(muN)
* @param T2 Tensor of Rank 1 to multiply from right with with.
* @returns T1.contract(T2,1) -> T1^(mu,nu,rho...)T2^sigma
*/
Tensor<N+1,D> rightprod(const Tensor<1,D> T2);
/**
* \brief Multiply Tensor from Left: T2_(muN)T1^(mu1...mk..mN-1)
* @param T2 Tensor of Rank 1 to multiply from left with with.
* @returns T1.contract(T2,1) -> T2^sigma T1^(mu,nu,rho...)
*/
Tensor<N+1,D> leftprod(const Tensor<1,D> T2);
/**
* \brief T^(mu1...mk..mN)T2_(muk) contract kth index, where k member of [1,N]
* @param T2 Tensor of Rank 1 to contract with.
* @param k int to contract Tensor T2 with from original Tensor.
* @returns T1.contract(T2,1) -> T1^(mu,nu,rho...)T2_mu
*/
Tensor<N-1,D> contract(const Tensor<1,D> T2, int k);
std::valarray<COM> components;
private:
int size;
COM sign(unsigned int i);
};
/**
* \brief Returns +--- Metric
* @returns Metric (+,-,-,-) {(1,0,0,0),(0,-1,0,0),(0,0,-1,0),(0,0,0,-1)}
*/
Tensor<2,4> Metric();
/**
* \brief Calculates current <p1|mu|p2>
* @param p1 Momentum of Particle 1
* @param h1 Helicity of Particle 1 (Boolean, False = -h, True = +h)
* @param p2 Momentum of Particle 2
* @param h2 Helicity of Particle 2 (Boolean, False = -h, True = +h)
* @returns Tensor T^mu = <p1|mu|p2> (in/out configuration considered in calc)
*/
Tensor<1,4> TCurrent(CLHEP::HepLorentzVector p1, bool h1,
CLHEP::HepLorentzVector p2, bool h2);
/**
* \brief Calculates current <p1|mu nu rho|p2>
* @param p1 Momentum of Particle 1
* @param h1 Helicity of Particle 1 (Boolean, False = -h, True = +h)
* @param p2 Momentum of Particle 2
* @param h2 Helicity of Particle 2 (Boolean, False = -h, True = +h)
* @returns Tensor T^mu^nu^rho = <p1|mu nu rho|p2> (in/out configuration considered in calc)
*/
Tensor<3,4> T3Current(CLHEP::HepLorentzVector p1, bool h1,
CLHEP::HepLorentzVector p2, bool h2);
/**
* \brief Calculates current <p1|mu nu rho tau sigma|p2>
* @param p1 Momentum of Particle 1
* @param h1 Helicity of Particle 1 (Boolean, False = -h, True = +h)
* @param p2 Momentum of Particle 2
* @param h2 Helicity of Particle 2 (Boolean, False = -h, True = +h)
* @returns Tensor T^mu^nu^rho = <p1|mu nu rho tau sigma|p2> (in/out configuration considered in calc)
*/
Tensor<5,4> T5Current(CLHEP::HepLorentzVector p1, bool h1,
CLHEP::HepLorentzVector p2, bool h2);
/**
* \brief Convert from CCurrent class
* @param j Current in CCurrent format
* @returns Current in Tensor Format
*/
Tensor<1,4> Construct1Tensor(CCurrent j);
/**
* \brief Convert from HLV class
* @param p Current in HLV format
* @returns Current in Tensor Format
*/
Tensor<1,4> Construct1Tensor(CLHEP::HepLorentzVector p);
/**
* \brief Construct Epsilon (Polarisation) Tensor
* @param k Momentum of incoming/outgoing boson
* @param ref Reference momentum for calculation
* @param pol Polarisation of boson
* @returns Polarisation Tensor E^mu
*/
Tensor<1,4> eps(CLHEP::HepLorentzVector k, CLHEP::HepLorentzVector ref, bool pol);
-/**
- * \brief Initialises Tensor values by iterating over permutations of gamma matrices.
- */
+//! Initialises Tensor values by iterating over permutations of gamma matrices.
bool init_sigma_index();
// implementation of template functions
#include "HEJ/detail/Tensor_impl.hh"

File Metadata

Mime Type
text/x-diff
Expires
Sat, Dec 21, 2:05 PM (15 h, 48 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4023061
Default Alt Text
(7 KB)

Event Timeline