![]() |
CosmoBolognaLib
Free Software C++/Python libraries for cosmological calculations
|
The class NumberCounts1D. More...
#include <NumberCounts1D.h>
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::Data > | Gaussian_smoothing (const double sigma) override |
apply a Gaussian filter to the distribution More... | |
![]() | |
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::Catalogue > | catalogue () |
function to get the protected member m_data More... | |
std::shared_ptr< glob::Histogram > | histogram () |
return the binned counts More... | |
glob::HistogramType | HistogramType () |
return the type of histogram normalization More... | |
double | fact () |
return the normalization factor More... | |
![]() | |
Measure ()=default | |
default constructor | |
virtual | ~Measure ()=default |
default destructor | |
virtual std::shared_ptr< data::Data > | dataset () const |
get the protected member dataset More... | |
Protected Member Functions | |
Protected member functions to measure the number counts | |
std::shared_ptr< data::Data > | m_measurePoisson () override |
measure the number counts with Poisson errors More... | |
std::shared_ptr< data::Data > | m_measureJackknife (const std::string dir_output_resample=par::defaultString) override |
measure the number counts with Jackknife covariance matrix More... | |
std::shared_ptr< data::Data > | m_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 | |
![]() | |
std::shared_ptr< catalogue::Catalogue > | m_data |
input data catalogue | |
glob::HistogramType | m_HistogramType |
the histogram type | |
double | m_fact |
the normalization factor | |
std::shared_ptr< glob::Histogram > | m_histogram |
number counts type | |
![]() | |
std::shared_ptr< data::Data > | m_dataset |
the dataset of the measure | |
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.
|
inline |
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
var | the variable type |
bin_type | the bin type |
data | object of class Catalogue |
nbins | the number of bins |
minVar | minimum range |
maxVar | maximmum range |
shift | the shift of the bin |
hist_type | the type of histogram |
fact | factor used to normalized the distribution |
1D
Definition at line 47 of file NumberCounts1D.cpp.
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
var | the variable type |
vec_edges | bin edges, used only in case of a custom binning |
data | object of class Catalogue |
hist_type | the type of histogram |
fact | factor used to normalized the distribution |
1D
Definition at line 72 of file NumberCounts1D.cpp.
|
overridevirtual |
compute the covariance matrix
hist | vector containing the measures used to compute the covariance matrix |
JK | true → 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.
|
overridevirtual |
apply a Gaussian filter to the distribution
σ | of the Gaussian kernel |
Reimplemented from cbl::measure::numbercounts::NumberCounts.
Definition at line 305 of file NumberCounts1D.cpp.
|
overrideprotectedvirtual |
measure the number counts with Bootstrap covariance matrix
dir_output_resample | output directory of the resampling correlation functions |
nResamplings | number of resampling used for bootstrap |
seed | the seed for random number generation |
Reimplemented from cbl::measure::numbercounts::NumberCounts.
Definition at line 187 of file NumberCounts1D.cpp.
|
overrideprotectedvirtual |
measure the number counts with Jackknife covariance matrix
dir_output_resample | output directory of the resampling correlation functions |
Reimplemented from cbl::measure::numbercounts::NumberCounts.
Definition at line 139 of file NumberCounts1D.cpp.
|
overrideprotectedvirtual |
measure the number counts with Poisson errors
Reimplemented from cbl::measure::numbercounts::NumberCounts.
Definition at line 96 of file NumberCounts1D.cpp.
|
overridevirtual |
measure the number counts
errorType | type of error |
dir_output_resample | output directory of the resampling correlation functions |
nResamplings | number of resampling used for bootstrap |
seed | the seed for random number generation |
conv | true → 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 239 of file NumberCounts1D.cpp.
|
overridevirtual |
write the measured number counts
dir | output directory |
file | output file |
rank | cpu index (for MPI usage) |
Reimplemented from cbl::measure::numbercounts::NumberCounts.
Definition at line 278 of file NumberCounts1D.cpp.
|
overridevirtual |
write the measured covariance matrix
dir | output directory |
file | output file |
Reimplemented from cbl::measure::numbercounts::NumberCounts.
Definition at line 293 of file NumberCounts1D.cpp.