Novel technique for the study of pileup events in cryogenic bolometers