CosmoBolognaLib
Free Software C++/Python libraries for cosmological calculations
fsigma8.cpp

This example shows how to estimate f*sigma8(z=1)

// ============================================
// Example code: how to estimate f(z)*sigma8(z)
// ============================================
#include "Cosmology.h"
int main () {
try {
// --------------------------------------------------------
// ---------------- set the cosmological model ------------
// ---------------------------------------------------------
// ----------------------------------------------------------------
// ---------------- estimate f*sigma8 at z=1 with CAMB ------------
// ----------------------------------------------------------------
double redshift = 1.;
std::string method = "CAMB";
double fs8 = cosmology.fsigma8(redshift, method);
std::cout << "f*sigma8(z=" << redshift << ") = " << fs8 << std::endl;
cbl::Beep("the linear growth rate times sigma8, at redshift "+cbl::conv(redshift, cbl::par::fDP0)+", is equal to "+cbl::conv(fs8, cbl::par::fDP1));
}
catch(cbl::glob::Exception &exc) { std::cerr << exc.what() << std::endl; exit(1); }
return 0;
}
The class Cosmology.
int main()
main function to create the logo of the CosmoBolognaLib
Definition: Logo.cpp:41
The class Cosmology.
Definition: Cosmology.h:277
The class Exception.
Definition: Exception.h:111
const char * what() const noexcept override
the error description
Definition: Exception.h:203
static const char fDP0[]
conversion symbol for: double -> std::string
Definition: Constants.h:127
static const char fDP1[]
conversion symbol for: double -> std::string
Definition: Constants.h:130
@ _Planck18_
Planck collaboration 2018, Paper VI: Table 2, TT,TE,EE+lowE+lensing.
std::string conv(const T val, const char *fact)
convert a number to a std::string
Definition: Kernel.h:903
void Beep(const std::string beep="beep")
produce a beep
Definition: Kernel.h:791