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

Pre release cleanup #31

Merged
merged 21 commits into from
Oct 30, 2023

Conversation

graeme-a-stewart
Copy link
Member

@graeme-a-stewart graeme-a-stewart commented Oct 25, 2023

This is a significant clean-up, taking us close to an actual release of this package.

The two underperforming algorithms (combining tiled and SoA) have been removed.

The two remaining algorithms have had their main APIs brought into line with one another:

  • named as plain_jet_reconstruct(particles::Vector{T}; p = -1, R = 1.0, recombine = +, ptmin = 0.0) and tiled_jet_reconstruct(particles::Vector{T}; p = -1, R = 1.0, recombine = +, ptmin = 0.0).

For the input particle type, JetReconstruction.PseudoJet and LorentzVectorHEP types are supported, but, in general, any type can be used that supports appropriate 4-vector methods (pt2(), phi(), rapidity(), px(), py(), pz(), energy()).

The return type of both algorithms is JetReconstruction.PseudoJet as this is the most complete and efficient type - translation to LorentzVectorHEP is trivial, but always doing it is rather expensive (particularly as cylindrical vectors from LorentzVectorHEP store pseudorapidity and jet reconstruction uses rapidity).

The old style Particle.jl type is removed.

Significant amounts of renaming of files, methods and variables have been done to help clarity.

The README is reworked to be more useful.

There are still some defects that need to be addressed (see open issues), but a lot is now fixed.

Closes #5 (LorentzVectorHEP is supported, but is problematic to use internally)
Closes #15 (I think we got really pretty close to optimal now)
Closes #23 (API is well defined now, as is use of alternative input types)
Closes #25 (MIT everywhere)

Delete the less performant tiled algorithms
Using LV inputs gives a standard interface to the
reconstruction algorithms
Implement HepMC reader that can return LVs
Adapt N2Plain algorithm to digest these inputs (there is a slight
performance regression, 780->833 us on my machine)
Clean up all of the "dev' code from the N2Plain algorithm
These are much more standard and supported objects
from the LorentzVectorHEP package

This drops use of the internal "Particle.jl" struct. Do not export
PseudoJet functions.

Some standard reformatting applied
This is used in N2Plain
Adapt tests to allow for algorithms returning phi in the
[-\pi, \pi] range
New version supports rapidity() method, as well as pt2() and
more consistent handling of mass()
This was mistakenly masked in .gitignore
Do not export "internal" pieces from JetReconstruction

Add "import" of relevant methods from LorentzVectorHEP
for use in the algorithms
Add an outer "wrapper" that writes the internal EDM
objects and allow for a direct call when the internal
EDM is already constructed (this is fairer for timings)

Refactor many of the variable names to get rid of the
underscore prefixes and to make it clearer when variables are arrays,
rather than single values
The conversion from LorentzVectorHEP to PseudoJet is rather expensive
and should be factored out of the benchmark for a fair comparison of
the actual algorithm
We want to have the full suite of relevant methods available in our
namespace
Change rap() to rapidity() for consistency
This makes the struct more generic and avoids directly accessing member
variables
Changing back to PseudoJets, make the generic method for
N2Tiled type agnostic (anything that supports energy(), px(), py(), pz()
is fine)
As N2Plain is written, it's completely happy to use PseudoJets directly
Anything non-standard will require recombine(::PseudoJet, ::PseudoJet)
to be defined.
To make the interface the same as N2Tiled support directly filtering on
the final jets' ptmin values (which actually
speeds up the code, slightly!)
Even from N2Plain we return PseudoJet types (but avoid construction
of new objects if possible)
Check that reconstruction from LorentzVector gives the same as PseudoJet
Write a proper README file that describes how to use the package
(real Julia documentation to come, but it's a start)

Rename main algorithms to be more consistent, viz.
sequential_jet_reconstruct and tiled_jet_reconstruct

Also remove all of the pre-cooked versions with specific values of p
(like cambridge_aachen_algo) as these add little value and would need to
exist for all algorithms.

Rename the chep.jl script to jetreco.jl and put it into an examples
directory
src/Pseudojet.jl Outdated Show resolved Hide resolved
Co-authored-by: Jerry Ling <[email protected]>
@Moelf
Copy link
Member

Moelf commented Oct 25, 2023

I'm not familiar with the content and FastJet APIs so can't say much :P

But seems to be a huge step towards being a proper library package in terms of organization

@graeme-a-stewart
Copy link
Member Author

I'm not familiar with the content and FastJet APIs so can't say much :P

Thanks for spotting the non const issue!

But seems to be a huge step towards being a proper library package in terms of organization

Thank you! I hope no obvious defects or daft things done.

@graeme-a-stewart graeme-a-stewart merged commit 0452ac3 into JuliaHEP:main Oct 30, 2023
4 checks passed
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.

License Matters Define public interface Optimisation needed use existing Lorentz Vector package
2 participants