45 cbl::cosmology::HaloProfile::HaloProfile (
const cbl::cosmology::Cosmology cosmology,
const double redshift,
const double conc,
const double Mass,
const double Delta,
const std::string profile_author,
const std::string halo_def,
const double trunc_fact,
const bool miscentering,
const bool single_profile,
const double sigma_off,
const double f_off)
47 m_set_profile(cosmology, redshift, conc,
Mass, Delta, profile_author, halo_def, trunc_fact, miscentering, single_profile, sigma_off, f_off);
54 cbl::cosmology::HaloProfile::HaloProfile (
const cbl::cosmology::Cosmology cosmology,
const double redshift,
const std::string cM_author,
const double Mass,
const double Delta,
const std::string profile_author,
const std::string halo_def,
const double trunc_fact,
const bool miscentering,
const bool single_profile,
const double sigma_off,
const double f_off)
56 m_set_profile(cosmology, redshift, 0.,
Mass, Delta, profile_author, halo_def, trunc_fact, miscentering, single_profile, sigma_off, f_off);
57 m_set_cM_relation(cM_author);
66 const double fact = (m_cosmology->unit()) ? 1 : m_cosmology->hh();
67 const double Mpivot = 2.e12/fact;
69 return m_A*pow(m_mass/Mpivot, m_B)*pow(1.+m_redshift, m_C);
79 const double conc = (this->*m_return_concentration)();
80 const double rho_s = pow(conc, 3) * m_cosmology->rho_crit(m_redshift)*m_Delta_func(m_Delta,*m_cosmology,m_redshift) / (3.*(log(1.+conc)-conc/(1.+conc)));
92 const double conc = (this->*m_return_concentration)();
93 const double overdensity = m_cosmology->rho_crit(m_redshift)*m_Delta_func(m_Delta,*m_cosmology,m_redshift);
94 const double r_s = pow( 3.*m_mass/(4.*
cbl::par::pi*overdensity), 1./3. ) / conc;
95 const double r_t = m_trunc_fact * r_s*conc;
96 const double tau = r_t/r_s;
97 const double fact = tau*tau / (2.*pow(tau*tau+1.,3)*(1.+conc)*(tau*tau+conc*conc)) * (conc*(tau*tau+1.) * (conc*(conc+1.) - tau*tau*(conc-1.)*(2.+3.*conc) - 2.*pow(tau,4)) + tau*(conc+1.)*(tau*tau+conc*conc) * (2.*(3.*tau*tau-1.) * std::atan(conc/tau) + tau*(tau*tau-3.)*log(tau*tau*(1.+conc)*(1.+conc)/(tau*tau+conc*conc))));
99 const double rho_s = pow(conc, 3) * m_cosmology->rho_crit(m_redshift)*m_Delta_func(m_Delta,*m_cosmology,m_redshift) / (3.*fact);
111 const double conc = (this->*m_return_concentration)();
112 const double overdensity = m_cosmology->rho_crit(m_redshift)*m_Delta_func(m_Delta,*m_cosmology,m_redshift);
113 const double r_s = pow( 3.*m_mass/(4.*
cbl::par::pi*overdensity), 1./3. ) / conc;
114 const double rho_s = m_rho_s_NFW();
117 std::vector<double> rho(rad.size());
118 for (
size_t i=0; i<rad.size(); i++)
119 rho[i] = rho_s/((rad[i]/r_s)*pow(1.+rad[i]/r_s, 2));
131 const double conc = (this->*m_return_concentration)();
132 const double overdensity = m_cosmology->rho_crit(m_redshift)*m_Delta_func(m_Delta,*m_cosmology,m_redshift);
133 const double r_s = pow( 3.*m_mass/(4.*
cbl::par::pi*overdensity), 1./3. ) / conc;
134 const double r_t = m_trunc_fact * r_s*conc;
135 const double rho_s = m_rho_s_NFW_trunc();
138 std::vector<double> rho(rad.size());
139 for (
size_t i=0; i<rad.size(); i++)
140 rho[i] = rho_s/((rad[i]/r_s)*pow(1.+rad[i]/r_s, 2)) * pow(r_t*r_t/(rad[i]*rad[i]+r_t*r_t),2);
152 std::function<double(
double)> F = [] (
double x) {
154 return (1 - std::acosh(1./x)/std::sqrt(1.-x*x)) / (x*x-1.);
158 return (1 - std::acos(1./x)/std::sqrt(x*x-1.)) / (x*x-1.);
162 const double conc = (this->*m_return_concentration)();
163 const double overdensity = m_cosmology->rho_crit(m_redshift)*m_Delta_func(m_Delta,*m_cosmology,m_redshift);
164 const double r_s = pow( 3.*m_mass/(4.*
cbl::par::pi*overdensity), 1./3. ) / conc;
165 const double rho_s = m_rho_s_NFW();
167 std::vector<double>
Sigma(rad.size());
168 for (
size_t i=0; i<rad.size(); i++)
169 Sigma[i] = 2. * rho_s * r_s * F(rad[i]/r_s) * 1.e-12;
181 std::function<double(
double)> G = [] (
double x) {
183 return log(x/2.) + std::acosh(1./x) / sqrt(1.-x*x);
187 return log(x/2.) + std::acos(1./x) / sqrt(x*x-1.);;
191 const double conc = (this->*m_return_concentration)();
192 const double overdensity = m_cosmology->rho_crit(m_redshift)*m_Delta_func(m_Delta,*m_cosmology,m_redshift);
193 const double r_s = pow( 3.*m_mass/(4.*
cbl::par::pi*overdensity), 1./3. ) / conc;
194 const double rho_s = m_rho_s_NFW();
196 std::vector<double> Sigma_mean(rad.size());
197 for (
size_t i=0; i<rad.size(); i++) {
198 double x = rad[i]/r_s;
199 Sigma_mean[i] = 4. * rho_s * r_s * G(x)/x/x * 1.e-12;
212 const double conc = (this->*m_return_concentration)();
214 const double overdensity = m_cosmology->rho_crit(m_redshift)*m_Delta_func(m_Delta,*m_cosmology,m_redshift);
215 const double r_s = pow( 3.*m_mass/(4.*
cbl::par::pi*overdensity), 1./3. ) / conc;
216 const double r_t = m_trunc_fact * r_s*conc;
217 const double tau = r_t/r_s;
218 const double rho_s = m_rho_s_NFW_trunc();
220 std::function<double(
double)> F = [] (
double x){
222 return std::acosh(1./x) / std::sqrt(1.-x*x);
226 return std::acos(1./x) / std::sqrt(x*x-1.);
230 std::function<double(
double)> G = [&F] (
double x){
232 return (F(x)-1.) / (1.-x*x);
236 return (1.-F(x)) / (x*x-1.);
240 std::function<double(
double)> L = [&tau] (
double x){
241 return log(x/(sqrt(x*x+tau*tau)+tau));
245 std::vector<double>
Sigma(rad.size());
246 double tausq = tau*tau;
247 double tau4th = tausq*tausq;
249 for (
size_t i=0; i<rad.size(); i++) {
250 double x = rad[i]/r_s;
251 double tausq_xsq = tausq+x*x;
253 double prefact = rho_s*r_s*tau4th/(tausq+1.)/(tausq+1.)/(tausq+1.);
254 double a = 2*(tausq+1.)*G(x);
256 double c = (tau4th-1.)/tausq/tausq_xsq;
257 double d = -
cbl::par::pi*(4*tausq_xsq+tausq+1.)/pow(tausq_xsq,1.5);
258 double e = (tausq*(tau4th-1.)+(tausq_xsq)*(3*tau4th-6*tausq-1))*L(x)/(tau*tau*tau)/pow(tausq_xsq,1.5);
260 Sigma[i] = prefact*(a+b+c+d+e) * 1.e-12;
272 const double conc = (this->*m_return_concentration)();
274 const double overdensity = m_cosmology->rho_crit(m_redshift)*m_Delta_func(m_Delta,*m_cosmology,m_redshift);
275 const double r_s = pow( 3.*m_mass/(4.*
cbl::par::pi*overdensity), 1./3. ) / conc;
276 const double r_t = m_trunc_fact * r_s*conc;
277 const double tau = r_t/r_s;
278 const double rho_s = m_rho_s_NFW_trunc();
280 std::function<double(
double)> F = [] (
double x) {
282 return std::acosh(1./x) / std::sqrt(1.-x*x);
286 return std::acos(1./x) / std::sqrt(x*x-1.);
289 std::function<double(
double)> L = [&tau] (
double x) {
290 return log(x/(sqrt(x*x+tau*tau)+tau));
294 std::vector<double> Sigma_mean(rad.size());
295 double tausq = tau*tau;
296 double tau4th = tausq*tausq;
298 for (
size_t i=0; i<rad.size(); i++) {
299 double x = rad[i]/r_s;
300 double tausq_xsq = tausq+x*x;
302 double prefact = 2. *
cbl::par::pi * rho_s * pow(r_s,3);
303 double term1 = tau4th / (tausq+1.) / (tausq+1.) / (tausq+1.);
304 double term2 = 2. * (tausq + 1. + 4.*(x*x-1.)) * F(x);
305 double term3 = (
cbl::par::pi * (3.*tausq-1.) + 2. * tau * (tausq-3.) * log(tau)) / tau;
306 double term4 = tausq * tau * sqrt(tausq_xsq);
307 double term5 = - tausq * tau *
cbl::par::pi * (4. * tausq_xsq - tausq - 1.);
308 double term6 = - tausq * (tau4th - 1.) + tausq_xsq * (3. * tau4th - 6. * tausq - 1.);
310 double M_proj = prefact * term1 * (term2 + term3 + (term5 + term6 * L(x)) / term4);
312 Sigma_mean[i] = M_proj / (
cbl::par::pi * rad[i]*rad[i]) * 1.e-12;
326 double dummy_R_s, dummy_R;
328 std::function<double(
double)> integrand = [&] (
double theta) {
329 double new_rad2 = dummy_R*dummy_R + dummy_R_s*dummy_R_s + 2*dummy_R*dummy_R_s*std::cos(theta);
330 return (this->*m_Sigma_cen_ptr)({std::sqrt(new_rad2)})[0];
334 double r=0, a_meantau=0, b_meantau=0, inv_mis_scale = 1./m_sigma_off/m_sigma_off;
335 std::function<double(
double)> tau_factor1 = [&a_meantau,&b_meantau,&inv_mis_scale] (
double s) {
336 return (exp(-0.5*(s*s+a_meantau)*inv_mis_scale))/sqrt(b_meantau-a_meantau-s*s);
339 std::function<double(
double)> tau_factor2 = [&a_meantau,&b_meantau,&inv_mis_scale] (
double s){
340 return (exp(-0.5*(b_meantau-s*s)*inv_mis_scale))/sqrt(b_meantau-a_meantau-s*s);
343 std::function<double(
double)> sigma_off_int = [&] (
double tau) {
344 a_meantau = (tau-r)*(tau-r);
345 b_meantau = (tau+r)*(tau+r);
346 double c_meantau = (a_meantau+b_meantau)*0.5;
347 double upper_limit = std::min(sqrt(c_meantau-a_meantau),sqrt(25*m_sigma_off*m_sigma_off-a_meantau));
349 if (c_meantau < 25*m_sigma_off*m_sigma_off)
351 double int_left = std::max(0.,sqrt(b_meantau-25*m_sigma_off*m_sigma_off));
352 double int_right = sqrt(b_meantau-c_meantau);
355 return sigma_off_int * tau * (this->*m_Sigma_cen_ptr)({tau})[0];
359 std::vector<double> Sigma_mis(rad.size());
361 if (m_single_profile) {
363 dummy_R_s = m_sigma_off;
365 for (
size_t i=0; i<rad.size(); i++) {
375 for (
size_t i=0; i<rad.size(); i++) {
394 if (m_sigma_off > m_sigma_off_threshold && m_f_off > m_f_off_threshold) {
395 const std::vector<double> Sigma_cen = (this->*m_Sigma_cen_ptr)(rad);
396 const std::vector<double> Sigma_mis = (this->*m_Sigma_mis_ptr)(rad);
398 std::vector<double> Sigma_tot(rad.size());
399 for (
size_t i=0; i<rad.size(); i++)
400 Sigma_tot[i] = (1.-m_f_off)*Sigma_cen[i] + m_f_off*Sigma_mis[i];
405 return (this->*m_Sigma_cen_ptr)(rad);
414 const std::vector<double>
Sigma = (this->*m_Sigma_cen_ptr)(rad);
415 const std::vector<double> Sigma_mean = (this->*m_Sigma_mean_cen_ptr)(rad);
418 std::vector<double> DeltaSigma(rad.size());
419 for (
size_t i=0; i<rad.size(); i++)
420 DeltaSigma[i] = Sigma_mean[i] -
Sigma[i];
431 if (m_sigma_off > m_sigma_off_threshold) {
435 const std::vector<double>
Sigma = (this->*m_Sigma_mis_ptr)(rad_forInterp);
440 std::function<double(
double)> mean_sigma_integrand = [&Sigma_interp] (
double rad){
441 return Sigma_interp(rad) * rad;
444 std::vector<double> Sigma_mean(rad.size());
445 for (
size_t i=0; i<rad.size(); i++)
449 std::vector<double> DeltaSigma(rad.size());
450 for (
size_t i=0; i<rad.size(); i++)
451 DeltaSigma[i] = Sigma_mean[i] - Sigma_interp(rad[i]);
457 return (this->*m_DeltaSigma_cen_ptr)(rad);
466 if (m_sigma_off > m_sigma_off_threshold && m_f_off > m_f_off_threshold) {
467 const std::vector<double> DeltaSigma_cen = (this->*m_DeltaSigma_cen_ptr)(rad);
468 const std::vector<double> DeltaSigma_mis = (this->*m_DeltaSigma_mis_ptr)(rad);
470 std::vector<double> DeltaSigma_tot(rad.size());
471 for (
size_t i=0; i<rad.size(); i++)
472 DeltaSigma_tot[i] = (1.-m_f_off)*DeltaSigma_cen[i] + m_f_off*DeltaSigma_mis[i];
474 return DeltaSigma_tot;
477 return (this->*m_DeltaSigma_cen_ptr)(rad);
486 m_isSet_cM_relation =
true;
488 if (cM_author==
"Duffy") {
489 if (m_redshift>2)
ErrorCBL(
"the concentration-mass relation by Duffy et al. has been tested only at z<2",
"set_cM_relation",
"HaloProfile.cpp");
491 if ( (m_halo_def ==
"critical" && m_Delta != 200.) || (m_halo_def ==
"mean" && 200.*m_cosmology->OmegaM(m_redshift) != m_Delta_func(m_Delta,*m_cosmology,m_redshift)) )
492 ErrorCBL(
"the concentration-mass relation by Duffy et al. has been implemented only for critical/mean overdensity factors equal to 200.",
"set_cM_relation",
"HaloProfile.cpp");
494 if (m_profile_author==
"NFW" || m_profile_author==
"NFW_trunc") {
495 if (m_halo_def==
"critical") {
500 else if (m_halo_def==
"vir") {
505 else if (m_halo_def==
"mean") {
510 else ErrorCBL(
"halo_def not allowed!",
"set_cM_relation",
"HaloProfile.cpp");
512 else if (m_profile_author==
"Einasto") {
513 if (m_halo_def==
"critical") {
518 else if (m_halo_def==
"vir") {
523 else if (m_halo_def==
"mean") {
528 else ErrorCBL(
"halo_def not allowed!",
"set_cM_relation",
"HaloProfile.cpp");
530 else ErrorCBL(
"profile not allowed!",
"set_cM_relation",
"HaloProfile.cpp");
534 else ErrorCBL(
"concentration-mass relation author not allowed!",
"set_cM_relation",
"HaloProfile.cpp");
541 void cbl::cosmology::HaloProfile::m_set_profile (
const cbl::cosmology::Cosmology cosmology,
const double redshift,
const double conc,
const double Mass,
const double Delta,
const std::string profile_author,
const std::string halo_def,
const double trunc_fact,
const bool miscentering,
const bool single_profile,
const double sigma_off,
const double f_off)
543 if (miscentering && single_profile && f_off != 1.)
544 ErrorCBL(
"if a single profile is considered in the miscentering model, then f_off must be set equal to 1.",
"m_set_profile",
"HaloProfile.cpp");
546 m_sigma_off_threshold = 1.e-4;
547 m_f_off_threshold = 1.e-4;
552 m_redshift = redshift;
553 m_concentration = conc;
556 m_profile_author = profile_author;
557 m_halo_def = halo_def;
559 m_trunc_fact = trunc_fact;
560 m_miscentering = miscentering;
561 m_single_profile = single_profile;
562 m_sigma_off = sigma_off;
566 if (halo_def ==
"critical")
568 (void)cosmo; (void)redshift;
570 else if (halo_def ==
"mean")
572 return delta * cosmo.OmegaM(redshift);};
573 else if (halo_def ==
"vir")
576 return cosmo.Delta_c(redshift,
"BryanNorman");};
578 ErrorCBL(
"wrong halo_def declaration!",
"m_set_profile",
"HaloProfile.cpp");
584 if (profile_author ==
"NFW") {
607 else if (profile_author ==
"NFW_trunc") {
631 ErrorCBL(
"density profile author not allowed!",
"m_set_profile",
"HaloProfile.cpp");
649 return (this->*m_rho_s_ptr)();
657 return (this->*m_rho_ptr)(rad);
666 return (this->*m_Sigma_ptr)(rad);
675 if (m_miscentering ==
false)
676 ErrorCBL(
"the miscentering is not set!",
"Sigma_mis",
"HaloProfile.cpp");
678 if (m_sigma_off > m_sigma_off_threshold)
679 return (this->*m_Sigma_mis_ptr)(rad);
681 return (this->*m_Sigma_cen_ptr)(rad);
690 if (m_miscentering ==
false)
691 ErrorCBL(
"the miscentering is not set!",
"Sigma_cen",
"HaloProfile.cpp");
693 return (this->*m_Sigma_cen_ptr)(rad);
703 ErrorCBL(
"model tested only in the range [1.e-2,70] Mpc.",
"Sigma_2h",
"HaloProfile.cpp");
705 double Rho_m = m_cosmology->rho_m(m_redshift);
706 double Dl = m_cosmology->D_A(m_redshift);
711 const double kl_min = 1.e-4;
712 const double kl_max = 1.e2;
716 std::vector<double> Pk = m_cosmology->Pk_matter(kl_forInterp, method_Pk, NL, m_redshift,
false,
"test", -1, 1.e-4, 100.);
720 std::function<double(
double)> Func = [&] (
double l)
725 double kl = l/((1+m_redshift)*Dl);
726 double Pk_ = Pk_interp(kl);
727 double J0 = gsl_sf_bessel_J0(X);
731 std::vector<double> S_2h(rad.size());
732 for (
size_t i=0; i<rad.size(); i++) {
735 S_2h[i] = 1.e-12 *
bias*Rho_m/(2.*
cbl::par::pi*pow(Dl,2)*pow(1+m_redshift,3)) * integral;
747 double delta_bkg = m_Delta_func(m_Delta,*m_cosmology,m_redshift)/m_cosmology->OmegaM(m_redshift);
748 double bias = m_cosmology->bias_halo(m_mass, m_redshift, bias_author, method_Pk,
false,
"test", interp_type, delta_bkg, -1., -1, 0.001, 100);
750 return Sigma_2h (rad,
bias, method_Pk, interp_type, NL);
759 return (this->*m_DeltaSigma_ptr)(rad);
768 if (m_miscentering ==
false)
769 ErrorCBL(
"the miscentering is not set!",
"DeltaSigma_mis",
"HaloProfile.cpp");
771 return (this->*m_DeltaSigma_mis_ptr)(rad);
780 if (m_miscentering ==
false)
781 ErrorCBL(
"the miscentering is not set!",
"DeltaSigma_cen",
"HaloProfile.cpp");
783 return (this->*m_DeltaSigma_cen_ptr)(rad);
793 ErrorCBL(
"model tested only in the range [1.e-2,70] Mpc.",
"DeltaSigma_2h",
"HaloProfile.cpp");
795 double Rho_m = m_cosmology->rho_m(m_redshift);
796 double Dl = m_cosmology->D_A(m_redshift);
801 const double kl_min = 1.e-4;
802 const double kl_max = 1.e2;
806 std::vector<double> Pk = m_cosmology->Pk_matter(kl_forInterp, method_Pk, NL, m_redshift,
false,
"test", -1, 1.e-4, 100.);
810 std::function<double(
double)> Func = [&] (
double l)
815 double kl = l/((1+m_redshift)*Dl);
816 double Pk_ = Pk_interp(kl);
817 double J2 = gsl_sf_bessel_Jn(2,X);
821 std::vector<double> DS_2h(rad.size());
822 for (
size_t i=0; i<rad.size(); i++) {
825 DS_2h[i] = 1.e-12 *
bias*Rho_m/(2.*
cbl::par::pi*pow(Dl,2)*pow(1+m_redshift,3)) * integral;
837 double delta_bkg = m_Delta_func(m_Delta,*m_cosmology,m_redshift)/m_cosmology->OmegaM(m_redshift);
838 double bias = m_cosmology->bias_halo(m_mass, m_redshift, bias_author, method_Pk,
false,
"test", interp_type, delta_bkg, -1., -1, 0.001, 100);
840 return DeltaSigma_2h (rad,
bias, method_Pk, interp_type, NL);
849 const double conc = concentration();
850 const double rho_s = m_cosmology->rho_crit(m_redshift)*m_cosmology->Delta_c(m_redshift)/3.*pow(conc, 3)/(log(1.+conc)-conc/(1.+conc));
851 const double r_s = m_cosmology->r_vir(m_mass, m_redshift)/conc;
852 const double mu = kk*r_s;
854 return 4.*
par::pi*rho_s*pow(r_s, 3)/m_mass*(cos(mu)*(gsl_sf_Ci(mu+mu*conc)-gsl_sf_Ci(mu))+sin(mu)*(gsl_sf_Si(mu+mu*conc)-gsl_sf_Si(mu))-sin(mu*conc)/(mu+mu*conc));
865 vector<double> yyi(nn);
867 for (
int i=0; i<nn; i++)
869 yyi[i] = 200./3.*pow(xxi[i],3.)/(log(1.+xxi[i])-xxi[i]/(1.+xxi[i]))-14.426*pow(Vmax/Rmax/m_cosmology->H0(),2.);
880 auto func = [&] (
const double xx)
882 const double c_in = (is_input_conc) ? conc : conc*xx;
883 const double c_out = (!is_input_conc) ? conc : conc/xx;
884 const double AA = log(1.+c_out)-c_out/(1.+c_out);
885 const double BB = log(1.+c_in)-c_in/(1.+c_in);
886 return fabs(Delta_in/Delta_out*AA*pow(xx, 3)-BB);
893 return Delta_out/Delta_in/pow(Rratio, 3)*
Mass;
std::vector< double > Sigma(const std::vector< double > rad)
the total surface density profile of the halo.
double density_profile_FourierSpace(const double kk)
the Fourier transform of the normalised halo density
std::vector< double > Sigma_cen(const std::vector< double > rad)
the centered contribution to the total surface density profile of the halo.
std::vector< double > m_Sigma_mis(const std::vector< double > rad)
the mis-centered surface density profile of the halo (see e.g. Bellagamba et al. 2019).
std::vector< double > m_DeltaSigma_cen(const std::vector< double > rad)
Excess surface density without the miscentering contribution.
std::vector< double > m_Sigma_mean_NFW_trunc(const std::vector< double > rad)
Mean surface density of the truncated NFW profile.
std::vector< double > m_Sigma_mean_NFW(const std::vector< double > rad)
Mean surface density of the NFW profile.
std::vector< double > Sigma_mis(const std::vector< double > rad)
the miscentering contribution to the total surface density profile of the halo.
std::vector< double > m_Sigma_including_miscentering(const std::vector< double > rad)
Surface density including the miscentering contribution.
HaloProfile()=default
default constructor
std::vector< double > DeltaSigma_2h(const std::vector< double > rad, const std::string bias_author, const std::string method_Pk="EisensteinHu", const std::string interp_type="Linear", const bool NL=false)
the 2-halo contribution to the excess surface density profile of the halo, computed by assuming a hal...
std::vector< double > density_profile_3D(const std::vector< double > rad)
the 3D halo density profile.
double m_return_set_concentration()
Return the concentration set by the user.
double concentration2(const double Vmax, const double Rmax) const
compute the halo concentration
void m_set_cM_relation(const std::string cM_author="Duffy")
set the concentration-mass relation. A function is set, computing the concentration of a dark matter ...
double rho_s()
the characteristic density of the 3D halo density profile.
double m_concentration_Duffy()
The concentration-mass relation by Duffy et al. (2008):
std::vector< double > m_rho_NFW(const std::vector< double > rad)
The NFW 3D density profile.
std::vector< double > DeltaSigma_cen(const std::vector< double > rad)
the centered contribution to the excess surface density profile of the halo.
std::vector< double > m_Sigma_NFW(const std::vector< double > rad)
Surface density of the NFW profile.
std::vector< double > DeltaSigma(const std::vector< double > rad)
the total excess surface density profile of the halo.
std::vector< double > m_DeltaSigma_mis(const std::vector< double > rad)
the mis-centered excess surface density profile of the halo (see e.g. Bellagamba et al....
std::vector< double > m_DeltaSigma_including_miscentering(const std::vector< double > rad)
Excess surface density including the miscentering contribution.
double m_rho_s_NFW()
Characteristic density of the NFW profile.
std::vector< double > m_Sigma_NFW_trunc(const std::vector< double > rad)
Surface density of the truncated NFW profile.
std::vector< double > Sigma_2h(const std::vector< double > rad, const std::string bias_author, const std::string method_Pk="EisensteinHu", const std::string interp_type="Linear", const bool NL=false)
the 2-halo contribution to the total surface density profile of the halo, computed by assuming a halo...
void m_set_profile(const cbl::cosmology::Cosmology cosmology, const double redshift, const double conc, const double Mass, const double Delta, const std::string profile_author, const std::string halo_def, const double trunc_fact=3., const bool miscentering=false, const bool single_profile=false, const double sigma_off=0.1, const double f_off=1.)
private function that sets the halo profile parameters. If the miscentering is considered,...
double m_rho_s_NFW_trunc()
Characteristic density of the truncated NFW profile.
std::vector< double > m_rho_NFW_trunc(const std::vector< double > rad)
The truncated NFW 3D density profile.
void set_cosmology(const cbl::cosmology::Cosmology cosmology)
set the cosmological model
double Mass_Delta(const double Mass, const double Delta_in, const double Delta_out, const double conc, const bool is_input_conc, const double rRmin_guess=1.e-3, const double rRmax_guess=10.) const
The halo mass converted to a different value of , assuming the Navarro-Frenk-White density profile.
std::vector< double > DeltaSigma_mis(const std::vector< double > rad)
the miscentering contribution to the excess surface density profile of the halo.
static const double pi
: the ratio of a circle's circumference to its diameter
double bias(const double Mmin, const double sigmalgM, const double M0, const double M1, const double alpha, const std::shared_ptr< void > inputs)
the mean galaxy bias
double GSL_minimize_1D(FunctionDoubleDouble func, const double start, double min=par::defaultDouble, double max=-par::defaultDouble, const int max_iter=1000, const bool verbose=false)
minimize the provided function using GSL procedure
double GSL_integrate_cquad(gsl_function func, const double a, const double b, const double rel_err=1.e-3, const double abs_err=0, const int nevals=100)
integral, using the gsl cquad method
double GSL_integrate_qag(gsl_function Func, const double a, const double b, const double rel_err=1.e-3, const double abs_err=0, const int limit_size=1000, const int rule=6)
integral, computed using the GSL qag method
The global namespace of the CosmoBolognaLib
T Min(const std::vector< T > vect)
minimum element of a std::vector
T Mass(const T RR, const T Rho)
the mass of a sphere of a given radius and density
std::vector< T > logarithmic_bin_vector(const size_t nn, const T min, const T max)
fill a std::vector with logarithmically spaced values
std::vector< T > linear_bin_vector(const size_t nn, const T min, const T max)
fill a std::vector with linearly spaced values
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
T Max(const std::vector< T > vect)
maximum element of a std::vector
double interpolated(const double _xx, const std::vector< double > xx, const std::vector< double > yy, const std::string type)
1D interpolation
double Sigma(const std::vector< double > vect)
the standard deviation of a std::vector