CosmoBolognaLib
Free Software C++/Python libraries for cosmological calculations
TwoPointCorrelationCross.h
Go to the documentation of this file.
1 /********************************************************************
2  * Copyright (C) 2010 by Federico Marulli and Carlo Giocoli *
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 
35 #ifndef __TWOPOINTCROSS__
36 #define __TWOPOINTCROSS__
37 
38 
39 #include "TwoPointCorrelation.h"
40 
41 
42 // ===================================================================================================
43 
44 
45 namespace cbl {
46 
47  namespace measure {
48 
49  namespace twopt {
50 
62 
63  protected :
64 
69 
71  std::shared_ptr<catalogue::Catalogue> m_data2;
72 
74 
75 
80 
82  std::shared_ptr<pairs::Pair> m_d1d2;
83 
85  std::shared_ptr<pairs::Pair> m_d1r;
86 
88  std::shared_ptr<pairs::Pair> m_d2r;
89 
91 
92 
97 
102  std::shared_ptr<catalogue::Catalogue> data2 () const { return m_data2; }
103 
108  std::shared_ptr<pairs::Pair> d1d2 () const { return m_d1d2; }
109 
114  std::shared_ptr<pairs::Pair> d1r () const { return m_d1r; }
115 
120  std::shared_ptr<pairs::Pair> d2r () const { return m_d2r; }
121 
123 
124 
129 
175  void count_allPairs (const TwoPType type, const std::string dir_output_pairs=par::defaultString, const std::vector<std::string> dir_input_pairs={}, const bool count_d1d2=true, const bool count_rr=true, const bool count_d1r=true, const bool count_d2r=true, const bool tcount=true, const Estimator estimator=Estimator::_SzapudiSzalay_, const double fact=0.1);
176 
178 
179 
184 
219  virtual std::shared_ptr<data::Data> correlation_SzapudiSzalayEstimator (const std::shared_ptr<pairs::Pair> d1d2, const std::shared_ptr<pairs::Pair> rr, const std::shared_ptr<pairs::Pair> d1r, const std::shared_ptr<pairs::Pair> d2r, const int nData1, const double nData1_weighted, const int nData2, const double nData2_weighted, const int nRandom, const double nRandom_weighted) = 0;
220 
258  virtual void measurePoisson (const std::string dir_output_pairs = par::defaultString, const std::vector<std::string> dir_input_pairs={}, const bool count_d1d2=true, const bool count_rr=true, const bool count_d1r=true, const bool count_d2r=true, const bool tcount=true, const Estimator estimator=Estimator::_LandySzalay_, double fact=0.1)
259  { (void)dir_output_pairs; (void)dir_input_pairs; (void)count_d1d2; (void)count_rr; (void)count_d1r; (void)count_d2r; (void)tcount; (void)estimator; (void)fact; cbl::ErrorCBL("", "measurePoisson", "TwoPointCorrelation.h"); }
260 
262 
263 
264  public:
265 
270 
276 
300  : TwoPointCorrelation(data1, random, compute_extra_info, random_dilution_fraction), m_data2(std::make_shared<catalogue::Catalogue>(catalogue::Catalogue(std::move(data2)))) {}
301 
306  virtual ~TwoPointCorrelationCross () = default;
307 
309 
310 
315 
340  double PoissonError (const Estimator estimator, const double d1d2, const double rr, const double d1r, const double d2r, const int nData1, const int nData2, const int nRandom) const;
341 
343 
344  };
345  }
346  }
347 }
348 
349 #endif
The class TwoPointCorrelation.
The class Catalogue.
Definition: Catalogue.h:654
TwoPointCorrelationCross(const catalogue::Catalogue data1, const catalogue::Catalogue data2, const catalogue::Catalogue random, const bool compute_extra_info=false, const double random_dilution_fraction=1.)
constructor
TwoPointCorrelationCross()=default
default constructor Cross
double PoissonError(const Estimator estimator, const double d1d2, const double rr, const double d1r, const double d2r, const int nData1, const int nData2, const int nRandom) const
the Poisson errors
std::shared_ptr< pairs::Pair > d1r() const
get the protected member m_d1r
void count_allPairs(const TwoPType type, const std::string dir_output_pairs=par::defaultString, const std::vector< std::string > dir_input_pairs={}, const bool count_d1d2=true, const bool count_rr=true, const bool count_d1r=true, const bool count_d2r=true, const bool tcount=true, const Estimator estimator=Estimator::_SzapudiSzalay_, const double fact=0.1)
count the data-data, random-random and data-random pairs, used to construct the estimator of the two-...
virtual ~TwoPointCorrelationCross()=default
default destructor
std::shared_ptr< pairs::Pair > m_d2r
number of data2-random pairs
std::shared_ptr< pairs::Pair > m_d1r
number of data1-random pairs
std::shared_ptr< pairs::Pair > d1d2() const
get the protected member m_d1d2
std::shared_ptr< catalogue::Catalogue > m_data2
input second data catalogue
std::shared_ptr< pairs::Pair > m_d1d2
number of data1-data2 pairs
virtual void measurePoisson(const std::string dir_output_pairs=par::defaultString, const std::vector< std::string > dir_input_pairs={}, const bool count_d1d2=true, const bool count_rr=true, const bool count_d1r=true, const bool count_d2r=true, const bool tcount=true, const Estimator estimator=Estimator::_LandySzalay_, double fact=0.1)
measure the two-point correlation function with Poisson errors
virtual std::shared_ptr< data::Data > correlation_SzapudiSzalayEstimator(const std::shared_ptr< pairs::Pair > d1d2, const std::shared_ptr< pairs::Pair > rr, const std::shared_ptr< pairs::Pair > d1r, const std::shared_ptr< pairs::Pair > d2r, const int nData1, const double nData1_weighted, const int nData2, const double nData2_weighted, const int nRandom, const double nRandom_weighted)=0
get a dataset containing the cross two-point correlation function measured with the Szapudi-Szalay es...
std::shared_ptr< pairs::Pair > d2r() const
get the protected member m_d2r
std::shared_ptr< catalogue::Catalogue > data2() const
get the protected member m_data2
std::shared_ptr< catalogue::Catalogue > random() const
get the protected member m_random
bool compute_extra_info() const
get the protected member m_compute_extra_info
bool random_dilution_fraction() const
get the protected member m_random_dilution_fraction
std::shared_ptr< pairs::Pair > rr() const
get the protected member m_rr
static const std::string defaultString
default std::string value
Definition: Constants.h:336
Estimator
the two-point correlation estimator
@ _SzapudiSzalay_
Szapudi&Szalay estimator.
@ _LandySzalay_
Landy&Szalay estimator.
TwoPType
the two-point correlation function type
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