CLASSpp Manual
Cosmology reference and developer manual
Loading...
Searching...
No Matches
transfer.h
Go to the documentation of this file.
1
3#ifndef __TRANSFER__
4#define __TRANSFER__
5
6#include <string>
7#include <vector>
8
9#include "hyperspherical.h"
10#include "nonlinear.h"
11
12/* macro: test if index_tt is in the range between index and index+num, while the flag is true */
13#define _index_tt_in_range_(index, num, flag) \
14 (flag) && (index_tt >= index) && (index_tt < index + num)
15/* macro: test if index_tt corresponds to an integrated nCl/sCl contribution */
16#define _integrated_ncl_ \
17 (_index_tt_in_range_(index_tt_lensing_, ppt->selection_num, ppt->has_cl_lensing_potential)) || \
18 (_index_tt_in_range_(index_tt_nc_lens_, ppt->selection_num, ppt->has_nc_lens)) || \
19 (_index_tt_in_range_(index_tt_nc_g4_, ppt->selection_num, ppt->has_nc_gr)) || \
20 (_index_tt_in_range_(index_tt_nc_g5_, ppt->selection_num, ppt->has_nc_gr))
21/* macro: test if index_tt corresponds to an non-integrated nCl/sCl contribution */
22#define _nonintegrated_ncl_ \
23 (_index_tt_in_range_(index_tt_density_, ppt->selection_num, ppt->has_nc_density)) || \
24 (_index_tt_in_range_(index_tt_rsd_, ppt->selection_num, ppt->has_nc_rsd)) || \
25 (_index_tt_in_range_(index_tt_d0_, ppt->selection_num, ppt->has_nc_rsd)) || \
26 (_index_tt_in_range_(index_tt_d1_, ppt->selection_num, ppt->has_nc_rsd)) || \
27 (_index_tt_in_range_(index_tt_nc_g1_, ppt->selection_num, ppt->has_nc_gr)) || \
28 (_index_tt_in_range_(index_tt_nc_g2_, ppt->selection_num, ppt->has_nc_gr)) || \
29 (_index_tt_in_range_(index_tt_nc_g3_, ppt->selection_num, ppt->has_nc_gr))
30/* macro: bin number associated to particular redshift bin and selection function for non-integrated contributions*/
31#define _get_bin_nonintegrated_ncl_(index_tt) \
32 if (_index_tt_in_range_(index_tt_density_, ppt->selection_num, ppt->has_nc_density)) \
33 bin = index_tt - index_tt_density_; \
34 if (_index_tt_in_range_(index_tt_rsd_, ppt->selection_num, ppt->has_nc_rsd)) \
35 bin = index_tt - index_tt_rsd_; \
36 if (_index_tt_in_range_(index_tt_d0_, ppt->selection_num, ppt->has_nc_rsd)) \
37 bin = index_tt - index_tt_d0_; \
38 if (_index_tt_in_range_(index_tt_d1_, ppt->selection_num, ppt->has_nc_rsd)) \
39 bin = index_tt - index_tt_d1_; \
40 if (_index_tt_in_range_(index_tt_nc_g1_, ppt->selection_num, ppt->has_nc_gr)) \
41 bin = index_tt - index_tt_nc_g1_; \
42 if (_index_tt_in_range_(index_tt_nc_g2_, ppt->selection_num, ppt->has_nc_gr)) \
43 bin = index_tt - index_tt_nc_g2_; \
44 if (_index_tt_in_range_(index_tt_nc_g3_, ppt->selection_num, ppt->has_nc_gr)) \
45 bin = index_tt - index_tt_nc_g3_;
46/* macro: bin number associated to particular redshift bin and selection function for integrated contributions*/
47#define _get_bin_integrated_ncl_(index_tt) \
48 if (_index_tt_in_range_(index_tt_lensing_, ppt->selection_num, ppt->has_cl_lensing_potential)) \
49 bin = index_tt - index_tt_lensing_; \
50 if (_index_tt_in_range_(index_tt_nc_lens_, ppt->selection_num, ppt->has_nc_lens)) \
51 bin = index_tt - index_tt_nc_lens_; \
52 if (_index_tt_in_range_(index_tt_nc_g4_, ppt->selection_num, ppt->has_nc_gr)) \
53 bin = index_tt - index_tt_nc_g4_; \
54 if (_index_tt_in_range_(index_tt_nc_g5_, ppt->selection_num, ppt->has_nc_gr)) \
55 bin = index_tt - index_tt_nc_g5_;
63struct transfers {
69
70 double lcmb_rescale = 1.;
73 double lcmb_tilt = 0.;
76 double lcmb_pivot = 0.1;
82 0.};
84 bool has_nz_file = false;
86 false;
87 std::string nz_file_name;
89 bool has_nz_evo_file = false;
91 false;
92 std::string nz_evo_file_name;
95
99
101 false;
104 0;
107};
108
120
121 HyperInterpStruct
124 HyperInterpStruct*
127 int l_size;
130
134
137 std::vector<double> interpolated_sources;
141 std::vector<double> sources;
146 std::vector<double> tau0_minus_tau;
147 std::vector<double>
149 std::vector<double> chi;
153 std::vector<double> cscKgen;
154 std::vector<double> cotKgen;
158 std::vector<double> Phi;
159 std::vector<double> dPhi;
160 std::vector<double> d2Phi;
161 std::vector<double> chireverse;
162 std::vector<double> rescale_function;
163 std::vector<double>
165 std::vector<double> chi_full_reverse;
168
172
173 double K;
174 int sgnK;
177
178 double
180 short
182};
183
191typedef enum {
192 SCALAR_TEMPERATURE_0,
193 SCALAR_TEMPERATURE_1,
194 SCALAR_TEMPERATURE_2,
195 SCALAR_POLARISATION_E,
196 VECTOR_TEMPERATURE_1,
197 VECTOR_TEMPERATURE_2,
198 VECTOR_POLARISATION_E,
199 VECTOR_POLARISATION_B,
200 TENSOR_TEMPERATURE_2,
201 TENSOR_POLARISATION_E,
202 TENSOR_POLARISATION_B,
203 NC_RSD
205
206enum Hermite_Interpolation_Order { HERMITE4, HERMITE6 };
207
208#endif
#define _SELECTION_NUM_MAX_
Definition perturbations.h:79
double selection_magnification_bias[_SELECTION_NUM_MAX_]
Definition transfer.h:81
double selection_bias[_SELECTION_NUM_MAX_]
Definition transfer.h:79
bool has_nz_evo_analytic
Definition transfer.h:90
double tau0_minus_tau_cut
Definition transfer.h:179
bool has_nz_file
Definition transfer.h:84
std::vector< double > cscKgen
Definition transfer.h:153
bool has_nz_evo_file
Definition transfer.h:89
double K
Definition transfer.h:173
std::vector< double > rescale_function
Definition transfer.h:162
int tau_size
Definition transfer.h:135
double lcmb_tilt
Definition transfer.h:73
std::vector< double > radial_function
Definition transfer.h:164
std::vector< double > chireverse
Definition transfer.h:161
bool initialise_HIS_cache
Definition transfer.h:100
int l_size
Definition transfer.h:127
double lcmb_rescale
Definition transfer.h:70
bool has_nz_analytic
Definition transfer.h:85
double lcmb_pivot
Definition transfer.h:76
std::vector< double > cotKgen
Definition transfer.h:154
std::vector< double > dPhi
Definition transfer.h:159
std::vector< double > d2Phi
Definition transfer.h:160
HyperInterpStruct HIS
Definition transfer.h:122
std::vector< double > w_trapz
Definition transfer.h:148
std::vector< double > interpolated_sources
Definition transfer.h:137
HyperInterpStruct * pBIS
Definition transfer.h:125
short neglect_late_source
Definition transfer.h:181
std::vector< double > sources
Definition transfer.h:141
std::string nz_evo_file_name
Definition transfer.h:92
std::vector< double > chi_full_reverse
Definition transfer.h:165
std::vector< double > chi
Definition transfer.h:149
std::vector< double > Phi
Definition transfer.h:158
int tau_size_max
Definition transfer.h:136
std::vector< double > tau0_minus_tau
Definition transfer.h:146
std::string nz_file_name
Definition transfer.h:87
radial_function_type
Definition transfer.h:191
int sgnK
Definition transfer.h:174
short transfer_verbose
Definition transfer.h:103
Definition transfer.h:116
Definition transfer.h:63