Chiquita data: iterative fit - Nov. 8

I think this code needs some revision, but I am using it as-is for the moment for comparison with previous results.

The datafile being used is chiquita.dat, from the Chiquita data in filtered.txt. This file is not adjusted for temperature effects. This list contains 14576 showers (out of 18388) which pass the nearest-neighbor cut after being filtered and then a cut on reconstructed angle (at 45 degrees).

The method being used here is:
- Call the flux x E^3 at each point C_data = N(logE) E^3/(.46E A(E) T)
- Fit the result to a line: log(C_data) = log(C2)-(gamma-3)log(E)
- This gives an estimated flux J2 = C2 E^-gamma
- J2 can be used to estimate the expected number of data points in each bin: N2 = Int(.46E*A(E0)R(E,E0)J(E0))dE0
- Turn N2 into F*E^3: C'= N2 E^3/(.46E A(E) T)
- Re-estimate J as J_Measured = (C_data/C')C2 E^-gamma

Code used:
- spectrum.C: Reads in Chiquita shower file and makes histograms of data and flux*E^3 for each energy shift.
- iteratefit.C: Turns flux histograms into Log(Flux*E^3) so they can be fit with a line.
- fitfn.C: Takes flux and returns number-per-bin.
- newflux.C: Takes N-per-bin and makes histogram of flux*E^3.
- ratios.C: Gets ratio of C_data to C' and multiplies the points from the best fit line by this ratio.
- getlog2.C: Turns final histograms into Log(Flux*E^3) so they can be fit with a line.
- error.C: Gets the max and min errors.
- drawspec.C: Draws final result on top of other data.

Root files:
- hists.root: Contains R(E,E0) and A(E0)

Chiquita data, and equivalent histograms with the energy shifted by +/- 20%:

The points in the following histogram are C_data(logE):

Fit to the data:

The points above are used to estimate the equivalent number-per-bin:

This histogram is fed back into the same function that was used to estimate the Flux*E^3 from the data. The only difference is that with the actual data, the aperture at the energy of each shower is used, while here the data is treated as N showers all at the central energy (in log space) of the bin. The points on this histogram C'(E) in the expressions at the top of the page.

The ratio between each pair of points in the above histogram (C_fit=C'):

The estimated flux from the best-fit line (C_2 E^-g) times the ratio of C_data/C'

Chiquita data and error band, with other data:

Aperture from simulations: