CHICOS Maximum Likelihood Code

CTShower Code (May not be most recent.)
Shower Test Page (V. 3.03 Testing may not be most current. Be wary of using v. 3.02 as you may have to kill it manually.)
Write-up Updated.

It appears that the likelihood method was returning lower energies because of the bug in the expected_inten function. This function was dividing by cos(theta) rather than multiplying by it. After fixing it, the energies agree much better with version 2.42:

I want to look at the showers where the energies disagree:

Shower 3, v. 3.03, Shower 3, v. 2.42
Shower 17, v. 303, Shower 17, v. 2.42
Shower 18, v. 303, Shower 18, v. 2.42
Shower 19, v. 303, Shower 19, v. 2.42
Shower 34, v. 303, Shower 34, v. 2.42
Shower 43, v. 303, Shower 43, v. 2.42
Shower 53, v. 303, Shower 53, v. 2.42
Shower 55, v. 303, Shower 55, v. 2.42

In every case the chisquare method ends up stuck on a site. The likelihood method is better for all of them, sometimes substantially, and sometimes only slightly.