A Monte-Carlo model of a SiPM coupled to a scintillating crystal