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

The class NumberCounts. More...

#include <NumberCounts.h>

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

Public Member Functions

Constructors/destructors
 NumberCounts ()=default
 default constructor
 
virtual ~NumberCounts ()=default
 default destructor
 
Member functions to set protected members
void set_data (const catalogue::Catalogue data)
 add a data catalogue More...
 
Member functions to get protected members
std::shared_ptr< catalogue::Cataloguecatalogue ()
 function to get the protected member m_data More...
 
Member functions to measure the number counts
virtual 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.)
 measure the number counts More...
 
input/output member functions (customized in all the derived classes)
virtual void write (const std::string dir=par::defaultString, const std::string file=par::defaultString, const int rank=0) const
 write the measured number counts More...
 
Member functions to estimate the errors and covariance matrices
virtual void write_covariance (const std::string dir, const std::string file) const
 write the measured covariance matrix More...
 
virtual void compute_covariance (const std::vector< std::shared_ptr< glob::Histogram >> histo, const bool JK)
 compute the covariance matrix More...
 
virtual std::shared_ptr< data::DataGaussian_smoothing (const double sigma)
 apply a Gaussian filter to the distribution More...
 
Functions to get the private members of the class
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
virtual std::shared_ptr< data::Datam_measurePoisson ()
 measure the number counts with Poisson errors More...
 
virtual std::shared_ptr< data::Datam_measureJackknife (const std::string dir_output_resample=par::defaultString)
 measure the number counts with Jackknife covariance matrix More...
 
virtual std::shared_ptr< data::Datam_measureBootstrap (const std::string dir_output_resample=par::defaultString, const int nResamplings=0, const int seed=3213)
 measure the number counts with Bootstrap covariance matrix More...
 

Protected Attributes

Input catalogue
std::shared_ptr< catalogue::Cataloguem_data
 input data catalogue
 
Binned data
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 NumberCounts.

"Headers/NumberCounts.h"

This is the base class used to measure the number counts

Definition at line 69 of file NumberCounts.h.

Member Function Documentation

◆ catalogue()

std::shared_ptr<catalogue::Catalogue> cbl::measure::numbercounts::NumberCounts::catalogue ( )
inline

function to get the protected member m_data

Returns
return the protected member m_data

Definition at line 193 of file NumberCounts.h.

◆ compute_covariance()

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

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 in cbl::measure::numbercounts::NumberCounts2D, and cbl::measure::numbercounts::NumberCounts1D.

Definition at line 261 of file NumberCounts.h.

◆ fact()

double cbl::measure::numbercounts::NumberCounts::fact ( )
inline

return the normalization factor

Returns
the normalization factor

Definition at line 301 of file NumberCounts.h.

◆ Gaussian_smoothing()

virtual std::shared_ptr<data::Data> cbl::measure::numbercounts::NumberCounts::Gaussian_smoothing ( const double  sigma)
inlinevirtual

apply a Gaussian filter to the distribution

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

Reimplemented in cbl::measure::numbercounts::NumberCounts2D, and cbl::measure::numbercounts::NumberCounts1D.

Definition at line 271 of file NumberCounts.h.

◆ histogram()

std::shared_ptr<glob::Histogram> cbl::measure::numbercounts::NumberCounts::histogram ( )
inline

return the binned counts

Returns
pointer to an object of class Histogram

Definition at line 286 of file NumberCounts.h.

◆ HistogramType()

glob::HistogramType cbl::measure::numbercounts::NumberCounts::HistogramType ( )
inline

return the type of histogram normalization

Returns
the type of histogram normalization

Definition at line 294 of file NumberCounts.h.

◆ m_measureBootstrap()

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

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, or an error message if the derived object does not have this member

Reimplemented in cbl::measure::numbercounts::NumberCounts2D, and cbl::measure::numbercounts::NumberCounts1D.

Definition at line 142 of file NumberCounts.h.

◆ m_measureJackknife()

virtual std::shared_ptr<data::Data> cbl::measure::numbercounts::NumberCounts::m_measureJackknife ( const std::string  dir_output_resample = par::defaultString)
inlineprotectedvirtual

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, or an error message if the derived object does not have this member

Reimplemented in cbl::measure::numbercounts::NumberCounts2D, and cbl::measure::numbercounts::NumberCounts1D.

Definition at line 125 of file NumberCounts.h.

◆ m_measurePoisson()

virtual std::shared_ptr<data::Data> cbl::measure::numbercounts::NumberCounts::m_measurePoisson ( )
inlineprotectedvirtual

measure the number counts with Poisson errors

Returns
pointer to object of type data, or an error message if the derived object does not have this member

Reimplemented in cbl::measure::numbercounts::NumberCounts2D, and cbl::measure::numbercounts::NumberCounts1D.

Definition at line 112 of file NumberCounts.h.

◆ measure()

virtual void cbl::measure::numbercounts::NumberCounts::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. 
)
inlinevirtual

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 in cbl::measure::numbercounts::NumberCounts2D, and cbl::measure::numbercounts::NumberCounts1D.

Definition at line 218 of file NumberCounts.h.

◆ set_data()

void cbl::measure::numbercounts::NumberCounts::set_data ( const catalogue::Catalogue  data)
inline

add a data catalogue

Parameters
dataobject of class Catalogue

Definition at line 179 of file NumberCounts.h.

◆ write()

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

write the measured number counts

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

Reimplemented in cbl::measure::numbercounts::NumberCounts2D, and cbl::measure::numbercounts::NumberCounts1D.

Definition at line 234 of file NumberCounts.h.

◆ write_covariance()

virtual void cbl::measure::numbercounts::NumberCounts::write_covariance ( const std::string  dir,
const std::string  file 
) const
inlinevirtual

write the measured covariance matrix

Parameters
diroutput directory
fileoutput file

Reimplemented in cbl::measure::numbercounts::NumberCounts2D, and cbl::measure::numbercounts::NumberCounts1D.

Definition at line 251 of file NumberCounts.h.


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