cepgen is hosted by Hepforge, IPPP Durham
CepGen 1.2.5
Central exclusive processes event generator
Loading...
Searching...
No Matches

A description object for parameters collection. More...

#include <CepGen/Core/ParametersDescription.h>

+ Inheritance diagram for ParametersDescription:
+ Collaboration diagram for ParametersDescription:

Classes

class  ParameterValues
 A collection of valid values for a given parameter. More...
 

Public Types

enum struct  Type { Value , Parameters , Module , ParametersVector }
 

Public Member Functions

 ParametersDescription (const std::string &mod_key="")
 Build the description of a parameters collection object.
 
 ParametersDescription (const ParametersList &params)
 Build the (empty) description of a parameters collection object from its definition.
 
bool empty () const
 Does a description of this parameter (or parameters collection) exist?
 
ParametersDescriptionoperator+= (const ParametersDescription &)
 Concatenate another description to this one.
 
template<typename I >
ParametersDescriptionsetKey (const I &key)
 Set the module name for this parameter (or parameters collection)
 
const std::string & key () const
 Module name for this parameter.
 
ParametersDescriptionsetDescription (const std::string &descr)
 Set the description of this parameter (or parameters collection)
 
const std::string & description () const
 Description of this parameter (or parameters collection)
 
ParametersDescriptionsetParametersVector (bool pv=true)
 This parameters is a collection of sub-parameters.
 
template<typename T >
ParametersDescriptionadd (const std::string &name, const T &def)
 Add the description to a new parameter.
 
template<typename T , typename U >
ParametersDescriptionaddAs (const std::string &name, const U &def)
 Add a recast definition to a new parameter.
 
ParametersDescriptionsetName (const std::string &name)
 Set the module name.
 
ParametersDescriptionaddParametersDescriptionVector (const std::string &, const ParametersDescription &, const std::vector< ParametersList > &def={})
 Add the description to a collection of ParametersList objects.
 
std::string describe (size_t offset=0) const
 Human-readable description of parameters and their default value.
 
ParametersListparameters ()
 List of parameters associated to this description object.
 
const ParametersListparameters () const
 List of parameters associated to this description object.
 
bool has (const std::string &) const
 Ensure the description exists.
 
const ParametersDescriptionget (const std::string &) const
 Get the description of a sub-object.
 
ParametersList validate (const ParametersList &) const
 Validate a set of used-steered parameters.
 
ParametersDescription steer (const ParametersList &) const
 Set parameters value for this description object.
 
Type type () const
 Get the type of parameter considered.
 
const ParameterValuesallowedValues () const
 Possible values for a parameter.
 
ParametersDescriptionallow (int, const std::string &="")
 Allow an integer value for a parameter.
 
ParametersDescriptionallow (const std::string &, const std::string &="")
 Allow a string value for a parameter.
 
void allowAll ()
 Allow all values to be set for a parameter.
 
template<>
ParametersDescriptionadd (const std::string &name, const ParametersDescription &desc)
 Add the description to a new sub-description (aka ParametersList) object.
 
template<>
ParametersDescriptionadd (const std::string &name, const ParametersList &)
 Disable the addition of a ParametersList object to this description.
 

Private Member Functions

template<typename T >
get (const std::string &key, const T &def=default_arg< T >::get()) const
 Get a parameter value.
 
template<>
Limits get (const std::string &key, const Limits &def) const
 
template<>
ParticleProperties get (const std::string &key, const ParticleProperties &def) const
 Get a particle properties object.
 
ParametersListoperator+= (const ParametersList &oth)
 Concatenate two parameters containers.
 

Friends

std::ostream & operator<< (std::ostream &, const ParametersDescription &)
 Human-readable description.
 
std::ostream & operator<< (std::ostream &, const Type &)
 Human-readable description of parameter type.
 

Detailed Description

Definition at line 26 of file ParametersDescription.h.

Member Enumeration Documentation

◆ Type

enum struct Type
strong
Enumerator
Value 
Parameters 
Module 
ParametersVector 

Definition at line 89 of file ParametersDescription.h.

Constructor & Destructor Documentation

◆ ParametersDescription() [1/2]

ParametersDescription ( const std::string &  mod_key = "")
explicit
Parameters
[in]mod_keyModule name (where applicable)

Definition at line 29 of file ParametersDescription.cpp.

◆ ParametersDescription() [2/2]

ParametersDescription ( const ParametersList params)
explicit

Definition at line 34 of file ParametersDescription.cpp.

Member Function Documentation

◆ add() [1/3]

template<>
ParametersDescription & add ( const std::string &  name,
const ParametersDescription desc 
)

Definition at line 173 of file ParametersDescription.cpp.

◆ add() [2/3]

template<>
ParametersDescription & add ( const std::string &  name,
const ParametersList  
)

Definition at line 189 of file ParametersDescription.cpp.

◆ add() [3/3]

template<typename T >
ParametersDescription & add ( const std::string &  name,
const T &  def 
)

Definition at line 59 of file ParametersDescription.h.

◆ addAs()

template<typename T , typename U >
ParametersDescription & addAs ( const std::string &  name,
const U def 
)

Definition at line 69 of file ParametersDescription.h.

◆ addParametersDescriptionVector()

ParametersDescription & addParametersDescriptionVector ( const std::string &  name,
const ParametersDescription desc,
const std::vector< ParametersList > &  def = {} 
)

Definition at line 195 of file ParametersDescription.cpp.

◆ allow() [1/2]

ParametersDescription & allow ( const std::string &  val,
const std::string &  descr = "" 
)

Definition at line 282 of file ParametersDescription.cpp.

◆ allow() [2/2]

ParametersDescription & allow ( int  val,
const std::string &  descr = "" 
)

Definition at line 276 of file ParametersDescription.cpp.

◆ allowAll()

void allowAll ( )

Definition at line 120 of file ParametersDescription.h.

◆ allowedValues()

const ParameterValues & allowedValues ( ) const

Definition at line 116 of file ParametersDescription.h.

◆ describe()

std::string describe ( size_t  offset = 0) const

Definition at line 96 of file ParametersDescription.cpp.

◆ description()

const std::string & description ( ) const

Definition at line 51 of file ParametersDescription.h.

◆ empty()

bool empty ( ) const

Definition at line 48 of file ParametersDescription.cpp.

◆ get()

const ParametersDescription & get ( const std::string &  key) const

Definition at line 74 of file ParametersDescription.cpp.

◆ has()

bool has ( const std::string &  key) const

Definition at line 72 of file ParametersDescription.cpp.

◆ key()

const std::string & key ( ) const

Definition at line 47 of file ParametersDescription.h.

◆ operator+=()

ParametersDescription & operator+= ( const ParametersDescription oth)

Definition at line 55 of file ParametersDescription.cpp.

◆ parameters() [1/2]

ParametersList & parameters ( )

Definition at line 216 of file ParametersDescription.cpp.

◆ parameters() [2/2]

const ParametersList & parameters ( ) const

Definition at line 218 of file ParametersDescription.cpp.

◆ setDescription()

ParametersDescription & setDescription ( const std::string &  descr)

Definition at line 167 of file ParametersDescription.cpp.

◆ setKey()

template<typename I >
ParametersDescription & setKey ( const I &  key)

Definition at line 42 of file ParametersDescription.h.

◆ setName()

ParametersDescription & setName ( const std::string &  name)

Definition at line 73 of file ParametersDescription.h.

◆ setParametersVector()

ParametersDescription & setParametersVector ( bool  pv = true)

Definition at line 53 of file ParametersDescription.h.

◆ steer()

ParametersDescription steer ( const ParametersList params) const

Definition at line 264 of file ParametersDescription.cpp.

◆ type()

Definition at line 86 of file ParametersDescription.cpp.

◆ validate()

ParametersList validate ( const ParametersList user_params) const

Definition at line 220 of file ParametersDescription.cpp.

Friends And Related Symbol Documentation

◆ operator<< [1/2]

std::ostream & operator<< ( std::ostream &  os,
const ParametersDescription desc 
)
friend

Definition at line 288 of file ParametersDescription.cpp.

◆ operator<< [2/2]

std::ostream & operator<< ( std::ostream &  os,
const Type type 
)
friend

Definition at line 290 of file ParametersDescription.cpp.