-
Notifications
You must be signed in to change notification settings - Fork 13
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
Use fastjet plugins? #77
Comments
@skluth , thank you for opening this issue. Fastjet plugins are going to be added to python fastjet in the future, although I cannot tell you when as it will require a lot of time from someone. Maybe @jpivarski knows more about it. |
If what you're asking about is in fj-contrib, we're waiting for fj-contrib to move from SVN to git so that we can make it a git submodule and include it in the build. If what you're asking about is in FastJet core, the Python module is built with all plugins enabled. I think only the CGAL support was temporarily turned off because of a compilation problem, but that only affects performance at high pile-up, not capabilities. Oh! We also turned off the one and only plugin that required Fortran. Many of the plugins were different jet algorithms—are eesiscone, jade, and pxcone among that set? These are the compilation arguments we use: Lines 62 to 70 in e5aebdc
Instead of listing out all those plugins, we include all of the ones written in C++ (as opposed to Fortran). |
@jpivarski I think pxcone was the one that required Fortran. |
Ah, then we'd need to get Fortran into CD. Let's hear from @skluth about the exact requirements, first, though. |
I think the problem for us is how to use a JetDefinition which needs a plugin even if the plugin enabled. We would like to use the various e+e- algorithms like eesiscone and JADE. |
For how to use a JetDefinition, is what you're looking for covered in https://fastjet.readthedocs.io/en/latest/Awkward.html? For example, import fastjet
jetdef = fastjet.JetDefinition(fastjet.antikt_algorithm, 0.6) What happens if you put in I didn't see any of the others you mentioned in that list. Since this is a Python module, we'd have to have the plugins compiled-in to be able to use them. |
The compiled-in algorithms work for us. The problem is creating a JetDefinition object with a plugin algo. All plugin algos have a enum fastjet::plugin_algorithm. In C++ one has to create a plugin instance of the correct type and create a JetDefinition instance with that. That probably needs dedicated code which detects that a requested algo is a plugin (i.e. not built-in), creates a C++ instance of that plugin, creates a JetDefintion object with the plugin and passes that back. |
@aryan26roy, is this something that can be done with the SWIG objects, or is it a C++ interface that needs to be exposed into Python? (First question is, do you recognize the procedure @skluth is describing? I don't know how these things are done in C++ so I don't quite understand the procedure. But since you've been working on the C++ side, maybe it makes more sense to you?) |
@jpivarski I couldn't find any of the algorithms that @skluth mentioned in the import list from swig. While the procedure for making a JetDefinition for a plugin is the same as native algorithms, if those plugins are not exposed through the swig bindings, we couldn't support them. (I can't find the eesiscone algorithms anywhere, maybe it is a part of fj contrib.) |
Here is the logic I have in a class to handle plugins:
Note it also shows which plugin class is eesiscone |
@skluth thanks! I found all the algorithms you mentioned in the docs. All of these plugin algorithms do not seem to be binded through swig @jpivarski. |
Perhaps it is enough to expose the plugin classes in the swig import list? Then one could build an instance on the python side and create e.g.
The fastjet::JetDefinition class has a matching ctor for this, so we need that exposed as well. |
About the Fortran-based pxcone algorithm: it is wrapped in C++ in fastjet, so I would think that all we would need for pxcone is building fastjet with pxcone (needs a Fortran compiler i.e. gfortran) and exposing the relevant plugin class fastjet::PxConePlugin( ... ) through the swig magic. |
@skluth yes, that should be enough. However, the swig bindings are provided by the core fastjet authors, perhaps we can ask them about it @jpivarski. |
I have a fastjet-3.4.0 build. I could try to experiment with the swig bindings, but I have no experience with this so far, so I would need a little introduction into where to look in the fastjet codebase. |
We can ask why this algorithm isn't configured in the same way as the others, or why it can't be done through the SWIG bindings, but if there's a way to do it in C++, then we can also expose that through pybind11. |
For our studies we would need access to some of the fastjet algorithms available as plugins. Examples are the eesiscone, the jade and the pxcone e+e- jet algorithms.
We can of course do this directly in C++, or with a dedicated C++ wrapper which can be loaded into python via ROOT.
But it would be great if the fastjet plugins could be made available directly through python fastjet.
The text was updated successfully, but these errors were encountered: