CosmoBolognaLib
Free Software C++/Python libraries for cosmological calculations
ModelFunction_TwoPointCorrelation2D_cartesian.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 
39 
40 using namespace std;
41 
42 using namespace cbl;
43 
44 
45 // ============================================================================================
46 
47 
48 std::vector<std::vector<double>> cbl::modelling::twopt::xi2D_dispersion (const std::vector<double> rp, const std::vector<double> pi, const std::shared_ptr<void> inputs, std::vector<double> &parameter)
49 {
50  // structure contaning the required input data
51  shared_ptr<STR_data_model> pp = static_pointer_cast<STR_data_model>(inputs);
52 
53 
54  // ----- input parameters -----
55 
56  // f(z)*sigma8(z)
57  double fsigma8 = parameter[0];
58 
59  // bias(z)*sigma8(z)
60  double bsigma8 = parameter[1];
61 
62  // the dispersion in the pairwise random peculiar velocities
63  double sigmav = parameter[2];
64 
65  // AP parameter: D_A,1(z)/D_A,2(z)
66  double AP1 = parameter[3];
67 
68  // AP parameter: H_2(z)/H_1(z)
69  double AP2 = parameter[4];
70 
71 
72  // ----- derived parameters -----
73 
74  // the linear bias
75  double bias = bsigma8/pp->sigma8_z;
76 
77  // the distortion parameter
78  double beta = fsigma8/bsigma8;
79 
80  vector<vector<double>> model(rp.size(), vector<double>(pi.size(), 0.));
81 
82  // return the 2D correlation function in Cartesian coordinates modelled with the dispersion model
83  if (sigmav == 0)
84  for (size_t i=0; i<rp.size(); i++)
85  for (size_t j=0; j<pi.size(); j++)
86  model[i][j] = xi2D_lin_model(AP1*rp[i], AP2*pi[j], beta, bias, pp->func_xi, pp->func_xi_, pp->func_xi__, pp->bias_nl, pp->bA);
87  else
88  for (size_t i=0; i<rp.size(); i++)
89  for (size_t j=0; j<pi.size(); j++)
90  model[i][j] = xi2D_model(AP1*rp[i], AP2*pi[j], beta, bias, sigmav, pp->func_xi, pp->func_xi_, pp->func_xi__, pp->var, pp->FV, pp->bias_nl, pp->bA, pp->v_min, pp->v_max, pp->step_v);
91 
92  return model;
93 }
Functions to model the 2D two-point correlation function in Cartesian coordinates.
static const double pi
: the ratio of a circle's circumference to its diameter
Definition: Constants.h:199
std::vector< std::vector< double > > xi2D_dispersion(const std::vector< double > rp, const std::vector< double > pi, const std::shared_ptr< void > inputs, std::vector< double > &parameter)
model for the 2D two-point correlation function, in Cartesian coordinates
double bias(const double Mmin, const double sigmalgM, const double M0, const double M1, const double alpha, const std::shared_ptr< void > inputs)
the mean galaxy bias
The global namespace of the CosmoBolognaLib
Definition: CAMB.h:38
double xi2D_model(const double rp, const double pi, const double beta, const double bias, const double sigmav, const std::vector< double > rad_real, const std::vector< double > xi_real, const std::vector< double > xi_, const std::vector< double > xi__, const double var, const int FV, int index=-1, const bool bias_nl=0, const double bA=0., const double v_min=-3000., const double v_max=3000., const int step_v=500)
the non-linear dispersion model for ξ(rp,π)
Definition: FuncXi.cpp:574
double xi2D_lin_model(const double beta, const double bias, const double xi_real, const double xi_, const double xi__, const double P_2, const double P_4)
the linear dispersion model for ξ(rp,π)
Definition: FuncXi.cpp:473