hep-mc  0.8
Public Member Functions | List of all members
hep::weighted_equally< IteratorOverMcResults > Struct Template Reference

Detailed Description

template<typename IteratorOverMcResults>
struct hep::weighted_equally< IteratorOverMcResults >

Accumulates results with the same weight. Computes a cumulative result using a range of results pointed to by begin and end. If \( E_i, S_i, N_i \) are the estimate, error and number of calls of each iteration in the range defined by [begin, end) and \( M \) the number of results, then the cumulative result is computed as:

\begin{align} E &= \frac{1}{M} \sum_{i=1}^M E_i \\ S &= \left( \frac{1}{M} \frac{1}{M-1} \sum_{i=1}^M \left( E_i - E \right)^2 \right)^{-\frac{1}{2}} \\ N &= \sum_{i=1}^M N_i \end{align}

Note that this function weighs the result of every iteration equally, independent from the sample size \( N_i \).

Public Member Functions

hep_mc_result< IteratorOverMcResults > operator() (IteratorOverMcResults begin, IteratorOverMcResults end) const
 

Member Function Documentation

◆ operator()()

template<typename IteratorOverMcResults >
hep_mc_result<IteratorOverMcResults> hep::weighted_equally< IteratorOverMcResults >::operator() ( IteratorOverMcResults  begin,
IteratorOverMcResults  end 
) const
inline

Performs the accumulation of results in the interval [begin, end).