hep-mc  0.8
Functions
Multi Channel Integrator

Detailed Description

The Multi Channel integration algorithm.

In contrast to the VEGAS algorithm, which uses a product of one-dimensional PDFs, the multi channel integration algorithm uses a sum of \( M \) user-defined PDFs \( p_j ( \vec{y}) \) with automatically adapted weights \( \alpha_j \) in the form

\[ p ( \vec{y} ) = \sum_{j=1}^M \alpha_j p_j ( \vec{y} ) \text{,} \quad \int \mathrm{d}^d y \; p_j \left( \vec{y} \right) = 1 \text{,} \quad \sum_{j=1}^M \alpha_j = 1 \text{,} \]

which is used to sample the function. Multi channel integration performs better compared to VEGAS if the peak structure of the integrand does not factorize. To avoid explicitly summing over every channel* \( j \) for each randomly chosen point \( \vec{x} \in U \equiv [0,1]^d \) the MC integrator also samples over the possible channels. This leads to the final formula

\[ I = \int \mathrm{d} i \int_U \mathrm{d}^d x \; \left. \frac{f (\vec{y})}{p (\vec{y})} \right|_{\vec{y} = \vec{y}_i ( \vec{x} )} \text{,} \qquad i \sim \left\{ \alpha_1, \alpha_2, \ldots, \alpha_M \right\} \]

where the integral over the index \( i \) is understood to be a Monte Carlo summation in which the index \( i \) is randomly chosen according to the specified weights. Since the PDFs \( \left\{ p_j \right\}_{j=1}^M \) are user-defined, the user also has to specify the CDFs \( \left\{ \vec{y}_j ( \vec{x} ) \right\}_{j=1}^M \) for each channel.

The multi channel integration uses the following parameters, where T denotes the numerical type, e.g. double:

Functions

template<typename I , typename Checkpoint = default_multi_channel_chkpt<numeric_type_of<I>>, typename Callback = mpi_callback<Checkpoint>>
Checkpoint hep::mpi_multi_channel (MPI_Comm communicator, I &&integrand, std::vector< std::size_t > const &iteration_calls, Checkpoint chkpt=make_multi_channel_chkpt< numeric_type_of< I >>(), Callback callback=mpi_callback< Checkpoint >())
 
template<typename I , typename R >
multi_channel_result< numeric_type_of< I > > hep::multi_channel_iteration (I &&integrand, std::size_t calls, std::vector< numeric_type_of< I >> const &channel_weights, R &generator)
 
template<typename I , typename Checkpoint = default_multi_channel_chkpt<numeric_type_of<I>>, typename Callback = callback<Checkpoint>>
Checkpoint hep::multi_channel (I &&integrand, std::vector< std::size_t > const &iteration_calls, Checkpoint chkpt=make_multi_channel_chkpt< numeric_type_of< I >>(), Callback callback=callback< Checkpoint >())
 

Function Documentation

◆ mpi_multi_channel()

template<typename I , typename Checkpoint = default_multi_channel_chkpt<numeric_type_of<I>>, typename Callback = mpi_callback<Checkpoint>>
Checkpoint hep::mpi_multi_channel ( MPI_Comm  communicator,
I &&  integrand,
std::vector< std::size_t > const &  iteration_calls,
Checkpoint  chkpt = make_multi_channel_chkpt<numeric_type_of<I>>(),
Callback  callback = mpi_callback<Checkpoint>() 
)
inline

MPI version of multi_channel.

Examples:
multi_channel_example.cpp.

◆ multi_channel()

template<typename I , typename Checkpoint = default_multi_channel_chkpt<numeric_type_of<I>>, typename Callback = callback<Checkpoint>>
Checkpoint hep::multi_channel ( I &&  integrand,
std::vector< std::size_t > const &  iteration_calls,
Checkpoint  chkpt = make_multi_channel_chkpt<numeric_type_of<I>>(),
Callback  callback = callback<Checkpoint>() 
)
inline

Multi channel integrator. Integrates integrand using iteration_calls.size() iterations, with the number of calls for each iteration given in iteration_calls. The integration starts from the default (empty) checkpoint, unless one is explicitly given in chkpt. After each successful iteration the callback function is invoked.

See also
checkpoints
integrands
callbacks
Examples:
multi_channel_disabled_channels.cpp, and multi_channel_example.cpp.

◆ multi_channel_iteration()

template<typename I , typename R >
multi_channel_result<numeric_type_of<I> > hep::multi_channel_iteration ( I &&  integrand,
std::size_t  calls,
std::vector< numeric_type_of< I >> const &  channel_weights,
R &  generator 
)
inline

Performs exactly one iteration using with multi channel integrator of integrand using exactly calls number of integrand evaluations. The parameter channel_weights must specify the weights of each channel. Note that the weights must be normalized, i.e. their sum must be one. Random numbers are drawn from generator.