-
Notifications
You must be signed in to change notification settings - Fork 25
Upstream FastJet algorithm from MuonCollider fork #51
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
tmadlener
merged 40 commits into
key4hep:main
from
aloeliger:k4h_muoncollider_fastjet_rebase
Sep 4, 2026
Merged
Changes from 38 commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
fb57250
FastJet
samf25 2bcebf3
Remove Valencia so that it compiles
samf25 cb6f71a
Add FastJet test
aloeliger c49fc03
Changes for PR review
aloeliger 809eec1
CMake fixes
aloeliger cc74ee9
Fix build warnings
aloeliger 4be4c2f
Further code cleanup
aloeliger 97c21ce
Fix unusused make options and code, and fix format
aloeliger f8fc63f
Fix some warnings and options
aloeliger 0996808
Add licensing information
aloeliger f99636b
Add licensing to python test option
aloeliger a0b5126
Update comments and remove an unused library
aloeliger 865b67f
Add Marlin/Gaudi comparison test
aloeliger 2b4fdcd
Minor fix to assertion reporting
aloeliger 8a29b04
Fix formatting
aloeliger ce040b0
Move pandora settings to python directory
aloeliger 89916a0
Update tests
aloeliger 850689b
Make sure to use Marlin Jets in comparison
tmadlener 5fee38d
Cleanup whitespace issues
tmadlener 5d87d50
Add license headers to make pre-commit happy
tmadlener 764ad73
Remove debug printout and unnecessary import
tmadlener 9ebd85c
Make sure to convert LCIO Jets back to EDM4hep
tmadlener 3175a1e
Merge remote-tracking branch 'key4hep/main' into pr51-conflict-resolu…
madbaron 2a7dfe5
rm init.py
madbaron 0ecf77a
Put the source python directory back on the test PYTHONPATH
madbaron 216b79a
Avoid clashing with the PFOsFromJets collection already in the REC file
madbaron e4d78ca
fixed swapped outputs
madbaron 2778582
Lift cluster mode parameters into separate validation
tmadlener b62dc41
remove unwarranted (int) casting
madbaron 333a740
move files to test
madbaron 9b39f8f
CMakeLists cleanup
madbaron cd9c8ce
get rid of extra pandora in tests
madbaron 2605501
rework jet comparison
madbaron a21cc57
trim comments
madbaron beb6713
forgot to add new files
madbaron 4c858fe
pick up Valencia jets
madbaron 681bafb
test to fix ci
madbaron 5697154
moved last file
madbaron e3dadc5
Update k4Reco/CMakeLists.txt
madbaron 9695178
Merge branch 'main' into k4h_muoncollider_fastjet_rebase
tmadlener 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,3 +1,14 @@ | ||
| # k4Reco | ||
|
|
||
| Gaudi algorithms for reconstruction using EDM4hep natively. | ||
|
|
||
| ## Example steering files | ||
|
|
||
| Example steering files that show how to configure and run the algorithms live in the | ||
| `options` directory of the corresponding subfolder of [`k4Reco`](k4Reco), e.g. | ||
| [`k4Reco/Tracking/options`](k4Reco/Tracking/options). The ones that are only used to | ||
| run and validate the algorithms in the tests are kept next to the tests instead, e.g. | ||
| [`test/FastJet`](test/FastJet) for the `FastJetAlg`. | ||
|
|
||
| In either case these files are examples and the configurations that we use for testing, | ||
| they are not blessed production configurations. |
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,70 @@ | ||
| # - Locate FastJet library (including fastjet-contrib) | ||
| # Defines: | ||
| # | ||
| # FASTJET_FOUND | ||
| # FASTJET_INCLUDE_DIR | ||
| # FASTJET_INCLUDE_DIRS (not cached) | ||
| # FASTJET_LIBRARY | ||
| # FASTJET_LIBRARIES (not cached) | ||
| # FASTJET_LIBRARY_DIRS (not cached) | ||
|
|
||
| find_path(FASTJET_INCLUDE_DIR fastjet/version.hh | ||
| HINTS $ENV{FASTJET_ROOT_DIR}/include ${FASTJET_ROOT_DIR}/include) | ||
|
|
||
| # fastjet-contrib provides the ValenciaPlugin. It is a separate package that may be | ||
| # installed either into the FastJet prefix or into one of its own | ||
| find_path(FASTJET_CONTRIB_INCLUDE_DIR fastjet/contrib/ValenciaPlugin.hh | ||
| HINTS $ENV{FJCONTRIB_ROOT_DIR}/include ${FJCONTRIB_ROOT_DIR}/include | ||
| $ENV{FASTJET_ROOT_DIR}/include ${FASTJET_ROOT_DIR}/include | ||
| ${FASTJET_INCLUDE_DIR}) | ||
|
|
||
| find_library(FASTJET_LIBRARY NAMES fastjet | ||
| HINTS $ENV{FASTJET_ROOT_DIR}/lib ${FASTJET_ROOT_DIR}/lib) | ||
|
|
||
| find_library(FASTJETPLUGINS_LIBRARY NAMES fastjetplugins | ||
| HINTS $ENV{FASTJET_ROOT_DIR}/lib ${FASTJET_ROOT_DIR}/lib) | ||
|
|
||
| # Needed by fastjet-contrib, which uses the background estimators and Recluster | ||
| find_library(FASTJETTOOLS_LIBRARY NAMES fastjettools | ||
| HINTS $ENV{FASTJET_ROOT_DIR}/lib ${FASTJET_ROOT_DIR}/lib) | ||
|
|
||
| find_library(FASTJETCONTRIB_LIBRARY NAMES fastjetcontribfragile fastjetcontrib | ||
| HINTS $ENV{FJCONTRIB_ROOT_DIR}/lib ${FJCONTRIB_ROOT_DIR}/lib | ||
| $ENV{FASTJET_ROOT_DIR}/lib ${FASTJET_ROOT_DIR}/lib) | ||
|
|
||
| find_library(SISCONE_LIBRARY NAMES siscone | ||
| HINTS $ENV{FASTJET_ROOT_DIR}/lib ${FASTJET_ROOT_DIR}/lib) | ||
|
|
||
| find_library(SISCONE_SPHERICAL_LIBRARY NAMES siscone_spherical | ||
| HINTS $ENV{FASTJET_ROOT_DIR}/lib ${FASTJET_ROOT_DIR}/lib) | ||
|
|
||
| # handle the QUIETLY and REQUIRED arguments and set FASTJET_FOUND to TRUE if | ||
| # all listed variables are TRUE | ||
| INCLUDE(FindPackageHandleStandardArgs) | ||
| FIND_PACKAGE_HANDLE_STANDARD_ARGS(FastJet DEFAULT_MSG FASTJET_INCLUDE_DIR FASTJET_LIBRARY | ||
| FASTJET_CONTRIB_INCLUDE_DIR FASTJETCONTRIB_LIBRARY | ||
| FASTJETTOOLS_LIBRARY) | ||
|
|
||
| mark_as_advanced(FASTJET_FOUND FASTJET_INCLUDE_DIR FASTJET_LIBRARY FASTJET_CONTRIB_INCLUDE_DIR | ||
| FASTJETPLUGINS_LIBRARY FASTJETTOOLS_LIBRARY FASTJETCONTRIB_LIBRARY | ||
| SISCONE_LIBRARY SISCONE_SPHERICAL_LIBRARY) | ||
|
|
||
| set(FASTJET_INCLUDE_DIRS ${FASTJET_INCLUDE_DIR} ${FASTJET_CONTRIB_INCLUDE_DIR}) | ||
| list(REMOVE_DUPLICATES FASTJET_INCLUDE_DIRS) | ||
| # libfastjetcontribfragile.so is built without linking the FastJet libraries it uses (hence | ||
| # "fragile"): it carries undefined references to fastjettools, and has no DT_NEEDED of its | ||
| # own to satisfy them. Nothing in k4Reco references fastjettools directly, so where | ||
| # --as-needed is the compiler default (Debian/Ubuntu) the linker drops it from our DT_NEEDED | ||
| # and loading the plugin then fails with | ||
| # undefined symbol: _ZTIN7fastjet28JetMedianBackgroundEstimatorE | ||
| # Pin the pair with --no-as-needed, and keep dependents before dependencies | ||
| if(CMAKE_SYSTEM_NAME STREQUAL "Linux") | ||
| set(FASTJET_CONTRIB_LINK "-Wl,--push-state,--no-as-needed" ${FASTJETCONTRIB_LIBRARY} | ||
| ${FASTJETTOOLS_LIBRARY} "-Wl,--pop-state") | ||
| else() | ||
| set(FASTJET_CONTRIB_LINK ${FASTJETCONTRIB_LIBRARY} ${FASTJETTOOLS_LIBRARY}) | ||
| endif() | ||
|
|
||
| set(FASTJET_LIBRARIES ${FASTJET_CONTRIB_LINK} ${FASTJETPLUGINS_LIBRARY} | ||
| ${SISCONE_SPHERICAL_LIBRARY} ${SISCONE_LIBRARY} ${FASTJET_LIBRARY}) | ||
| get_filename_component(FASTJET_LIBRARY_DIRS ${FASTJET_LIBRARY} 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
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,55 @@ | ||
| /* | ||
| * Copyright (c) 2020-2024 Key4hep-Project. | ||
| * | ||
| * This file is part of Key4hep. | ||
| * See https://key4hep.github.io/key4hep-doc/ for further info. | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
| #ifndef K4RECO_FASTJET_ECLUSTERMODE_H | ||
| #define K4RECO_FASTJET_ECLUSTERMODE_H | ||
|
|
||
| #include <iostream> | ||
|
|
||
| // The enum, name and value of the enum for the Cluster Mode | ||
| namespace k4Reco::FastJet { | ||
| enum EClusterMode { | ||
| NONE = 0, | ||
| FJ_exclusive_yCut = 1, // exclusive clustering mode implemented in FastJet | ||
| FJ_exclusive_nJets = 2, // exclusive clustering mode implemented in FastJet | ||
| FJ_inclusive = 4, // inclusive "-" | ||
| OWN_inclusiveIteration = 8 // use FJ inclusive Clustering, but iterate until we have the desired number of jets | ||
| }; | ||
| std::ostream& operator<<(std::ostream& out, EClusterMode& m) { | ||
| switch (m) { | ||
| case OWN_inclusiveIteration: | ||
| out << "InclusiveIterativeNJets"; | ||
| break; | ||
| case FJ_inclusive: | ||
| out << "Inclusive"; | ||
| break; | ||
| case FJ_exclusive_nJets: | ||
| out << "ExclusiveNJets"; | ||
| break; | ||
| case FJ_exclusive_yCut: | ||
| out << "ExclusiveYCut"; | ||
| break; | ||
| default: | ||
| out << "unknown"; | ||
| break; | ||
| } | ||
| return out; | ||
| } | ||
|
|
||
| } // namespace k4Reco::FastJet | ||
| #endif |
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.