forked from Expander/FlexibleSUSY
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add initial template for outer, semi-analytic constraint
Still to do: neat way to update input scale consistently
- Loading branch information
Dylan Harries
committed
Jan 4, 2017
1 parent
6b65568
commit 5692a22
Showing
6 changed files
with
229 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
122 changes: 122 additions & 0 deletions
122
templates/semi_analytic_soft_parameters_constraint.cpp.in
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
// ==================================================================== | ||
// 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@ | ||
|
||
#include "@ModelName@_semi_analytic_soft_parameters_constraint.hpp" | ||
#include "@ModelName@_semi_analytic_model.hpp" | ||
#include "wrappers.hpp" | ||
#include "logger.hpp" | ||
#include "ew_input.hpp" | ||
#include "gsl_utils.hpp" | ||
#include "minimizer.hpp" | ||
#include "root_finder.hpp" | ||
#include "threshold_loop_functions.hpp" | ||
|
||
#include <cassert> | ||
#include <cmath> | ||
|
||
namespace flexiblesusy { | ||
|
||
#define DERIVEDPARAMETER(p) model->p() | ||
#define INPUTPARAMETER(p) model->get_input().p | ||
#define MODELPARAMETER(p) model->get_##p() | ||
#define PHASE(p) model->get_##p() | ||
#define BETAPARAMETER(p) beta_functions.get_##p() | ||
#define BETAPARAMETER1(l,p) beta_functions_##l##L.get_##p() | ||
#define BETA(p) beta_##p | ||
#define BETA1(l,p) beta_##l##L_##p | ||
#define LowEnergyConstant(p) Electroweak_constants::p | ||
#define MZPole qedqcd.displayPoleMZ() | ||
#define STANDARDDEVIATION(p) Electroweak_constants::Error_##p | ||
#define Pole(p) model->get_physical().p | ||
#define SCALE model->get_scale() | ||
#define THRESHOLD static_cast<int>(model->get_thresholds()) | ||
#define MODEL model | ||
#define MODELCLASSNAME @ModelName@<Semi_analytic> | ||
|
||
@ModelName@_soft_parameters_constraint<Semi_analytic>::@ModelName@_soft_parameters_constraint( | ||
@ModelName@<Semi_analytic>* model_, const softsusy::QedQcd& qedqcd_) | ||
: model(model_) | ||
, qedqcd(qedqcd_) | ||
{ | ||
initialize(); | ||
} | ||
|
||
@ModelName@_soft_parameters_constraint<Semi_analytic>::~@ModelName@_soft_parameters_constraint() | ||
{ | ||
} | ||
|
||
void @ModelName@_soft_parameters_constraint<Semi_analytic>::apply() | ||
{ | ||
assert(model && "Error: @ModelName@_soft_parameters_constraint<Semi_analytic>::" | ||
"apply():model pointer must not be zero"); | ||
|
||
@temporarySetting@ | ||
|
||
model->calculate_coefficients(input_scale); | ||
model->calculate_DRbar_masses(); | ||
update_scale(); | ||
|
||
// apply user-defined susy scale constraints | ||
@applyConstraint@ | ||
@temporaryResetting@ | ||
} | ||
|
||
const @ModelName@_input_parameters& @ModelName@_soft_parameters_constraint<Semi_analytic>::get_input_parameters() const | ||
{ | ||
assert(model && "Error: @ModelName@_soft_parameters_constraint<Semi_analytic>::" | ||
"get_input_parameters(): model pointer is zero."); | ||
|
||
return model->get_input(); | ||
} | ||
|
||
void @ModelName@_soft_parameters_constraint<Semi_analytic>::set_model(Model* model_) | ||
{ | ||
model = cast_model<@ModelName@<Semi_analytic>*>(model_); | ||
} | ||
|
||
void @ModelName@_soft_parameters_constraint<Semi_analytic>::clear() | ||
{ | ||
scale = 0.; | ||
initial_scale_guess = 0.; | ||
input_scale = 0.; | ||
model = nullptr; | ||
qedqcd = softsusy::QedQcd(); | ||
} | ||
|
||
void @ModelName@_soft_parameters_constraint<Semi_analytic>::initialize() | ||
{ | ||
assert(model && "@ModelName@_soft_parameters_constraint<Semi_analytic>::" | ||
"initialize(): model pointer is zero."); | ||
|
||
@scaleGuess@ | ||
scale = initial_scale_guess; | ||
input_scale = scale; | ||
} | ||
|
||
void @ModelName@_soft_parameters_constraint<Semi_analytic>::update_scale() | ||
{ | ||
assert(model && "@ModelName@_soft_parameters_constraint<Semi_analytic>::" | ||
"update_scale(): model pointer is zero."); | ||
|
||
@calculateScale@ | ||
@restrictScale@ | ||
} | ||
|
||
} // namespace flexiblesusy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
// ==================================================================== | ||
// 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@ | ||
|
||
#ifndef @ModelName@_SEMI_ANALYTIC_SOFT_PARAMETERS_CONSTRAINT_H | ||
#define @ModelName@_SEMI_ANALYTIC_SOFT_PARAMETERS_CONSTRAINT_H | ||
|
||
#include "@ModelName@_input_parameters.hpp" | ||
#include "single_scale_constraint.hpp" | ||
#include "lowe.h" | ||
|
||
namespace flexiblesusy { | ||
|
||
template <class T> | ||
class @ModelName@; | ||
|
||
class Semi_analytic; | ||
|
||
template<> | ||
class @ModelName@_soft_parameters_constraint<Semi_analytic> : public Single_scale_constraint { | ||
public: | ||
@ModelName@_soft_parameters_constraint() = default; | ||
@ModelName@_soft_parameters_constraint(@ModelName@<Semi_analytic>*, const softsusy::QedQcd&); | ||
virtual ~@ModelName@_soft_parameters_constraint(); | ||
virtual void apply() override; | ||
virtual double get_scale() const override { return scale; } | ||
virtual std::string name() const override { return "@ModelName@ soft parameters constraint"; } | ||
virtual void set_model(Model*) override; | ||
|
||
void clear(); | ||
double get_initial_scale_guess() const { return initial_scale_guess; } | ||
double get_input_scale() const { return input_scale; } | ||
void set_input_scale(double s) { input_scale = s; } | ||
const @ModelName@_input_parameters& get_input_parameters() const; | ||
@ModelName@<Semi_analytic>* get_model() const { return model; } | ||
void initialize(); | ||
const softsusy::QedQcd& get_sm_parameters() const { return qedqcd; } | ||
void set_sm_parameters(const softsusy::QedQcd& qedqcd_) { qedqcd = qedqcd_; } | ||
|
||
protected: | ||
void update_scale(); | ||
|
||
private: | ||
double scale{0.}; | ||
double initial_scale_guess{0.}; | ||
double input_scale{0.}; | ||
@ModelName@<Semi_analytic>* model{nullptr}; | ||
softsusy::QedQcd qedqcd{}; | ||
}; | ||
|
||
} // namespace flexiblesusy | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// ==================================================================== | ||
// 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@ | ||
|
||
#ifndef @ModelName@_SOFT_PARAMETERS_CONSTRAINT_H | ||
#define @ModelName@_SOFT_PARAMETERS_CONSTRAINT_H | ||
|
||
namespace flexiblesusy { | ||
|
||
template <class T> | ||
class @ModelName@_soft_parameters_constraint; | ||
|
||
} // namespace flexiblesusy | ||
|
||
#endif |