  Background properties in experimental particle physics are typically
estimated using large data sets. However, different events can exhibit
different features because of the quantum mechanical nature of the underlying
physics processes. While signal and background fractions in a given data set
can be evaluated using a maximum likelihood estimator, the shapes of the
corresponding distributions are traditionally obtained using high-statistics
control samples, which normally neglects the effect of fluctuations. On the
other hand, if it was possible to subtract background using templates that take
fluctuations into account, this would be expected to improve the resolution of
the observables of interest, and to reduce systematics depending on the
analysis. This study is an initial step in this direction. We propose a novel
algorithm inspired by the Gibbs sampler that makes it possible to estimate the
shapes of signal and background probability density functions from a given
collection of particles, using control sample templates as initial conditions
and refining them to take into account the effect of fluctuations. Results on
Monte Carlo data are presented, and the prospects for future development are
discussed.
