1#ifndef HALOMODEL_INCLUDE
2#define HALOMODEL_INCLUDE
31 using Func1 = std::function<double(
double)>;
32 using Func2 = std::function<double(
double,
double)>;
86 double xcollapse{std::numeric_limits<double>::quiet_NaN()};
193 double xini = std::log(1e-5),
220 int npts_k = 1000)
const;
228 int npts_z = 100)
const;
237 int npts_M = 100)
const;
257 const std::string filename_pofk,
258 Spline & logDelta_of_logk_spline,
259 double normalization = 1.0,
266 const std::function<
double(
double)> logDelta_of_logk,
268 Spline & logsigma_of_logR_spline,
269 const DVector *fiducial_logR_array =
nullptr,
270 const DVector *fiducial_logk_array =
nullptr);
300 const std::function<
double(
double,
double)> & rho_function,
307 const std::function<
double(
double,
double)> & rho_function,
308 Spline2D & y_of_logR_and_logk_spline,
309 const double DeltaVir,
312 const DVector *fiducial_logR_array =
nullptr,
313 const DVector *fiducial_logk_array =
nullptr);
317 const Spline & logsigma_of_logR_spline,
318 Spline & lognu_of_logR_spline,
319 Spline & logR_of_lognu_spline,
320 const DVector *fiducial_logR_array =
nullptr);
323 const Spline & logR_of_lognu_spline,
324 const Spline & lognu_of_logR_spline,
325 Spline & dndlogM_of_logM_spline,
326 Spline & n_of_logM_spline,
327 const std::function<
double(
double)> & pdf_of_nu,
332 const Spline & logR_of_lognu_spline,
333 const Spline2D & y_of_logR_and_logk_spline,
334 Spline & logDelta_onehalo_of_logk_spline,
335 Spline & logDelta_twohalo_of_logk_spline,
336 Spline & logDelta_full_of_logk_spline,
337 const std::function<
double(
double)> & logDeltaLin_of_logk,
338 const std::function<
double(
double)> & pdf_of_nu,
339 const std::function<
double(
double)> & bias_of_nu,
340 const double eta_hmcode = 0.0,
341 const double kmin = 1e-5,
342 const double kmax = 100.0,
343 const int npts_k = 100);
347 const Spline & growthfactor_of_x_spline,
348 const Spline & logsigma_of_logR_spline,
349 Spline & formationredshift_of_logM_spline,
353 double massfraction = 0.01);
357 const std::function<
double(
double)> logDelta_of_logk,
360 const DVector *fiducial_logk_array =
nullptr);
364 const Spline & logsigma_of_logR_spline,
365 const Spline & lognu_of_logR_spline);
const std::string filename
FML::COSMOLOGY::SPHERICALCOLLAPSE::SphericalCollapse SphericalCollapse
Class for computing the standard halomodel predictions for plus or just doing spherical collapse.
std::string halo_massfunction
HaloBiasFunction halo_bias_function
void output_nofM(std::string filename, double Mmin=1e8, double Mmax=1e16, int npts_M=100) const
Spline delta_ini_of_x_spline
RhoFunction halo_density_profile
double get_f_hmcode(double x) const
Spline2D y_of_logR_and_logk_spline
Spline deltac_of_x_spline
Spline logsigma_of_logR_spline
Spline lognu_of_logR_spline
Spline formationredshift_of_logM_spline
Spline logDeltaHM_full_of_logk_spline
Spline logDelta_of_logk_spline
double DeltaVir_multiplier
Spline lognu_of_logM_spline
cofMFunction halo_mass_concentration_relation
void compute_at_redshift(double zcollapse)
double get_DeltaVir_hmcode(double x) const
double xini_spherical_collapse
Spline DeltaVir_of_x_spline
int npts_spherical_collapse
std::shared_ptr< DVector > fiducial_logR_array
HaloModel & operator=(const HaloModel &)=default
HaloModel(const HaloModel &)=default
Spline growthrate_of_x_spline
WindowFunction fourier_window_function
double get_cmin_hmcode(double x) const
HaloMultiplicityFunction halo_multiplicity_function
Spline growthfactor_of_x_spline
void output_deltac(std::string filename, double zmin=0.0, double zmax=10.0, int npts_z=100) const
double get_deltac_hmcode(double x) const
Spline logR_of_lognu_spline
std::shared_ptr< DVector > fiducial_logk_array
void output_pofk(std::string filename, double kmin=1e-5, double kmax=100, int npts_k=1000) const
SphericalCollapseModel spcmodel
Spline logDeltaHM_twohalo_of_logk_spline
Spline logDeltaHM_onehalo_of_logk_spline
double get_kstar_hmcode(double x) const
double get_alpha_hmcode() const
double get_eta_hmcode(double x) const
Spline dndlogM_of_logM_spline
Class for doing general spherical collapse calculations, i.e.
The class contains all the info about the model needed to run the spherical collapse and halomodel Co...
This is a wrapper class for easy use of GSL splines It is (OpenMP) thread safe as long as splines are...
This is a wrapper around the GSL library to easily solve ODEs and return the data in whatever format ...
Class for performing timings of the code using std::chrono.
std::function< double(double)> WindowFunction
double RofM(double M, double OmegaM, double x)
void compute_lognu_of_logR(const double deltac, const Spline &logsigma_of_logR_spline, Spline &lognu_of_logR_spline, Spline &logR_of_lognu_spline, const DVector *fiducial_logR_array)
std::function< double(double, HaloModel *hm)> HaloMultiplicityFunction
void compute_sigma(const Func1 logDelta_of_logk, const WindowFunction window_of_kR, Spline &logsigma_of_logR_spline, const DVector *fiducial_logR_array, const DVector *fiducial_logk_array)
FML::SOLVERS::ODESOLVER::ODESolver ODESolver
double compute_sigmav(const Func1 logDelta_of_logk, const WindowFunction window_of_kR, double R, const DVector *fiducial_logk_array)
FML::SOLVERS::ODESOLVER::DVector DVector
FML::SOLVERS::ODESOLVER::ODEFunctionJacobian ODEFunctionJacobian
std::function< double(double, HaloModel *hm)> HaloBiasFunction
std::pair< double, double > compute_neff(const Spline &logsigma_of_logR_spline, const Spline &lognu_of_logR_spline)
void compute_one_and_two_halo_terms(const Spline &logR_of_lognu_spline, const Spline2D &y_of_logR_and_logk_spline, Spline &logDelta_onehalo_of_logk_spline, Spline &logDelta_twohalo_of_logk_spline, Spline &logDelta_full_of_logk_spline, const Func1 &logDeltaLin_of_logk, const Func1 &pdf_of_nu, const Func1 &bias_of_nu, const double eta_hmcode, const double kmin, const double kmax, const int npts_k)
cofMFunction get_nfw_halo_mass_concentration_relation()
void compute_formation_redshift_factor(const Spline &growthfactor_of_x_spline, const Spline &logsigma_of_logR_spline, Spline &formationredshift_of_logM_spline, double deltac, double OmegaM, double xcollapse, double massfraction)
DVector compute_rho_fourier_single(const Func2 &rho_function, const DVector &k_array, const double M, const double Rvir)
HaloBiasFunction get_sheth_tormen_halo_bias_function()
FML::SOLVERS::ODESOLVER::ODEFunction ODEFunction
std::function< double(double, double, HaloModel *hm)> RhoFunction
double MofRvir(double Rvir, double DeltaVir, double OmegaM, double x)
WindowFunction get_tophat_window_fourier()
double RvirofM(double M, double DeltaVir, double OmegaM, double x)
FML::COSMOLOGY::SPHERICALCOLLAPSE::SphericalCollapseModel SphericalCollapseModel
RhoFunction get_nfw_halo_density_profile()
std::function< double(double, HaloModel *hm)> cofMFunction
HaloMultiplicityFunction get_sheth_tormen_halo_multiplicity_function()
void compute_rho_fourier(const Func2 &rho_function, Spline2D &y_of_logR_and_logk_spline, const double DeltaVir, const double OmegaM, const double x, const DVector *fiducial_logR_array, const DVector *fiducial_logk_array)
void compute_massfunction(const Spline &logR_of_lognu_spline, const Spline &lognu_of_logR_spline, Spline &dndlogM_of_logM_spline, Spline &n_of_logM_spline, const Func1 &pdf_of_nu, const double OmegaM, const double x)
void read_pofk_file(const std::string filename_pofk, Spline &logDelta_of_logk_spline, double normalization, int col_k, int col_pofk)
FML::SOLVERS::ODESOLVER::DVector2D DVector2D
std::function< double(double, double)> Func2
double MofR(double R, double OmegaM, double x)
std::function< double(double)> Func1
FML::UTILS::Timings Timings
std::function< int(double, const double *, double *)> ODEFunction
std::vector< DVector > DVector2D
std::vector< double > DVector
std::function< int(double, const double *, double *, double *)> ODEFunctionJacobian