CosmoBolognaLib
Free Software C++/Python libraries for cosmological calculations
cbl::measure::numbercounts::NumberCounts2D Class Reference

The class NumberCounts2D. More...

#include <NumberCounts2D.h>

Inheritance diagram for cbl::measure::numbercounts::NumberCounts2D:
Collaboration diagram for cbl::measure::numbercounts::NumberCounts2D:

Public Member Functions

Constructors/destructors
 NumberCounts2D ()
 default constructor More...
 
virtual ~NumberCounts2D ()=default
 default destructor
 
 NumberCounts2D (const catalogue::Var var1, const BinType bin_type1, const catalogue::Var var2, const BinType bin_type2, const catalogue::Catalogue data, const size_t nbins1, const size_t nbins2, const double minVar1=par::defaultDouble, const double maxVar1=par::defaultDouble, const double minVar2=par::defaultDouble, const double maxVar2=par::defaultDouble, const double shift1=0.5, const double shift2=0.5, const glob::HistogramType hist_type=glob::HistogramType::_N_V_, const double fact=1.)
 constructor More...
 
 NumberCounts2D (const catalogue::Var var1, const catalogue::Var var2, const std::vector< double > vec_edges1, const std::vector< double > vec_edges2, const catalogue::Catalogue data, const glob::HistogramType hist_type=glob::HistogramType::_N_V_, const double fact=1.)
 constructor More...
 
Member functions to measure the number counts
void measure (const ErrorType errorType=ErrorType::_Poisson_, const std::string dir_output_resample=par::defaultString, const int nResamplings=0, const int seed=3213, const bool conv=false, const double sigma=0.) override
 measure the number counts More...
 
void compute_covariance (const std::vector< std::shared_ptr< glob::Histogram >> histo, const bool JK) override
 compute the covariance matrix More...
 
std::shared_ptr< data::DataGaussian_smoothing (const double sigma) override
 apply a Gaussian filter to the distribution More...
 
Input/Output member functions (customized in all the derived classes)
void write (const std::string dir=par::defaultString, const std::string file=par::defaultString, const int rank=0) const override
 write the measured number counts More...
 
void write_covariance (const std::string dir, const std::string file) const override
 write measured covariance matrix More...
 
- Public Member Functions inherited from cbl::measure::numbercounts::NumberCounts
 NumberCounts ()=default
 default constructor
 
virtual ~NumberCounts ()=default
 default destructor
 
void set_data (const catalogue::Catalogue data)
 add a data catalogue More...
 
std::shared_ptr< catalogue::Cataloguecatalogue ()
 function to get the protected member m_data More...
 
std::shared_ptr< glob::Histogramhistogram ()
 return the binned counts More...
 
glob::HistogramType HistogramType ()
 return the type of histogram normalization More...
 
double fact ()
 return the normalization factor More...
 
- Public Member Functions inherited from cbl::measure::Measure
 Measure ()=default
 default constructor
 
virtual ~Measure ()=default
 default destructor
 
virtual std::shared_ptr< data::Datadataset () const
 get the protected member dataset More...
 

Protected Member Functions

Protected member functions to measure the number counts
std::shared_ptr< data::Datam_measurePoisson () override
 measure the number counts with Poisson errors More...
 
std::shared_ptr< data::Datam_measureJackknife (const std::string dir_output_resample=par::defaultString) override
 measure the number counts with Jackknife covariance matrix More...
 
std::shared_ptr< data::Datam_measureBootstrap (const std::string dir_output_resample=par::defaultString, const int nResamplings=0, const int seed=3213) override
 measure the number counts with Bootstrap covariance matrix More...
 
Protected member functions to measure the number counts

Protected Attributes

catalogue::Var m_Var1
 the first catalogue variable to bin
 
catalogue::Var m_Var2
 the second catalogue variable to bin
 
- Protected Attributes inherited from cbl::measure::numbercounts::NumberCounts
std::shared_ptr< catalogue::Cataloguem_data
 input data catalogue
 
glob::HistogramType m_HistogramType
 the histogram type
 
double m_fact
 the normalization factor
 
std::shared_ptr< glob::Histogramm_histogram
 number counts type
 
- Protected Attributes inherited from cbl::measure::Measure
std::shared_ptr< data::Datam_dataset
 the dataset of the measure
 

Detailed Description

The class NumberCounts2D.

"Headers/NumberCounts2D.h"

This is the base class used to measure the number counts of one variable

Definition at line 67 of file NumberCounts2D.h.

Constructor & Destructor Documentation

◆ NumberCounts2D() [1/3]

cbl::measure::numbercounts::NumberCounts2D::NumberCounts2D ( )
inline

default constructor

2D

Definition at line 130 of file NumberCounts2D.h.

◆ NumberCounts2D() [2/3]

cbl::measure::numbercounts::NumberCounts2D::NumberCounts2D ( const catalogue::Var  var1,
const BinType  bin_type1,
const catalogue::Var  var2,
const BinType  bin_type2,
const catalogue::Catalogue  data,
const size_t  nbins1,
const size_t  nbins2,
const double  minVar1 = par::defaultDouble,
const double  maxVar1 = par::defaultDouble,
const double  minVar2 = par::defaultDouble,
const double  maxVar2 = par::defaultDouble,
const double  shift1 = 0.5,
const double  shift2 = 0.5,
const glob::HistogramType  hist_type = glob::HistogramType::_N_V_,
const double  fact = 1. 
)

constructor

Parameters
var1the first variable type
bin_type1the first bin type
var2the second variable type
bin_type2the second bin type
dataobject of class Catalogue
nbins1the number of bins for the first variable
nbins2the number of bins for the second variable
minVar1minimum range for the first variable
maxVar1maximmum range for the first variable
minVar2minimum range for the second variable
maxVar2maximmum range for the second variable
shift1bin shift for the first variable
shift2bin shift for the second variable
hist_typethe type of histogram
factfactor used to normalized the distribution

Definition at line 47 of file NumberCounts2D.cpp.

◆ NumberCounts2D() [3/3]

cbl::measure::numbercounts::NumberCounts2D::NumberCounts2D ( const catalogue::Var  var1,
const catalogue::Var  var2,
const std::vector< double >  vec_edges1,
const std::vector< double >  vec_edges2,
const catalogue::Catalogue  data,
const glob::HistogramType  hist_type = glob::HistogramType::_N_V_,
const double  fact = 1. 
)

constructor

Parameters
var1the first variable type
var2the second variable type
vec_edges1the bin edges for var1
vec_edges2the bin edges for var2
dataobject of class Catalogue
hist_typethe type of histogram
factfactor used to normalized the distribution

Definition at line 71 of file NumberCounts2D.cpp.

Member Function Documentation

◆ compute_covariance()

void cbl::measure::numbercounts::NumberCounts2D::compute_covariance ( const std::vector< std::shared_ptr< glob::Histogram >>  histo,
const bool  JK 
)
overridevirtual

compute the covariance matrix

Parameters
histovector containing the measures used to compute the covariance matrix
JKtrue → compute the jackknife covariance matrix; false compute the standard covariance matrix

Reimplemented from cbl::measure::numbercounts::NumberCounts.

Definition at line 254 of file NumberCounts2D.cpp.

◆ Gaussian_smoothing()

shared_ptr< data::Data > cbl::measure::numbercounts::NumberCounts2D::Gaussian_smoothing ( const double  sigma)
overridevirtual

apply a Gaussian filter to the distribution

Parameters
&sigma;of the Gaussian kernel
Returns
pointer to object of type Data

Reimplemented from cbl::measure::numbercounts::NumberCounts.

Definition at line 295 of file NumberCounts2D.cpp.

◆ m_measureBootstrap()

shared_ptr< data::Data > cbl::measure::numbercounts::NumberCounts2D::m_measureBootstrap ( const std::string  dir_output_resample = par::defaultString,
const int  nResamplings = 0,
const int  seed = 3213 
)
overrideprotectedvirtual

measure the number counts with Bootstrap covariance matrix

Parameters
dir_output_resampleoutput directory of the resampling correlation functions
nResamplingsnumber of resampling used for bootstrap
seedthe seed for random number generation
Returns
pointer to object of type Data

Reimplemented from cbl::measure::numbercounts::NumberCounts.

Definition at line 189 of file NumberCounts2D.cpp.

◆ m_measureJackknife()

shared_ptr< data::Data > cbl::measure::numbercounts::NumberCounts2D::m_measureJackknife ( const std::string  dir_output_resample = par::defaultString)
overrideprotectedvirtual

measure the number counts with Jackknife covariance matrix

Parameters
dir_output_resampleoutput directory of the resampling correlation functions
Returns
pointer to object of type Data

Reimplemented from cbl::measure::numbercounts::NumberCounts.

Definition at line 151 of file NumberCounts2D.cpp.

◆ m_measurePoisson()

shared_ptr< data::Data > cbl::measure::numbercounts::NumberCounts2D::m_measurePoisson ( )
overrideprotectedvirtual

measure the number counts with Poisson errors

Returns
none

Reimplemented from cbl::measure::numbercounts::NumberCounts.

Definition at line 98 of file NumberCounts2D.cpp.

◆ measure()

void cbl::measure::numbercounts::NumberCounts2D::measure ( const ErrorType  errorType = ErrorType::_Poisson_,
const std::string  dir_output_resample = par::defaultString,
const int  nResamplings = 0,
const int  seed = 3213,
const bool  conv = false,
const double  sigma = 0. 
)
overridevirtual

measure the number counts

Parameters
errorTypetype of error
dir_output_resampleoutput directory of the resampling correlation functions
nResamplingsnumber of resampling used for bootstrap
seedthe seed for random number generation
convtrue → compute the Gaussian convolvolution of the distribution; false → do not convolve
sigmaσ of the Gaussian kernel

Reimplemented from cbl::measure::numbercounts::NumberCounts.

Definition at line 231 of file NumberCounts2D.cpp.

◆ write()

void cbl::measure::numbercounts::NumberCounts2D::write ( const std::string  dir = par::defaultString,
const std::string  file = par::defaultString,
const int  rank = 0 
) const
overridevirtual

write the measured number counts

Parameters
diroutput directory
fileoutput file
rankcpu index (for MPI usage)

Reimplemented from cbl::measure::numbercounts::NumberCounts.

Definition at line 272 of file NumberCounts2D.cpp.

◆ write_covariance()

void cbl::measure::numbercounts::NumberCounts2D::write_covariance ( const std::string  dir,
const std::string  file 
) const
overridevirtual

write measured covariance matrix

Parameters
diroutput directory
fileoutput file

Reimplemented from cbl::measure::numbercounts::NumberCounts.

Definition at line 286 of file NumberCounts2D.cpp.


The documentation for this class was generated from the following files: