Skip to content

Conversation

@dteague
Copy link
Contributor

@dteague dteague commented May 7, 2020

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_ and year_ 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 SelectorBase so 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

  • I removed TTTSelector since I don't use it any more
  • I changed some functions to use the manager data path getter so that can be removed as an argument in the python code
  • cleaned up some python code arguments, specifically to match command line names (still needs work if I remember)
  • Probably other stuff, can't remember all, its been a while...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant