.. _physics-haloMassFunction: Halo Mass Function ================== Class providing halo mass functions, :math:`\mathrm{d}n/\mathrm{d}M`, which give the comoving number density of dark matter halos per unit mass interval as a function of halo mass and cosmic time. The halo mass function is a fundamental quantity in models of large-scale structure and galaxy formation, encoding the statistics of gravitational collapse from a given primordial density field. **Default implementation:** ``haloMassFunctionTinker2008`` Methods ------- ``differential`` → ``double precision`` Return the differential halo mass function for ``mass`` [:math:`\mathrm{M}_\odot`] at ``time`` [Gyr]. * ``double precision , intent(in ) :: time, mass`` * ``type (treeNode), intent(inout), optional :: node`` ``integrated`` → ``double precision`` Return the halo mass function at ``time`` [Gyr] integrated between ``massLow`` and ``massHigh`` [:math:`\mathrm{M}_\odot`]. * ``double precision , intent(in ) :: time, massLow, massHigh`` * ``type (treeNode), intent(inout), target, optional :: node`` * ``integer , intent( out) , optional :: status`` ``massFraction`` → ``double precision`` Return the halo mass fraction at ``time`` [Gyr] integrated between ``massLow`` and ``massHigh`` [:math:`\mathrm{M}_\odot`]. * ``double precision , intent(in ) :: time, massLow, massHigh`` * ``type (treeNode), intent(inout), target, optional :: node`` .. _physics-haloMassFunctionAccelerator: ``haloMassFunctionAccelerator`` ------------------------------- A dark matter halo mass function class which accelerates another mass function using tabulation. **Methods** * ``tabulate`` — Tabulate the mass function. **Parameters** * ``[toleranceRelative]`` (default ``1.0d-2``) — The relative tolerance within which a cached (accelerated) profile estimate is accepted; if the requested radius differs from the cached value by more than this fractional amount, the full profile calculation is recomputed. * ``[factorRadiusMaximum]`` (default ``3.0d0``) — The maximum radial extrapolation factor allowed when using cached profile values for the dark-matter-only profile; if the requested radius exceeds the cached radius by more than this factor, the full calculation is recomputed. * ``[toleranceRelative]`` (default ``1.0d-2``) — The toleranceRelative with which to accept accelerated estimates. * ``[factorRadiusMaximum]`` (default ``3.0d0``) — The maximum radial extrapolation factor allowed when using cached profile values; if the requested radius differs from the cached radius by more than this factor, the full profile is recomputed rather than interpolated. * ``[toleranceRelative]`` (default ``1.0d-2``) — The tolerance with which to accept accelerated estimates. * ``[factorRadiusMaximum]`` (default ``3.0d0``) — The maximum factor by which to interpolate in radius. * ``[nonAnalyticSolver]`` (default ``var_str('fallThrough')``) — Selects how solutions are computed when no analytic solution is available. If set to "``fallThrough``" then the solution ignoring heating is used, while if set to "``numerical``" then numerical solvers are used to find solutions. * ``[componentType]`` (default ``var_str('unknown')``) — The component type that this mass distribution represents. * ``[massType]`` (default ``var_str('unknown')``) — The mass type that this mass distribution represents. * ``[tablePointsPerDecade]`` (default ``10``) — The number of points per decade of wavenumber at which to tabulate the transfer function. .. _physics-haloMassFunctionBhattacharya2011: ``haloMassFunctionBhattacharya2011`` ------------------------------------ The dark matter halo mass function is computed using the redshift-dependent fitting function of :cite:t:`bhattacharya_mass_2011`, calibrated against N-body simulations. The shape parameters :math:`\bar{a}`, :math:`\bar{p}`, :math:`\bar{q}`, and normalization :math:`\bar{A}` of the fit can each be specified via input parameters. **Methods** * ``a`` — Return the parameter :math:`\bar{a}` in the :cite:t:`bhattacharya_mass_2011` halo mass function fit. * ``c`` — Return the parameter :math:`\bar{b}` in the :cite:t:`bhattacharya_mass_2011` halo mass function fit. * ``b`` — Return the parameter :math:`\bar{c}` in the :cite:t:`bhattacharya_mass_2011` halo mass function fit. * ``p`` — Return the parameter :math:`\bar{p}` in the :cite:t:`bhattacharya_mass_2011` halo mass function fit. * ``q`` — Return the parameter :math:`\bar{q}` in the :cite:t:`bhattacharya_mass_2011` halo mass function fit. * ``normalization`` — Return the parameter :math:`\bar{A}` in the :cite:t:`bhattacharya_mass_2011` halo mass function fit. **Parameters** * ``[a]`` (default ``0.788d0``) — The parameter :math:`\bar{a}` in the :cite:t:`bhattacharya_mass_2011` halo mass function fit. * ``[b]`` (default ``1.000d0``) — The parameter :math:`\bar{b}` in the :cite:t:`bhattacharya_mass_2011` halo mass function fit. * ``[c]`` (default ``1.000d0``) — The parameter :math:`\bar{c}` in the :cite:t:`bhattacharya_mass_2011` halo mass function fit. * ``[p]`` (default ``0.807d0``) — The parameter :math:`\bar{p}` in the :cite:t:`bhattacharya_mass_2011` halo mass function fit. * ``[q]`` (default ``1.795d0``) — The parameter :math:`\bar{q}` in the :cite:t:`bhattacharya_mass_2011` halo mass function fit. * ``[normalization]`` (default ``0.333d0``) — The normalization parameter :math:`\bar{A}` in the :cite:t:`bhattacharya_mass_2011` halo mass function fit. .. _physics-haloMassFunctionDespali2015: ``haloMassFunctionDespali2015`` ------------------------------- A dark matter halo mass function class using the function given by :cite:t:`despali_universality_2015`. This uses the functional form proposed by :cite:t:`sheth_ellipsoidal_2001` but with parameters :math:`a`, :math:`p`, and :math:`A` set using eqn. (12) of :cite:t:`despali_universality_2015`. **Methods** * ``x`` — Return the parameter :math:`x` in the :cite:t:`despali_universality_2015` halo mass function fit. .. _physics-haloMassFunctionDetectionEfficiency: ``haloMassFunctionDetectionEfficiency`` --------------------------------------- The halo mass function is computed by modifying another mass function by the halo-finder detection efficiency. **Parameters** * ``[massMinimum]`` — The minimum mass at which halos are detected. * ``[efficiencyAtMassMinimum]`` — The efficiency of detection at the minimum mass. * ``[exponentMass]`` — The exponent :math:`\alpha` in the detection efficiency, :math:`f(M) = 1 - (1-\epsilon) (M/M_\mathrm{min})^\alpha (1+z)^\beta`. * ``[exponentRedshift]`` — The exponent :math:`\beta` in the detection efficiency, :math:`f(M) = 1 - (1-\epsilon) (M/M_\mathrm{min})^\alpha (1+z)^\beta`. .. _physics-haloMassFunctionEnvironmental: ``haloMassFunctionEnvironmental`` --------------------------------- The halo mass function is computed by handling the transition though the environment mass scale. **Parameters** * ``[a]`` (default ``0.0d0``) — The linear coefficient :math:`a` that multiplies the large-scale environmental overdensity when computing the environment-dependent shift to the critical overdensity for halo collapse (a value of 0 gives no environmental dependence). .. _physics-haloMassFunctionEnvironmentAveraged: ``haloMassFunctionEnvironmentAveraged`` --------------------------------------- The dark matter halo mass function is computed by averaging another, environment-dependent mass function over the probability distribution of large-scale environments, marginalizing over the local density field. This allows environment-dependent mass functions to be used in a mean cosmological context, with optional accounting for unoccupied volume via ``[includeUnoccupiedVolume]``. **Parameters** * ``[includeUnoccupiedVolume]`` (default ``.true.``) — If true, account for any volume which is not included in the environment (e.g. regions which have collapsed on the scale of the environment in a peak-background split environment), when averaging over environment. Otherwise, ignore this unoccupied volume. .. _physics-haloMassFunctionErrorConvolved: ``haloMassFunctionErrorConvolved`` ---------------------------------- The halo mass function is computed by convolving another halo mass function with a mass dependent error. Specifically, the mass function is convolved with a Gaussian random error distribution with width computed using the given ``nbodyHaloMassError`` object. **Parameters** * ``[errorFractionalMaximum]`` — Maximum allowed fractional error in halo mass. * ``[toleranceRelative]`` (default ``1.0d-6``) — Maximum allowed fractional error in halo mass. * ``[tolerateIntegrationFailure]`` (default ``.false.``) — If true, tolerate failures in integration. .. _physics-haloMassFunctionFofBias: ``haloMassFunctionFofBias`` --------------------------- The halo mass function is computed by modifying another halo mass function to mimic systematic errors arising in the friends-of-friends halo finding algorithm. Specifically, a systematic shift in mass motivated by the results of percolation theory :cite:t:`more_overdensity_2011` is applied. In particular, :math:`M_\mathrm{particle}=`\ ``[massParticle]`` is the mass of the particle in the simulation to which the friends-of-friends algorithm was applied. **Parameters** * ``[massParticle]`` — Parameter :math:`M_\mathrm{particle}` appearing in model for friends-of-friends errors in the halo mass function. * ``[massInfiniteToMassSharpEdge]`` (default ``0.98d0``) — The ratio of the friends-of-friends mass in the limit of infinite number of particles to the mass of the halo enclosed within a sharp-edged sphere bounding an isodensity surface equal to the critical density for percolation. * ``[linkingLength]`` — The linking length (in physical Mpc) used in the friends-of-friends algorithm. * ``[linkingLengthIsComoving]`` — Specifies whether or not the given linking length is in comoving units. .. _physics-haloMassFunctionMultiplier: ``haloMassFunctionMultiplier`` ------------------------------ The halo mass function is computed by multiplying another halo mass function by a constant factor. **Parameters** * ``[multiplier]`` (default ``0.0d0``) — A constant multiplicative factor applied to cooling rates computed by the wrapped cooling rate object, allowing uniform rescaling of all cooling rates (e.g. to model suppressed or enhanced cooling). * ``[multiplier]`` — The factor by which to multiply the halo mass function. * ``[exponentRedshift]`` — The exponent of :math:`(1+z)` in the multiplier of the halo mass function. .. _physics-haloMassFunctionOndaroMallea2021: ``haloMassFunctionOndaroMallea2021`` ------------------------------------ The dark matter halo mass function class of :cite:t:`ondaro-mallea_non-universality_2022` for non-universal primordial power spectra and structure growth rates. The mass function is given by .. math:: n(M) = n^\prime(M) f_2(n_\mathrm{eff}) f_3(\alpha_\mathrm{eff}), where :math:`n^\prime(M)` is some other mass function, .. math:: f_2(n_\mathrm{eff})=n_0 n_\mathrm{eff}^2 + n_1 n_\mathrm{eff} + n_0, and .. math:: f_3(\alpha_\mathrm{eff})=a_0 \alpha_\mathrm{eff}^2 + a_1. Here .. math:: n_\mathrm{eff} = -3 -2 \frac{\mathrm{d} \log \sigma(R)}{\mathrm{d} \log R} = -3 -6 \frac{\mathrm{d} \log \sigma(M)}{\mathrm{d} \log M}, where :math:`M` is halo mass, and :math:`\sigma(M)` is the fractional root-variance in the linear theory cosmological density field on that scale, and .. math:: \alpha_\mathrm{eff}(a) = \left. \frac{\mathrm{d} \log D}{\mathrm{d} \log a}\right|_{a=a_\mathrm{ev}}, where :math:`D(a)` is the linear growth factor, :math:`a` is the expansion factor, and :math:`D(a_\mathrm{ev})=\gamma D(a)` with :math:`\gamma=4/5`. **Parameters** * ``[coefficientsN]`` (default ``[-0.1178d0,-0.3389d0,0.3022d0]``) — The coefficients, :math:`n_{0\ldots2}`, appearing in equation (7) of the :cite:t:`ondaro-mallea_non-universality_2022` halo mass function model. * ``[coefficientsA]`` (default ``[-1.0785d0,2.9700d0]``) — The coefficients, :math:`a_{0\ldots1}`, appearing in equation (8) of the :cite:t:`ondaro-mallea_non-universality_2022` halo mass function model. .. _physics-haloMassFunctionPressSchechter: ``haloMassFunctionPressSchechter`` ---------------------------------- A dark matter halo mass function class using the function given by :cite:t:`press_formation_1974`. Specifically, .. math:: n(M,t) = 2 {\Omega_\mathrm{M} \rho_\mathrm{crit} \over M^2} \alpha \sigma^2(M) f[S(M,t)], where :math:`\alpha = \mathrm{d}\ln\sigma/\mathrm{d}\ln M` and :math:`f[S]` is the excursion set barrier first crossing distribution for variance :math:`S(M)=\sigma^2(M)`, computed using the selected :galacticus-class:`excursionSetFirstCrossingClass`. .. _physics-haloMassFunctionPseudoHalos: ``haloMassFunctionPseudoHalos`` ------------------------------- The halo mass function is computed by adding a population of pseudo-halos to another halo mass function. **Parameters** * ``[massZeroPointReference]`` — The mass zero-point reference :math:`M^\prime_0` in the relation :math:`M_0(m_\mathrm{p}) = M^\prime_0 (m_\mathrm{p}/m^\prime_\mathrm{p})^\gamma`. * ``[massParticleReference]`` — The particle mass reference :math:`m^\prime_\mathrm{p}` in the relation :math:`M_0(m_\mathrm{p}) = M^\prime_0 (m_\mathrm{p}/m^\prime_\mathrm{p})^\gamma`. * ``[massParticle]`` — The particle mass :math:`m_\mathrm{p}` in the relation :math:`M_0(m_\mathrm{p}) = M^\prime_0 (m_\mathrm{p}/m^\prime_\mathrm{p})^\gamma`. * ``[countParticleMinimum]`` — The minimum number of particles in a detectable halo. * ``[exponentMassParticle]`` — The exponent :math:`\gamma` in the relation :math:`M_0(m_\mathrm{p}) = M^\prime_0 (m_\mathrm{p}/m^\prime_\mathrm{p})^\gamma`. * ``[exponentNormalization]`` — The exponent :math:`\xi` in the relation :math:`n(M) = n_0 [M^\prime_0/M_0(m_\mathrm{p})]^\xi [M/M_0(m_\mathrm{p})])^\alpha (1+z)^\beta (1+\delta_\mathrm{c})^\mu`. * ``[normalization]`` — The normalization :math:`n_0` in the pseudo-halo mass function :math:`n(M) = n_0 [M^\prime_0/M_0(m_\mathrm{p})]^\xi [M^\prime_0/M_0(m_\mathrm{p})]^\xi [M/M_0(m_\mathrm{p})])^\alpha (1+z)^\beta (1+\delta_\mathrm{c})^\mu`. * ``[exponentMass]`` — The exponent :math:`\alpha` in the pseudo-halo mass function :math:`n(M) = n_0 [M^\prime_0/M_0(m_\mathrm{p})]^\xi [M/M_0(m_\mathrm{p})])^\alpha (1+z)^\beta (1+\delta_\mathrm{c})^\mu`. * ``[exponentRedshift]`` — The exponent :math:`\beta` in the pseudo-halo mass function :math:`n(M) = n_0 [M^\prime_0/M_0(m_\mathrm{p})]^\xi [M/M_0(m_\mathrm{p})])^\alpha (1+z)^\beta (1+\delta_\mathrm{c})^\mu`. * ``[exponentOverdensity]`` — The exponent :math:`\mu` in the pseudo-halo mass function :math:`n(M) = n_0 [M/M_0(m_\mathrm{p})])^\alpha (1+z)^\beta (1+\delta_\mathrm{c})^\mu`. .. _physics-haloMassFunctionReed2007: ``haloMassFunctionReed2007`` ---------------------------- The halo mass function is computed from the function given by :cite:t:`reed_halo_2007`. .. _physics-haloMassFunctionRodriguezPuebla2016: ``haloMassFunctionRodriguezPuebla2016`` --------------------------------------- The halo mass function is computed from the function given by :cite:t:`tinker_towardhalo_2008`, and using the fits of :cite:t:`rodriguez-puebla_halo_2016` for the parameter values. .. _physics-haloMassFunctionShethTormen: ``haloMassFunctionShethTormen`` ------------------------------- The dark matter halo mass function is computed using the ellipsoidal collapse fitting function of :cite:t:`sheth_ellipsoidal_2001`, which improves upon the Press-Schechter formalism by accounting for non-spherical collapse. The shape parameters :math:`a`, :math:`p` and normalization :math:`A` of the fit can each be specified via input parameters. **Methods** * ``a`` — Return the parameter :math:`a` in the :cite:t:`sheth_ellipsoidal_2001` halo mass function fit. * ``p`` — Return the parameter :math:`p` in the :cite:t:`sheth_ellipsoidal_2001` halo mass function fit. * ``normalization`` — Return the parameter :math:`A` in the :cite:t:`sheth_ellipsoidal_2001` halo mass function fit. **Parameters** * ``[a]`` (default ``0.707d0``) — The parameter :math:`a` in the :cite:t:`sheth_ellipsoidal_2001` halo mass function fit. * ``[p]`` (default ``0.3d0``) — The parameter :math:`p` in the :cite:t:`sheth_ellipsoidal_2001` halo mass function fit. * ``[normalization]`` (default ``0.3221836349d0``) — The normalization parameter :math:`A` in the :cite:t:`sheth_ellipsoidal_2001` halo mass function fit. .. _physics-haloMassFunctionSimpleSystematic: ``haloMassFunctionSimpleSystematic`` ------------------------------------ A halo mass function class in which the mass function is computed by modifying another halo mass function (specified as a subparameter) using a simple model for systematic errors as follows: .. math:: {\mathrm{d} n\over \mathrm{d}M}(M) \rightarrow {\mathrm{d} n\over \mathrm{d}M}(M) \left( 1 + \alpha + \beta \log_{10}\left[ {M \over 10^{12}\mathrm{M}_\odot} \right] \right) where :math:`\alpha=`\ ``[alpha]``, and :math:`\beta=`\ ``[beta]``. **Parameters** * ``[alpha]`` (default ``0.0d0``) — Parameter :math:`\alpha` appearing in model for simple systematic shift in the halo mass function. * ``[beta]`` (default ``0.0d0``) — Parameter :math:`\beta` appearing in model for simple systematic shift in the halo mass function. .. _physics-haloMassFunctionSimulationVariance: ``haloMassFunctionSimulationVariance`` -------------------------------------- The halo mass function is computed by modifying another mass function to account for cosmic variance in a simulation cube. **Parameters** * ``[lengthSimulationCube]`` — The length of the simulation cube from which the target mass function was derived. * ``[perturbationFractional]`` — The fractional perturbation (in units of the simulation cube root-variance) to apply. .. _physics-haloMassFunctionTinker2008: ``haloMassFunctionTinker2008`` ------------------------------ A dark matter halo mass function class using the function given by :cite:t:`tinker_towardhalo_2008`, and using their fits for the parameter values at the appropriate virial density contrast. **(Default implementation)** **Methods** * ``parametersEvaluate`` — Evaluate hyper-parameters needed for the fitting function. .. _physics-haloMassFunctionTinker2008Form: ``haloMassFunctionTinker2008Form`` ---------------------------------- The halo mass function is computed from the function given by :cite:t:`tinker_towardhalo_2008`. **Methods** * ``a`` — Return the parameter :math:`a` in the :cite:t:`tinker_towardhalo_2008` halo mass function fit. * ``b`` — Return the parameter :math:`b` in the :cite:t:`tinker_towardhalo_2008` halo mass function fit. * ``c`` — Return the parameter :math:`c` in the :cite:t:`tinker_towardhalo_2008` halo mass function fit. * ``normalization`` — Return the parameter :math:`A` in the :cite:t:`tinker_towardhalo_2008` halo mass function fit. .. _physics-haloMassFunctionTinker2008Generic: ``haloMassFunctionTinker2008Generic`` ------------------------------------- The dark matter halo mass function is computed using the empirical fitting function of :cite:t:`tinker_towardhalo_2008`, calibrated against N-body simulations over a wide range of halo masses and redshifts. The normalization :math:`A` and shape parameters :math:`a`, :math:`b`, :math:`c` of the fit can each be specified directly via input parameters. **Parameters** * ``[normalization]`` (default ``0.150d0``) — The normalization parameter, :math:`A`, for the :cite:t:`tinker_towardhalo_2008` halo mass function. * ``[a]`` (default ``1.36d0``) — The parameter :math:`a` for the :cite:t:`tinker_towardhalo_2008` halo mass function. * ``[b]`` (default ``2.54d0``) — The parameter :math:`b` for the :cite:t:`tinker_towardhalo_2008` halo mass function. * ``[c]`` (default ``1.14d0``) — The parameter :math:`c` for the :cite:t:`tinker_towardhalo_2008` halo mass function.