  This paper studies a method of a two dimensional background calculation for
an analysis of events with two particles of the same type registered in
experiments in high-energy physics. The standard two-dimensional integration is
replaced by an approximation of a specially constructed one-dimensional
function. The number of the signal events is found by the subtraction of the
background events. It allows calculating the purity of the selection. The
procedure does not require a hypothesis about background and signal shapes.
Monte Carlo examples of double J/psi samples are used to demonstrate high
performance of the purity calculation method. A comparison of the method with
standard two-dimensional fit of the signal revealed a systematic shift of the
fit results to lower values.
