CosmoBolognaLib
Free Software C++/Python libraries for cosmological calculations
MassFunction_vector.cpp
1 /********************************************************************
2  * Copyright (C) 2010 by Federico Marulli *
3  * federico.marulli3@unibo.it *
4  * *
5  * This program is free software; you can redistribute it and/or *
6  * modify it under the terms of the GNU General Public License as *
7  * published by the Free Software Foundation; either version 2 of *
8  * the License, or (at your option) any later version. *
9  * *
10  * This program is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13  * GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the GNU General Public *
16  * License along with this program; if not, write to the Free *
17  * Software Foundation, Inc., *
18  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19  ********************************************************************/
20 
35 #include "Cosmology.h"
36 
37 using namespace std;
38 
39 using namespace cbl;
40 
41 
42 // =====================================================================================
43 
44 
45 vector<double> cbl::cosmology::Cosmology::mass_function (const std::vector<double> Mass, const std::vector<double> Sigma, const std::vector<double> Dln_Sigma, const double redshift, const std::string model_MF, const bool store_output, const std::string output_root, const double Delta, const std::string interpType, const int norm, const double k_min, const double k_max, const double prec, const std::string method_SS, const std::string input_file, const bool is_parameter_file)
46 {
47  double fact = (m_unit) ? 1 : m_hh;
48  double D_N = DN(redshift);
49 
50  vector<double> MASS(Mass.size(), 0), MF(Mass.size(), 0);
51  for (size_t i=0; i<Mass.size(); i++) {
52  MASS[i] = Mass[i]*fact;
53  MF[i] = m_MF_generator(MASS[i], Sigma[i], Dln_Sigma[i], redshift, D_N, model_MF, Delta)*pow(fact, 4.);
54  }
55 
56  if (m_fNL!=0)
57  for (size_t i=0; i<Mass.size(); i++)
58  MF[i] *= MF_correction(MASS[i], redshift, method_SS, store_output, output_root, interpType, norm, k_min, k_max, prec, input_file, is_parameter_file);
59 
60  return MF;
61 }
The class Cosmology.
double mass_function(const double Mass, const double redshift, const std::string model_MF, const std::string method_SS, const bool store_output=true, const std::string output_root="test", const double Delta=200., const std::string interpType="Linear", const int norm=-1, const double k_min=0.001, const double k_max=100., const double prec=1.e-2, const std::string input_file=par::defaultString, const bool is_parameter_file=true, const bool default_delta=true, const double delta_t=1.686)
the mass function of dark matter haloes (filaments and sheets)
The global namespace of the CosmoBolognaLib
Definition: CAMB.h:38
T Mass(const T RR, const T Rho)
the mass of a sphere of a given radius and density
Definition: Func.h:1243
double Sigma(const std::vector< double > vect)
the standard deviation of a std::vector
Definition: Func.cpp:925