MeV gamma ray detection algorithms for stacked silicon detectors