sfof
fof_class.hpp
Go to the documentation of this file.
1 
7 #ifndef FOF_CLASS_H
8 #define FOF_CLASS_H
9 
19 #include <string>
20 #include <vector>
21 #include "astro.hpp"
22 #include "cluster_class.hpp"
23 #include "galaxy_class.hpp"
24 #include "kdtree_class.hpp"
25 #include "zbin_class.hpp"
26 
27 class FoF { // Class for friends-of-friends functions
28 
29 public:
30 
32  std::vector<Cluster> list_of_clusters;
33 
37  FoF(int max_ngal_val) {
38  max_ngal = max_ngal_val;
39  cluster_count = -1;
40  link_r = 0;
41  link_z = 0;
42  };
43 
50  void setup (double, double, const std::string &);
51 
56  void remove (int);
57 
66  int friends_of_friends (int, const std::vector<Zbin> &, std::vector<Galaxy> &,
67  const Kdtree &);
68 
69 private:
70 
73 
76 
78  int max_ngal;
79 
81  double link_r;
82 
84  double link_z;
85 
87  std::string mode;
88 
95  bool bin_check (int, const std::vector<int> &);
96 
97 
106  bool friendship (const Zbin &, const Galaxy &, const Galaxy &, double);
107 
114  void new_cluster (const Zbin &, Galaxy*, Galaxy*);
115 
122  void add_member (const Zbin &, Galaxy* , Cluster &);
123 
133  int find_friends (const Zbin &, Galaxy &, double, std::vector<Galaxy> &, const Kdtree &);
134 
144  int find_friends_of_friends (const Zbin &, Cluster &, double,
145  std::vector<Galaxy> &, const Kdtree &);
146 
147 };
148 
149 #endif // FOF_CLASS_H
Galaxy
Class for storing galaxy properties.
Definition: galaxy_class.hpp:71
Zbin
Class for storing redshift bin properties.
Definition: zbin_class.hpp:21
FoF::link_z
double link_z
Line-of-sight linking parameter.
Definition: fof_class.hpp:84
FoF::astro
Astro astro
Include Astro class.
Definition: fof_class.hpp:72
FoF::bin_check
bool bin_check(int, const std::vector< int > &)
This method checks if a Galaxy instance is compatible with a given Zbin instance.
Definition: fof_class.cpp:19
FoF::mode
std::string mode
FoF mode ["spec"/"phot"].
Definition: fof_class.hpp:87
FoF::setup
void setup(double, double, const std::string &)
This method sets-up a FoF instance.
Definition: fof_class.cpp:6
kdtree_class.hpp
FoF::add_member
void add_member(const Zbin &, Galaxy *, Cluster &)
This method adds a new member Galaxy instance to an existing Cluster instance.
Definition: fof_class.cpp:61
Astro
Class containing basic functions required for astronomy.
Definition: astro.hpp:22
FoF::find_friends
int find_friends(const Zbin &, Galaxy &, double, std::vector< Galaxy > &, const Kdtree &)
This method finds Galaxy instances linked to a given Galaxy instance in a given Zbin instance.
Definition: fof_class.cpp:72
FoF::new_cluster
void new_cluster(const Zbin &, Galaxy *, Galaxy *)
This method creates a new Cluster instance.
Definition: fof_class.cpp:50
zbin_class.hpp
FoF::friendship
bool friendship(const Zbin &, const Galaxy &, const Galaxy &, double)
This method checks if two Galaxy instances satisfy the linking conditions in a given Zbin instance.
Definition: fof_class.cpp:31
FoF::FoF
FoF(int max_ngal_val)
Initialise FoF instance.
Definition: fof_class.hpp:37
Kdtree
Class for constructing a kd-tree.
Definition: kdtree_class.hpp:34
astro.hpp
galaxy_class.hpp
FoF::list_of_clusters
std::vector< Cluster > list_of_clusters
Vector of Cluster instances.
Definition: fof_class.hpp:32
cluster_class.hpp
FoF::max_ngal
int max_ngal
Maximum number of cluster members.
Definition: fof_class.hpp:78
FoF::friends_of_friends
int friends_of_friends(int, const std::vector< Zbin > &, std::vector< Galaxy > &, const Kdtree &)
This method performs a friends-of-friends search for Cluster instances in a given Zbin instance.
Definition: fof_class.cpp:116
FoF::find_friends_of_friends
int find_friends_of_friends(const Zbin &, Cluster &, double, std::vector< Galaxy > &, const Kdtree &)
This method finds Galaxy instances linked to the members of a given Cluster instance in a given Zbin ...
Definition: fof_class.cpp:104
FoF::remove
void remove(int)
This method removes Cluster instances that have too few member Galaxy instances.
Definition: fof_class.cpp:144
Cluster
Class for storing galaxy cluster properties and members.
Definition: cluster_class.hpp:26
FoF::link_r
double link_r
Transverse linking parameter.
Definition: fof_class.hpp:81
FoF
Class for perfoming friends-of-friends cluster detection.
Definition: fof_class.hpp:27
FoF::cluster_count
int cluster_count
Count of current number of Cluster instances.
Definition: fof_class.hpp:75