35 #ifndef __TWOPOINTWED__
36 #define __TWOPOINTWED__
103 std::shared_ptr<data::Data>
Wedges (
const std::vector<double>
rr,
const std::vector<double> mu,
const std::vector<std::vector<double> > xi,
const std::vector<std::vector<double> > error_xi)
override;
118 std::shared_ptr<data::Data>
data_with_extra_info (
const std::vector<double> rad,
const std::vector<double> wedges,
const std::vector<double> error)
const;
243 void measureBootstrap (
const int nMocks,
const std::string dir_output_pairs =
par::defaultString,
const std::vector<std::string> dir_input_pairs={},
const std::string dir_output_resample =
par::defaultString,
const bool count_dd=
true,
const bool count_rr=
true,
const bool count_dr=
true,
const bool tcount=
true,
const Estimator estimator=
Estimator::_LandySzalay_,
const double fact=0.1,
const int seed=3213)
override;
255 std::vector<std::shared_ptr<data::Data> >
XiJackknife (
const std::vector<std::shared_ptr<pairs::Pair> >
dd,
const std::vector<std::shared_ptr<pairs::Pair> >
rr)
override;
269 std::vector<std::shared_ptr<data::Data> >
XiJackknife (
const std::vector<std::shared_ptr<pairs::Pair> >
dd,
const std::vector<std::shared_ptr<pairs::Pair> >
rr,
const std::vector<std::shared_ptr<pairs::Pair> >
dr)
override;
285 std::vector<std::shared_ptr<data::Data> >
XiBootstrap (
const int nMocks,
const std::vector<std::shared_ptr<pairs::Pair> >
dd,
const std::vector<std::shared_ptr<pairs::Pair> >
rr,
const int seed=3213)
override;
304 std::vector<std::shared_ptr<data::Data> >
XiBootstrap (
const int nMocks,
const std::vector<std::shared_ptr<pairs::Pair> >
dd,
const std::vector<std::shared_ptr<pairs::Pair> >
rr,
const std::vector<std::shared_ptr<pairs::Pair> >
dr,
const int seed=3213)
override;
382 TwoPointCorrelation_wedges (
catalogue::Catalogue data,
catalogue::Catalogue random,
const BinType binType_rad,
const double rMin,
const double rMax,
const int nbins_rad,
const double shift_rad,
const int nWedges=2,
const int nbins_mu=50,
const double shift_mu=0.5,
const std::vector<std::vector<double>>
mu_integral_limits={{0., 0.5}, {0.5, 1.}},
const CoordinateUnits angularUnits=
CoordinateUnits::_radians_, std::function<double(
double)> angularWeight=
nullptr,
const bool compute_extra_info=
false,
const double random_dilution_fraction=1.)
383 :
TwoPointCorrelation2D_polar(
data,
random, binType_rad, rMin, rMax, nbins_rad, shift_rad,
BinType::_linear_, 0., 1., nbins_mu, shift_mu, angularUnits, angularWeight,
compute_extra_info,
random_dilution_fraction)
388 cbl::ErrorCBL(
"nWedges must be larger than 2!",
"TwoPointCorrelation_wedges",
"TwoPointCorrelation_wedges.h");
458 TwoPointCorrelation_wedges (
catalogue::Catalogue data,
catalogue::Catalogue random,
const BinType binType_rad,
const double rMin,
const double rMax,
const double binSize_rad,
const double shift_rad,
const int nWedges=2,
const double binSize_mu=1.,
const double shift_mu=0.5,
const std::vector<std::vector<double>>
mu_integral_limits={{0., 0.5}, {0.5, 1.}},
const CoordinateUnits angularUnits=
CoordinateUnits::_radians_, std::function<double(
double)> angularWeight=
nullptr,
const bool compute_extra_info=
false,
const double random_dilution_fraction=1.)
459 :
TwoPointCorrelation2D_polar(
data,
random, binType_rad, rMin, rMax, binSize_rad, shift_rad,
BinType::_linear_, 0., 1., binSize_mu, shift_mu, angularUnits, angularWeight,
compute_extra_info,
random_dilution_fraction)
464 cbl::ErrorCBL(
"nWedges must be larger than 2!",
"TwoPointCorrelation_wedges",
"TwoPointCorrelation_wedges.h");
505 std::vector<double>
xx ()
const override;
523 std::vector<double>
xiParallel ()
const override;
535 std::vector<double>
yy ()
const
536 {
cbl::ErrorCBL(
"",
"yy",
"TwoPointCorrelation_wedges.h"); std::vector<double> vv;
return vv; }
542 std::vector<double>
xi1D ()
const
543 {
cbl::ErrorCBL(
"",
"xi1D",
"TwoPointCorrelation_wedges.h"); std::vector<double> vv;
return vv; }
552 {
cbl::ErrorCBL(
"",
"error1D",
"TwoPointCorrelation_wedges.h"); std::vector<double> vv;
return vv; }
558 std::vector<std::vector<double> >
xi2D ()
const
559 {
cbl::ErrorCBL(
"",
"xi2D",
"TwoPointCorrelation_wedges.h"); std::vector<std::vector<double> > vv;
return vv; }
567 std::vector<std::vector<double> >
error2D ()
const
568 {
cbl::ErrorCBL(
"",
"error2D",
"TwoPointCorrelation_wedges.h"); std::vector<std::vector<double> > vv;
return vv; }
624 void measure (
const ErrorType errorType=
ErrorType::_Poisson_,
const std::string dir_output_pairs=
par::defaultString,
const std::vector<std::string> dir_input_pairs={},
const std::string dir_output_resample=
par::defaultString,
const int nMocks=0,
const bool count_dd=
true,
const bool count_rr=
true,
const bool count_dr=
true,
const bool tcount=
true,
const Estimator estimator=
Estimator::_LandySzalay_,
const double fact=0.1,
const int seed=3213)
override;
640 void read (
const std::string dir,
const std::string file)
override
667 void read_covariance (
const std::string dir,
const std::string file)
override;
675 void write_covariance (
const std::string dir,
const std::string file)
const override;
685 void compute_covariance (
const std::vector<std::shared_ptr<data::Data>> xi,
const bool JK)
override;
696 void compute_covariance (
const std::vector<std::string> file,
const bool JK)
override;
The class TwoPointCorrelation2D_polar.
The class TwoPointCorrelation2D_polar.
TwoPointCorrelation2D_polar()
default constructor 2D_polar
The class TwoPointCorrelation_wedges.
void measure(const ErrorType errorType=ErrorType::_Poisson_, const std::string dir_output_pairs=par::defaultString, const std::vector< std::string > dir_input_pairs={}, const std::string dir_output_resample=par::defaultString, const int nMocks=0, const bool count_dd=true, const bool count_rr=true, const bool count_dr=true, const bool tcount=true, const Estimator estimator=Estimator::_LandySzalay_, const double fact=0.1, const int seed=3213) override
measure the wedges of the two-point correlation function
std::vector< double > yy() const
get the y coordinates
int nWedges() const
get the number of measured wedges
void write(const std::string dir=par::defaultString, const std::string file=par::defaultString, const int rank=0) const override
write the wedges of the two-point correlation function
std::vector< double > xiParallel() const override
get the parallel wedge
void write_covariance(const std::string dir, const std::string file) const override
write the measured two-point correlation
void measureBootstrap(const int nMocks, const std::string dir_output_pairs=par::defaultString, const std::vector< std::string > dir_input_pairs={}, const std::string dir_output_resample=par::defaultString, const bool count_dd=true, const bool count_rr=true, const bool count_dr=true, const bool tcount=true, const Estimator estimator=Estimator::_LandySzalay_, const double fact=0.1, const int seed=3213) override
measure the wedges of the two-point correlation function estimating the covariance with Bootstrap res...
std::vector< std::shared_ptr< data::Data > > XiBootstrap(const int nMocks, const std::vector< std::shared_ptr< pairs::Pair > > dd, const std::vector< std::shared_ptr< pairs::Pair > > rr, const int seed=3213) override
measure the bootstrap resampling of the wedges of the two-point correlation function
void read_covariance(const std::string dir, const std::string file) override
read the measured covariance matrix
std::shared_ptr< data::Data > Wedges(const std::vector< double > rr, const std::vector< double > mu, const std::vector< std::vector< double > > xi, const std::vector< std::vector< double > > error_xi) override
pointer to the data containing the wedges of the two-point correlation function
void compute_covariance(const std::vector< std::shared_ptr< data::Data >> xi, const bool JK) override
compute the covariance matrix
std::vector< std::vector< double > > m_mu_integral_limits
integral limits used to measure the wedges
std::shared_ptr< data::Data > data_with_extra_info(const std::vector< double > rad, const std::vector< double > wedges, const std::vector< double > error) const
pointer to the data object containing the values of the wedges with the extra info retrieved from the...
~TwoPointCorrelation_wedges()=default
default destructor
TwoPointCorrelation_wedges()
default constructor _wedges
std::vector< double > xx() const override
get the x coordinates
std::vector< double > xi1D() const
get the the binned correlation function
void measurePoisson(const std::string dir_output_pairs=par::defaultString, const std::vector< std::string > dir_input_pairs={}, const bool count_dd=true, const bool count_rr=true, const bool count_dr=true, const bool tcount=true, const Estimator estimator=Estimator::_LandySzalay_, const double fact=0.1) override
measure the wedges of the two-point correlation function with Poisson errors
std::vector< std::vector< double > > mu_integral_limits() const
get the integral limits used to measure the wedges
std::vector< std::vector< double > > error2D() const
get the errors on the binned 2D correlation function function
void read(const std::string dir, const std::string file) override
read the wedges of the two-point correlation function
TwoPointCorrelation_wedges(catalogue::Catalogue data, catalogue::Catalogue random, const BinType binType_rad, const double rMin, const double rMax, const int nbins_rad, const double shift_rad, const int nWedges=2, const int nbins_mu=50, const double shift_mu=0.5, const std::vector< std::vector< double >> mu_integral_limits={{0., 0.5}, {0.5, 1.}}, const CoordinateUnits angularUnits=CoordinateUnits::_radians_, std::function< double(double)> angularWeight=nullptr, const bool compute_extra_info=false, const double random_dilution_fraction=1.)
constructor, using the number of bins
std::vector< double > error1D() const
get the error on the binned correlation function function
void measureJackknife(const std::string dir_output_pairs=par::defaultString, const std::vector< std::string > dir_input_pairs={}, const std::string dir_output_resample=par::defaultString, const bool count_dd=true, const bool count_rr=true, const bool count_dr=true, const bool tcount=true, const Estimator estimator=Estimator::_LandySzalay_, const double fact=0.1) override
measure the wedges of the two-point correlation function estimating the covariance with Jackknife res...
std::vector< double > xiPerpendicular() const override
get the perpendicular wedge
int m_nWedges
number of measured wedges
std::vector< std::shared_ptr< data::Data > > XiJackknife(const std::vector< std::shared_ptr< pairs::Pair > > dd, const std::vector< std::shared_ptr< pairs::Pair > > rr) override
measure the jackknife resampling of the wedges of the two-point correlation function
TwoPointCorrelation_wedges(catalogue::Catalogue data, catalogue::Catalogue random, const BinType binType_rad, const double rMin, const double rMax, const double binSize_rad, const double shift_rad, const int nWedges=2, const double binSize_mu=1., const double shift_mu=0.5, const std::vector< std::vector< double >> mu_integral_limits={{0., 0.5}, {0.5, 1.}}, const CoordinateUnits angularUnits=CoordinateUnits::_radians_, std::function< double(double)> angularWeight=nullptr, const bool compute_extra_info=false, const double random_dilution_fraction=1.)
constructor, using the bin size
std::vector< std::vector< double > > xi2D() const
get the the binned 2D correlation function
std::vector< double > errorParallel() const override
get the errors on the parallel wedge
std::vector< double > errorPerpendicular() const override
get the errors on the perpendicular wedge
std::shared_ptr< pairs::Pair > dr() const
get the protected member m_dr
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
std::shared_ptr< pairs::Pair > dd() const
get the protected member m_dd
std::shared_ptr< catalogue::Catalogue > data() const
get the protected member m_data
TwoPType m_twoPType
two-point correlation function type
static const char fINT[]
conversion symbol for: int -> std::string
static const std::string defaultString
default std::string value
@ _workInProgress_
error due to work in progress
Estimator
the two-point correlation estimator
@ _LandySzalay_
Landy&Szalay estimator.
@ _wedges_
the wedges of the two-point correlation function, ξi(r)
ErrorType
the two-point correlation function error type
@ _Poisson_
Poissonian error.
The global namespace of the CosmoBolognaLib
std::string conv(const T val, const char *fact)
convert a number to a std::string
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
CoordinateUnits
the coordinate units
@ _radians_
angle in radians