Dynamic enum plus more #35
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I cleaned up the commit history so hopefully the commit history explains the story better
Dynamic Enums
Top change: Create Dynamic Enum class which is just a wrapper for a map that assigns a number to that string. The idea is it acts exactly like a regular enum, but can be specified at an analysis level instead of a Parent class level. Idea being all selections for instance can be placed in the selector class one is concerned with and not have a huge list of selections that requires the entire code base to be recompiled
There are certainly more elegant ways of doing this that I simply don't know how about, but this is a first step
The dynamic enums were used on the
selection_andyear_variable, but this could be expanded further. There is a sort of bad implementation of allowing these dynamic enums to be updated twice (first implemented to get Fake Rates and Efficiency code to work), but this could be done to have a set of code wide systematics as well as local systematics (specific to an analysis). We could try an implement this maybe later?My large point is to narrow
SelectorBaseso adding new analyses carries less of its baggage, it is easier to parse, and make analysis specific changes not affect all packages (recompile everything when adding a selection)Other changes