Skip to content

Commit

Permalink
avoid class with only static methods
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Voigt authored and Alexander Voigt committed Jan 14, 2017
1 parent 2d3b01c commit dce1dcb
Show file tree
Hide file tree
Showing 2 changed files with 114 additions and 126 deletions.
218 changes: 107 additions & 111 deletions templates/standard_model_matching.cpp.in
Expand Up @@ -32,6 +32,7 @@
using namespace flexiblesusy::standard_model;

namespace flexiblesusy {
namespace @ModelName@_standard_model_matching {

#define MODELPARAMETER(p) model.get_##p()
#define SMPARAMETER(p) sm.get_##p()
Expand Down Expand Up @@ -79,54 +80,6 @@ constexpr RAII_set_loop_order<T> make_raii_set_loop_order(T& model, unsigned loo
return RAII_set_loop_order<T>(model, loop_order);
}

} // anonymous namespace

/**
* Calculates \f$\lambda(Q)\f$ at the tree level from the lightest
* CP-even Higgs boson mass of the @ModelName@.
*
* @param sm Standard Model
* @param model BSM model
* @param idx Higgs index (in mass ordered Higgs multiplet)
*/
void @ModelName@_standard_model_matching::match_high_to_low_scale_model_tree_level(
Standard_model& sm, @ModelName@_mass_eigenstates& model, unsigned idx)
{
model.calculate_DRbar_masses();
sm.set_Lambdax(Sqr(model.get_M@HiggsBoson(idx)@/sm.get_v()));
sm.calculate_DRbar_masses();
}


/**
* Calculates \f$\lambda(Q)\f$ at the 1-loop level from the lightest
* CP-even Higgs boson mass of the @ModelName@ by requiring that the
* 1-loop Higgs pole masses are equal in both models.
*
* @param sm Standard Model
* @param model BSM model
* @param loop_order downwards matching loop order
* @param idx Higgs index (in mass ordered Higgs multiplet)
*/
void @ModelName@_standard_model_matching::match_high_to_low_scale_model(
Standard_model& sm, @ModelName@_mass_eigenstates& model, unsigned loop_order, unsigned idx)
{
if (loop_order == 0) {
match_high_to_low_scale_model_tree_level(sm, model, idx);
return;
}

// temporarily set loop order to `loop_order'
const auto los_sm = make_raii_set_loop_order(sm, loop_order);
const auto los_model = make_raii_set_loop_order(model, loop_order);

match_high_to_low_scale_model(sm, model, idx);

model.get_physical().clear();
sm.get_physical().clear();
}


/**
* Calculates \f$\lambda(Q)\f$ at the current loop level from the
* lightest CP-even Higgs boson mass of the @ModelName@ by requiring
Expand All @@ -136,7 +89,7 @@ void @ModelName@_standard_model_matching::match_high_to_low_scale_model(
* @param model BSM model
* @param idx Higgs index (in mass ordered Higgs multiplet)
*/
void @ModelName@_standard_model_matching::match_high_to_low_scale_model(
void match_high_to_low_scale_model(
Standard_model& sm, @ModelName@_mass_eigenstates& model, unsigned idx)
{
model.calculate_DRbar_masses();
Expand All @@ -151,40 +104,7 @@ void @ModelName@_standard_model_matching::match_high_to_low_scale_model(
- Sqr(sm.get_physical().Mhh) + Sqr(sm.get_Mhh()))/Sqr(sm.get_v()));
}

/**
* Calculates the gauge and Yukawa couplings and the SM-like VEV in
* the @ModelName@ at the tree level from the known Standard Model
* couplings and the SM vev.
*/
void @ModelName@_standard_model_matching::match_low_to_high_scale_model_tree_level(
@ModelName@_mass_eigenstates& model, Standard_model& sm)
{
sm.calculate_DRbar_masses();
model.set_@hyperchargeCoupling@(sm.get_g1()*standard_model_info::normalization_g1/@ModelName@_info::normalization_@hyperchargeCoupling@);
model.set_@leftCoupling@(sm.get_g2()*standard_model_info::normalization_g2/@ModelName@_info::normalization_@leftCoupling@);
model.set_@strongCoupling@(sm.get_g3()*standard_model_info::normalization_g3/@ModelName@_info::normalization_@strongCoupling@);

{
auto MODEL = &model;
const double VEV = sm.get_v();

@applyUserMatching@
}

Eigen::Matrix<double, 3, 3> upQuarksDRbar = ZEROMATRIX(3,3);
Eigen::Matrix<double, 3, 3> downQuarksDRbar = ZEROMATRIX(3,3);
Eigen::Matrix<double, 3, 3> downLeptonsDRbar = ZEROMATRIX(3,3);

upQuarksDRbar.diagonal() = sm.get_MFu();
downQuarksDRbar.diagonal() = sm.get_MFd();
downLeptonsDRbar.diagonal() = sm.get_MFe();

@setYukawas@

model.calculate_DRbar_masses();
}

static void calculate_SM_pole_masses(@ModelName@_mass_eigenstates& model, Standard_model& sm)
void calculate_SM_pole_masses(@ModelName@_mass_eigenstates& model, Standard_model& sm)
{
#ifdef ENABLE_THREADS
auto model_ptr = &model;
Expand All @@ -206,31 +126,6 @@ static void calculate_SM_pole_masses(@ModelName@_mass_eigenstates& model, Standa
#endif
}

/**
* Calculates the gauge and Yukawa couplings and the SM-like VEV in
* the @ModelName@ at the 1-loop level from the known Standard Model
* couplings and the SM vev.
*/
void @ModelName@_standard_model_matching::match_low_to_high_scale_model(
@ModelName@_mass_eigenstates& model, Standard_model& sm, unsigned loop_order)
{
if (loop_order == 0) {
match_low_to_high_scale_model_tree_level(model, sm);
return;
}

// temporarily set loop order to `loop_order'
const auto los_sm = make_raii_set_loop_order(sm, loop_order);
const auto los_model = make_raii_set_loop_order(model, loop_order);

match_low_to_high_scale_model(model, sm);

model.get_physical().clear();
sm.get_physical().clear();
}

namespace {

double calculate_delta_alpha_em(double alpha_em, const @ModelName@_mass_eigenstates& model)
{
const double currentScale = model.get_scale();
Expand Down Expand Up @@ -302,14 +197,12 @@ double calculate_MZ_DRbar(const Standard_model& sm, @ModelName@_mass_eigenstates
return AbsSqrt(mz2);
}

} // anonymous namespace

/**
* Calculates the gauge and Yukawa couplings and the SM-like VEV in
* the @ModelName@ at the current loop level from the known Standard
* Model couplings and the SM vev.
*/
void @ModelName@_standard_model_matching::match_low_to_high_scale_model(
void match_low_to_high_scale_model(
@ModelName@_mass_eigenstates& model, Standard_model& sm)
{
model.calculate_DRbar_masses();
Expand Down Expand Up @@ -354,4 +247,107 @@ void @ModelName@_standard_model_matching::match_low_to_high_scale_model(
@setYukawas@
}

} // anonymous namespace

/**
* Calculates \f$\lambda(Q)\f$ at the tree level from the lightest
* CP-even Higgs boson mass of the @ModelName@.
*
* @param sm Standard Model
* @param model BSM model
* @param idx Higgs index (in mass ordered Higgs multiplet)
*/
void match_high_to_low_scale_model_tree_level(
Standard_model& sm, @ModelName@_mass_eigenstates& model, unsigned idx)
{
model.calculate_DRbar_masses();
sm.set_Lambdax(Sqr(model.get_M@HiggsBoson(idx)@/sm.get_v()));
sm.calculate_DRbar_masses();
}

/**
* Calculates \f$\lambda(Q)\f$ at the 1-loop level from the lightest
* CP-even Higgs boson mass of the @ModelName@ by requiring that the
* 1-loop Higgs pole masses are equal in both models.
*
* @param sm Standard Model
* @param model BSM model
* @param loop_order downwards matching loop order
* @param idx Higgs index (in mass ordered Higgs multiplet)
*/
void match_high_to_low_scale_model(
Standard_model& sm, @ModelName@_mass_eigenstates& model, unsigned loop_order, unsigned idx)
{
if (loop_order == 0) {
match_high_to_low_scale_model_tree_level(sm, model, idx);
return;
}

// temporarily set loop order to `loop_order'
const auto los_sm = make_raii_set_loop_order(sm, loop_order);
const auto los_model = make_raii_set_loop_order(model, loop_order);

match_high_to_low_scale_model(sm, model, idx);

model.get_physical().clear();
sm.get_physical().clear();
}

/**
* Calculates the gauge and Yukawa couplings and the SM-like VEV in
* the @ModelName@ at the tree level from the known Standard Model
* couplings and the SM vev.
*/
void match_low_to_high_scale_model_tree_level(
@ModelName@_mass_eigenstates& model, Standard_model& sm)
{
sm.calculate_DRbar_masses();
model.set_@hyperchargeCoupling@(sm.get_g1()*standard_model_info::normalization_g1/@ModelName@_info::normalization_@hyperchargeCoupling@);
model.set_@leftCoupling@(sm.get_g2()*standard_model_info::normalization_g2/@ModelName@_info::normalization_@leftCoupling@);
model.set_@strongCoupling@(sm.get_g3()*standard_model_info::normalization_g3/@ModelName@_info::normalization_@strongCoupling@);

{
auto MODEL = &model;
const double VEV = sm.get_v();

@applyUserMatching@
}

Eigen::Matrix<double, 3, 3> upQuarksDRbar = ZEROMATRIX(3,3);
Eigen::Matrix<double, 3, 3> downQuarksDRbar = ZEROMATRIX(3,3);
Eigen::Matrix<double, 3, 3> downLeptonsDRbar = ZEROMATRIX(3,3);

upQuarksDRbar.diagonal() = sm.get_MFu();
downQuarksDRbar.diagonal() = sm.get_MFd();
downLeptonsDRbar.diagonal() = sm.get_MFe();

@setYukawas@

model.calculate_DRbar_masses();
}

/**
* Calculates the gauge and Yukawa couplings and the SM-like VEV in
* the @ModelName@ at the 1-loop level from the known Standard Model
* couplings and the SM vev.
*/
void match_low_to_high_scale_model(
@ModelName@_mass_eigenstates& model, Standard_model& sm, unsigned loop_order)
{
if (loop_order == 0) {
match_low_to_high_scale_model_tree_level(model, sm);
return;
}

// temporarily set loop order to `loop_order'
const auto los_sm = make_raii_set_loop_order(sm, loop_order);
const auto los_model = make_raii_set_loop_order(model, loop_order);

match_low_to_high_scale_model(model, sm);

model.get_physical().clear();
sm.get_physical().clear();
}

} // namespace @ModelName@_standard_model_matching
} // namespace flexiblesusy
22 changes: 7 additions & 15 deletions templates/standard_model_matching.hpp.in
Expand Up @@ -25,23 +25,15 @@
#include "standard_model.hpp"

namespace flexiblesusy {
namespace @ModelName@_standard_model_matching {

/**
* @class standard_model_two_scale_matching
* @brief provides matching conditions from the @ModelName@ to the Standard Model and reverse
*/
class @ModelName@_standard_model_matching
{
public:
static void match_high_to_low_scale_model_tree_level(standard_model::Standard_model&, @ModelName@_mass_eigenstates&, unsigned);
static void match_high_to_low_scale_model(standard_model::Standard_model&, @ModelName@_mass_eigenstates&, unsigned, unsigned);
static void match_low_to_high_scale_model_tree_level(@ModelName@_mass_eigenstates&, standard_model::Standard_model&);
static void match_low_to_high_scale_model(@ModelName@_mass_eigenstates&, standard_model::Standard_model&, unsigned);
protected:
static void match_high_to_low_scale_model(standard_model::Standard_model&, @ModelName@_mass_eigenstates&, unsigned);
static void match_low_to_high_scale_model(@ModelName@_mass_eigenstates&, standard_model::Standard_model&);
};
void match_high_to_low_scale_model_tree_level(standard_model::Standard_model&, @ModelName@_mass_eigenstates&, unsigned);
void match_high_to_low_scale_model(standard_model::Standard_model&, @ModelName@_mass_eigenstates&, unsigned, unsigned);

void match_low_to_high_scale_model_tree_level(@ModelName@_mass_eigenstates&, standard_model::Standard_model&);
void match_low_to_high_scale_model(@ModelName@_mass_eigenstates&, standard_model::Standard_model&, unsigned);

} // namespace @ModelName@_standard_model_matching
} // namespace flexiblesusy

#endif

0 comments on commit dce1dcb

Please sign in to comment.