Nanga Parbat 1.1.0
A TMD fitting framework
Public Member Functions | Protected Attributes | Friends | List of all members
NangaParbat::ChiSquare Class Reference

The "ChiSquare" class computes the χ2's given a set of "DataHandler" objects and the corresponding "ConvolutionTable" objects. The computation depends of the non-perturbative functions given as input. More...

#include <chisquare.h>

Public Member Functions

 ChiSquare (std::vector< std::pair< DataHandler *, ConvolutionTable * > > DSVect, Parameterisation *NPFunc)
 The "ChiSquare" constructor. More...
 
 ChiSquare (Parameterisation *NPFunc)
 The default "ChiSquare" constructor. More...
 
virtual void AddBlock (std::pair< DataHandler *, ConvolutionTable * > DSBlock)
 Add ("DataHandler","ConvolutionTable") pair block to the "DSVect" vector. More...
 
std::vector< double > GetResiduals (int const &ids, bool const &central=false) const
 Function that returns the residuals of the χ2 deriving from the Cholesky decomposition of the covariance matrix. More...
 
std::vector< double > GetResidualDerivatives (int const &ids, int const &ipar) const
 Function that returns the derivative of the residuals of the χ2 deriving from the Cholesky decomposition of the covariance matrix w.r.t. the "ipar"-th parameter. More...
 
std::pair< std::vector< double >, double > GetSystematicShifts (int const &ids) const
 Function that returns the systematic shifts and the associated penalty term of the χ2. More...
 
double Evaluate (int const &ids=-1, bool const &central=false) const
 Function that evaluates the χ2's. More...
 
std::vector< double > Derive () const
 Function that evaluates the (analytic) derivative of the χ2's w.r.t. the "ipar"-th parameter. More...
 
double operator() (int const &ids=-1)
 Utility operator that shortcuts the Evaluate method. More...
 
virtual void SetParameters (std::vector< double > const &pars)
 Function that sets the free parameters of the parameterisation. More...
 
std::vector< std::pair< DataHandler *, ConvolutionTable * > > GetBlocks () const
 Function that returns the vector of ("DataHandler", "ConvolutionTable") object-pairs for all the datasets. More...
 
ParameterisationGetNonPerturbativeFunction () const
 Function that returns the "Parameterisation" object associated to this chisquare object. More...
 
std::vector< int > GetDataPointNumbers () const
 Function that gets the number of data points that pass the qT / Q cut for each data set in the form of a vector of integers. More...
 
std::vector< int > GetDataPointNumbersAfterCuts () const
 Function that gets the number of data points that pass all the cuts for each data set in the form of a vector of integers. More...
 
int GetDataPointNumber () const
 Function that gets the number of data points that pass the qT / Q cut for the whole dataset. More...
 
int GetDataPointNumberAfterCuts () const
 Function that gets the number of data points that pass all the cuts for the whole dataset. More...
 
int GetNumberOfExperiments () const
 Function that returns the number of experiments. More...
 
int GetNumberOfParameters () const
 Function that returns the number of parameters of the parameterisation objects. More...
 
std::vector< double > GetParameters () const
 Function that returns the parameters of the parameterisation objects. More...
 

Protected Attributes

std::vector< std::pair< DataHandler *, ConvolutionTable * > > _DSVect
 Vector of "DataHandler-ConvolutionTable" pairs. More...
 
Parameterisation_NPFunc
 Parameterisation of the non-perturbative component. More...
 
std::vector< int > _ndata
 Vector constaining the number of data points per dataset that pass the qT/Q cut. More...
 
std::vector< int > _ndatac
 Vector constaining the number of data points per dataset that pass all the cuts. More...
 

Friends

YAML::Emitter & operator<< (YAML::Emitter &os, ChiSquare const &chi2)
 Method which prints ChiSquare feautures with cout <<. More...
 

Detailed Description

The "ChiSquare" class computes the χ2's given a set of "DataHandler" objects and the corresponding "ConvolutionTable" objects. The computation depends of the non-perturbative functions given as input.

Examples
ComputeMeanReplica.cc, and RunFit.cc.

Constructor & Destructor Documentation

◆ ChiSquare() [1/2]

NangaParbat::ChiSquare::ChiSquare ( std::vector< std::pair< DataHandler *, ConvolutionTable * > >  DSVect,
Parameterisation NPFunc 
)

The "ChiSquare" constructor.

Parameters
DSVectvector of pairs of "DataHandler" and "ConvolutionTable" objects
NPFunc"Parameterisation" object containing the non-perturbative function(s)

◆ ChiSquare() [2/2]

NangaParbat::ChiSquare::ChiSquare ( Parameterisation NPFunc)

The default "ChiSquare" constructor.

Parameters
NPFunc"Parameterisation" object containing the non-perturbative function(s)

Member Function Documentation

◆ AddBlock()

virtual void NangaParbat::ChiSquare::AddBlock ( std::pair< DataHandler *, ConvolutionTable * >  DSBlock)
virtual

Add ("DataHandler","ConvolutionTable") pair block to the "DSVect" vector.

Parameters
DSBlockthe ("DataHandler","ConvolutionTable")-pair block to be appended

◆ Derive()

std::vector< double > NangaParbat::ChiSquare::Derive ( ) const

Function that evaluates the (analytic) derivative of the χ2's w.r.t. the "ipar"-th parameter.

Returns
a vector containing the value of the derivatives w.r.t. the parameters of global χ2 normalised to the number of data points.
Note
As opposed to the Evaluate function, there seems to be no need to allow for the computation of the derivarive of the χ2 of the single dataset.

◆ Evaluate()

double NangaParbat::ChiSquare::Evaluate ( int const &  ids = -1,
bool const &  central = false 
) const

Function that evaluates the χ2's.

Parameters
idsthe dataset index (default: -1, the global χ2 is computed)
centralif true, the χ2 is computed using the experimental central values rather than the fluctuated data (default: false)
Returns
the value of the χ2 of the "ids"-th block normalised to the number of data points.

◆ GetBlocks()

std::vector< std::pair< DataHandler *, ConvolutionTable * > > NangaParbat::ChiSquare::GetBlocks ( ) const
inline

Function that returns the vector of ("DataHandler", "ConvolutionTable") object-pairs for all the datasets.

Returns
The vector of ("DataHandler", "ConvolutionTable") object-pairs

◆ GetDataPointNumber()

int NangaParbat::ChiSquare::GetDataPointNumber ( ) const
inline

Function that gets the number of data points that pass the qT / Q cut for the whole dataset.

Returns
The number of data points that pass the qT / Q cut for the whole dataset

◆ GetDataPointNumberAfterCuts()

int NangaParbat::ChiSquare::GetDataPointNumberAfterCuts ( ) const
inline

Function that gets the number of data points that pass all the cuts for the whole dataset.

Returns
The number of data points that pass the qT / Q cut for the whole dataset

◆ GetDataPointNumbers()

std::vector< int > NangaParbat::ChiSquare::GetDataPointNumbers ( ) const
inline

Function that gets the number of data points that pass the qT / Q cut for each data set in the form of a vector of integers.

Returns
The number of data points that pass the qT / Q cut for each data set

◆ GetDataPointNumbersAfterCuts()

std::vector< int > NangaParbat::ChiSquare::GetDataPointNumbersAfterCuts ( ) const
inline

Function that gets the number of data points that pass all the cuts for each data set in the form of a vector of integers.

Returns
The number of data points that pass the qT / Q cut for each data set

◆ GetNonPerturbativeFunction()

Parameterisation * NangaParbat::ChiSquare::GetNonPerturbativeFunction ( ) const
inline

Function that returns the "Parameterisation" object associated to this chisquare object.

Returns
The "Parameterisation" object

◆ GetNumberOfExperiments()

int NangaParbat::ChiSquare::GetNumberOfExperiments ( ) const
inline

Function that returns the number of experiments.

Returns
The number of experiments.

◆ GetNumberOfParameters()

int NangaParbat::ChiSquare::GetNumberOfParameters ( ) const
inline

Function that returns the number of parameters of the parameterisation objects.

Returns
The number of parameters.

◆ GetParameters()

std::vector< double > NangaParbat::ChiSquare::GetParameters ( ) const
inline

Function that returns the parameters of the parameterisation objects.

Returns
The vector containing the parameters.

◆ GetResidualDerivatives()

std::vector< double > NangaParbat::ChiSquare::GetResidualDerivatives ( int const &  ids,
int const &  ipar 
) const

Function that returns the derivative of the residuals of the χ2 deriving from the Cholesky decomposition of the covariance matrix w.r.t. the "ipar"-th parameter.

Parameters
idsthe dataset index
iparthe parameter index
Returns
the vector of derivatives of the residuals

◆ GetResiduals()

std::vector< double > NangaParbat::ChiSquare::GetResiduals ( int const &  ids,
bool const &  central = false 
) const

Function that returns the residuals of the χ2 deriving from the Cholesky decomposition of the covariance matrix.

Parameters
idsthe dataset index
centralif true, the residuals are computed using the experimental central values rather than the fluctuated data (default: false)
Returns
the vector of residuals

◆ GetSystematicShifts()

std::pair< std::vector< double >, double > NangaParbat::ChiSquare::GetSystematicShifts ( int const &  ids) const

Function that returns the systematic shifts and the associated penalty term of the χ2.

Parameters
idsthe dataset index
Returns
a pair with the vector of nuisance parameters as a first entry and the penalty as a second.

◆ operator()()

double NangaParbat::ChiSquare::operator() ( int const &  ids = -1)
inline

Utility operator that shortcuts the Evaluate method.

◆ SetParameters()

virtual void NangaParbat::ChiSquare::SetParameters ( std::vector< double > const &  pars)
inlinevirtual

Function that sets the free parameters of the parameterisation.

Parameters
parsthe vector of parameters

Friends And Related Function Documentation

◆ operator<<

YAML::Emitter & operator<< ( YAML::Emitter &  os,
ChiSquare const &  chi2 
)
friend

Method which prints ChiSquare feautures with cout <<.

Member Data Documentation

◆ _DSVect

std::vector<std::pair<DataHandler*, ConvolutionTable*> > NangaParbat::ChiSquare::_DSVect
protected

Vector of "DataHandler-ConvolutionTable" pairs.

◆ _ndata

std::vector<int> NangaParbat::ChiSquare::_ndata
protected

Vector constaining the number of data points per dataset that pass the qT/Q cut.

◆ _ndatac

std::vector<int> NangaParbat::ChiSquare::_ndatac
protected

Vector constaining the number of data points per dataset that pass all the cuts.

◆ _NPFunc

Parameterisation* NangaParbat::ChiSquare::_NPFunc
protected

Parameterisation of the non-perturbative component.


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