-
Notifications
You must be signed in to change notification settings - Fork 3
Flavour Tagging features #3
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
Merged
Merged
Changes from 7 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
b08b6fc
Flavour Tagging features
HarryWang0619 86d5273
run Formatter
HarryWang0619 4abad83
try to fix github action
HarryWang0619 a572a7d
Try to make a temp alias of EEJet as the released version of JetRecon…
HarryWang0619 016edfb
update some documentation
HarryWang0619 a17aa39
Fixups for initial version
graeme-a-stewart 82b5fde
Update README
graeme-a-stewart e0448f2
Make the example work
HarryWang0619 ddfc3c1
Run JuliaFormatter
HarryWang0619 9b3f2d7
More optimizations and clean up unused helper docs.
HarryWang0619 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,12 @@ | ||
| /Manifest*.toml | ||
| Manifest.toml | ||
| *.DS_Store | ||
| *.root | ||
| examples/flavour-tagging/data/wc_pt_7classes_12_04_2023/fccee_fl.swp | ||
| .vscode/ | ||
|
|
||
| # Misc files | ||
| .DS_Store | ||
| /notebooks/* | ||
| **/profile/* | ||
| /statprof/* | ||
| /debug/* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| # CLAUDE.md | ||
|
|
||
| This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. | ||
|
|
||
| ## Common Development Commands | ||
|
|
||
| ### Build and Package Management | ||
| - `julia --project` - Start Julia with the project environment | ||
| - `] instantiate` - Install all dependencies from Project.toml | ||
| - `] update` - Update dependencies | ||
| - `] build` - Build the package | ||
|
|
||
| ### Testing | ||
| - `julia --project -e 'using Pkg; Pkg.test()'` - Run all tests | ||
| - `julia --project test/runtests.jl` - Run tests directly | ||
|
|
||
| ### Running Examples | ||
| - `cd examples/flavour-tagging && julia --project simple-flavour-tagging.jl` - Run the flavour tagging example | ||
| - First run `julia --project -e 'using Pkg; Pkg.resolve(); Pkg.instantiate()'` in the example directory | ||
|
|
||
| ### Formatting | ||
| The repository uses automatic formatting via GitHub Actions. JuliaFormatter is used with default settings in pull requests. | ||
|
|
||
| ## High-Level Architecture | ||
|
|
||
| JetTaggingFCC.jl is a Julia package for jet flavour tagging in high-energy physics, designed to integrate with the JetReconstruction.jl ecosystem. It uses ONNX neural network models to classify jets based on their quark flavour content (b-jets, c-jets, light jets). | ||
|
|
||
| ### Core Architecture Pattern | ||
|
|
||
| 1. **Main Module** (`JetTaggingFCC.jl`): Entry point that includes and exports the JetFlavourTagging submodule | ||
| 2. **Feature Extraction Pipeline**: Extracts 59 physics features from jet constituents: | ||
| - Basic kinematics (pt, energy, mass, etc.) | ||
| - Track parameters and covariance matrices | ||
| - Particle identification flags | ||
| - Impact parameters and relative measurements | ||
| 3. **ONNX Integration**: Uses ONNXRunTime.jl to run pre-trained neural networks for classification | ||
|
|
||
| ### Key Dependencies Integration | ||
|
|
||
| - **EDM4hep.jl**: Provides the `ReconstructedParticle` type and event data model | ||
| - **JetReconstruction.jl**: Core jet reconstruction algorithms (this package extends it) | ||
| - **LorentzVectorHEP.jl**: 4-vector operations for particle physics | ||
| - **StructArrays.jl**: Efficient storage of constituent collections | ||
|
|
||
| ### Data Flow | ||
|
|
||
| 1. Reconstructed particles → Jet reconstruction → Jet constituents | ||
| 2. Feature extraction from constituents (59 features per constituent) | ||
| 3. ONNX model inference → Flavour probabilities | ||
|
|
||
| ### Important Type Aliases | ||
|
|
||
| ```julia | ||
| const JetConstituents = StructVector{ReconstructedParticle, <:Any} | ||
| const JetConstituentsData = Vector{Float32} | ||
| ``` | ||
|
|
||
| Currently defined redundantly across modules - consider this when adding new types. | ||
|
|
||
| ## Development Notes | ||
|
|
||
| - The package uses Julia's package extension mechanism - EDM4hep must be loaded to trigger the extension | ||
| - Physical constants are centralized in `JetPhysicalConstants.jl` using PhysicalConstants.jl | ||
| - Feature extraction functions follow the naming pattern `get_<feature_name>` | ||
| - All "flavor" spellings have been standardized to "flavour" throughout the codebase |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,26 @@ | ||
| name = "JetTaggingFCC" | ||
| uuid = "12f500dc-52b1-4d85-9b70-29fa5347616c" | ||
| authors = ["Harry <[email protected]> and contributors"] | ||
| version = "1.0.0-DEV" | ||
| version = "0.1.0" | ||
|
|
||
| [deps] | ||
| EDM4hep = "eb32b910-dde9-4347-8fce-cd6be3498f0c" | ||
| JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6" | ||
| JetReconstruction = "44e8cb2c-dfab-4825-9c70-d4808a591196" | ||
| LorentzVectorHEP = "f612022c-142a-473f-8cfd-a09cf3793c6c" | ||
| ONNXRunTime = "e034b28e-924e-41b2-b98f-d2bbeb830c6a" | ||
| PhysicalConstants = "5ad8b20f-a522-5ce9-bfc9-ddf1d5bda6ab" | ||
| StructArrays = "09ab397b-f2b6-538f-b94a-2f83cf4a842a" | ||
|
|
||
| [compat] | ||
| julia = "1.6.7" | ||
| EDM4hep = "0.4.0" | ||
| JSON = "0.21" | ||
| JetReconstruction = "1.0" | ||
| LorentzVectorHEP = "0.1.6" | ||
| ONNXRunTime = "1.3.1" | ||
| PhysicalConstants = "0.2.4" | ||
| StructArrays = "0.6.18, 0.7" | ||
| julia = "1.9" | ||
|
|
||
| [extras] | ||
| Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,22 @@ | ||
| # JetTaggingFCC | ||
| # JetTaggingFCC.jl | ||
|
|
||
| [](https://github.com/JuliaHEP/JetTaggingFCC.jl/actions/workflows/CI.yml?query=branch%3Amain) | ||
|
|
||
| Julia package for jet flavour tagging at Future Circular Collider (FCC) | ||
| experiments using machine learning. | ||
|
|
||
| ## Overview | ||
|
|
||
| JetTaggingFCC.jl provides tools for identifying the quark flavor content of jets | ||
| in high-energy physics experiments. It uses ONNX neural network models to | ||
| classify jets based on their constituent particles. | ||
|
|
||
| ## Features | ||
|
|
||
| - Load and process EDM4hep event data to extract physics features from jet constituents | ||
| - Run ONNX neural network inference for flavour classification | ||
|
|
||
| See the `examples/` directory for detailed usage examples. | ||
|
|
||
| **Important** This package need the pre-release version of `JetReconstruction`, | ||
| so currently `Pkg.develop("JetReconstruction")` is required. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| [deps] | ||
| Accessors = "7d9f7c33-5ae7-4f3b-8dc6-eff91059b697" | ||
| ArgParse = "c7e460c6-2fb9-53a9-8c5b-16f535851c63" | ||
| CodecZlib = "944b1d66-785c-5afd-91f1-9de20f533193" | ||
| CodecZstd = "6b39b394-51ab-5f42-8807-6242bab2b4c2" | ||
| EDM4hep = "eb32b910-dde9-4347-8fce-cd6be3498f0c" | ||
| EnumX = "4e289a0a-7415-4d19-859d-a7e5c4648b56" | ||
| IJulia = "7073ff75-c697-5162-941a-fcdaad2a7d2a" | ||
| JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6" | ||
| JetReconstruction = "44e8cb2c-dfab-4825-9c70-d4808a591196" | ||
| JetTaggingFCC = "12f500dc-52b1-4d85-9b70-29fa5347616c" | ||
| Logging = "56ddb016-857b-54e1-b83d-db4d58db5568" | ||
| LorentzVectorHEP = "f612022c-142a-473f-8cfd-a09cf3793c6c" | ||
| LorentzVectors = "3f54b04b-17fc-5cd4-9758-90c048d965e3" | ||
| MuladdMacro = "46d2c3a1-f734-5fdb-9937-b9b9aeba4221" | ||
| ONNXRunTime = "e034b28e-924e-41b2-b98f-d2bbeb830c6a" | ||
| PhysicalConstants = "5ad8b20f-a522-5ce9-bfc9-ddf1d5bda6ab" | ||
| StructArrays = "09ab397b-f2b6-538f-b94a-2f83cf4a842a" | ||
|
|
||
| [sources] | ||
| JetTaggingFCC = {path = "../.."} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| # Jet Reconstruction Flavour Tagging Module Examples | ||
|
|
||
| ## `simple-flavour-tagging.jl` | ||
|
|
||
| ```bash | ||
| julia --project simple-flavour-tagging.jl | ||
| ``` | ||
| This script will perform a simple flavour tagging with one events only. | ||
| It will use the `FlavourTagging` module to tag the jets in the event and print the results. | ||
|
|
||
| ## `simple-flavour-tagging.ipynb` | ||
|
|
||
| The same as the above example, but using a Jupyter notebook. |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.