psi46/pxar — pull request #172 by simonspa (2014-06-26 17:12:22+00:00)
Title: Provide Variance Values

This pull request contains changes enabling pxarcore to return the variance of the averaged pulse height.

This mostly affects the `pxar::pixel` class which had to be changed. Sadly this breaks backwards compatibility since the members `value` and the new `variance` can't be accessed directly anymore. This gives us the freedom to do compression to 16bit fixed-point values instead of only integer precision. By getting the values via the getter functions `pxar::pixel::getValue()` and `pxar::pixel::getVariance()` we abstract the internal storage completely and allow for future changes to the way we compress and store the data. This makes the whole thing a lot more flexible.

Currently the value itself is still stored as 16bit integer, but the variance is compressed from `double` to a 16bit fixed point value with a precision of about 10^-4. Both values are returned as doubles and are therefore independent from the actual format we store them in. One pixel hit therefore requires only 32bit storage for 16bit value and 16bit variance information which keeps the overall memory footprint in a sane region, which is important especially for large tests.

All tests which access pixel class objects had to be altered to use `->getValue()` instead of `->value`. In addition, the `PixTestGainPedestals` test already uses the new `getVariance()` function instead of assuming an error of 5% on the pulse height average.

Please review and merge.