class Gambit::Spec

Need to forward declare Spec class. More…

Inherits from Gambit::SubSpectrum

Public Types

Name
typedef DerivedSpecD
typedef Spec< D >Self
typedef SpecTraits< D >::ContentsContents
typedef SpecTraits< D >::ModelModel
typedef SpecTraits< D >::InputInput
typedef MapTypes< D, MapTag::Get >MTget
typedef MapTypes< D, MapTag::Set >MTset
typedef std::map< Par::Tags, MapCollection< MTget > >GetterMaps
typedef std::map< Par::Tags, MapCollection< MTset > >SetterMaps

Public Functions

Name
Model &get_Model()
Input &get_Input()
const Model &get_Model() const
const Input &get_Input() const
Model &model()
Get model object on which to call function pointers.
const Model &model() const
Return it as const if we are a const object.
Input &input()
Get struct containing any extra data input on SubSpectrum object creation.
const Input &input() const
Return it as const if we are a const object.
virtual boolhas(const Par::Tags partype, const str & name, const SpecOverrideOptions =use_overrides, const SafeBool =SafeBool(true)) const
Spec member function definitions.
virtual doubleget(const Par::Tags partype, const str & name, const SpecOverrideOptions =use_overrides, const SafeBool =SafeBool(true)) const
virtual voidset(const Par::Tags partype, const double set_value, const str & name, const SafeBool =SafeBool(true))
virtual boolhas(const Par::Tags partype, const str & name, const int i, const SpecOverrideOptions =use_overrides, const SafeBool =SafeBool(true)) const
virtual doubleget(const Par::Tags partype, const str & name, const int i, const SpecOverrideOptions =use_overrides, const SafeBool =SafeBool(true)) const
virtual voidset(const Par::Tags partype, const double set_value, const str & name, const int i, const SafeBool =SafeBool(true))
virtual boolhas(const Par::Tags partype, const str & name, const int i, const int j, const SpecOverrideOptions =use_overrides) const
virtual doubleget(const Par::Tags partype, const str & name, const int i, const int j, const SpecOverrideOptions =use_overrides) const
virtual voidset(const Par::Tags partype, const double set_value, const str & name, const int i, const int j)
const std::map< Par::Tags, MapCollection< MTget > >fill_getter_maps()
const std::map< Par::Tags, MapCollection< MTset > >fill_setter_maps()
intindex_offset()
virtual std::stringgetName() const
Main public interface functions.
Spec()
virtual~Spec()
Virtual destructor.
virtual std::unique_ptr< SubSpectrum >clone() const

Public Attributes

Name
DummyModeldummymodel
DummyInputdummyinput
const GetterMapsgetter_maps
Initialise maps (uses filler overrides from DerivedSpec if defined)
const SetterMapssetter_maps

Friends

Name
classFptrFinder

Additional inherited members

Public Functions inherited from Gambit::SubSpectrum

Name
SubSpectrum()
Constructors/destructors.
virtual~SubSpectrum()
virtual voidwriteSLHAfile(int slha_version, const str & filename) const
Dump out spectrum information to an SLHA file (if possible)
virtual SLHAstructgetSLHAea(int slha_version) const
Get spectrum information in SLHAea format (if possible)
virtual voidadd_to_SLHAea(int , SLHAstruct & ) const
Add spectrum information to an SLHAea object (if possible)
virtual intget_numbers_stable_particles() const
virtual doublehard_upper() const
virtual doublesoft_upper() const
virtual doublesoft_lower() const
virtual doublehard_lower() const
virtual voidRunToScaleOverride(double )
Run spectrum to new scale.
virtual doubleGetScale() const
Returns the renormalisation scale of parameters.
virtual voidSetScale(double )
voidRunToScale(double scale, const int behave =0)
voidset_override(const Par::Tags partype, const double value, const str & name, const bool allow_new =false, const bool decouple =false)
Parameter override functions.
voidset_override(const Par::Tags partype, const double value, const str & name, const int i, const bool allow_new =false, const bool decouple =false)
voidset_override(const Par::Tags partype, const double value, const str & name, const int i, const int j, const bool allow_new =false)
voidset_override_vector(const Par::Tags tag, const double value, const std::vector< str > & params, const bool allow_new =false, const bool decouple =false)
Vector override functions.
voidset_override_vector(const Par::Tags tag, const double value, const std::vector< str > & params, const std::vector< int > indices, const bool allow_new =false, const bool decouple =false)
voidset_override_vector(const Par::Tags tag, const double value, const std::vector< str > & params, const int i, const bool allow_new =false, const bool decouple =false)
voidset_override_vector(const Par::Tags tag, const double value, const str & par, const std::vector< int > indices, const bool allow_new =false, const bool decouple =false)
doublesafeget(const Par::Tags partype, const str & mass, const SpecOverrideOptions =use_overrides, const SafeBool check_antiparticle =SafeBool(true)) const
safeget functions, by Abram
doublesafeget(const Par::Tags partype, const str & mass, const int i, const SpecOverrideOptions =use_overrides, const SafeBool check_antiparticle =SafeBool(true)) const
doublesafeget(const Par::Tags partype, const str & mass, const int i, const int j, const SpecOverrideOptions =use_overrides) const
doublesafeget(const Par::Tags partype, const int pdg_code, const int context, const SpecOverrideOptions =use_overrides, const SafeBool check_antiparticle =SafeBool(true)) const
doublesafeget(const Par::Tags partype, const std::pair< int, int > pdgpr, const SpecOverrideOptions =use_overrides, const SafeBool check_antiparticle =SafeBool(true)) const
doublesafeget(const Par::Tags partype, const std::pair< str, int > shortpr, const SpecOverrideOptions =use_overrides, const SafeBool check_antiparticle =SafeBool(true)) const
voidset_override(const Par::Tags partype, const double value, const int PDGcode, const int context, const bool allow_new =false, const bool decouple =false)
PDB overloads for setters.
voidset_override(const Par::Tags partype, const double value, const std::pair< int, int > pdgpr, const bool allow_new =false, const bool decouple =false)
voidset_override(const Par::Tags partype, const double value, const std::pair< str, int > shortpr, const bool allow_new =false, const bool decouple =false)
PDB overloads of set_override functions.
virtual const std::map< int, int > &PDG_translator() const
TODO: extra PDB overloads to handle all the one and two index cases (well all the ones that are feasible…)

Protected Attributes inherited from Gambit::SubSpectrum

Name
std::map< Par::Tags, OverrideMaps >override_maps
Map of override maps.

Detailed Description

template <class DerivedSpec >
class Gambit::Spec;

Need to forward declare Spec class.

Public Types Documentation

typedef D

typedef DerivedSpec Gambit::Spec< DerivedSpec >::D;

typedef Self

typedef Spec<D> Gambit::Spec< DerivedSpec >::Self;

typedef Contents

typedef SpecTraits<D>::Contents Gambit::Spec< DerivedSpec >::Contents;

Note: Wrapper need to define a specialisation of SpecTraits, which typedefs Model and Input. “Grab” these typedefs here to simplify notation

typedef Model

typedef SpecTraits<D>::Model Gambit::Spec< DerivedSpec >::Model;

typedef Input

typedef SpecTraits<D>::Input Gambit::Spec< DerivedSpec >::Input;

typedef MTget

typedef MapTypes<D,MapTag::Get> Gambit::Spec< DerivedSpec >::MTget;

typedef MTset

typedef MapTypes<D,MapTag::Set> Gambit::Spec< DerivedSpec >::MTset;

typedef GetterMaps

typedef std::map<Par::Tags,MapCollection<MTget> > Gambit::Spec< DerivedSpec >::GetterMaps;

Will need a map of map collections for both the getters and setters, containing the map collections for the permitted parameter types

typedef SetterMaps

typedef std::map<Par::Tags,MapCollection<MTset> > Gambit::Spec< DerivedSpec >::SetterMaps;

Public Functions Documentation

function get_Model

inline Model & get_Model()

function get_Input

inline Input & get_Input()

function get_Model

inline const Model & get_Model() const

function get_Input

inline const Input & get_Input() const

function model

inline Model & model()

Get model object on which to call function pointers.

function model

inline const Model & model() const

Return it as const if we are a const object.

function input

inline Input & input()

Get struct containing any extra data input on SubSpectrum object creation.

function input

inline const Input & input() const

Return it as const if we are a const object.

function has

virtual bool has(
    const Par::Tags partype,
    const str & name,
    const SpecOverrideOptions =use_overrides,
    const SafeBool =SafeBool(true)
) const

Spec member function definitions.

Reimplements: Gambit::SubSpectrum::has

No indices

TODO: Could avoid dismantling the MapCollection struct by just letting the SetMaps class do it, but one step at a time… Could also reduce duplication between getter and checker functions by making the ‘has’ function take an optional argument to return an FptrFinder, which can then just be used to call the found function.

function get

virtual double get(
    const Par::Tags partype,
    const str & name,
    const SpecOverrideOptions =use_overrides,
    const SafeBool =SafeBool(true)
) const

Reimplements: Gambit::SubSpectrum::get

function set

virtual void set(
    const Par::Tags partype,
    const double set_value,
    const str & name,
    const SafeBool =SafeBool(true)
)

Reimplements: Gambit::SubSpectrum::set

function has

virtual bool has(
    const Par::Tags partype,
    const str & name,
    const int i,
    const SpecOverrideOptions =use_overrides,
    const SafeBool =SafeBool(true)
) const

Reimplements: Gambit::SubSpectrum::has

One index

function get

virtual double get(
    const Par::Tags partype,
    const str & name,
    const int i,
    const SpecOverrideOptions =use_overrides,
    const SafeBool =SafeBool(true)
) const

Reimplements: Gambit::SubSpectrum::get

function set

virtual void set(
    const Par::Tags partype,
    const double set_value,
    const str & name,
    const int i,
    const SafeBool =SafeBool(true)
)

Reimplements: Gambit::SubSpectrum::set

function has

virtual bool has(
    const Par::Tags partype,
    const str & name,
    const int i,
    const int j,
    const SpecOverrideOptions =use_overrides
) const

Reimplements: Gambit::SubSpectrum::has

Two indices

function get

virtual double get(
    const Par::Tags partype,
    const str & name,
    const int i,
    const int j,
    const SpecOverrideOptions =use_overrides
) const

Reimplements: Gambit::SubSpectrum::get

function set

virtual void set(
    const Par::Tags partype,
    const double set_value,
    const str & name,
    const int i,
    const int j
)

Reimplements: Gambit::SubSpectrum::set

function fill_getter_maps

static inline const std::map< Par::Tags, MapCollection< MTget > > fill_getter_maps()

Default (empty) map filler functions Override as needed in derived classes

function fill_setter_maps

static inline const std::map< Par::Tags, MapCollection< MTset > > fill_setter_maps()

function index_offset

static inline int index_offset()

Get integer offset convention used by internal model class (needed by getters which take indices) By default assume no offset. Overrride as needed in derived class.

function getName

inline virtual std::string getName() const

Main public interface functions.

Reimplements: Gambit::SubSpectrum::getName

Get name

function Spec

inline Spec()

Constructor This uses the “Contents” class to verify (once, not every construction) that this wrapper provides all the basic functionality that it is supposed to.

function ~Spec

inline virtual ~Spec()

Virtual destructor.

function clone

inline virtual std::unique_ptr< SubSpectrum > clone() const

Reimplements: Gambit::SubSpectrum::clone

CRTP-style polymorphic clone function Now derived classes will not need to re-implement the clone function.

Public Attributes Documentation

variable dummymodel

DummyModel dummymodel;

Getters for wrapped data; be sure to define the ‘get_Model’ and ‘get_Input’ functions in the wrappers (with public access) Might as well use static polymorphism rather than virtual functions, since we are using the CRTP already anyway. Default “null” versions of get_Model and get_Input, to be used if wrapper does not override them.

variable dummyinput

DummyInput dummyinput;

variable getter_maps

static const GetterMaps getter_maps;

Initialise maps (uses filler overrides from DerivedSpec if defined)

variable setter_maps

static const SetterMaps setter_maps;

Friends

friend FptrFinder

friend class FptrFinder(
    FptrFinder 
);

Updated on 2023-06-26 at 21:36:51 +0000