In Pennsylvania, the sentencing guidelines use something called the Offense Gravity Score (OGS). The OGS is determined based on the the offense for which the person is being sentenced. Some charges have two seperate offense gravity scores depending on what the underlying act was under the statute. For example, EWOC has a different OGS if the endangering happened once or more than once. Therefore, the sentence would be higher if endangering happened more than once.
Traditionally, at trial, the judge would simply put EWOC on the verdict sheet and if the defendant was found guilty the JUDGE WOULD DECIDE whether the endangerment happened more than once. Suddenly along came a person named Apprendi and he said that he thought if the sentencing guidelines were effected based on a factual determination, he should have a right to have the jury decide not the judge.
In Apprendi v. New Jersey , 530 U.S. 466 (2000), the United States Supreme Court agreed. The Supremes said that if the type of underlying act changes the sentencing, the sentencing ramification, the defendant has the right to have a jury determine the exact act under the statute and the subsequent sentencing issues.
Therefore, in regard to your question, the jury gets to determine the facts that effect the OGS, not the judge.