MET EDM: Fix issue reading files from before double->float change
!37953 (merged) changed the MET EDM to store energy/momentum values as float
rather than double
. In principle ROOT should be able to automatically convert between the type when reading an old file with a new release, but some users reported issues with this. It turned out what was happening was that the input file was being read in before any accessors were initialized, which led to ROOT deciding that the correct type was double
before any MET code was executed at all.
This fixes the issue by making the accessors used for these variables static
members of the relevant classes (rather than declaring them as static
locally within member functions), such that they're initialized right at the start of runtime (and therefore before ROOT has a chance to read in any doubles from a file) instead of whenever the user first tries to use a MET object.
Tagging @cdelitzs, @salderwe, @jbossios, and I think @jferrand who reported this issue.