48 shared_ptr<cbl::modelling::cosmo::CMB_DistancePrior> cbl::modelling::cosmo::CMB_DistancePrior::Create (
const string distance_prior_name)
50 if (distance_prior_name ==
"Aubourg15_Planck15")
51 return move(unique_ptr<cbl::modelling::cosmo::Aubourg15_Planck15>(
new cbl::modelling::cosmo::Aubourg15_Planck15()));
52 else if (distance_prior_name ==
"Aubourg15_WMAP09")
53 return move(unique_ptr<cbl::modelling::cosmo::Aubourg15_WMAP09>(
new cbl::modelling::cosmo::Aubourg15_WMAP09()));
54 else ErrorCBL(
"no such type of distance_prior_name!",
"Create",
"Modelling_Cosmology.cpp");
66 m_data_type = data_type;
75 m_cosmology = move(make_shared<cbl::cosmology::Cosmology>(cosmology));
85 (void)external_dataset;
87 const size_t nParams = cosmoPar_name.size();
88 checkDim(cosmoPar_prior, nParams,
"cosmoPar_prior");
90 vector<statistics::ParameterType> cosmoPar_type(nParams, statistics::ParameterType::_Base_);
91 vector<string> cosmoPar_string(nParams);
93 for (
size_t i=0; i<nParams; i++)
96 m_data_model.cosmology = m_cosmology;
97 m_data_model.Cpar = cosmoPar_name;
98 m_data_model.data_type = m_data_type;
101 m_data_model.distance_prior = cbl::modelling::cosmo::CMB_DistancePrior::Create(distance_prior);
107 auto inputs = make_shared<STR_data_model_cosmology>(m_data_model);
110 m_set_prior(cosmoPar_prior);
The class Modelling_Cosmology.
The class Modelling_Cosmology.
void set_fiducial_cosmology(const cbl::cosmology::Cosmology cosmology)
set the fiducial cosmology
Modelling_Cosmology()=default
default constuctor
void set_cosmological_parameters(const std::vector< cbl::cosmology::CosmologicalParameter > cosmoPar_name, const std::vector< cbl::statistics::PriorDistribution > cosmoPar_prior, const std::string distance_prior=par::defaultString, const std::vector< std::string > external_dataset={})
set the cosmological parameters
static const std::string defaultString
default std::string value
std::string CosmologicalParameter_name(const CosmologicalParameter parameter)
name of the cosmological parameter
std::shared_ptr< data::Data > join_dataset(std::vector< std::shared_ptr< data::Data >> dataset)
merge dataset (only work for one dataset type)
std::vector< double > cosmological_measurements_model(const std::vector< double > redshift, const std::shared_ptr< void > inputs, std::vector< double > ¶meter)
model for the generic cosmological measurements
std::vector< double > cosmological_measurements_model_CMB_DistancePrior(const std::vector< double > redshift, const std::shared_ptr< void > inputs, std::vector< double > ¶meter)
model for the generic cosmological measurements plus distance prior from CMB experiments
The global namespace of the CosmoBolognaLib
void checkDim(const std::vector< T > vect, const int val, const std::string vector, bool equal=true)
check if the dimension of a std::vector is equal/lower than an input value
int ErrorCBL(const std::string msg, const std::string functionCBL, const std::string fileCBL, const cbl::glob::ExitCode exitCode=cbl::glob::ExitCode::_error_)
throw an exception: it is used for handling exceptions inside the CosmoBolognaLib