49 shared_ptr<STR_NC_data_model> pp = static_pointer_cast<STR_NC_data_model>(inputs);
58 for (
size_t i=0; i<pp->Cpar.size(); ++i)
62 std::vector<double> Pk = cosmo.
Pk_matter(pp->kk, pp->method_Pk,
false, 0., pp->store_output, pp->output_root, pp->norm, pp->k_min, pp->k_max, pp->prec, pp->file_par);
64 return cbl::modelling::numbercounts::mass_function(redshift, mass, cosmo, pp->model_MF, pp->store_output, pp->Delta, pp->isDelta_critical, pp->kk, Pk,
"Spline", pp->k_max);
73 (void)redshift; (void)mass;
76 shared_ptr<STR_NC_data_model> pp = static_pointer_cast<STR_NC_data_model>(inputs);
85 for (
size_t i=0; i<pp->Cpar.size(); ++i)
89 std::vector<double> Pk = cosmo.
Pk_matter(pp->kk, pp->method_Pk,
false, 0., pp->store_output, pp->output_root, pp->norm, pp->k_min, pp->k_max, pp->prec, pp->file_par);
91 std::vector<std::vector<double>>
mass_function =
cbl::modelling::numbercounts::mass_function (pp->z_vector, pp->Mass_vector, cosmo, pp->model_MF, pp->store_output, pp->Delta, pp->isDelta_critical, pp->kk, Pk,
"Spline", pp->k_max);
95 std::vector<std::vector<double>> number_density(pp->edges_x.size()-1, std::vector<double>(pp->edges_y.size()-1));
96 for (
size_t i=0; i<pp->edges_x.size()-1; i++) {
97 for (
size_t j=0; j<pp->edges_y.size()-1; j++) {
98 number_density[i][j] = interp_MF.
IntegrateVegas(pp->edges_x[i], pp->edges_x[i+1], pp->edges_y[j], pp->edges_y[j+1]);
102 return number_density;
111 (void)redshift; (void)mass;
114 shared_ptr<STR_NC_data_model> pp = static_pointer_cast<STR_NC_data_model>(inputs);
123 const size_t npar = (pp->is_sigma8_free) ? pp->Cpar.size() : pp->Cpar.size()-1;
124 for (
size_t i=0; i<npar; ++i)
131 const std::vector<double> Pk = cosmo.
Pk_matter(pp->kk, pp->method_Pk,
false, 0., pp->store_output, pp->output_root, pp->norm, pp->k_min, pp->k_max, pp->prec, pp->file_par,
true);
136 if (!pp->is_sigma8_free) parameter[pp->Cpar.size()-1] = interp[0](
Mass(8., cosmo.
rho_m()));
138 std::vector<std::vector<double>>
number_counts(pp->edges_x.size()-1, std::vector<double>(pp->edges_y.size()-1));
139 for (
size_t i=0; i<pp->edges_x.size()-1; i++) {
140 for (
size_t j=0; j<pp->edges_y.size()-1; j++) {
141 number_counts[i][j] =
cbl::modelling::numbercounts::number_counts(pp->edges_x[i], pp->edges_x[i+1], pp->edges_y[j], pp->edges_y[j+1], cosmo, pp->area_rad, pp->model_MF, pp->store_output, pp->Delta, pp->isDelta_critical, interp[0], interp[1]);
Global functions to model number counts.
double rho_m(const double redshift=0., const bool unit1=false, const bool nu=false) const
the mean cosmic background density
void set_parameter(const CosmologicalParameter parameter, const double value)
set the value of one cosmological paramter
std::vector< double > Pk_matter(const std::vector< double > kk, const std::string method_Pk, const bool NL, const double redshift, const bool store_output=true, const std::string output_root="test", const int norm=-1, const double k_min=0.001, const double k_max=100., const double prec=1.e-2, const std::string file_par=par::defaultString, const bool unit1=false)
the dark matter power spectrum
double IntegrateVegas(const double xmin, const double xmax, const double ymin, const double ymax) const
evaluate the 2D integral of the interpolated function using the Vegas routine from CUBA libraries
void sigmaM_dlnsigmaM(double &sigmaM, double &dlnsigmaM, const double mass, const cbl::glob::FuncGrid interp_Pk, const double kmax, const double rho)
compute
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
double mass_function(const double mass, cosmology::Cosmology cosmology, const double redshift, const std::string model_MF, const bool store_output, const double Delta, const bool isDelta_critical, const cbl::glob::FuncGrid interp_Pk, const double kmax)
compute the mass function
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
double number_counts(const double redshift_min, const double redshift_max, const double Mass_min, const double Mass_max, cosmology::Cosmology cosmology, const double Area, const std::string model_MF, const bool store_output, const double Delta, const bool isDelta_critical, const glob::FuncGrid interp_sigmaM, const glob::FuncGrid interp_DlnsigmaM)
compute the number counts as function of 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
T Mass(const T RR, const T Rho)
the mass of a sphere of a given radius and density