CosmoBolognaLib
Free Software C++/Python libraries for cosmological calculations
Halo.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 __HALO__
35 #define __HALO__
36 
37 
38 // ===================================================================================================
39 
40 
41 namespace cbl {
42 
43  namespace catalogue {
44 
53  class Halo : public Object {
54 
55  protected :
56 
58  double m_vx;
59 
61  double m_vy;
62 
64  double m_vz;
65 
67  double m_mass;
68 
69 
70  public:
71 
76 
81  Halo ()
83 
91  std::shared_ptr<Object> getShared() {
92  return std::make_shared<Halo>(*this);
93  }
94 
125  Halo (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)
127 
166  Halo (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)
167  : Object(coord, cosm, z1_guess, z2_guess, weight, region, ID, field, x_displacement, y_displacement, z_displacement), m_vx(vx), m_vy(vy), m_vz(vz), m_mass(mass) {}
168 
199  Halo (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)
201 
235  Halo (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)
237 
273  Halo (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)
275 
312  Halo (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)
313  : Object(coord, inputUnits, cosm, weight, region, ID, field, x_displacement, y_displacement, z_displacement), m_vx(vx), m_vy(vy), m_vz(vz), m_mass(mass) {}
314 
355  Halo (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)
357 
361  ~Halo () = default;
362 
364 
365 
370 
375  double vx () const override
376  { return m_vx; }
377 
382  double vy () const override
383  { return m_vy; }
384 
389  double vz () const override
390  { return m_vz; }
391 
396  double mass () const override
397  { return m_mass; }
398 
400 
401 
406 
411  void set_vx (const double vx=par::defaultDouble) override
412  { m_vx = vx; }
413 
418  void set_vy (const double vy=par::defaultDouble) override
419  { m_vy = vy; }
420 
425  void set_vz (const double vz=par::defaultDouble) override
426  { m_vz = vz; }
427 
432  void set_mass (const double mass=par::defaultDouble) override
433  { m_mass = mass; }
434 
436 
437 
442 
449  bool isSet_vx () override
450  { return (cbl::isSet(m_vx)) ? true : false; }
451 
458  bool isSet_vy () override
459  { return (cbl::isSet(m_vy)) ? true : false; }
460 
467  bool isSet_vz () override
468  { return (cbl::isSet(m_vz)) ? true : false; }
469 
475  bool isSet_mass () override
476  { return (cbl::isSet(m_mass)) ? true : false; }
477 
479 
480  };
481  }
482 }
483 
484 #endif
The class CatalogueChainMesh.
Definition: Halo.h:53
double m_vz
halo peculiar velocity along the z direction
Definition: Halo.h:64
void set_vz(const double vz=par::defaultDouble) override
set the protected member m_vz
Definition: Halo.h:425
void set_vy(const double vy=par::defaultDouble) override
set the protected member m_vy
Definition: Halo.h:418
void set_vx(const double vx=par::defaultDouble) override
set the protected member m_vx
Definition: Halo.h:411
double vx() const override
get the protected member m_vx
Definition: Halo.h:375
Halo(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)
constructor that uses observed coordinates in any angular units
Definition: Halo.h:235
Halo(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)
constructor that uses observed coordinates and a cosmological model to estimate the comoving coordina...
Definition: Halo.h:312
bool isSet_mass() override
check if the protected member m_mass is set
Definition: Halo.h:475
~Halo()=default
default destructor
double vy() const override
get the protected member m_vy
Definition: Halo.h:382
bool isSet_vy() override
check if the protected member m_vy is set
Definition: Halo.h:458
double m_vy
halo peculiar velocity along the y direction
Definition: Halo.h:61
Halo(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)
constructor that uses comoving coordinates and a cosmological model to estimate the redshift
Definition: Halo.h:166
double vz() const override
get the protected member m_vz
Definition: Halo.h:389
double m_vx
halo peculiar velocity along the x direction
Definition: Halo.h:58
double m_mass
halo mass
Definition: Halo.h:67
bool isSet_vz() override
check if the protected member m_vz is set
Definition: Halo.h:467
Halo(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)
constructor that uses observed coordinates in radians and a cosmological model to estimate the comovi...
Definition: Halo.h:273
Halo(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)
constructor that uses both comoving and observed coordinates
Definition: Halo.h:355
double mass() const override
get the protected member m_mass
Definition: Halo.h:396
Halo(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)
constructor that uses observed coordinates in radians
Definition: Halo.h:199
std::shared_ptr< Object > getShared()
function that allows copying private variables of the class when an object of class Catalogue is copi...
Definition: Halo.h:91
bool isSet_vx() override
check if the protected member m_vx is set
Definition: Halo.h:449
Halo(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)
constructor that uses comoving coordinates
Definition: Halo.h:125
Halo()
default constructor
Definition: Halo.h:81
void set_mass(const double mass=par::defaultDouble) override
set the protected member m_mass
Definition: Halo.h:432
The class Object.
Definition: Object.h:132
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