44 using namespace modelling::numbercounts;
52 std::vector<cbl::cosmology::CosmologicalParameter> param = cosmo_param;
55 if (find(param.begin(), param.end(), cosmology::CosmologicalParameter::_sigma8_)!=param.end())
56 m_data_model.is_sigma8_free =
true;
58 if (!m_data_model.is_sigma8_free)
59 param.push_back(cosmology::CosmologicalParameter::_sigma8_);
61 m_data_model.Cpar = param;
63 const size_t nParams = param.size();
64 checkDim(param, nParams,
"cosmoPar_prior");
66 vector<statistics::ParameterType> cosmoPar_type((m_data_model.is_sigma8_free) ? nParams : nParams-1, statistics::ParameterType::_Base_);
67 if (!m_data_model.is_sigma8_free)
68 cosmoPar_type.push_back(statistics::ParameterType::_Derived_);
70 vector<string> cosmoPar_string(nParams);
72 for (
size_t i=0; i<nParams; i++)
76 auto inputs = make_shared<STR_NC_data_model>(m_data_model);
79 m_set_prior(cosmo_param_prior);
82 switch (m_HistogramType) {
83 case (glob::HistogramType::_N_V_):
86 case (glob::HistogramType::_n_V_):
89 case (glob::HistogramType::_dn_dV_):
93 ErrorCBL(
"no such a variable in the list!",
"set_model_NumberCounts_cosmology",
"Modelling_NumberCounts2D_RedshiftMass.cpp");
Global functions to model number counts.
The class Modelling_NumberCounts2D_RedshiftMass.
void set_model_NumberCounts_cosmology(const std::vector< cbl::cosmology::CosmologicalParameter > cosmo_param={}, const std::vector< statistics::PriorDistribution > cosmo_param_prior={})
set the cosmological parameters used to model the mass function
std::string CosmologicalParameter_name(const CosmologicalParameter parameter)
name of the cosmological parameter
std::vector< std::vector< double > > mass_function_redshift_mass(const std::vector< double > redshift, const std::vector< double > mass, const std::shared_ptr< void > inputs, std::vector< double > ¶meter)
compute the mass function as a function of the mass and redshift
std::vector< std::vector< double > > number_counts_redshift_mass(const std::vector< double > redshift, const std::vector< double > mass, const std::shared_ptr< void > inputs, std::vector< double > ¶meter)
compute the number counts as a function of the mass and redshift
std::vector< std::vector< double > > number_density_redshift_mass(const std::vector< double > redshift, const std::vector< double > mass, const std::shared_ptr< void > inputs, std::vector< double > ¶meter)
compute the number density as a function of the mass and redshift
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