Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-04-19 09:10:07

0001 #ifndef METOOLS_SpinCorrelations_Amplitude2_Matrix_H
0002 #define METOOLS_SpinCorrelations_Amplitude2_Matrix_H
0003 
0004 #include <vector>
0005 #include "ATOOLS/Math/MyComplex.H"
0006 
0007 namespace ATOOLS {
0008   class Particle;
0009 }
0010 
0011 namespace METOOLS {
0012 
0013   class Amplitude2_Matrix : public std::vector<Complex> {
0014   protected:
0015     const ATOOLS::Particle* p_part;
0016     size_t m_nhel;
0017 
0018   public:
0019     Amplitude2_Matrix(const ATOOLS::Particle* p);
0020     Amplitude2_Matrix(const ATOOLS::Particle* p, Complex factor);
0021     Amplitude2_Matrix(const Amplitude2_Matrix& amp) : std::vector<Complex>(amp), p_part(amp.p_part), m_nhel(amp.m_nhel) {}
0022     ~Amplitude2_Matrix();
0023 
0024     Complex Trace() const;
0025     void Normalise();
0026     void Add(const Amplitude2_Matrix& sigma, const Complex& factor);
0027     /**
0028     * @param coeff vector containing the transformation coefficients, the vector contains one vector for each final
0029          * helicity which includes all related transformation coefficients to describe the final polarization object in
0030          * terms of the polarization objects in an old polarization definition (typically the polarization definition
0031          * used for matrix element calculation), the entries should be ordered according to the polarization ordering
0032          * in the Amplitude2_Matrix which should be transformed
0033     * @param conj_coeff vector containing the coefficients for the transformation of the complex conjugate
0034      * matrix elements, form analog to coeff
0035     *
0036     * method for transforming the Amplitude2_Matrix to another basis for polarization definition
0037     */
0038     void PolBasisTrafo(vector<vector<Complex>> coeff, vector<vector<Complex>> conj_coeff);
0039     inline const ATOOLS::Particle* Particle() const { return p_part; }
0040     inline void SetParticle(const ATOOLS::Particle* p) { p_part=p; }
0041     inline size_t GetSpin() { return m_nhel; }
0042 
0043     Complex operator*(const Amplitude2_Matrix& sigma) const;
0044     inline const Complex& operator()(size_t lambda, size_t lambdap) const {
0045       return (*this)[lambda+m_nhel*lambdap];
0046     }
0047 
0048     friend std::ostream& operator<<(std::ostream&, const Amplitude2_Matrix&);
0049   };
0050 
0051 }
0052 
0053 #endif