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

The class NumberCounts1D. More...

#include <NumberCounts1D.h>

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

Public Member Functions

Constructors/destructors
 NumberCounts1D ()
 default constructor More...
 
virtual ~NumberCounts1D ()=default
 default destructor
 
 NumberCounts1D (const catalogue::Var var, const BinType bin_type, const catalogue::Catalogue data, const size_t nbins, const double minVar=par::defaultDouble, const double maxVar=par::defaultDouble, const double shift=0.5, const glob::HistogramType hist_type=glob::HistogramType::_N_V_, const double fact=1.)
 constructor More...
 
 NumberCounts1D (const catalogue::Var var, const std::vector< double > vec_edges, 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 >> hist, const bool JK) override
 compute the covariance matrix 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 the measured covariance matrix More...
 
std::shared_ptr< data::DataGaussian_smoothing (const double sigma) override
 apply a Gaussian filter to the distribution 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_Var
 the 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 NumberCounts1D.

"Headers/NumberCounts1D.h"

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

Definition at line 68 of file NumberCounts1D.h.

Constructor & Destructor Documentation

◆ NumberCounts1D() [1/3]

cbl::measure::numbercounts::NumberCounts1D::NumberCounts1D ( )
inline

default constructor

1D

Definition at line 128 of file NumberCounts1D.h.

◆ NumberCounts1D() [2/3]

cbl::measure::numbercounts::NumberCounts1D::NumberCounts1D ( const catalogue::Var  var,
const BinType  bin_type,
const catalogue::Catalogue  data,
const size_t  nbins,
const double  minVar = par::defaultDouble,
const double  maxVar = par::defaultDouble,
const double  shift = 0.5,
const glob::HistogramType  hist_type = glob::HistogramType::_N_V_,
const double  fact = 1. 
)

constructor

Parameters
varthe variable type
bin_typethe bin type
dataobject of class Catalogue
nbinsthe number of bins
minVarminimum range
maxVarmaximmum range
shiftthe shift of the bin
hist_typethe type of histogram
factfactor used to normalized the distribution

1D

Definition at line 47 of file NumberCounts1D.cpp.

◆ NumberCounts1D() [3/3]

cbl::measure::numbercounts::NumberCounts1D::NumberCounts1D ( const catalogue::Var  var,
const std::vector< double >  vec_edges,
const catalogue::Catalogue  data,
const glob::HistogramType  hist_type = glob::HistogramType::_N_V_,
const double  fact = 1. 
)

constructor

Parameters
varthe variable type
vec_edgesbin edges, used only in case of a custom binning
dataobject of class Catalogue
hist_typethe type of histogram
factfactor used to normalized the distribution

1D

Definition at line 72 of file NumberCounts1D.cpp.

Member Function Documentation

◆ compute_covariance()

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

compute the covariance matrix

Parameters
histvector 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 261 of file NumberCounts1D.cpp.

◆ Gaussian_smoothing()

shared_ptr< data::Data > cbl::measure::numbercounts::NumberCounts1D::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 305 of file NumberCounts1D.cpp.

◆ m_measureBootstrap()

shared_ptr< data::Data > cbl::measure::numbercounts::NumberCounts1D::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
point to object of type Data

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

Definition at line 187 of file NumberCounts1D.cpp.

◆ m_measureJackknife()

shared_ptr< data::Data > cbl::measure::numbercounts::NumberCounts1D::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
point to object of type Data

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

Definition at line 139 of file NumberCounts1D.cpp.

◆ m_measurePoisson()

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

measure the number counts with Poisson errors

Returns
point to object of type Data

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

Definition at line 96 of file NumberCounts1D.cpp.

◆ measure()

void cbl::measure::numbercounts::NumberCounts1D::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.

Examples
numberCounts.cpp, and numberCounts_errors.cpp.

Definition at line 239 of file NumberCounts1D.cpp.

◆ write()

void cbl::measure::numbercounts::NumberCounts1D::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 278 of file NumberCounts1D.cpp.

◆ write_covariance()

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

write the measured covariance matrix

Parameters
diroutput directory
fileoutput file

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

Definition at line 293 of file NumberCounts1D.cpp.


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