In particle physics, we often start with mixture of events from different processes, e.g. signal and background, and we are interested in estimating the number of signal events in the mixture. A typical example is the fit of the invariant mass distribution of decay candidates to extract the number of real decays. In maximum-likelihood estimation, the ansatz is to model the mixture with a composite density which is a linear combination of component densities, which are themselves usually parametric models. A template fit is a variant where the component densities (templates) are estimated non-parametrically via histograms from simulation or from a pure independent control sample. In this case, a calculation of the uncertainty of the component yield has to consider statistical uncertainties in the templates. Barlow and Beeston found an elegant approach for this problem already in 1993. Since then and especially recently, several authors developed approaches for the case where the template are build from weighted samples, where each event has an associated weight. I will review these approaches, including our own. Implementations for practical use are available in the iminuit Python library.
O. Behnke, L, Brenner, L. Lyons, N. Wardle, S. Algeri