CosmoBolognaLib
Free Software C++/Python libraries for cosmological calculations
LogNormal.h
Go to the documentation of this file.
1 /********************************************************************
2  * Copyright (C) 2010 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 
33 #ifndef __LOGNORMAL__
34 #define __LOGNORMAL__
35 
36 #include "Catalogue.h"
37 #include <fftw3.h>
38 
39 namespace cbl {
40 
48  namespace lognormal {
49 
58  class LogNormal {
59 
60  protected:
61 
63  std::vector<std::shared_ptr<catalogue::Catalogue>> m_catalogue = {};
64 
67 
70 
72  int m_nObjects;
73 
75  double m_redshift;
76 
78  double m_bias;
79 
81  double m_cell_size;
82 
84  bool m_real;
85 
87  std::string m_method_Pk;
88 
90  bool m_NL;
91 
92 
93  public:
94 
99 
103  LogNormal () = default;
104 
108  ~LogNormal () = default;
109 
138  LogNormal (const catalogue::Catalogue random, const cosmology::Cosmology cosmology, const int nObjects, const double redshift, const double bias, const double cell_size, const bool real=true, const std::string method_Pk="CAMB", const bool NL=false)
140 
142 
143 
148 
156  std::shared_ptr<catalogue::Catalogue> catalogue (const size_t i);
157 
164  int nObjects () const { return m_nObjects; }
165 
172  int redshift () const { return m_redshift; }
173 
179  double bias () const { return m_bias; }
180 
187  bool real () const { return m_real; }
188 
195  std::string method_Pk () const { return m_method_Pk; }
196 
203  bool NL () const { return m_NL; }
204 
206 
207 
212 
219  void set_nObjects (const int nObjects) { m_nObjects = nObjects; }
220 
227  void set_redshift (const double redshift) { m_redshift = redshift; }
228 
235  void set_bias (const double bias) { m_bias = bias; }
236 
243  void set_real (const bool real) { m_real = real; }
244 
251  void set_method_Pk (const std::string method_Pk) { m_method_Pk = method_Pk; }
252 
259  void set_NL (const bool NL) { m_NL = NL; }
260 
262 
263 
268 
284  void generate (const int n_lognormal_mocks, const std::string output_dir, const std::string filename="lognormal", const int start=1, const int seed=3213);
285 
287 
288  };
289 
290  }
291 
292 }
293 
294 #endif
The class Catalogue
The class Catalogue.
Definition: Catalogue.h:654
The class Cosmology.
Definition: Cosmology.h:277
The class LogNormal.
Definition: LogNormal.h:58
double bias() const
get the private member LogNormal::m_bias
Definition: LogNormal.h:179
double m_redshift
the mean redshift the log-normal catalogues
Definition: LogNormal.h:75
int nObjects() const
get the private member LogNormal::m_nObjects
Definition: LogNormal.h:164
catalogue::Catalogue m_random
the random catalogues used to construct the mask
Definition: LogNormal.h:66
void set_method_Pk(const std::string method_Pk)
set the private member LogNormal::m_method_Pk
Definition: LogNormal.h:251
LogNormal()=default
default constructor
void set_bias(const double bias)
set the private member LogNormal::m_bias
Definition: LogNormal.h:235
double m_bias
the bias of the log-normal density field catalogues
Definition: LogNormal.h:78
void generate(const int n_lognormal_mocks, const std::string output_dir, const std::string filename="lognormal", const int start=1, const int seed=3213)
generate the log-normal mock catalogues
Definition: LogNormal.cpp:62
double m_cell_size
the cell size in comoving scale
Definition: LogNormal.h:81
LogNormal(const catalogue::Catalogue random, const cosmology::Cosmology cosmology, const int nObjects, const double redshift, const double bias, const double cell_size, const bool real=true, const std::string method_Pk="CAMB", const bool NL=false)
constructor
Definition: LogNormal.h:138
~LogNormal()=default
default destructor
void set_real(const bool real)
set the private member LogNormal::m_real
Definition: LogNormal.h:243
bool real() const
get the private member LogNormal::m_real
Definition: LogNormal.h:187
bool m_real
true → real space; false → redshift space (only monopole distortions)
Definition: LogNormal.h:84
std::shared_ptr< catalogue::Catalogue > catalogue(const size_t i)
get the private member LogNormal::m_LNCat[i]
Definition: LogNormal.cpp:47
std::vector< std::shared_ptr< catalogue::Catalogue > > m_catalogue
vector containing pointers to the log-normal realizations
Definition: LogNormal.h:63
bool m_NL
true → compute the non-linear power spectrum; false → compute the linear power spectrum
Definition: LogNormal.h:90
std::string method_Pk() const
get the private member LogNormal::m_method_Pk
Definition: LogNormal.h:195
int m_nObjects
the mean total number of objects in the log-normal catalogues
Definition: LogNormal.h:72
void set_nObjects(const int nObjects)
set the private member LogNormal::m_nObjects
Definition: LogNormal.h:219
int redshift() const
get the private member LogNormal::m_redshift
Definition: LogNormal.h:172
void set_redshift(const double redshift)
set the private member LogNormal::m_redshift
Definition: LogNormal.h:227
cosmology::Cosmology m_cosmology
the assumed cosmological model
Definition: LogNormal.h:69
std::string m_method_Pk
the method to compute the model power spectrum (i.e. the Boltzmann solver)
Definition: LogNormal.h:87
bool NL() const
get the private member LogNormal::m_NL
Definition: LogNormal.h:203
void set_NL(const bool NL)
set the private member LogNormal::m_NL
Definition: LogNormal.h:259
The global namespace of the CosmoBolognaLib
Definition: CAMB.h:38