CosmoBolognaLib
Free Software C++/Python libraries for cosmological calculations
Modelling_TwoPointCorrelation2D.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 
38 
39 using namespace std;
40 
41 using namespace cbl;
42 
43 
44 // ============================================================================================
45 
46 
47 cbl::modelling::twopt::Modelling_TwoPointCorrelation2D::Modelling_TwoPointCorrelation2D (const std::shared_ptr<cbl::measure::twopt::TwoPointCorrelation> twop)
48 {
49  m_data = twop->dataset();
50  m_twoPType = twop->twoPType();
51 }
52 
53 
54 // ============================================================================================
55 
56 
58 {
59  m_data = dataset;
60  m_twoPType = twoPType;
61 }
62 
63 
64 // ============================================================================================
65 
66 
67 void cbl::modelling::twopt::Modelling_TwoPointCorrelation2D::set_data_model (const cosmology::Cosmology cosmology, const double redshift, const std::string method_Pk, const double sigmaNL, const bool NL, const int FV, const bool store_output, const std::string output_root, const bool bias_nl, const double bA, const bool xiType, const double k_star, const bool xiNL, const double v_min, const double v_max, const int step_v, const int norm, const double r_min, const double r_max, const double k_min, const double k_max, const int step, const double aa, const bool GSL, const double prec, const std::string file_par)
68 {
69  m_data_model = make_shared<STR_data_model>(STR_data_model());
70 
71  m_data_model->cosmology = make_shared<cosmology::Cosmology>(cosmology);
72  m_data_model->redshift = redshift;
73  m_data_model->method_Pk = method_Pk;
74  m_data_model->sigmaNL = sigmaNL;
75  m_data_model->NL = NL;
76  m_data_model->FV = FV;
77  m_data_model->store_output = store_output;
78  m_data_model->output_root = output_root;
79  m_data_model->bias_nl = bias_nl;
80  m_data_model->bA = bA;
81  m_data_model->xiType = xiType;
82  m_data_model->k_star = k_star;
83  m_data_model->xiNL = xiNL;
84  m_data_model->v_min = v_min;
85  m_data_model->v_max = v_max;
86  m_data_model->step_v = step_v;
87  m_data_model->norm = norm;
88  m_data_model->r_min = r_min;
89  m_data_model->r_max = r_max;
90  m_data_model->k_min = k_min;
91  m_data_model->k_max = k_max;
92  m_data_model->step = step;
93  m_data_model->aa = aa;
94  m_data_model->GSL = GSL;
95  m_data_model->prec = prec;
96  m_data_model->file_par = file_par;
97 
98  if (m_data_model->cosmology->sigma8()>0) {
99  m_data_model->sigma8_z = m_data_model->cosmology->sigma8(m_data_model->redshift);
100  }
101  else {
102  coutCBL << "sigma8 is not set, it will be computed from the power spectrum with " << m_data_model->method_Pk << endl;
103  m_data_model->sigma8_z = m_data_model->cosmology->sigma8_Pk(m_data_model->method_Pk, m_data_model->redshift, m_data_model->store_output, m_data_model->output_root);
104  coutCBL << "--> sigma8(z=" << m_data_model->redshift << ") = " << m_data_model->sigma8_z << endl << endl;
105  }
106  m_data_model->linear_growth_rate_z = m_data_model->cosmology->linear_growth_rate(m_data_model->redshift);
107  m_data_model->var = (1.+ m_data_model->redshift)/m_data_model->cosmology->HH(m_data_model->redshift);
108 }
#define coutCBL
CBL print message.
Definition: Kernel.h:734
The class Modelling_TwoPointCorrelation2D.
The class Cosmology.
Definition: Cosmology.h:277
void set_data_model(const cbl::cosmology::Cosmology cosmology={}, const double redshift=0., const std::string method_Pk="CAMB", const double sigmaNL=0, const bool NL=true, const int FV=0, const bool store_output=true, const std::string output_root="test", const bool bias_nl=false, const double bA=-1., const bool xiType=false, const double k_star=-1., const bool xiNL=false, const double v_min=-5000., const double v_max=5000., const int step_v=500, const int norm=-1, const double r_min=0.1, const double r_max=150., const double k_min=0., const double k_max=100., const int step=200, const double aa=0., const bool GSL=true, const double prec=1.e-2, const std::string file_par=par::defaultString)
set the parameters for the computation of the dark matter two-point correlation function
Modelling_TwoPointCorrelation2D()=default
default constuctor
TwoPType
the two-point correlation function type
The global namespace of the CosmoBolognaLib
Definition: CAMB.h:38