Skip to content

Commit

Permalink
make physical struct independent of slha_io
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Voigt committed Jul 27, 2015
1 parent 3309a8c commit 77da66a
Showing 1 changed file with 39 additions and 7 deletions.
46 changes: 39 additions & 7 deletions addons/gm2os/MSSMNoFV_onshell_physical.cpp
Expand Up @@ -19,12 +19,10 @@
// File generated at Wed 22 Jul 2015 18:14:31

#include "MSSMNoFV_onshell_physical.hpp"
#include "slha_io.hpp"
#include "numerics2.hpp"

#include <iostream>

#define LOCALPHYSICAL(p) p

namespace flexiblesusy {

MSSMNoFV_onshell_physical::MSSMNoFV_onshell_physical()
Expand Down Expand Up @@ -107,15 +105,50 @@ void MSSMNoFV_onshell_physical::clear()

}

namespace {

template<int N>
void convert_symmetric_fermion_mixings_to_hk(Eigen::Array<double, N, 1>& m,
Eigen::Matrix<std::complex<double>, N, N>& z)
{
for (int i = 0; i < N; i++) {
if (m(i) < 0.) {
z.row(i) *= std::complex<double>(0.0,1.0);
m(i) *= -1;
}
}
}

template<int N>
void convert_symmetric_fermion_mixings_to_slha(Eigen::Array<double, N, 1>& m,
Eigen::Matrix<std::complex<double>, N, N>& z)
{
for (int i = 0; i < N; i++) {
// check if i'th row contains non-zero imaginary parts
if (!is_zero(z.row(i).imag().cwiseAbs().maxCoeff())) {
z.row(i) *= std::complex<double>(0.0,1.0);
m(i) *= -1;
#ifdef ENABLE_DEBUG
if (!is_zero(z.row(i).imag().cwiseAbs().maxCoeff())) {
WARNING("Row " << i << " of the following fermion mixing matrix"
" contains entries which have non-zero real and imaginary"
" parts:\nZ = " << z);
}
#endif
}
}
}

}

/**
* Convert masses and mixing matrices to Haber-Kane convention:
* Fermion masses are always positive and mixing matrices are allowed
* to be complex.
*/
void MSSMNoFV_onshell_physical::convert_to_hk()
{
SLHA_io::convert_symmetric_fermion_mixings_to_hk(LOCALPHYSICAL(MChi), LOCALPHYSICAL(ZN));

convert_symmetric_fermion_mixings_to_hk(MChi, ZN);
}

/**
Expand All @@ -125,8 +158,7 @@ void MSSMNoFV_onshell_physical::convert_to_hk()
*/
void MSSMNoFV_onshell_physical::convert_to_slha()
{
SLHA_io::convert_symmetric_fermion_mixings_to_slha(LOCALPHYSICAL(MChi), LOCALPHYSICAL(ZN));

convert_symmetric_fermion_mixings_to_slha(MChi, ZN);
}

void MSSMNoFV_onshell_physical::print(std::ostream& ostr) const
Expand Down

0 comments on commit 77da66a

Please sign in to comment.