hep-mc  0.8
Classes | Functions
VEGAS PDFs

Detailed Description

Functions and Classes that implement that VEGAS grid.

Functions and classes that allow to use and manipulate probability distribution functions (PDFs) as described in the VEGAS publication.

The class vegas_pdf implements the separable PDF using a piecewise constant function, where the pieces are called bins whose boundaries are stored. The PDF can be manipulated by vegas_refine_pdf. The weight and the corresponding random number is computed by vegas_icdf. PDFs can be read and written using the stream operators, see the example vegas_read_pdf.cpp and vegas_write_pdf.cpp.

Classes

class  hep::vegas_pdf< T >
 

Functions

template<typename T >
hep::vegas_icdf (vegas_pdf< T > const &pdf, std::vector< T > &random_numbers, std::vector< std::size_t > &bin)
 
template<typename T >
vegas_pdf< T > hep::vegas_refine_pdf (vegas_pdf< T > const &pdf, T alpha, std::vector< T > const &data)
 

Function Documentation

◆ vegas_icdf()

template<typename T >
T hep::vegas_icdf ( vegas_pdf< T > const &  pdf,
std::vector< T > &  random_numbers,
std::vector< std::size_t > &  bin 
)
inline

Applies the inverse cumulative distribution function to random_numbers and updates it with the new numbers. The bin indices are written into bin. The number returned by this function is the corresponding weight; a weight of one means that this pdf is a uniform one.

◆ vegas_refine_pdf()

template<typename T >
vegas_pdf<T> hep::vegas_refine_pdf ( vegas_pdf< T > const &  pdf,
alpha,
std::vector< T > const &  data 
)
inline

Refines the pdf using data, which must be the binned square-function values, and returns the new pdf. The process can be controlled by the parameter alpha which is documented in the Vegas publication [3] [4] . This function's code is derived from Thomas Hahn's refine_grid from the CUBA [1] VEGAS implementation.