sfof
cluster_class.hpp
Go to the documentation of this file.
1 
7 #ifndef CLUSTER_CLASS_H
8 #define CLUSTER_CLASS_H
9 
20 #include <math.h>
21 #include "astro.hpp"
22 #include "cosmo.hpp"
23 #include "galaxy_class.hpp"
24 #include "point_class.hpp"
25 
26 class Cluster { // Class structure for cluster properties.
27 
28 public:
29 
31  int num;
32 
34  int ngal;
35 
37  double ra;
38 
40  double ra_err;
41 
43  double dec;
44 
46  double dec_err;
47 
49  double z;
50 
52  double z_err;
53 
55  double size;
56 
58  double area;
59 
61  double sn;
62 
64  double da;
65 
67  std::vector<Galaxy*> mem;
68 
73  Cluster (int num_val) {
74  num = num_val;
75  ngal = 0;
76  ra = 0;
77  ra_err = 0;
78  dec = 0;
79  dec_err = 0;
80  z = 0;
81  z_err = 0;
82  size = 0;
83  area = 0;
84  da = 0;
85  };
86 
87  Cluster (){
88  num = 0;
89  ngal = 0;
90  ra = 0;
91  ra_err = 0;
92  dec = 0;
93  dec_err = 0;
94  z = 0;
95  z_err = 0;
96  size = 0;
97  area =0;
98  }
99 
104  void add_gal (Galaxy*);
105 
114  void assign_dist (double, double, double, double);
115 
120  void assign_props ();
121 
127  void assign_sn (double);
128 
134  void update_size (const std::string);
135 
139  void clear ();
140 
145  void rename (int);
146 
150  void unique ();
151 
152  friend bool operator< (const Cluster& clt1, const Cluster& clt2);
153 
154 private:
155 
158 
161 
162 };
163 
168 inline bool operator< (const Cluster& clt1, const Cluster& clt2) {
169  return clt1.ngal < clt2.ngal;
170 }
171 
172 #endif // CLUSTER_CLASS_H
Galaxy
Class for storing galaxy properties.
Definition: galaxy_class.hpp:71
point_class.hpp
Cluster::operator<
friend bool operator<(const Cluster &clt1, const Cluster &clt2)
Bool < operator for Cluster class.
Definition: cluster_class.hpp:168
Cluster::assign_props
void assign_props()
This method assigns properties based on those of the members to the Cluster instance.
Definition: cluster_class.cpp:24
Cluster::area
double area
Area of Cluster instance in specified units.
Definition: cluster_class.hpp:58
Cluster::astro
Astro astro
Include Astro class.
Definition: cluster_class.hpp:157
Cluster::sn
double sn
Signal-to-noise of Cluster instance.
Definition: cluster_class.hpp:61
Astro
Class containing basic functions required for astronomy.
Definition: astro.hpp:22
Cluster::z_err
double z_err
Redshift error of Cluster instance.
Definition: cluster_class.hpp:52
Cluster::ra_err
double ra_err
Right ascension error of Cluster instance.
Definition: cluster_class.hpp:40
Cluster::ngal
int ngal
Number of members in Cluster instance.
Definition: cluster_class.hpp:34
Cluster::ra
double ra
Right ascension of Cluster instance.
Definition: cluster_class.hpp:37
Cluster::num
int num
Number asscosiated to Cluster instance.
Definition: cluster_class.hpp:31
Cluster::da
double da
Angular diameter distance of Cluster instance.
Definition: cluster_class.hpp:64
Cluster::assign_sn
void assign_sn(double)
This method assigns a signal-to-noise value to a Cluster instance given a value of the expected backg...
Definition: cluster_class.cpp:48
cosmo.hpp
astro.hpp
Cluster::rename
void rename(int)
This method resets the number associated to a Cluster instance.
Definition: cluster_class.cpp:77
galaxy_class.hpp
Cluster::size
double size
Size of Cluster instance in specified units.
Definition: cluster_class.hpp:55
Cluster::clear
void clear()
This method clears all members from a Cluster instance.
Definition: cluster_class.cpp:72
Cluster::unique
void unique()
This method removes all duplicate members from a Cluster instance.
Definition: cluster_class.cpp:82
Cosmo
Class containing basic functions required for Cosmology.
Definition: cosmo.hpp:19
Cluster::dec
double dec
Declination of Cluster instance.
Definition: cluster_class.hpp:43
Cluster::assign_dist
void assign_dist(double, double, double, double)
This method calculates the angular diameter distance of a Cluster instance for a given cosmology.
Definition: cluster_class.cpp:12
Cluster::z
double z
Redshift of Cluster instance.
Definition: cluster_class.hpp:49
Cluster::dec_err
double dec_err
Declination error of Cluster instance.
Definition: cluster_class.hpp:46
Cluster::update_size
void update_size(const std::string)
This method updates the units of the cluster size to those specified.
Definition: cluster_class.cpp:63
operator<
bool operator<(const Cluster &clt1, const Cluster &clt2)
Bool < operator for Cluster class.
Definition: cluster_class.hpp:168
Cluster::cosmo
Cosmo cosmo
Include Cosmo class.
Definition: cluster_class.hpp:160
Cluster::mem
std::vector< Galaxy * > mem
Vector of Cluster member Galaxy instances.
Definition: cluster_class.hpp:67
Cluster
Class for storing galaxy cluster properties and members.
Definition: cluster_class.hpp:26
Cluster::Cluster
Cluster()
Definition: cluster_class.hpp:87
Cluster::add_gal
void add_gal(Galaxy *)
This method adds a Galaxy instance to a Cluster instance.
Definition: cluster_class.cpp:7
Cluster::Cluster
Cluster(int num_val)
Initialise Cluster instance.
Definition: cluster_class.hpp:73