CosmoBolognaLib
Free Software C++/Python libraries for cosmological calculations
Triplet2D.h
Go to the documentation of this file.
1 /********************************************************************
2  * Copyright (C) 2015 by Federico Marulli, Michele Moresco, *
3  * and Alfonso Veropalumbo *
4  * *
5  * federico.marulli3@unibo.it *
6  * *
7  * This program is free software; you can redistribute it and/or *
8  * modify it under the terms of the GNU General Public License as *
9  * published by the Free Software Foundation; either version 2 of *
10  * the License, or (at your option) any later version. *
11  * *
12  * This program is distributed in the hope that it will be useful, *
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15  * GNU General Public License for more details. *
16  * *
17  * You should have received a copy of the GNU General Public *
18  * License along with this program; if not, write to the Free *
19  * Software Foundation, Inc., *
20  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
21  *******************************************************************/
22 
38 #ifndef __TRIPLET2D__
39 #define __TRIPLET2D__
40 
41 
42 #include "Triplet.h"
43 
44 
45 // ===================================================================================================
46 
47 
48 namespace cbl {
49 
50  namespace triplets {
51 
64  class Triplet2D : public Triplet {
65 
66  private:
67 
73 
77  virtual void set_parameters () = 0;
78 
80 
81 
82  protected:
83 
85  std::vector<double> m_scale_D1;
86 
88  std::vector<double> m_scale_D2;
89 
91  std::vector<std::vector<double> > m_TT2D;
92 
93 
98 
100  double m_r12_D1;
101 
104 
106  double m_r13_D1;
107 
110 
113 
115  double m_binSize_D1;
116 
118  double m_r12_D2;
119 
122 
124  double m_r13_D2;
125 
128 
131 
133  double m_binSize_D2;
134 
136 
137 
138  public:
139 
144 
150  { m_tripletDim = Dim::_2D_; }
151 
173  Triplet2D (const double r12_D1, const double r12_binSize_D1, const double r13_D1, const double r13_binSize_D1, const int nbins_D1, const double r12_D2, const double r12_binSize_D2, const double r13_D2, const double r13_binSize_D2, const int nbins_D2)
175  { m_tripletDim = Dim::_2D_; m_TT2D.resize(m_nbins_D1+1, std::vector<double>(m_nbins_D2+1, 0.)); }
176 
181  ~Triplet2D () = default;
182 
184 
185 
190 
196  double scale_D1 (const int i) const override { (void)i; return m_scale_D1[i]; }
197 
202  std::vector<double> scale_D1 () const override { return m_scale_D1; }
203 
209  double scale_D2 (const int i) const override { (void)i; return m_scale_D2[i]; }
210 
215  std::vector<double> scale_D2 () const override { return m_scale_D2; }
216 
223  double TT2D (const int i, const int j) const override { (void)i; (void)j; return m_TT2D[i][j]; }
224 
229  std::vector<std::vector<double> > TT2D () const override { return m_TT2D; }
230 
235  double r12_D1 () const override { return m_r12_D1; }
236 
241  double r12_binSize_D1 () const override { return m_r12_binSize_D1; }
242 
247  double r13_D1 () const override { return m_r13_D1; }
248 
253  double r13_binSize_D1 () const override { return m_r13_binSize_D1; }
254 
259  double binSize_D1 () const override { return m_binSize_D1; }
260 
265  double r12_D2 () const override { return m_r12_D2; }
266 
271  double r12_binSize_D2 () const override { return m_r12_binSize_D2; }
272 
277  double r13_D2 () const override { return m_r13_D2; }
278 
283  double r13_binSize_D2 () const override { return m_r13_binSize_D2; }
284 
289  double binSize_D2 () const override { return m_binSize_D2; }
290 
292 
293 
298 
307  void Sum (const std::shared_ptr<Triplet> tt, const double ww=1) override
308  { (void)tt; (void)ww; ErrorCBL("", "Sum", "Triple2D.h", cbl::glob::ExitCode::_workInProgress_); }
309 
318  virtual void get_triplet (const double r12, const double r13, const double r23, int &klin) override
319  { (void)r12; (void)r13; (void)r23; (void)klin; ErrorCBL("", "get_triplet", "Triple2D.h", cbl::glob::ExitCode::_workInProgress_); }
320 
326  virtual void set_triplet (const int klin, const double ww=1.) override
327  { (void)klin; (void)ww; ErrorCBL("", "set_triplet", "Triple2D.h", cbl::glob::ExitCode::_workInProgress_); }
328 
339  void put (const double r12, const double r13, const double r23, const double ww=1.) override
340  { (void)r12; (void)r13; (void)r23; (void)ww; ErrorCBL("", "put", "Triple2D.h", cbl::glob::ExitCode::_workInProgress_); }
341 
351  void put (const std::shared_ptr<catalogue::Object> obj1, const std::shared_ptr<catalogue::Object> obj2, const std::shared_ptr<catalogue::Object> obj3) override
352  { (void)obj1; (void)obj2; (void)obj3; ErrorCBL("", "put", "Triple2D.h", cbl::glob::ExitCode::_workInProgress_); }
353 
355 
356  };
357  }
358 }
359 
360 #endif
The class Triplet.
The class Triplet2D.
Definition: Triplet2D.h:64
virtual void set_parameters()=0
set the binning parameters
std::vector< double > m_scale_D2
the binned scales in the second dimension
Definition: Triplet2D.h:88
void put(const std::shared_ptr< catalogue::Object > obj1, const std::shared_ptr< catalogue::Object > obj2, const std::shared_ptr< catalogue::Object > obj3) override
estimate the distance between three objects and update the triplet vectors accordingly
Definition: Triplet2D.h:351
virtual void set_triplet(const int klin, const double ww=1.) override
update the triplet
Definition: Triplet2D.h:326
std::vector< double > scale_D1() const override
get the protected member m_scale_D1
Definition: Triplet2D.h:202
double TT2D(const int i, const int j) const override
get the protected member m_PP2D[i]
Definition: Triplet2D.h:223
int m_nbins_D2
the number of bins in the second dimension
Definition: Triplet2D.h:130
Triplet2D()
default constructor
Definition: Triplet2D.h:148
std::vector< std::vector< double > > TT2D() const override
get the protected member m_PP2D
Definition: Triplet2D.h:229
double r12_D1() const override
get the protected member Triplet1D::m_r12_D1
Definition: Triplet2D.h:235
int m_nbins_D1
the number of bins in the first dimension
Definition: Triplet2D.h:112
void Sum(const std::shared_ptr< Triplet > tt, const double ww=1) override
sum the number of triplets
Definition: Triplet2D.h:307
double scale_D1(const int i) const override
get the protected member m_scale_D1[i]
Definition: Triplet2D.h:196
double r13_D1() const override
get the protected member Triplet1D::m_r13_D1
Definition: Triplet2D.h:247
std::vector< double > scale_D2() const override
get the protected member m_scale_D2
Definition: Triplet2D.h:215
std::vector< std::vector< double > > m_TT2D
the number of binned triplets
Definition: Triplet2D.h:91
double binSize_D2() const override
get the protected member m_binSize_D2
Definition: Triplet2D.h:289
double m_r12_binSize_D2
the size of r12 bin in the second dimension
Definition: Triplet2D.h:121
double m_binSize_D2
the bin size in the second dimension
Definition: Triplet2D.h:133
double r13_binSize_D1() const override
get the protected member Triplet1D::m_r13_binSize_D1
Definition: Triplet2D.h:253
double m_r13_D2
the size of r13 in the second dimension
Definition: Triplet2D.h:124
~Triplet2D()=default
default destructor
std::vector< double > m_scale_D1
the binned scales in the first dimension
Definition: Triplet2D.h:85
double m_binSize_D1
the bin size in the first dimension
Definition: Triplet2D.h:115
double r12_D2() const override
get the protected member Triplet1D::m_r12_D2
Definition: Triplet2D.h:265
double r12_binSize_D1() const override
get the protected member Triplet1D::m_r12_binSize_D1
Definition: Triplet2D.h:241
double m_r12_D1
the size of r12 in the first dimension
Definition: Triplet2D.h:100
double m_r12_binSize_D1
the size of r12 bin in the first dimension
Definition: Triplet2D.h:103
void put(const double r12, const double r13, const double r23, const double ww=1.) override
estimate the distance between three objects and update the triplet vectors accordingly
Definition: Triplet2D.h:339
double r12_binSize_D2() const override
get the protected member Triplet1D::m_r12_binSize_D2
Definition: Triplet2D.h:271
virtual void get_triplet(const double r12, const double r13, const double r23, int &klin) override
estimate the distance between two objects and update the triplet vectors accordingly
Definition: Triplet2D.h:318
Triplet2D(const double r12_D1, const double r12_binSize_D1, const double r13_D1, const double r13_binSize_D1, const int nbins_D1, const double r12_D2, const double r12_binSize_D2, const double r13_D2, const double r13_binSize_D2, const int nbins_D2)
constructor
Definition: Triplet2D.h:173
double m_r13_D1
the size of r13 in the first dimension
Definition: Triplet2D.h:106
double binSize_D1() const override
get the protected member m_binSize_D1
Definition: Triplet2D.h:259
double r13_D2() const override
get the protected member Triplet1D::m_r13_D2
Definition: Triplet2D.h:277
double m_r13_binSize_D1
the size of r13 bin in the first dimension
Definition: Triplet2D.h:109
double scale_D2(const int i) const override
get the protected member m_scale_D2[i]
Definition: Triplet2D.h:209
double r13_binSize_D2() const override
get the protected member Triplet1D::m_r13_binSize_D2
Definition: Triplet2D.h:283
double m_r13_binSize_D2
the size of r13 bin in the second dimension
Definition: Triplet2D.h:127
double m_r12_D2
the size of r12 in the second dimension
Definition: Triplet2D.h:118
The class Triplet.
Definition: Triplet.h:133
Dim m_tripletDim
the dimension of the triplet vectors
Definition: Triplet.h:154
virtual double r12() const
get the private member m_r12
Definition: Triplet.h:285
virtual int nbins_D2() const
get the protected member Triplet1D::m_nbins_D2
Definition: Triplet.h:408
virtual int nbins_D1() const
get the protected member Triplet1D::m_nbins_D1
Definition: Triplet.h:360
virtual double r13() const
get the private member m_side_u
Definition: Triplet.h:299
@ _workInProgress_
error due to work in progress
The global namespace of the CosmoBolognaLib
Definition: CAMB.h:38
int ErrorCBL(const std::string msg, const std::string functionCBL, const std::string fileCBL, const cbl::glob::ExitCode exitCode=cbl::glob::ExitCode::_error_)
throw an exception: it is used for handling exceptions inside the CosmoBolognaLib
Definition: Kernel.h:780
@ _2D_
2D pair, used e.g. for 2D pairs, in Cartesian or polar coordinates