CosmoBolognaLib
Free Software C++/Python libraries for cosmological calculations
ModelFunction_NumberCounts1D_Size.cpp
Go to the documentation of this file.
1 /********************************************************************
2  * Copyright (C) 2016 by Federico Marulli and Alfonso Veropalumbo *
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 
37 
38 using namespace std;
39 
40 using namespace cbl;
41 
42 // ===========================================================================================
43 
44 std::vector<double> cbl::modelling::numbercounts::size_function_model (const std::vector<double> radii, const std::shared_ptr<void> inputs, std::vector<double> &parameter)
45 {
46  // structure contaning the required input data
47  shared_ptr<STR_NCSF_data_model> pp = static_pointer_cast<STR_NCSF_data_model>(inputs);
48 
49  // redefine the cosmology
50  cbl::cosmology::Cosmology cosmo = *pp->cosmology;
51 
52  for (size_t i=0; i<pp->Cpar.size(); ++i)
53  cosmo.set_parameter(pp->Cpar[i], parameter[i]);
54 
55  double bias_eff;
56  double bias_slope;
57  double bias_offset;
58  if (parameter.size()==pp->Cpar.size()+3){
59  bias_eff = parameter[parameter.size()-3];
60  bias_slope = parameter[parameter.size()-2];
61  bias_offset = parameter[parameter.size()-1];}
62  else {
63  bias_eff = pp->b_eff;
64  bias_slope = pp->b_slope;
65  bias_offset = pp->b_offset;}
66 
67  return cbl::modelling::numbercounts::size_function(cosmo, radii, pp->redshift, pp->model_SF, bias_eff, bias_slope, bias_offset, pp->deltav_NL, pp->delta_c, pp->method_Pk, pp->store_output, pp->output_root, pp->interpType, pp->k_max, pp->input_file, pp->is_parameter_file);
68 
69 }
70 
71 
72 
Global functions to model number counts.
The class Cosmology.
Definition: Cosmology.h:277
double deltav_NL(const double deltav=-2.71) const
Non-Linear (under)density contrast.
void set_parameter(const CosmologicalParameter parameter, const double value)
set the value of one cosmological paramter
Definition: Cosmology.cpp:424
std::vector< double > size_function(cosmology::Cosmology cosmology, const std::vector< double > radii, const double redshift, const std::string model, const double b_eff, double slope=0.854, double offset=0.420, const double deltav_NL=-0.795, const double del_c=1.69, const std::string method_Pk="Eisensteinhu", const bool store_output=true, const std::string output_root="test", const std::string interpType="Linear", const double k_max=100., const std::string input_file=par::defaultString, const bool is_parameter_file=true)
the void size function
std::vector< double > size_function_model(const std::vector< double > radii, const std::shared_ptr< void > inputs, std::vector< double > &parameter)
compute the size function as a function of the void effective radii
The global namespace of the CosmoBolognaLib
Definition: CAMB.h:38