CosmoBolognaLib
Free Software C++/Python libraries for cosmological calculations
Mock.h
Go to the documentation of this file.
1 /********************************************************************
2  * Copyright (C) 2015 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 
34 #ifndef __MOCK__
35 #define __MOCK__
36 
37 
38 // ===================================================================================================
39 
40 
41 namespace cbl {
42 
43  namespace catalogue {
44 
53  class Mock : public Halo {
54 
55  private :
56 
58  double m_generic;
59 
60 
61  public:
62 
67 
72  Mock ()
73  : Halo(), m_generic(par::defaultDouble) {}
74 
82  std::shared_ptr<Object> getShared() {
83  return std::make_shared<Mock>(*this);
84  }
85 
118  Mock (const comovingCoordinates coord, const double weight=1., const long region=par::defaultLong, const int ID=par::defaultInt, const std::string field=par::defaultString, const double x_displacement=par::defaultDouble, const double y_displacement=par::defaultDouble, const double z_displacement=par::defaultDouble, const double vx=par::defaultDouble, const double vy=par::defaultDouble, const double vz=par::defaultDouble, const double mass=par::defaultDouble, const double generic=par::defaultDouble)
120 
161  Mock (const comovingCoordinates coord, const cosmology::Cosmology &cosm, const double z1_guess=0., const double z2_guess=10., const double weight=1., const long region=par::defaultLong, const int ID=par::defaultInt, const std::string field=par::defaultString, const double x_displacement=par::defaultDouble, const double y_displacement=par::defaultDouble, const double z_displacement=par::defaultDouble, const double vx=par::defaultDouble, const double vy=par::defaultDouble, const double vz=par::defaultDouble, const double mass=par::defaultDouble, const double generic=par::defaultDouble)
162  : Halo(coord, cosm, z1_guess, z2_guess, weight, region, ID, field, x_displacement, y_displacement, z_displacement, vx, vy, vz, mass), m_generic(generic) {}
163 
196  Mock (const observedCoordinates coord, const double weight=1., const long region=par::defaultLong, const int ID=par::defaultInt, const std::string field=par::defaultString, const double x_displacement=par::defaultDouble, const double y_displacement=par::defaultDouble, const double z_displacement=par::defaultDouble, const double vx=par::defaultDouble, const double vy=par::defaultDouble, const double vz=par::defaultDouble, const double mass=par::defaultDouble, const double generic=par::defaultDouble)
198 
234  Mock (const observedCoordinates coord, const CoordinateUnits inputUnits, const double weight=1., const long region=par::defaultLong, const int ID=par::defaultInt, const std::string field=par::defaultString, const double x_displacement=par::defaultDouble, const double y_displacement=par::defaultDouble, const double z_displacement=par::defaultDouble, const double vx=par::defaultDouble, const double vy=par::defaultDouble, const double vz=par::defaultDouble, const double mass=par::defaultDouble, const double generic=par::defaultDouble)
236 
274  Mock (const observedCoordinates coord, const cosmology::Cosmology &cosm, const double weight=1., const long region=par::defaultLong, const int ID=par::defaultInt, const std::string field=par::defaultString, const double x_displacement=par::defaultDouble, const double y_displacement=par::defaultDouble, const double z_displacement=par::defaultDouble, const double vx=par::defaultDouble, const double vy=par::defaultDouble, const double vz=par::defaultDouble, const double mass=par::defaultDouble, const double generic=par::defaultDouble)
276 
314  Mock (const observedCoordinates coord, const CoordinateUnits inputUnits, const cosmology::Cosmology &cosm, const double weight=1., const long region=par::defaultLong, const int ID=par::defaultInt, const std::string field=par::defaultString, const double x_displacement=par::defaultDouble, const double y_displacement=par::defaultDouble, const double z_displacement=par::defaultDouble, const double vx=par::defaultDouble, const double vy=par::defaultDouble, const double vz=par::defaultDouble, const double mass=par::defaultDouble, const double generic=par::defaultDouble)
315  : Halo(coord, inputUnits, cosm, weight, region, ID, field, x_displacement, y_displacement, z_displacement, vx, vy, vz, mass), m_generic(generic) {}
316 
358  Mock (const double xx, const double yy, const double zz, const double ra, const double dec, const double redshift, const double weight=1., const long region=par::defaultLong, const int ID=par::defaultInt, const std::string field=par::defaultString, const double x_displacement=par::defaultDouble, const double y_displacement=par::defaultDouble, const double z_displacement=par::defaultDouble, const double vx=par::defaultDouble, const double vy=par::defaultDouble, const double vz=par::defaultDouble, const double mass=par::defaultDouble, const double generic=par::defaultDouble)
360 
364  ~Mock () = default;
365 
367 
368 
373 
378  double generic () const override { return m_generic; }
379 
381 
382 
387 
392  void set_generic (const double generic=par::defaultDouble) override { m_generic = generic; }
393 
395 
396 
401 
407  bool isSet_generic () override
408  { return (cbl::isSet(m_generic)) ? true : false; }
409 
411 
412  };
413  }
414 }
415 
416 #endif
The class CatalogueChainMesh.
Definition: Halo.h:53
double vx() const override
get the protected member m_vx
Definition: Halo.h:375
double vy() const override
get the protected member m_vy
Definition: Halo.h:382
double vz() const override
get the protected member m_vz
Definition: Halo.h:389
double mass() const override
get the protected member m_mass
Definition: Halo.h:396
The class Mock.
Definition: Mock.h:53
Mock(const double xx, const double yy, const double zz, const double ra, const double dec, const double redshift, const double weight=1., const long region=par::defaultLong, const int ID=par::defaultInt, const std::string field=par::defaultString, const double x_displacement=par::defaultDouble, const double y_displacement=par::defaultDouble, const double z_displacement=par::defaultDouble, const double vx=par::defaultDouble, const double vy=par::defaultDouble, const double vz=par::defaultDouble, const double mass=par::defaultDouble, const double generic=par::defaultDouble)
constructor that uses both comoving and observed coordinates
Definition: Mock.h:358
Mock(const observedCoordinates coord, const CoordinateUnits inputUnits, const double weight=1., const long region=par::defaultLong, const int ID=par::defaultInt, const std::string field=par::defaultString, const double x_displacement=par::defaultDouble, const double y_displacement=par::defaultDouble, const double z_displacement=par::defaultDouble, const double vx=par::defaultDouble, const double vy=par::defaultDouble, const double vz=par::defaultDouble, const double mass=par::defaultDouble, const double generic=par::defaultDouble)
constructor that uses observed coordinates in any angular units
Definition: Mock.h:234
bool isSet_generic() override
set the private member m_generic
Definition: Mock.h:407
~Mock()=default
default destructor
Mock(const comovingCoordinates coord, const double weight=1., const long region=par::defaultLong, const int ID=par::defaultInt, const std::string field=par::defaultString, const double x_displacement=par::defaultDouble, const double y_displacement=par::defaultDouble, const double z_displacement=par::defaultDouble, const double vx=par::defaultDouble, const double vy=par::defaultDouble, const double vz=par::defaultDouble, const double mass=par::defaultDouble, const double generic=par::defaultDouble)
constructor that uses comoving coordinates
Definition: Mock.h:118
std::shared_ptr< Object > getShared()
function that allows copying private variables of the class when an object of class Catalogue is copi...
Definition: Mock.h:82
Mock(const comovingCoordinates coord, const cosmology::Cosmology &cosm, const double z1_guess=0., const double z2_guess=10., const double weight=1., const long region=par::defaultLong, const int ID=par::defaultInt, const std::string field=par::defaultString, const double x_displacement=par::defaultDouble, const double y_displacement=par::defaultDouble, const double z_displacement=par::defaultDouble, const double vx=par::defaultDouble, const double vy=par::defaultDouble, const double vz=par::defaultDouble, const double mass=par::defaultDouble, const double generic=par::defaultDouble)
constructor that uses comoving coordinates and a cosmological model to estimate the redshift
Definition: Mock.h:161
Mock(const observedCoordinates coord, const CoordinateUnits inputUnits, const cosmology::Cosmology &cosm, const double weight=1., const long region=par::defaultLong, const int ID=par::defaultInt, const std::string field=par::defaultString, const double x_displacement=par::defaultDouble, const double y_displacement=par::defaultDouble, const double z_displacement=par::defaultDouble, const double vx=par::defaultDouble, const double vy=par::defaultDouble, const double vz=par::defaultDouble, const double mass=par::defaultDouble, const double generic=par::defaultDouble)
constructor that uses observed coordinates and a cosmological model to estimate the comoving coordina...
Definition: Mock.h:314
double generic() const override
get the private member m_generic
Definition: Mock.h:378
Mock(const observedCoordinates coord, const double weight=1., const long region=par::defaultLong, const int ID=par::defaultInt, const std::string field=par::defaultString, const double x_displacement=par::defaultDouble, const double y_displacement=par::defaultDouble, const double z_displacement=par::defaultDouble, const double vx=par::defaultDouble, const double vy=par::defaultDouble, const double vz=par::defaultDouble, const double mass=par::defaultDouble, const double generic=par::defaultDouble)
constructor that uses observed coordinates in radians
Definition: Mock.h:196
Mock()
default constructor
Definition: Mock.h:72
void set_generic(const double generic=par::defaultDouble) override
set the private member m_generic
Definition: Mock.h:392
double m_generic
generic variable of the mock object
Definition: Mock.h:58
Mock(const observedCoordinates coord, const cosmology::Cosmology &cosm, const double weight=1., const long region=par::defaultLong, const int ID=par::defaultInt, const std::string field=par::defaultString, const double x_displacement=par::defaultDouble, const double y_displacement=par::defaultDouble, const double z_displacement=par::defaultDouble, const double vx=par::defaultDouble, const double vy=par::defaultDouble, const double vz=par::defaultDouble, const double mass=par::defaultDouble, const double generic=par::defaultDouble)
constructor that uses observed coordinates in radians and a cosmological model to estimate the comovi...
Definition: Mock.h:274
double zz() const
get the member m_zz
Definition: Object.h:758
long region() const
get the member m_region
Definition: Object.h:835
double dec() const
get the member m_dec
Definition: Object.h:779
double y_displacement() const
get the member m_y_displacement
Definition: Object.h:867
double weight() const
get the member m_weight
Definition: Object.h:828
double ra() const
get the member m_ra
Definition: Object.h:772
std::string field() const
get the member m_field
Definition: Object.h:850
double yy() const
get the member m_yy
Definition: Object.h:751
double redshift() const
get the member m_redshift
Definition: Object.h:807
double x_displacement() const
get the member m_x_displacement
Definition: Object.h:860
int ID() const
get the member m_radius
Definition: Object.h:843
double xx() const
get the member m_xx
Definition: Object.h:744
double z_displacement() const
get the member m_z_displacement
Definition: Object.h:874
The class Cosmology.
Definition: Cosmology.h:277
static const std::string defaultString
default std::string value
Definition: Constants.h:336
static const long defaultLong
default long value
Definition: Constants.h:342
static const double defaultDouble
default double value
Definition: Constants.h:348
static const int defaultInt
default integer value
Definition: Constants.h:339
The global namespace of the CosmoBolognaLib
Definition: CAMB.h:38
bool isSet(const std::string var)
check if the value of a [string] variable has already been set
Definition: Kernel.h:803
CoordinateUnits
the coordinate units
Definition: Kernel.h:562