Skip to content

Commit

Permalink
adding SLHA model class
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Voigt committed Jul 15, 2015
1 parent 0495722 commit d7c0b64
Show file tree
Hide file tree
Showing 5 changed files with 251 additions and 7 deletions.
12 changes: 11 additions & 1 deletion meta/FlexibleSUSY.m
Original file line number Diff line number Diff line change
Expand Up @@ -2169,7 +2169,7 @@ corresponding tadpole is real or imaginary (only in models with CP
}];

PrintHeadline["Creating SLHA model"];
Print["Creating class for SLHA model ..."];
Print["Creating class for SLHA two-scale model ..."];
WriteModelSLHAClass[massMatrices,
{{FileNameJoin[{Global`$flexiblesusyTemplateDir, "model_slha.hpp.in"}],
FileNameJoin[{Global`$flexiblesusyOutputDir, FlexibleSUSY`FSModelName <> "_model_slha.hpp"}]},
Expand All @@ -2179,6 +2179,16 @@ corresponding tadpole is real or imaginary (only in models with CP
FileNameJoin[{Global`$flexiblesusyOutputDir, FlexibleSUSY`FSModelName <> "_two_scale_model_slha.cpp"}]}
}];

If[HaveSolver[FlexibleSUSY`RootSolver],
Print["Creating class for SLHA root model ..."];
WriteModelSLHAClass[massMatrices,
{{FileNameJoin[{Global`$flexiblesusyTemplateDir, "root_model_slha.hpp.in"}],
FileNameJoin[{Global`$flexiblesusyOutputDir, FlexibleSUSY`FSModelName <> "_root_model_slha.hpp"}]},
{FileNameJoin[{Global`$flexiblesusyTemplateDir, "root_model_slha.cpp.in"}],
FileNameJoin[{Global`$flexiblesusyOutputDir, FlexibleSUSY`FSModelName <> "_root_model_slha.cpp"}]}}
];
];

PrintHeadline["Creating model"];
Print["Creating class for model ..."];
WriteModelClass[massMatrices, ewsbEquations,
Expand Down
6 changes: 4 additions & 2 deletions templates/module.mk
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,12 @@ TEMPLATES := \
$(DIR)/root_initial_guesser_low_scale_model.cpp.in \
$(DIR)/root_low_scale_constraint.hpp.in \
$(DIR)/root_low_scale_constraint.cpp.in \
$(DIR)/root_susy_scale_constraint.hpp.in \
$(DIR)/root_susy_scale_constraint.cpp.in \
$(DIR)/root_model.hpp.in \
$(DIR)/root_model.cpp.in \
$(DIR)/root_model_slha.hpp.in \
$(DIR)/root_model_slha.cpp.in \
$(DIR)/root_susy_scale_constraint.hpp.in \
$(DIR)/root_susy_scale_constraint.cpp.in \
$(DIR)/run.cpp.in \
$(DIR)/run_cmd_line.cpp.in \
$(DIR)/scan.cpp.in \
Expand Down
10 changes: 6 additions & 4 deletions templates/module.mk.in
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,17 @@ LIB@CLASSNAME@_SRC += \
$(DIR)/@CLASSNAME@_root_high_scale_constraint.cpp \
$(DIR)/@CLASSNAME@_root_initial_guesser.cpp \
$(DIR)/@CLASSNAME@_root_low_scale_constraint.cpp \
$(DIR)/@CLASSNAME@_root_susy_scale_constraint.cpp \
$(DIR)/@CLASSNAME@_root_model.cpp
$(DIR)/@CLASSNAME@_root_model.cpp \
$(DIR)/@CLASSNAME@_root_model_slha.cpp \
$(DIR)/@CLASSNAME@_root_susy_scale_constraint.cpp
LIB@CLASSNAME@_HDR += \
$(DIR)/@CLASSNAME@_root_convergence_tester.hpp \
$(DIR)/@CLASSNAME@_root_high_scale_constraint.hpp \
$(DIR)/@CLASSNAME@_root_initial_guesser.hpp \
$(DIR)/@CLASSNAME@_root_low_scale_constraint.hpp \
$(DIR)/@CLASSNAME@_root_susy_scale_constraint.hpp \
$(DIR)/@CLASSNAME@_root_model.hpp
$(DIR)/@CLASSNAME@_root_model.hpp \
$(DIR)/@CLASSNAME@_root_model_slha.hpp \
$(DIR)/@CLASSNAME@_root_susy_scale_constraint.hpp
endif

ifneq ($(ALGORITHMS),)
Expand Down
138 changes: 138 additions & 0 deletions templates/root_model_slha.cpp.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
// ====================================================================
// This file is part of FlexibleSUSY.
//
// FlexibleSUSY is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published
// by the Free Software Foundation, either version 3 of the License,
// or (at your option) any later version.
//
// FlexibleSUSY is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with FlexibleSUSY. If not, see
// <http://www.gnu.org/licenses/>.
// ====================================================================

// File generated at @DateAndTime@

/**
* @file @ModelName@_root_model_slha.cpp
* @brief @ModelName@ model class wrapper for SLHA conversion
*/

#include "@ModelName@_root_model_slha.hpp"
#include "slha_io.hpp"
#include "ckm.hpp"
#include "pmns.hpp"

namespace flexiblesusy {

#define CLASSNAME @ModelName@_slha<Root>
#define LOCALPHYSICAL(p) physical.p

CLASSNAME::@ModelName@_slha(const @ModelName@_input_parameters& input_)
: @ModelName@<Root>(input_)
, physical_slha()
, ckm(Eigen::Matrix<std::complex<double>,3,3>::Identity())
, pmns(Eigen::Matrix<std::complex<double>,3,3>::Identity())
{
}

/**
* Copy constructor. Copies from base class (two-scale model class in
* BPMZ convention) and converts parameters to SLHA.
*
* @param model_ model class in BPMZ convention
*/
CLASSNAME::@ModelName@_slha(const @ModelName@<Root>& model_)
: @ModelName@<Root>(model_)
{
convert_to_slha();
}

CLASSNAME::~@ModelName@_slha()
{
}

void CLASSNAME::clear()
{
@ModelName@<Root>::clear();
physical_slha.clear();
}

void CLASSNAME::calculate_spectrum()
{
@ModelName@<Root>::calculate_spectrum();
convert_to_slha();
}

void CLASSNAME::convert_to_slha()
{
physical_slha = get_physical();
physical_slha.convert_to_slha();

convert_yukawa_couplings_to_slha();
calculate_ckm_matrix();
calculate_pmns_matrix();
convert_trilinear_couplings_to_slha();
convert_soft_squared_masses_to_slha();
}

void CLASSNAME::calculate_ckm_matrix()
{
@calculateCKMMatrix@
}

void CLASSNAME::calculate_pmns_matrix()
{
@calculatePMNSMatrix@
}

/**
* Convert Yukawa couplings to SLHA convention
*/
void CLASSNAME::convert_yukawa_couplings_to_slha()
{
@convertYukawaCouplingsToSLHA@
}

/**
* Convert trilinear couplings to SLHA convention
*/
void CLASSNAME::convert_trilinear_couplings_to_slha()
{
@convertTrilinearCouplingsToSLHA@
}

/**
* Convert trilinear couplings to SLHA convention
*/
void CLASSNAME::convert_soft_squared_masses_to_slha()
{
@convertSoftSquaredMassesToSLHA@
}

const @ModelName@_physical& CLASSNAME::get_physical_slha() const
{
return physical_slha;
}

@ModelName@_physical& CLASSNAME::get_physical_slha()
{
return physical_slha;
}

void CLASSNAME::print(std::ostream& ostr) const
{
@ModelName@<Root>::print(ostr);

ostr << "----------------------------------------\n"
"SLHA convention:\n"
"----------------------------------------\n";
physical_slha.print(ostr);
}

} // namespace flexiblesusy
92 changes: 92 additions & 0 deletions templates/root_model_slha.hpp.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
// ====================================================================
// This file is part of FlexibleSUSY.
//
// FlexibleSUSY is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published
// by the Free Software Foundation, either version 3 of the License,
// or (at your option) any later version.
//
// FlexibleSUSY is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with FlexibleSUSY. If not, see
// <http://www.gnu.org/licenses/>.
// ====================================================================

/**
* @file @ModelName@_root_model_slha.hpp
* @brief contains wrapper class for model class in SLHA convention
*/

// File generated at @DateAndTime@

#ifndef @ModelName@_ROOT_SLHA_H
#define @ModelName@_ROOT_SLHA_H

#include "@ModelName@_root_model.hpp"
#include "@ModelName@_physical.hpp"
#include "@ModelName@_model_slha.hpp"
#include "wrappers.hpp"

#define PHYSICAL_SLHA(p) physical_slha.p
#define PHYSICAL_SLHA_REAL(p) Re(physical_slha.p)

namespace flexiblesusy {

class Root;

/**
* @class @ModelName@_slha<Root>
* @brief model class wrapper in SLHA convention
*/

template<>
class @ModelName@_slha<Root> : public @ModelName@<Root> {
public:
explicit @ModelName@_slha(const @ModelName@_input_parameters& input_ = @ModelName@_input_parameters());
explicit @ModelName@_slha(const @ModelName@<Root>&);
virtual ~@ModelName@_slha();

virtual void clear();
void convert_to_slha(); ///< converts pole masses and couplings to SLHA convention
const Eigen::Matrix<std::complex<double>,3,3>& get_ckm_matrix() const { return ckm; }
const Eigen::Matrix<std::complex<double>,3,3>& get_pmns_matrix() const { return pmns; }
const @ModelName@_physical& get_physical_slha() const; ///< returns pole masses to SLHA convention
@ModelName@_physical& get_physical_slha(); ///< returns pole masses to SLHA convention

// interface functions
virtual void calculate_spectrum();
virtual void print(std::ostream&) const;

@slhaPoleMassGetters@
@slhaPoleMixingMatrixGetters@
@slhaYukawaGetter@
@slhaTrilinearCouplingsGetter@
@slhaSoftSquaredMassesGetter@
@slhaFerimonMixingMatricesGetters@

private:
@ModelName@_physical physical_slha; ///< contains the pole masses and mixings in slha convention
Eigen::Matrix<std::complex<double>,3,3> ckm;
Eigen::Matrix<std::complex<double>,3,3> pmns;
@slhaYukawaDef@
@slhaFerimonMixingMatricesDef@
@slhaTrilinearCouplingsDef@
@slhaSoftSquaredMassesDef@

void calculate_ckm_matrix();
void calculate_pmns_matrix();
void convert_yukawa_couplings_to_slha();
void convert_trilinear_couplings_to_slha();
void convert_soft_squared_masses_to_slha();
};

} // namespace flexiblesusy

#undef PHYSICAL_SLHA
#undef PHYSICAL_SLHA_REAL

#endif

0 comments on commit d7c0b64

Please sign in to comment.