Skip to content

Commit

Permalink
Merge pull request #302 from kjvbrt/example_addons_install
Browse files Browse the repository at this point in the history
Converting examples to use installed addons
  • Loading branch information
kjvbrt authored Aug 15, 2023
2 parents f2984b1 + 1c47c00 commit e5f2627
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 10 deletions.
6 changes: 6 additions & 0 deletions addons/FastJet/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ fccanalyses_addon_build(FastJet
ROOT::MathCore
INSTALL_COMPONENT fastjet)

add_custom_command(TARGET FastJet POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_SOURCE_DIR}/python/*
${CMAKE_CURRENT_BINARY_DIR}
)


install(FILES
${CMAKE_CURRENT_LIST_DIR}/ExternalRecombiner.h
Expand Down
6 changes: 6 additions & 0 deletions addons/ONNXRuntime/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ fccanalyses_addon_build(ONNXRuntime
EXT_LIBS ROOT::ROOTVecOps ${ONNXRUNTIME_LIBRARIES} nlohmann_json::nlohmann_json
INSTALL_COMPONENT onnxruntime)

add_custom_command(TARGET ONNXRuntime POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_SOURCE_DIR}/python/*
${CMAKE_CURRENT_BINARY_DIR}
)

if(BUILD_TESTING)
find_catch_instance()
if(Catch2_FOUND)
Expand Down
2 changes: 1 addition & 1 deletion cmake/FCCAnalysesFunctions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function(add_integration_test _testname)
)
set_property(TEST fccanalysisrun_${_testname} APPEND PROPERTY ENVIRONMENT
LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/analyzers/dataframe:$ENV{LD_LIBRARY_PATH}
PYTHONPATH=${CMAKE_SOURCE_DIR}/python:$ENV{PYTHONPATH}
PYTHONPATH=${CMAKE_SOURCE_DIR}/python:${CMAKE_BINARY_DIR}:$ENV{PYTHONPATH}
PATH=${CMAKE_SOURCE_DIR}/bin:${CMAKE_BINARY_DIR}:$ENV{PATH}
ROOT_INCLUDE_PATH=${CMAKE_SOURCE_DIR}/analyzers/dataframe:$ENV{ROOT_INCLUDE_PATH}
TEST_INPUT_DATA_DIR=${TEST_INPUT_DATA_DIR}
Expand Down
6 changes: 3 additions & 3 deletions examples/FCCee/higgs/mH-recoil/stage1_flavor.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ def get_file_path(url, filename):
weaver_preproc = get_file_path(url_preproc, local_preproc)
weaver_model = get_file_path(url_model, local_model)

from addons.ONNXRuntime.python.jetFlavourHelper import JetFlavourHelper
from addons.FastJet.python.jetClusteringHelper import (
from addons.ONNXRuntime.jetFlavourHelper import JetFlavourHelper
from addons.FastJet.jetClusteringHelper import (
ExclusiveJetClusteringHelper,
)

Expand Down Expand Up @@ -258,4 +258,4 @@ def output():
## outputs jet scores and constituent breakdown
branchList += jetFlavourHelper.outputBranches()

return branchList
return branchList
4 changes: 2 additions & 2 deletions examples/FCCee/smearing/smear_jets.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ def jet_sequence(df, collections, output_branches, tag=""):
weaver_preproc = get_file_path(url_preproc, local_preproc)
weaver_model = get_file_path(url_model, local_model)

from addons.ONNXRuntime.python.jetFlavourHelper import JetFlavourHelper
from addons.FastJet.python.jetClusteringHelper import ExclusiveJetClusteringHelper
from addons.ONNXRuntime.jetFlavourHelper import JetFlavourHelper
from addons.FastJet.jetClusteringHelper import ExclusiveJetClusteringHelper

output_branches = []

Expand Down
4 changes: 2 additions & 2 deletions examples/FCCee/weaver/analysis_inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ def get_file_path(url, filename):
weaver_preproc = get_file_path(url_preproc, local_preproc)
weaver_model = get_file_path(url_model, local_model)

from addons.ONNXRuntime.python.jetFlavourHelper import JetFlavourHelper
from addons.FastJet.python.jetClusteringHelper import ExclusiveJetClusteringHelper
from addons.ONNXRuntime.jetFlavourHelper import JetFlavourHelper
from addons.FastJet.jetClusteringHelper import ExclusiveJetClusteringHelper

jetFlavourHelper = None
jetClusteringHelper = None
Expand Down
4 changes: 2 additions & 2 deletions examples/FCCee/weaver/stage1.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
variables_event,
)

from addons.ONNXRuntime.python.jetFlavourHelper import JetFlavourHelper
from addons.FastJet.python.jetClusteringHelper import ExclusiveJetClusteringHelper
from addons.ONNXRuntime.jetFlavourHelper import JetFlavourHelper
from addons.FastJet.jetClusteringHelper import ExclusiveJetClusteringHelper

jetFlavourHelper = None
jetClusteringHelper = None
Expand Down

0 comments on commit e5f2627

Please sign in to comment.