The electronic structure of [6,6]-phenyl C61 butyric acid methyl ester (PCBM), poly(3-hexylthiophene) (P3HT), and P3HT/PCBM blends is studied using soft X-ray emission and absorption spectroscopy and density functional theory calculations. We find that annealing reduces the HOMO-LUMO gap of P3HT and P3HT/PCBM blends, whereas annealing has little effect on the HOMO-LUMO gap of PCBM. We propose a model connecting torsional disorder in a P3HT polymer to the HOMO-LUMO gap, which suggests that annealing helps to decrease the torsional disorder in the P3HT polymers. Our model is used to predict the characteristic length scales of the flat P3TH polymer segments in P3HT and P3HT/PCBM blends before and after annealing. Our approach may prove useful in characterizing organic photovoltaic devices in situ or even in operando.