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

Detailed Description

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

Accumulates results weighted with their inverse variance. 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 &= S^2 \sum_{i=1}^M \frac{E_i}{S_i^2} \\ S &= \left( \sum_{i=1}^M \frac{1}{S_i^2} \right)^{-\frac{1}{2}} \\ N &= \sum_{i=1}^M N_i \end{align}

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_with_variance< IteratorOverMcResults >::operator() ( IteratorOverMcResults  begin,
IteratorOverMcResults  end 
) const
inline

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