At a sentencing hearing, the judge will review the presentence report (prepared by the probation office) and hear arguments from both the prosecutor and the defense attorney—and sometimes, the victim.
Especially in felony and more serious misdemeanor cases, judges typically rely on presentence reports, prepared by probation officers, in making sentencing decisions.