Open swertz opened 2 years ago
Hm I wasn't aware there would commonly be a need to switch between simple and compound objects. I don't see an obvious issue with making them polymorphic. (the interior nodes however are purposely not polymorphic)
I would simply argue that whether a correction is compound or not is an implementation detail, that the user does not necessarily need to know about.
I second the suggestion. Whether the correction is compound or not is not of interest to the vast majority of users. Internally we can design them as separate, but having a unified user-facing interface would be a very nice enhancement. (Incidentally, this is also one of the points I noticed while working on the JECViewer and mentioned in the Cross-POG meeting last week)
While testing the jetmet SFs for JES, I realized that working with CompoundCorrections can be a bit awkward. The issue is that depending on the correction level(s) that is (are) needed (simple or multiple), one has to work with either a
Correction
or aCompoundCorrection
object. When writing helper code that loads the corrections, using as input the correction level requested by the user, one doesn't know in advance what will be used. Essentially I need to do e.g.:Perhaps it would be easier if both
Correction
andCompoundCorrection
inherited from the same abstract class, that declares theevaluate
method? Then,CorrectionSet::at
could automatically return either the correction or the compound correction, depending on the presence of the key incorrections_
, dropping the extracompound
method?