Fixing bug in CTShower
CTShower code
I had trouble reproducing the problem in the debugger because
the fitting program autoFit3 (which generates an image of the
shower reconstruction) actually seems to run fine. The regular
autoFit program, which only saves the reconstructed parameters,
also seemed to run fine. It is only the web reconstruction
which is failing.
Sample showers:
- autoFit3 shower 1 (v. 234) - Finds a solution, plots correctly.
- web shower 1, v234 (all hits) - No solution, data is plotted.
- web shower 1, v234, no accidentals - Finds a solution, plots correctly.
- web shower 1, v235 (all hits) - Finds a solution, does not plot.
- web shower 1, v235, no accidentals - Finds a solution, plots correctly.
- autoFit3 shower 2 (v. 234) - Finds a solution, plots correctly.
- web shower 2, v234 (all hits) - No solution, plots data.
- web shower 2, v234, no accidentals - No solution, plots data.
- web shower 2, v235 (all hits) - Finds a solution, does not plot.
- web shower 2, v235, no accidentals - No solution, plots data.
- autoFit3 shower 3 (v. 234) - Finds a solution, plots correctly.
- web shower 3, v234 (all hits) - Finds a solution, does not plot.
- web shower 3, v234, no accidentals - Finds a solution, does not plot.
- web shower 3, v235 (all hits) - Finds a solution, does not plot.
- web shower 3, v235, no accidentals - No solution, plots data.
- autoFit3 shower 4 (v. 234) - Finds a solution, plots correctly.
- web shower 4, v234 (all hits) - Finds a solution, does not plot.
- web shower 4, v234, no accidentals - No solution, plots data.
- web shower 4, v235 (all hits) - Finds a solution, plots correctly.
- web shower 4, v235, no accidentals - No solution, plots data.
- autoFit3 shower 5 (v. 234) - Finds a solution, plots correctly.
- web shower 5, v234 (all hits) - No solution, plots data.
- web shower 5, v234, no accidentals - No solution, plots data.
- web shower 5, v235 (all hits) - Finds solution, does not plot.
- web shower 5, v235, no accidentals - No solution, plots data.
It seems that there are two problems: the reconstructor is
sometimes going off the rails and finding NAN solutions, and
other times a solution is found but there is a UI problem and
the results don't show up.
I just noticed that the average of the CIT1000 sites is always 0, or
even negative. This must be throwing off the fits.
UPDATE: the problem seems to be in GenerateFitShower(), which
assumes all of the 1000s exist when averaging intensities.