Skip to content
Merged
Show file tree
Hide file tree
Changes from 38 commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
fb57250
FastJet
samf25 Aug 25, 2025
2bcebf3
Remove Valencia so that it compiles
samf25 Aug 26, 2025
cb6f71a
Add FastJet test
aloeliger Mar 18, 2026
c49fc03
Changes for PR review
aloeliger Mar 31, 2026
809eec1
CMake fixes
aloeliger Mar 31, 2026
cc74ee9
Fix build warnings
aloeliger Apr 2, 2026
4be4c2f
Further code cleanup
aloeliger Apr 2, 2026
97c21ce
Fix unusused make options and code, and fix format
aloeliger Apr 7, 2026
f8fc63f
Fix some warnings and options
aloeliger Apr 8, 2026
0996808
Add licensing information
aloeliger Apr 8, 2026
f99636b
Add licensing to python test option
aloeliger Apr 9, 2026
a0b5126
Update comments and remove an unused library
aloeliger Apr 9, 2026
865b67f
Add Marlin/Gaudi comparison test
aloeliger Apr 16, 2026
2b4fdcd
Minor fix to assertion reporting
aloeliger Apr 16, 2026
8a29b04
Fix formatting
aloeliger Apr 16, 2026
ce040b0
Move pandora settings to python directory
aloeliger Apr 16, 2026
89916a0
Update tests
aloeliger Apr 16, 2026
850689b
Make sure to use Marlin Jets in comparison
tmadlener Apr 17, 2026
5fee38d
Cleanup whitespace issues
tmadlener Apr 17, 2026
5d87d50
Add license headers to make pre-commit happy
tmadlener Apr 17, 2026
764ad73
Remove debug printout and unnecessary import
tmadlener Apr 17, 2026
9ebd85c
Make sure to convert LCIO Jets back to EDM4hep
tmadlener Apr 17, 2026
3175a1e
Merge remote-tracking branch 'key4hep/main' into pr51-conflict-resolu…
madbaron Aug 27, 2026
2a7dfe5
rm init.py
madbaron Aug 27, 2026
0ecf77a
Put the source python directory back on the test PYTHONPATH
madbaron Aug 27, 2026
216b79a
Avoid clashing with the PFOsFromJets collection already in the REC file
madbaron Aug 27, 2026
e4d78ca
fixed swapped outputs
madbaron Aug 27, 2026
2778582
Lift cluster mode parameters into separate validation
tmadlener Aug 28, 2026
b62dc41
remove unwarranted (int) casting
madbaron Aug 29, 2026
333a740
move files to test
madbaron Aug 29, 2026
9b39f8f
CMakeLists cleanup
madbaron Aug 31, 2026
cd9c8ce
get rid of extra pandora in tests
madbaron Aug 31, 2026
2605501
rework jet comparison
madbaron Aug 31, 2026
a21cc57
trim comments
madbaron Aug 31, 2026
beb6713
forgot to add new files
madbaron Aug 31, 2026
4c858fe
pick up Valencia jets
madbaron Sep 1, 2026
681bafb
test to fix ci
madbaron Sep 1, 2026
5697154
moved last file
madbaron Sep 2, 2026
e3dadc5
Update k4Reco/CMakeLists.txt
madbaron Sep 4, 2026
9695178
Merge branch 'main' into k4h_muoncollider_fastjet_rebase
tmadlener Sep 4, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ set(${PROJECT_NAME}_VERSION_MINOR 4)
set(${PROJECT_NAME}_VERSION_PATCH 0)

set(${PROJECT_NAME}_VERSION "${${PROJECT_NAME}_VERSION_MAJOR}.${${PROJECT_NAME}_VERSION_MINOR}.${${PROJECT_NAME}_VERSION_PATCH}")
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})

option(BUILD_TRACKING "Build conformal tracking" ON)

Expand All @@ -37,6 +38,8 @@ find_package(k4FWCore 1.4 REQUIRED)
find_package(ROOT REQUIRED COMPONENTS RIO Tree)
find_package(k4SimGeant4 REQUIRED)

find_package(FastJet REQUIRED)

include(cmake/Key4hepConfig.cmake)

include(GNUInstallDirs)
Expand Down
11 changes: 11 additions & 0 deletions README.md
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.
70 changes: 70 additions & 0 deletions cmake/FindFastJet.cmake
Comment thread
aloeliger marked this conversation as resolved.
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)
14 changes: 13 additions & 1 deletion k4Reco/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ limitations under the License.

set(sources
DDPlanarDigi/components/DDPlanarDigi.cpp
FastJet/src/FastJetAlg.cpp
GaudiLumiCalClusterer/components/GaudiLumiCalClusterer.cpp
GaudiLumiCalClusterer/src/LumiCalClusterer.cpp
GaudiLumiCalClusterer/src/LumiCalClusterer_getCalHits.cpp
Expand All @@ -44,6 +45,7 @@ set(libs
ROOT::Core
ROOT::MathCore
ROOT::Tree
${FASTJET_LIBRARIES}
)

if(BUILD_TRACKING)
Expand Down Expand Up @@ -123,6 +125,11 @@ target_include_directories(k4RecoPlugins PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/Tracking/include>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
Comment thread
aloeliger marked this conversation as resolved.
Outdated

# Only the FastJetAlg sources use these, nothing links against a Gaudi module
Comment thread
madbaron marked this conversation as resolved.
Outdated
target_include_directories(k4RecoPlugins PRIVATE
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/FastJet/include>)
target_include_directories(k4RecoPlugins SYSTEM PRIVATE ${FASTJET_INCLUDE_DIRS})

Comment thread
aloeliger marked this conversation as resolved.
if(BUILD_TRACKING)
target_include_directories(k4RecoPlugins
PUBLIC
Expand All @@ -136,7 +143,12 @@ if(BUILD_TRACKING)
)
endif()

install(TARGETS GaudiTrkUtils k4RecoPlugins
set(install_targets k4RecoPlugins)
if(BUILD_TRACKING)
list(APPEND install_targets GaudiTrkUtils)
endif()

install(TARGETS ${install_targets}
EXPORT k4RecoTargets
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT bin
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT shlib
Expand Down
55 changes: 55 additions & 0 deletions k4Reco/FastJet/include/EClusterMode.h
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
Loading
Loading