Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generic strategy switching #35

Merged
merged 5 commits into from
Apr 5, 2024
Merged

Generic strategy switching #35

merged 5 commits into from
Apr 5, 2024

Conversation

graeme-a-stewart
Copy link
Member

@graeme-a-stewart graeme-a-stewart commented Apr 3, 2024

Improve the use of Emums that provide the different strategy switches. We use EnumX to have these scoped, otherwise generic names like Best would be troublesome. CLI string values are automatically mapped to the different strategy names.

A Best strategy is implemented that switches between N2Tiled and N2Plain based on empirical measurements.

The demonstration code is simplified by always calling the generic_jet_reconstruct function, delegating the strategy decision to inside the package (where it should be!).

Closes #28.
Closes #27.

Better use of the strategy enum (with conversion to/from
strings as needed)
Introduce the generic_jet_reconstruction wrapper that supports also
the "Best" strategy, which dynamically switches algorithm based on the
event cluster density.
EnumX provides a scoped enum, which is much nicer when the enum
names are quite generic (like "Best")

This doesn't work with MLStyle, so drop the switching back to a
simple "if .. elseif ..." construct
Use the explicit name "Strategy" for the emun type
instead of the generic "T" (this works better with the --help option)
Results indicated that N2Tiled gets faster than N2Plain
between 65 and 112 initial clusters, so 90 is a good intermediate
pick
Update to new strategy enum
@graeme-a-stewart graeme-a-stewart merged commit 958c27a into main Apr 5, 2024
4 checks passed
@graeme-a-stewart
Copy link
Member Author

Self merging for further development

@Moelf Moelf deleted the improve-enum branch April 5, 2024 14:30
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.

Defaut strategy Nicer strategy switching
1 participant