CosmoBolognaLib
Free Software C++/Python libraries for cosmological calculations
ModelFunction_ThreePointCorrelation_comoving_reduced.cpp
Go to the documentation of this file.
1 /*******************************************************************
2  * Copyright (C) 2017 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 
39 
40 using namespace std;
41 
42 using namespace cbl;
43 
44 
45 // ============================================================================================
46 
47 
48 std::vector<double> cbl::modelling::threept::Q_nonlinear_localbias (const std::vector<double> theta, const std::shared_ptr<void> inputs, std::vector<double> &parameter)
49 {
50  (void)theta;
51 
52  // structure contaning the required input data
53  shared_ptr<STR_data_model_threept> pp = static_pointer_cast<STR_data_model_threept>(inputs);
54 
55  // input likelihood parameters
56 
57  // bias
58  double bias1 = parameter[0];
59  double bias2 = parameter[1];
60 
61  vector<double> Q_nl_lb(pp->Q_DM.size());
62  for (size_t i=0; i<Q_nl_lb.size(); ++i)
63  Q_nl_lb[i] = 1./bias1*(pp->Q_DM[i]+bias2/bias1);
64 
65  return Q_nl_lb;
66 }
67 
68 
69 // ============================================================================================
70 
71 std::vector<double> cbl::modelling::threept::Q_nonlinear_nonlocalbias (const std::vector<double> theta, const std::shared_ptr<void> inputs, std::vector<double> &parameter)
72 {
73  (void)theta;
74 
75  // structure contaning the required input data
76  shared_ptr<STR_data_model_threept> pp = static_pointer_cast<STR_data_model_threept>(inputs);
77 
78  // input likelihood parameters
79 
80  // bias
81  double bias1 = parameter[0];
82  double bias2 = parameter[1];
83  double g2 = parameter[2];
84 
85  vector<double> Q_nl_nlb(pp->theta.size());
86  Q_nl_nlb = pp->cosmology->Q_halo (pp->r1, pp->r2, pp->theta, bias1, bias2, g2, pp->model, pp->kk, pp->Pk_matter);
87 
88  return Q_nl_nlb;
89 }
90 
91 
92 // ============================================================================================
93 
94 
95 std::vector<double> cbl::modelling::threept::Q_nonlinear_nonlocalbias_alpha (const std::vector<double> theta, const std::shared_ptr<void> inputs, std::vector<double> &parameter)
96 {
97  (void)theta;
98 
99  // structure contaning the required input data
100  shared_ptr<STR_data_model_threept> pp = static_pointer_cast<STR_data_model_threept>(inputs);
101 
102  // input likelihood parameters
103 
104  // bias
105  double bias1 = parameter[0];
106  double bias2 = parameter[1];
107  double g2 = parameter[2];
108  double alpha = parameter[3];
109 
110  vector<double> Q_nl_nlb_alpha(pp->theta.size());
111 
112  Q_nl_nlb_alpha = pp->cosmology->Q_halo (pp->r1*alpha, pp->r2*alpha, pp->theta, bias1, bias2, g2, pp->model, pp->kk, pp->Pk_matter);
113 
114  return Q_nl_nlb_alpha;
115 }
Functions to model the reduced three-point correlation function in comoving coordinates.
static const double alpha
: the fine-structure constant
Definition: Constants.h:233
std::vector< double > Q_nonlinear_localbias(const std::vector< double > theta, const std::shared_ptr< void > inputs, std::vector< double > &parameter)
model for the reduced three-point correlation function
std::vector< double > Q_nonlinear_nonlocalbias(const std::vector< double > theta, const std::shared_ptr< void > inputs, std::vector< double > &parameter)
model for the reduced three-point correlation function with non-local contributions
std::vector< double > Q_nonlinear_nonlocalbias_alpha(const std::vector< double > theta, const std::shared_ptr< void > inputs, std::vector< double > &parameter)
model for the reduced three-point correlation function with non-local contributions with alpha shift ...
The global namespace of the CosmoBolognaLib
Definition: CAMB.h:38