Added calculation of reference density from bkg. dist.