Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-27 09:14:54

0001 // Misc math functions that are useful to have

0002 //

0003 // Author:       Daniel Winney (2020)

0004 // Affiliation:  Joint Physics Analysis Center (JPAC)

0005 // Email:        dwinney@iu.edu

0006 // ---------------------------------------------------------------------------

0007 
0008 #ifndef _MATH_
0009 #define _MATH_
0010 
0011 #include "constants.hpp"
0012 #include <iostream>
0013 #include <complex>
0014 #include <algorithm>
0015 
0016 namespace jpacPhoto
0017 {
0018     template <typename T>
0019     inline T Kallen(T x, T y, T z)
0020     {
0021         return x*x + y*y + z*z - 2. * (x*y + x*z + y*z);
0022     };
0023 
0024     std::complex<double> cgamma(std::complex<double> z, int OPT = 0);
0025 
0026     inline unsigned int factorial(unsigned int n) 
0027     {
0028         if (n == 0)
0029         return 1;
0030         return n * factorial(n - 1);
0031     };
0032 
0033     // ---------------------------------------------------------------------------

0034     // Wigner d-func coefficient of leading power

0035     double wigner_leading_coeff(int j, int lam1, int lam2);
0036 
0037     // Wigner d-function for half-integer spin

0038     double wigner_d_half(int j, int lam1, int lam2, double theta);
0039 
0040     // Wigner d-function for integer spin

0041     double wigner_d_int(int j, int lam1, int lam2, double theta);
0042 
0043     // Wigner d-function for integer spin in terms of the cosine of theta not theta

0044     std::complex<double> wigner_d_int_cos(int j, int lam1, int lam2, double cos);
0045 };
0046 
0047 #endif