CosmoBolognaLib
Free Software C++/Python libraries for cosmological calculations
Modelling_MassObservableRelation.h
Go to the documentation of this file.
1 /********************************************************************
2  * Copyright (C) 2021 by Federico Marulli and Giorgio Lesci *
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 
34 #ifndef __MODELLINGMORELATION__
35 #define __MODELLINGMORELATION__
36 
37 #include "Cosmology.h"
38 #include "Measure.h"
39 #include "Modelling.h"
40 
41 
42 // ===================================================================================================
43 
44 
45 namespace cbl {
46 
47  namespace modelling {
48 
56  namespace massobsrel {
57 
66 
68  std::shared_ptr<cosmology::Cosmology> cosmology;
69 
71  std::vector<cosmology::CosmologicalParameter> Cpar;
72 
74  std::function<double(const double, const double, const std::shared_ptr<void>)> fz;
75 
77  std::function<double(const double, const double)> z_error;
78 
80  std::function<double(const double, const double)> proxy_error;
81 
83  std::vector<double> redshift;
84 
87 
89  double proxy_pivot;
90 
92  double mass_pivot;
93 
95  double log_base;
96 
98  std::vector<double> z_eff_err;
99 
101  std::vector<double> proxy_eff_err;
102 
104  std::vector<double> Nclusters;
105 
107  std::vector<std::vector<double>> edges_proxy;
108 
110  std::vector<double> edges_z;
111 
113  std::string method_Pk;
114 
116  double k_min;
117 
119  double k_max;
120 
122  int step;
123 
125  std::vector<double> kk;
126 
128  int norm;
129 
132 
134  std::string output_root;
135 
137  std::string file_par;
138 
140  double prec;
141 
143  double Delta;
144 
147 
149  std::string model_MF;
150 
152  std::vector<double> Mass_vector;
153 
155  double area_rad;
156 
159 
164  };
165 
180 
181  protected:
182 
185 
187  bool m_isSet_Nclusters = false;
188 
189  public:
190 
195 
201 
207  Modelling_MassObservableRelation (const std::shared_ptr<cbl::data::Data> dataset)
208  { m_data = dataset; }
209 
214  virtual ~Modelling_MassObservableRelation () = default;
215 
217 
222 
229 
231 
232 
237 
244  void set_mass_pivot (const double mass_pivot) { m_data_model.mass_pivot = mass_pivot; }
245 
266  void set_data_model (const cbl::cosmology::Cosmology cosmology, const std::vector<double> redshift, const double redshift_pivot, const double proxy_pivot, const double log_base);
267 
307  void set_data_model (const cbl::cosmology::Cosmology cosmology, const std::vector<double> redshift, const double redshift_pivot, const double proxy_pivot, const double log_base, const std::vector<double> Nclusters);
308 
385  void set_model_MassObservableRelation_cosmology (const std::string z_evo, const std::vector<cbl::cosmology::CosmologicalParameter> cosmo_param, const std::vector<statistics::PriorDistribution> cosmo_prior, const statistics::PriorDistribution alpha_prior, const statistics::PriorDistribution beta_prior, const statistics::PriorDistribution gamma_prior, const statistics::PriorDistribution scatter0_prior, const statistics::PriorDistribution scatterM_prior, const statistics::PriorDistribution scatterM_exponent_prior, const statistics::PriorDistribution scatterz_prior, const statistics::PriorDistribution scatterz_exponent_prior);
386 
388  };
389 
390 
407  double scaling_relation(const double alpha, const double beta, const double gamma, const double div_proxy, const double f_z);
408 
422  std::vector<double> model_scaling_relation (const std::vector<double> proxy, const std::shared_ptr<void> inputs, std::vector<double> &parameter);
423 
437  std::vector<double> model_scaling_relation_int (const std::vector<double> proxy, const std::shared_ptr<void> inputs, std::vector<double> &parameter);
438 
439  }
440  }
441 }
442 
443 #endif
The class Cosmology.
The class Measure.
The class Modelling.
The class Cosmology.
Definition: Cosmology.h:277
The class Modelling.
Definition: Modelling.h:64
std::shared_ptr< data::Data > m_data
input data to be modelled
Definition: Modelling.h:69
Modelling_MassObservableRelation(const std::shared_ptr< cbl::data::Data > dataset)
constuctor for the modelling of the cluster mass - mass proxy relation. Cosmological units are forced
bool m_isSet_Nclusters
check if the number of clusters in the bin is set
STR_MOrelation_data_model data_model()
get the member m_data_model
virtual ~Modelling_MassObservableRelation()=default
default destructor
STR_MOrelation_data_model m_data_model
the container of parameters for the model computation
void set_data_model(const cbl::cosmology::Cosmology cosmology, const std::vector< double > redshift, const double redshift_pivot, const double proxy_pivot, const double log_base)
Set the data used to construct the scaling relation, written as:
Modelling_MassObservableRelation()=default
default constuctor _MassObservableRelation
void set_model_MassObservableRelation_cosmology(const std::string z_evo, const std::vector< cbl::cosmology::CosmologicalParameter > cosmo_param, const std::vector< statistics::PriorDistribution > cosmo_prior, const statistics::PriorDistribution alpha_prior, const statistics::PriorDistribution beta_prior, const statistics::PriorDistribution gamma_prior, const statistics::PriorDistribution scatter0_prior, const statistics::PriorDistribution scatterM_prior, const statistics::PriorDistribution scatterM_exponent_prior, const statistics::PriorDistribution scatterz_prior, const statistics::PriorDistribution scatterz_exponent_prior)
Set the scaling relation and cosmological parameters, where the scaling relation is written as.
The class PriorDistribution.
static const double alpha
: the fine-structure constant
Definition: Constants.h:233
std::vector< double > model_scaling_relation(const std::vector< double > proxy, const std::shared_ptr< void > inputs, std::vector< double > &parameter)
set the cluster scaling relation model
double scaling_relation(const double alpha, const double beta, const double gamma, const double div_proxy, const double f_z)
compute the mass - mass proxy scaling relation
std::vector< double > model_scaling_relation_int(const std::vector< double > proxy, const std::shared_ptr< void > inputs, std::vector< double > &parameter)
set the cluster scaling relation model
The global namespace of the CosmoBolognaLib
Definition: CAMB.h:38
std::vector< cosmology::CosmologicalParameter > Cpar
Cosmological parameters.
std::function< double(const double, const double)> proxy_error
function returning the mass proxy error (absolute or relative)
std::vector< double > z_eff_err
Vector of redshift error values.
std::string model_MF
author(s) who proposed the mass function
bool store_output
true the output files created by the Boltzmann solver are stored; false the output files are remove...
double k_min
minimum wave vector module up to which the power spectrum is computed
int step
number of steps used to compute the binned dark matter correlation function
int norm
0 → don't normalize the power spectrum; 1 → normalize the power spectrum
bool is_sigma8_free
true → sigma8 is a free parameter; false → sigma8 can be considered a derived parameter
std::function< double(const double, const double)> z_error
function returning the redshift error (absolute or relative)
std::vector< double > Nclusters
Vector of number of clusters in the stacked bin.
std::vector< double > redshift
Array of redshift values where the scaling relation is evaluated.
std::vector< std::vector< double > > edges_proxy
the mass proxy bin edges
std::vector< double > proxy_eff_err
Vector of proxy error values.
double k_max
maximum wave vector module up to which the power spectrum is computed
std::string output_root
output root of the parameter file used to compute the dark matter power spectrum
STR_MOrelation_data_model()=default
default constructor
std::shared_ptr< cosmology::Cosmology > cosmology
Fiducial cosmology.
std::vector< double > kk
vector of wave vector modules
std::function< double(const double, const double, const std::shared_ptr< void >)> fz
the redshift evolution function in the scaling relation
std::string method_Pk
method to compute the dark matter power spectrum