Skip to content

Commit

Permalink
make gm2 functions independent of FlexibleSUSY's wrappers module
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Voigt authored and Alexander Voigt committed Jul 24, 2015
1 parent 22f1d5c commit bc16579
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 22 deletions.
20 changes: 12 additions & 8 deletions addons/gm2os/MSSMNoFV_onshell.cpp
Expand Up @@ -17,14 +17,14 @@
// ====================================================================

#include "MSSMNoFV_onshell.hpp"
#include "wrappers.hpp"
#include "gsl_utils.hpp"
#include "logger.hpp"
#include "numerics2.hpp"
#include "root_finder.hpp"
#include "gm2_error.hpp"

#include <cmath>
#include <complex>

namespace {
static const double ALPHA_EM_THOMPSON = 1./137.035999074;
Expand All @@ -41,6 +41,10 @@ namespace {
double calculate_alpha(double e) {
return e * e / (4. * M_PI);
}
int sign(double x) { return x < 0 ? -1 : 1; }
double signed_abs_sqrt(double x) {
return sign(x) * std::sqrt(std::abs(x));
}
}

namespace flexiblesusy {
Expand Down Expand Up @@ -216,12 +220,12 @@ bool MSSMNoFV_onshell::is_equal(const Eigen::ArrayBase<Derived>& a,
const Eigen::ArrayBase<Derived>& b,
double precision_goal)
{
return MaxRelDiff(a,b) < precision_goal;
return (a - b).cwiseAbs().maxCoeff() < precision_goal;
}

bool MSSMNoFV_onshell::is_equal(double a, double b, double precision_goal)
{
return MaxRelDiff(a,b) < precision_goal;
return std::abs(a - b) < precision_goal;
}

/**
Expand Down Expand Up @@ -260,9 +264,9 @@ void MSSMNoFV_onshell::convert_Mu_M1_M2(
const auto X(U.transpose() * MCha_goal.matrix().asDiagonal() * V);
const auto Y(N.transpose() * MChi_goal.matrix().asDiagonal() * N);

set_MassB(Re(Y(0,0)));
set_MassWB(Re(X(0,0)));
set_Mu(Re(X(1,1)));
set_MassB(std::real(Y(0,0)));
set_MassWB(std::real(X(0,0)));
set_Mu(std::real(X(1,1)));

calculate_DRbar_masses();

Expand Down Expand Up @@ -345,8 +349,8 @@ std::ostream& operator<<(std::ostream& os, const MSSMNoFV_onshell& model)
"Mu = " << model.get_Mu() << '\n' <<
"M1 = " << model.get_MassB() << '\n' <<
"M2 = " << model.get_MassWB() << '\n' <<
"msl(2,2) = " << SignedAbsSqrt(model.get_ml2(1,1)) << '\n' <<
"mse(2,2) = " << SignedAbsSqrt(model.get_me2(1,1)) << '\n'
"msl(2,2) = " << signed_abs_sqrt(model.get_ml2(1,1)) << '\n' <<
"mse(2,2) = " << signed_abs_sqrt(model.get_me2(1,1)) << '\n'
;

return os;
Expand Down
1 change: 0 additions & 1 deletion addons/gm2os/gm2.cpp
Expand Up @@ -21,7 +21,6 @@
#include "gm2_1loop.hpp"
#include "gm2_2loop.hpp"
#include "error.hpp"
#include "wrappers.hpp"

#include "slha_io.hpp"
#include "gm2_slha_io.hpp"
Expand Down
5 changes: 2 additions & 3 deletions addons/gm2os/gm2_1loop.cpp
Expand Up @@ -19,7 +19,6 @@
#include "gm2_1loop.hpp"
#include "MSSMNoFV_onshell.hpp"
#include "ffunctions.hpp"
#include "wrappers.hpp"

#include <complex>

Expand Down Expand Up @@ -96,8 +95,8 @@ Eigen::Matrix<std::complex<double>,4,2> n_L(const MSSMNoFV_onshell& model) {
for(int i=0; i <4; ++i) {
for(int m=0; m <2; ++m) {
result(i, m) = ( (1. / sqrt(2.) * ( gY * ZN(i, 0)
+ g2 * ZN(i, 1) ) * Conj(u_smu(m, 0)))
- ymu * ZN(i, 2) * Conj(u_smu(m, 1)) );
+ g2 * ZN(i, 1) ) * std::conj(u_smu(m, 0)))
- ymu * ZN(i, 2) * std::conj(u_smu(m, 1)) );
}
}

Expand Down
3 changes: 3 additions & 0 deletions addons/gm2os/gm2_1loop.hpp
Expand Up @@ -19,13 +19,16 @@
#ifndef GM2_1LOOP_H
#define GM2_1LOOP_H

#include <cmath>
#include <Eigen/Core>

namespace flexiblesusy {
namespace gm2os {

class MSSMNoFV_onshell;

static const double oneOver16PiSqr = 1./(16. * M_PI * M_PI);

/// calculates full 1-loop SUSY contributions to (g-2) in the MSSM
double calculate_gm2_1loop(const MSSMNoFV_onshell&);

Expand Down
19 changes: 9 additions & 10 deletions addons/gm2os/gm2_2loop.cpp
Expand Up @@ -20,7 +20,6 @@
#include "gm2_1loop.hpp"
#include "MSSMNoFV_onshell.hpp"
#include "ffunctions.hpp"
#include "wrappers.hpp"

#include <complex>
#include <cmath>
Expand Down Expand Up @@ -272,11 +271,11 @@ Eigen::Matrix<std::complex<double>,3,3> lambda_mu_cha(const MSSMNoFV_onshell& mo
const Eigen::Matrix<std::complex<double>,2,2> V(model.get_UP());

for(int k=0; k<2; ++k) {
result(k, 0) = ( Sqrt(2.) * MW / MCha(k)
result(k, 0) = ( std::sqrt(2.) * MW / MCha(k)
* (U(k, 0) * V(k, 1) * CA + U(k, 1) * V(k, 0) * (-SA)) );
result(k, 1) = ( Sqrt(2.) * MW / MCha(k)
result(k, 1) = ( std::sqrt(2.) * MW / MCha(k)
* (U(k, 0) * V(k, 1) * SA + U(k, 1) * V(k, 0) * CA) );
result(k, 2) = ( Sqrt(2.) * MW / MCha(k)
result(k, 2) = ( std::sqrt(2.) * MW / MCha(k)
* (U(k, 0) * V(k, 1) * (-CB) + U(k, 1) * V(k, 0) * (-SB)) );
}
result(2, 0) = -SA / CB;
Expand All @@ -302,9 +301,9 @@ Eigen::Matrix<std::complex<double>,2,2> lambda_stop(const MSSMNoFV_onshell& mode

for(int i=0; i<2; ++i) {
result(i, 0) = 2. * MT / (sqr(MStop(i)) * SB) * (Mu * SA + At * CA)
* Conj(UStop(i, 0)) * UStop(i, 1);
* std::conj(UStop(i, 0)) * UStop(i, 1);
result(i, 1) = 2. * MT / (sqr(MStop(i)) * SB) * (Mu * (-CA) + At * SA)
* Conj(UStop(i, 0)) * UStop(i, 1);
* std::conj(UStop(i, 0)) * UStop(i, 1);
}

return result;
Expand All @@ -325,9 +324,9 @@ Eigen::Matrix<std::complex<double>,2,2> lambda_sbot(const MSSMNoFV_onshell& mode

for(int i=0; i<2; ++i) {
result(i, 0) = 2. * MB / (sqr(MSbot(i)) * CB) * (- Mu * CA + Ab * (-SA))
* Conj(USbot(i, 0)) * USbot(i, 1);
* std::conj(USbot(i, 0)) * USbot(i, 1);
result(i, 1) = 2. * MB / (sqr(MSbot(i)) * CB) * (- Mu * SA + Ab * CA)
* Conj(USbot(i, 0)) * USbot(i, 1);
* std::conj(USbot(i, 0)) * USbot(i, 1);
}

return result;
Expand All @@ -348,9 +347,9 @@ Eigen::Matrix<std::complex<double>,2,2> lambda_stau(const MSSMNoFV_onshell& mode

for(int i=0; i<2; ++i) {
result(i, 0) = 2. * ML / (sqr(MStau(i)) * CB) * (- Mu * CA + Al * (-SA))
* Conj(UStau(i, 0)) * UStau(i, 1);
* std::conj(UStau(i, 0)) * UStau(i, 1);
result(i, 1) = 2. * ML / (sqr(MStau(i)) * CB) * (- Mu * SA + Al * CA)
* Conj(UStau(i, 0)) * UStau(i, 1);
* std::conj(UStau(i, 0)) * UStau(i, 1);
}

return result;
Expand Down

0 comments on commit bc16579

Please sign in to comment.