-
Notifications
You must be signed in to change notification settings - Fork 13
Jet Flavour Extension #164
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
Conversation
This part act as the main part of the jet flavour tagging module. (Withe the ONNX runtime part updating) Expected Next: 1. Updated JetFlavourHelper (ONNX Interface) 2. Examples
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #164 +/- ##
===========================================
- Coverage 76.92% 40.25% -36.68%
===========================================
Files 20 24 +4
Lines 1296 2477 +1181
===========================================
Hits 997 997
- Misses 299 1480 +1181 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Check if the latest update of JetReconstruction.jl fixed the formatting for this file
New Files: ONNX inference (JetFlavourHelper)
Changes:
1. Update build_constituents_cluster
2. Changed Bz to Float32 (same as EDM4hep)
3. Changed Track_L to AbstractArray{AbstractFloat} where we don't need to copy but just view the track_L (more efficient)
Update with 'On working sections'
add the /example/flavour-tagging/data folder (for local debug) to .gitignore. Will remove this and use cern eos path in future updates.
Add JSON to Library project.toml as ONNX profile need to be load with JSON.
|
Hello @HarryWang0619 - thanks for starting this PR off. Can you let us know what sort of feedback you're looking for at the moment? The code doesn't seem to be very runnable ( There is a lot of good advice about conventions, documentation and testing in https://juliahep.github.io/JetReconstruction.jl/dev/contributing/. |
|
Hello @HarryWang0619 - I am very excited about this PR! I have made a quick pass and left some general comments that I think will point you in the right direction for finishing things. |
new example by running with julia --project simple-flavour-tagging.jl
|
Here's some important recent updates.
Questions:
mcps = RootIO.get(reader, evt, "Particle") # MC Particles
MCRecoLinks = RootIO.get(reader, evt, "MCRecoAssociations") # Link of MC particles to reco particles
mc_vertices = Vector{LorentzVector{Float32}}(undef, length(recps)) # empty vector to store the vertex
reco_to_mc = Dict(link.rec_idx.index => link.sim_idx.index for link in MCRecoLinks)
for (rec_idx, mc_idx) in reco_to_mc
mc_vertices[rec_idx+1] = LorentzVector(mcps[mc_idx+1].vertex.x, mcps[mc_idx+1].vertex.y, mcps[mc_idx+1].vertex.z, mcps[mc_idx+1].time)
endTODO (as of Jul17):
|
We now have the desired output type as a positional parameter as this solves a type stability issue (Julia will only dispatch on positional parameters)
|
Hi @HarryWang0619 - thanks a lot for these recent improvements. I am happy to say that the We have an issue that this extension is depending on a lot of other packages so, e.g., the tests don't work and won't work unless we add a lot of other packages into the test environment, which is pretty heavy. So I now think that this is really a significant enough piece of work that we should put into a new package, probably called Should it be @HarryWang0619 if you have never made a Julia package before it's not that hard, but I can also help with it (or do it and create the core pieces for you to PR to). I am pretty convinced this is now the correct way to proceed, rather than hanging everything off JetReconstruction. |
|
Hi @graeme-a-stewart, that's an interesting suggestion. It's too bad that there can't be a separate testing environment for extensions of the main repository, but I agree that it might be too heavy for everything to go in one spot. Regarding the scope of a new package, I would like for it to be experiment-agnostic but the reality is that flavour tagging implementations depend strongly on the experiment you're looking at. Harry's code is designed to run on edm4hep files, I would say that I've not made a julia package before but we can give it a shot if you offer a pointer to some instructions to follow. Should this live in the JuliaHEP ecosystem? |
|
Hi @mattleblanc - thanks for your thoughts. I am not afraid of making additional packages in Julia - because of the excellent package manager, dependency management is a breeze. Probably best to be cautious with the name, so I am happy with There is a really good guide to creating packages here: https://modernjuliaworkflows.org/sharing/. It may require someone with JuliaHEP admin rights to create the initial repo - I can check later. |
|
Sounds good. If someone with JuliaHEP admin can make the repo and give @HarryWang0619 and I the privileges we need, we can get it set up. |
|
https://github.com/JuliaHEP/JetTaggingFCC.jl I have invited you all (@HarryWang0619 @emadmtr and @mattleblanc) into the JuliaHEP organisation so that we can manage repo permissions more easily. |
Thank you! I just accepted the invitation and I will follow the routine that you shared to set up the repository! |
|
If you're unsure of anything, just ask! |
I have just made my first commit following the PkgTemplate.jl set up guide. However, I mistakenly named the default branch as Repository-Setup. I wonder can you help me to change the default branch to main? Thank you! |
You can rename it in repository settings > general >default branch. Docs |
|
Hi Mateusz, Thank you for the recourse! I can not see such option under the settings page under the repository. I think it's because I don't have the admin access for the JetTaggingFCC.jl repo. |
|
Right, sorry. Changed it for you |
Thank you! I will be starting to commit to the new repository and I think we can close this PR. (We can move to the other side!) |
Overview
This PR introduces native Julia implementation of jet flavour tagging capabilities, providing a Julia alternative to the existing Python-based functionality in FCCAnalyses.
FCCAnalyses currently provides jet flavour tagging through Python ONNX runtime integration. To enable seamless jet reconstruction and analysis workflows entirely within Julia, we need native Julia implementations that can:
Implementation Details
This implementation provides the core infrastructure for jet flavour tagging by:
Core Components
Dependencies
Expected
-Example: An example that demonstrates a full workflow from EDM4hep ROOT File to ONNX weight output
-Tests: Test with a sample EDM4hep file
This is the code part for issue #163