diff --git a/.github/scripts/man2html.sh b/.github/scripts/man2html.sh
index 683e988df8..db72d29b87 100755
--- a/.github/scripts/man2html.sh
+++ b/.github/scripts/man2html.sh
@@ -3,9 +3,9 @@
mkdir -p ./man/html
cd ./man/man1
for MANFILE in *; do
- mandoc -Thtml -Ostyle=/css/mandoc.css "${MANFILE}" > "../html/${MANFILE::-1}html"
+ mandoc -Thtml -Ostyle=../../css/mandoc.css "${MANFILE}" > "../html/${MANFILE::-1}html"
done
cd ../man7
for MANFILE in *; do
- mandoc -Thtml -Ostyle=/css/mandoc.css "${MANFILE}" > "../html/${MANFILE::-1}html"
+ mandoc -Thtml -Ostyle=../../css/mandoc.css "${MANFILE}" > "../html/${MANFILE::-1}html"
done
diff --git a/.github/workflows/bench.yml b/.github/workflows/bench.yml
index 265ca0aac8..768860fc68 100644
--- a/.github/workflows/bench.yml
+++ b/.github/workflows/bench.yml
@@ -1,6 +1,9 @@
-name: benchmark
+name: Benchmark
-on: [push]
+on:
+ push:
+ branches:
+ - master
jobs:
bench:
@@ -9,39 +12,43 @@ jobs:
fail-fast: false
matrix:
include:
- - SETUP: '/cvmfs/sw.hsf.org/key4hep/setup.sh'
+ - STACK: '/cvmfs/sw.hsf.org/key4hep/setup.sh'
NAME: prod
- - SETUP: '/cvmfs/sw-nightlies.hsf.org/key4hep/setup.sh'
+ - STACK: '/cvmfs/sw-nightlies.hsf.org/key4hep/setup.sh'
NAME: nightly
steps:
- - uses: actions/checkout@v3
- - uses: cvmfs-contrib/github-action-cvmfs@v3
+ - uses: actions/checkout@v4
+ - uses: cvmfs-contrib/github-action-cvmfs@v4
- name: Start container
run: |
- docker run -it --name CI_container -v ${GITHUB_WORKSPACE}:/Package -v /cvmfs:/cvmfs:shared -d ghcr.io/aidasoft/centos7:latest /bin/bash
+ docker run -it --name CI_container \
+ -v ${GITHUB_WORKSPACE}:/Package \
+ -v /cvmfs:/cvmfs:shared \
+ -d ghcr.io/key4hep/key4hep-images/alma9:latest \
+ /bin/bash
- name: CMake Configure
run: |
docker exec CI_container /bin/bash -c 'cd Package;\
mkdir -p build install;\
- source ${{ matrix.SETUP }};\
+ source ${{ matrix.STACK }};\
cd build;\
- cmake -DCMAKE_INSTALL_PREFIX=../install -DCMAKE_CXX_STANDARD=17 -DCMAKE_CXX_FLAGS=" -fdiagnostics-color=always " -G Ninja ..;'
+ cmake -DCMAKE_INSTALL_PREFIX=../install -DCMAKE_CXX_STANDARD=17 -DCMAKE_CXX_FLAGS=" -fdiagnostics-color=always " -G Ninja ..;'
- name: Compile
run: |
docker exec CI_container /bin/bash -c 'cd ./Package;\
- source ${{ matrix.SETUP }};\
+ source ${{ matrix.STACK }};\
cd build;\
ninja -k0;'
- name: Install
run: |
docker exec CI_container /bin/bash -c 'cd ./Package;\
- source ${{ matrix.SETUP }};\
+ source ${{ matrix.STACK }};\
cd build;\
ninja -k0 install;'
- name: Test
run: |
docker exec CI_container /bin/bash -c 'cd ./Package;\
- source ${{ matrix.SETUP }};\
+ source ${{ matrix.STACK }};\
cd build;\
ninja -k0 && ctest --output-on-failure;'
- name: Prepare benchmark outputs
diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml
index 89a1424e11..c6a177a300 100644
--- a/.github/workflows/docs.yml
+++ b/.github/workflows/docs.yml
@@ -1,16 +1,23 @@
-name: documentation
+name: Documentation
-on: [push]
+on:
+ push:
+ branches:
+ - master
jobs:
docs:
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v3
- - uses: cvmfs-contrib/github-action-cvmfs@v3
+ - uses: actions/checkout@v4
+ - uses: cvmfs-contrib/github-action-cvmfs@v4
- name: Start container
run: |
- docker run -it --name CI_container -v ${GITHUB_WORKSPACE}:/Package -v /cvmfs:/cvmfs:shared -d ghcr.io/aidasoft/centos7:latest /bin/bash
+ docker run -it \
+ --name CI_container \
+ -v ${GITHUB_WORKSPACE}:/Package \
+ -v /cvmfs:/cvmfs:shared \
+ -d ghcr.io/key4hep/key4hep-images/alma9:latest /bin/bash
- name: Compile Documentation
run: |
docker exec CI_container /bin/bash -c 'cd Package
@@ -21,7 +28,7 @@ jobs:
cmake ..
make doc'
- name: Deploy to GitHub Pages
- uses: peaceiris/actions-gh-pages@v3
+ uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build/doxygen/html
@@ -37,7 +44,7 @@ jobs:
run: |
.github/scripts/man2html.sh
- name: Deploy to GitHub Pages
- uses: peaceiris/actions-gh-pages@v3
+ uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./man/html
diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml
index e8494a46ef..6884af8ae7 100644
--- a/.github/workflows/format.yml
+++ b/.github/workflows/format.yml
@@ -6,24 +6,29 @@ jobs:
format:
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v3
+ - uses: actions/checkout@v4
with:
fetch-depth: 0
- - uses: cvmfs-contrib/github-action-cvmfs@v3
+ - uses: cvmfs-contrib/github-action-cvmfs@v4
- name: Start container
run: |
- docker run -it --name CI_container -v ${GITHUB_WORKSPACE}:/Package -v /cvmfs:/cvmfs:shared -d ghcr.io/aidasoft/centos7:latest /bin/bash
+ docker run -it --name CI_container \
+ -v ${GITHUB_WORKSPACE}:/Package \
+ -v /cvmfs:/cvmfs:shared \
+ -d ghcr.io/key4hep/key4hep-images/alma9:latest \
+ /bin/bash
- name: Add upstream
run: |
- docker exec CI_container /bin/bash -c 'cd ./Package
- git remote add upstream https://github.com/HEP-FCC/FCCAnalyses.git
+ docker exec CI_container /bin/bash -c 'cd Package; \
+ git config --global --add safe.directory /Package; \
+ git remote add upstream https://github.com/HEP-FCC/FCCAnalyses.git; \
git fetch upstream'
- name: Run formatter
run: |
- docker exec CI_container /bin/bash -c 'cd ./Package
- source /cvmfs/sft.cern.ch/lcg/contrib/clang/14.0.6/x86_64-centos7/setup.sh
+ docker exec CI_container /bin/bash -c 'cd ./Package; \
+ source /cvmfs/sw.hsf.org/key4hep/setup.sh;\
git clang-format --style=file $(git merge-base upstream/master HEAD)'
- name: Check cleanliness
run: |
- docker exec CI_container /bin/bash -c 'cd ./Package
+ docker exec CI_container /bin/bash -c 'cd ./Package; \
git diff'
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 35f068856f..4b0fad4ffc 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -1,4 +1,4 @@
-name: linux
+name: 'Build and Test'
on: [push, pull_request]
@@ -8,42 +8,48 @@ jobs:
strategy:
fail-fast: false
matrix:
- SETUP: ['/cvmfs/sw.hsf.org/key4hep/setup.sh', '/cvmfs/sw-nightlies.hsf.org/key4hep/setup.sh']
+ STACK: ['/cvmfs/sw.hsf.org/key4hep/setup.sh',
+ '/cvmfs/sw-nightlies.hsf.org/key4hep/setup.sh']
+ OS: ['alma9',
+ 'ubuntu22']
steps:
- - uses: actions/checkout@v3
- - uses: cvmfs-contrib/github-action-cvmfs@v3
+ - uses: actions/checkout@v4
+ - uses: cvmfs-contrib/github-action-cvmfs@v4
- name: Start container
run: |
- docker run -it --name CI_container -v ${GITHUB_WORKSPACE}:/Package -v /cvmfs:/cvmfs:shared -d ghcr.io/aidasoft/centos7:latest /bin/bash
+ docker run -it --name CI_container \
+ -v ${GITHUB_WORKSPACE}:/Package \
+ -v /cvmfs:/cvmfs:shared \
+ -d ghcr.io/key4hep/key4hep-images/${{ matrix.OS }}:latest \
+ /bin/bash
- name: CMake Configure
run: |
- docker exec CI_container /bin/bash -c 'cd Package;\
- mkdir -p build install;\
- source ${{ matrix.SETUP }};\
- cd build;\
- cmake -DCMAKE_INSTALL_PREFIX=../install -DCMAKE_CXX_STANDARD=17 -DCMAKE_CXX_FLAGS=" -fdiagnostics-color=always " -DWITH_DD4HEP=ON -DWITH_ACTS=ON -DWITH_ONNX=ON -G Ninja ..;'
+ docker exec CI_container /bin/bash -c 'cd Package; \
+ mkdir -p build install; \
+ source ${{ matrix.STACK }}; \
+ cd build; \
+ cmake -DCMAKE_INSTALL_PREFIX=../install -DCMAKE_CXX_STANDARD=17 -DCMAKE_CXX_FLAGS=" -fdiagnostics-color=always " -DWITH_DD4HEP=ON -DWITH_ACTS=OFF -DWITH_ONNX=ON -G Ninja ..;'
- name: Compile
run: |
- docker exec CI_container /bin/bash -c 'cd ./Package;\
- source ${{ matrix.SETUP }};\
- cd build;\
- ninja -k0;'
+ docker exec CI_container /bin/bash -c 'cd ./Package; \
+ source ${{ matrix.STACK }}; \
+ cd build; \
+ ninja -k0;'
- name: Install
run: |
- docker exec CI_container /bin/bash -c 'cd ./Package;\
- source ${{ matrix.SETUP }};\
- cd build;\
+ docker exec CI_container /bin/bash -c 'cd ./Package; \
+ source ${{ matrix.STACK }}; \
+ cd build; \
ninja -k0 install;'
- name: Test
run: |
- docker exec CI_container /bin/bash -c 'cd ./Package;\
- source ${{ matrix.SETUP }};\
- cd build;\
- ninja -k0 && ctest --output-on-failure;'
+ docker exec CI_container /bin/bash -c 'cd ./Package; \
+ source ${{ matrix.STACK }}; \
+ cd build; \
+ ninja -k0 && ctest --output-on-failure'
- name: Test using local Setup.sh
run: |
- docker exec CI_container /bin/bash -c 'cd ./Package
- source ${{ matrix.SETUP }}
- source ./setup.sh
- fccanalysis run examples/FCCee/higgs/mH-recoil/mumu/analysis_stage1.py --output myoutput.root --files-list root://eospublic.cern.ch//eos/experiment/fcc/ee/generation/DelphesEvents/spring2021/IDEA/p8_ee_Zbb_ecm91_EvtGen_Bc2TauNuTAUHADNU/events_131527278.root
- '
+ docker exec CI_container /bin/bash -c 'cd ./Package; \
+ source ${{ matrix.STACK }}; \
+ source ./setup.sh; \
+ fccanalysis run examples/FCCee/higgs/mH-recoil/mumu/analysis_stage1.py --output myoutput.root --files-list root://eospublic.cern.ch//eos/experiment/fcc/ee/generation/DelphesEvents/spring2021/IDEA/p8_ee_Zbb_ecm91_EvtGen_Bc2TauNuTAUHADNU/events_131527278.root'
diff --git a/.gitignore b/.gitignore
index eed87bf725..28858293fb 100644
--- a/.gitignore
+++ b/.gitignore
@@ -10,6 +10,10 @@ __pycache__/
# ROOT files
*.root
+# HTCondor
+# ignores .cc file in the top FCCAnalyses directory
+/*.cc
+
# Editors
*~
.vimlocal
@@ -100,3 +104,7 @@ benchmark*json
# Local configuration
.fccana/*
+
+# Graphviz graphs
+*.dot
+*.png
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 24c3093f63..a220f1f363 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,7 +1,9 @@
cmake_minimum_required(VERSION 3.16.9)
-project(FCCAnalyses CXX)
+project(FCCAnalyses VERSION 0.9.0
+ LANGUAGES CXX
+)
#--- RPATH settings -----------------------------------------------------------
@@ -29,6 +31,9 @@ option(USE_EXTERNAL_CATCH2 "Link against an external Catch2 v3 static library, o
option(FCCANALYSES_DOCUMENTATION "Whether or not to create doxygen doc target." ON)
+#--- Export compile commands --------------------------------------------------
+set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
+
#--- Set a better default for installation directory---------------------------
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX "${CMAKE_CURRENT_LIST_DIR}/install" CACHE PATH "default install path" FORCE)
@@ -46,17 +51,17 @@ set(INSTALL_INCLUDE_DIR include CACHE PATH
#--- Declare C++ Standard -----------------------------------------------------
-set(CMAKE_CXX_STANDARD 17 CACHE STRING "")
-if(NOT CMAKE_CXX_STANDARD MATCHES "17")
+set(CMAKE_CXX_STANDARD 20 CACHE STRING "")
+if(NOT CMAKE_CXX_STANDARD MATCHES "17|20")
message(FATAL_ERROR "Unsupported C++ standard: ${CMAKE_CXX_STANDARD}")
endif()
message (STATUS "C++ standard: ${CMAKE_CXX_STANDARD}")
#--- Dependencies -------------------------------------------------------------
-find_package(ROOT COMPONENTS ROOTVecOps ROOTDataFrame REQUIRED)
-find_package(EDM4HEP REQUIRED)
-find_package(podio)
+find_package(ROOT REQUIRED COMPONENTS ROOTVecOps ROOTDataFrame TMVA TMVAUtils)
+find_package(EDM4HEP REQUIRED) # will find also podio
+find_package(TBB REQUIRED COMPONENTS tbb)
# need to use our own FindFastJet.cmake
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
@@ -91,9 +96,15 @@ if(WITH_DD4HEP)
endif()
if(WITH_ONNX)
- find_package(ONNXRuntime)
- if(ONNXRuntime_FOUND)
+ # New onnxruntime (at least 1.17.1 and above) provide a onnxruntimeConfig.cmake
+ # and use the name onnxruntime
+ find_package(onnxruntime)
+ if (NOT onnxruntime_FOUND)
+ message(STATUS "Could not find onnxruntime (> 1.17.1). Looking for an older version")
+ find_package(ONNXRuntime)
+ endif()
+ if(onnxruntime_FOUND OR ONNXRuntime_FOUND)
elseif(WITH_ONNX STREQUAL AUTO)
message(WARNING "ONNXRuntime not found. Skipping ONNX-dependent analyzers.")
set(WITH_ONNX OFF)
@@ -140,6 +151,9 @@ install(FILES ${_man_files_1} DESTINATION ${CMAKE_INSTALL_PREFIX}/share/man/man1
file(GLOB _man_files_7 man/man7/*.7)
install(FILES ${_man_files_7} DESTINATION ${CMAKE_INSTALL_PREFIX}/share/man/man7)
+
+install(DIRECTORY examples DESTINATION ${CMAKE_INSTALL_PREFIX}/share/examples)
+
#--- Descend into subdirectories ----------------------------------------------
set(ADDONS_LIBRARIES CACHE STRING "List of external libraries the RDF utilities will be linked against")
diff --git a/README.md b/README.md
index 82bb375b1d..2e4488ab7b 100644
--- a/README.md
+++ b/README.md
@@ -4,242 +4,68 @@ Common framework for FCC related analyses. This framework allows one to write
full analysis, taking [EDM4hep](https://github.com/key4hep/EDM4hep) input ROOT
files and producing the plots.
->
-> As usual, if you aim at contributing to the repository, please fork it,
-> develop your feature/analysis and submit a pull requests.
->
-> To have access to the FCC samples, you need to be subscribed to one of the
-> following e-groups (with owner approval) `fcc-eos-read-xx` with `xx=ee,hh,eh`.
-> The configuration files are accessible at `/afs/cern.ch/work/f/fccsw/public/FCCDicts/` with a mirror at `/cvmfs/fcc.cern.ch/FCCDicts/`.
-> For accessing/reading information about existing datasets you do not need special rights.
-> However, if you need new datasets, you are invited to contact `emmanuel.perez@cern.ch`, `gerardo.ganis@cern.ch` or `juraj.smiesko@cern.ch`
-> who will explian the procedure, including granting the required access, where relevant.
->
-Detailed code documentation can be found
-[here](http://hep-fcc.github.io/FCCAnalyses/doc/latest/index.html).
+## Quick Start
+Running analysis script can be done using `fccanalysis` command which is
+shipped in Key4hep stack:
-## Table of contents
-
-* [FCCAnalyses](#fccanalyses)
- * [Table of contents](#table-of-contents)
- * [RootDataFrame based](#rootdataframe-based)
- * [Getting started](#getting-started)
- * [Generalities](#generalities)
- * [Example analysis](#example-analysis)
- * [Pre-selection](#pre-selection)
- * [Final selection](#final-selection)
- * [Plotting](#plotting)
- * [Contributing](#contributing)
- * [Formating](#code-formating)
-
-
-## RootDataFrame based
-
-Using ROOT dataframe allows to use modern, high-level interface and very quick
-processing time as it natively supports multithreading. In this README,
-everything from reading EDM4hep files on EOS and producing flat n-tuples, to
-running a final selection and plotting the results will be explained.
-
-ROOT dataframe documentation is available
-[here](https://root.cern/doc/master/classROOT_1_1RDataFrame.html).
-
-
-## Getting started
-
-In order to use the FCC analyzers within ROOT RDataFrame, a dictionary needs to
-be built and put into `LD_LIBRARY_PATH`. In order to build and load FCCAnalyses
-with default options one needs to run following two commands:
-
-```shell
-source ./setup.sh
-fccanalysis build
-```
-
-The FCCAnalyses is a CMake based project and any customizations can be provided
-in classic CMake style, the following commands are equivalent to default version
-of FCCAnalyses:
-
-```shell
-source ./setup.sh
-mkdir build install
-cd build
-cmake .. -DCMAKE_INSTALL_PREFIX=../install
-make install
-cd ..
-```
-
->
-> Each time changes are made in the C++ code, for example in
-> `analyzers/dataframe/` please do not forget to re-compile :)
->
-> To cleanly recompile the default version of FCCAnalyses one can use
-> `fccanalysis build --clean-build`.
-
-In order to provide the possibility to keep developing an analysis with well
-defined Key4hep stack, the sub-command `fccanalysis pin` is provided. One can
-pin his/her analysis with
-```
-source setup.sh
-fccanalysis pin
-```
-
-To remove the pin run
-```
-fccanalysis pin --clear
-```
-
-
-## Generalities
-
-Analyses in the FCCAnalyses framework usually follow standardized workflow,
-which consists of multiple files inside a single directory. Individual files
-denote steps in the analysis and have the following meaning:
-
-1. `analysis.py` or `analysis_stage`: In this file(s) the class of type
- `RDFanalysis` is used to define the list of analysers and filters to run on
- (`analysers` function) as well as the output variables (`output` function).
- It also contains the configuration parameters `processList`, `prodTag`,
- `outputDir`, `inputDir`, `nCPUS` and `runBatch`. User can define multiple
- stages of `analysis.py`. The first stage will most likely run on centrally
- produced EDM4hep events, thus the usage of `prodTag`. When running a second
- analysis stage, user points to the directory where the samples are
- located using `inputDir`.
-
-2. `analysis_final.py`: This analysis file contains the final selections and it
- runs over the locally produced n-tuples from the various stages of
- `analysis.py`. It contains a link to the `procDict.json` such that the
- samples can be properly normalised by getting centrally produced cross
- sections. (this might be removed later to include everything in the yaml,
- closer to the sample). It also contains the list of processes (matching the
- standard names), the number of CPUs, the cut list, and the variables (that
- will be both written in a `TTree` and in the form of `TH1` properly
- normalised to an integrated luminosity of 1pb-1.
-
-3. `analysis_plots.py`: This analysis file is used to select the final
- selections from running `analysis_final.py` to plot. It usually contains
- information about how to merge processes, write some extra text, normalise
- to a given integrated luminosity etc... For the moment it is possible to
- only plot one signal at the time, but several backgrounds.
-
-
-## Example analysis
-
-To better explain the FCCAnalyses workflow let's run our example analysis. The
-analysis should be located at `examples/FCCee/higgs/mH-recoil/mumu/`.
-
-
-### Pre-selection
-
-The pre-selection runs over already existing and properly registered FCCSW
-EDM4hep events. The dataset names with the corresponding statistics can be found
-[here](http://fcc-physics-events.web.cern.ch/fcc-physics-events/FCCee/spring2021/Delphesevents_IDEA.php)
-for the IDEA spring 2021 campaign. The `processList` is a dictionary of
-processes, each process having it's own dictionary of parameters. For example
-```python
-'p8_ee_ZH_ecm240':{'fraction':0.2, 'chunks':2, 'output':'p8_ee_ZH_ecm240_out'}
-```
-where `p8_ee_ZH_ecm240` should match an existing sample in the database,
-`fraction` is the fraction of the sample you want to run on (default is 1),
-`chunks` is the number of jobs to run (you will have the corresponding number
-of output files) and `output` in case you need to change the name of the output
-file (please note that then the sample will not be matched in the database for
-`finalSel.py` histograms normalisation). The other parameters are explained in
-[the example file](https://github.com/HEP-FCC/FCCAnalyses/blob/master/examples/FCCee/higgs/mH-recoil/mumu/analysis_stage1.py).
-
-To run the pre-selection stage of the example analysis run:
-
-```shell
-fccanalysis run examples/FCCee/higgs/mH-recoil/mumu/analysis_stage1.py
+```sh
+source /cvmfs/sw.hsf.org/key4hep/setup.sh
+fccanalysis run analysis_script.py
```
-This will create the output files in the `ZH_mumu_recoil/stage1` subdirectory
-of the output director specified with parameter `outDir` in the file.
-You also have the possibility to bypass the samples specified in the
-`processList` variable by using command line parameter `--output`, like so:
+## Pre-generated Samples
-```shell
-fccanalysis run examples/FCCee/higgs/mH-recoil/mumu/analysis_stage1.py \
- --output \
- --files-list
-```
+### Access
-The example analysis consists of two pre-selection stages, to run the second one
-slightly alter the previous command:
+To have read access to the FCC pre-generated samples, one needs to be subscribed to
+the following e-group (with owner approval): `fcc-eos-access`.
-```shell
-fccanalysis run examples/FCCee/higgs/mH-recoil/mumu/analysis_stage2.py
-```
+### Winter 2023 and Spring 2021 Pre-generated Samples
-#### Pre-selection on batch (HTCondor)
+In order to run over pre-generated samples from `winter2023` or `spring2021`
+campaigns one needs to compile `pre-edm4hep1` branch of the FCCAnalyses in the
+`2024-03-10` release:
-It is also possible to run the pre-selection step on the batch. For that the
-`runBatch` parameter needs to be set to true. Please make sure you select a
-long enough `batchQueue` and that your computing group is properly set
-`compGroup` (as you might not have the right to use the default one
-`group_u_FCC.local_gen` as it request to be part of the FCC computing e-group
-`fcc-experiments-comp`). When running on batch, you should use the `chunk`
-parameter for each sample in your `processList` such that you benefit from high
-parallelisation.
+ ```sh
+ source /cvmfs/sw.hsf.org/key4hep/setup.sh -r 2024-03-10
+ git clone --branch pre-edm4hep1 git@github.com:HEP-FCC/FCCAnalyses.git
+ cd FCCAnalyses
+ source ./setup.sh
+ fccanalysis build -j 8
+ ```
-### Final selection
+### Sample Metadata
-The final selection runs on the pre-selection files that were produced in the
-[Pre-selection](#pre-selection) step. In the configuration file
-`analysis_final.py` various cuts are defined to be run on and the final
-variables to be stored in both a `TTree` and histograms. This is why the
-variables needs extra fields like `title`, number of bins and range for the
-histogram creation. In the example analysis it can be run like this:
+All sample information, including Key4hep stack used for the campaign, is
+collected at the
+[FCC Physics Events](https://fcc-physics-events.web.cern.ch/)
+website.
-```shell
-fccanalysis final examples/FCCee/higgs/mH-recoil/mumu/analysis_final.py
-```
-This will create 2 files per selection `SAMPLENAME_SELECTIONNAME.root` for the
-`TTree` and `SAMPLENAME_SELECTIONNAME_histo.root` for the histograms.
-`SAMPLENAME` and `SELECTIONNAME` correspond to the name of the sample and
-selection respectively in the configuration file.
+## Documentation
-
-### Plotting
-
-The plotting analysis file `analysis_plots.py` contains not only details for
-the rendering of the plots but also ways of combining samples for plotting.
-In the example analysis it can be run in the following manner:
-
-```shell
-fccanalysis plots examples/FCCee/higgs/mH-recoil/mumu/analysis_plots.py
-```
-
-Resulting plots will be located the `outdir` defined in the analysis file.
-
-### Experimental
-
-In an attempt to ease the development of new physics case studies, such as for the [FCCee physics performance](https://github.com/HEP-FCC/FCCeePhysicsPerformance) cases, a new experimental analysis package creation tool is introduced.
-[See here](case-studies/README.md) for more details.
+Detailed documentation can be found at the
+[FCCAnalyses](https://hep-fcc.github.io/FCCAnalyses/) webpage.
## Contributing
-### Code formating
+As usual, if you aim at contributing to the repository, please fork it, develop
+your feature/analysis and submit a pull requests.
-The preferred style of the C++ code in the FCCAnalyses is LLVM which is checked
-by CI job.
-Currently `clang-format` is not available in the Key4hep stack, but one can
-obtain a suitable version of it from CVMFS thanks to LCG:
-```
-source /cvmfs/sft.cern.ch/lcg/contrib/clang/14.0.6/x86_64-centos7/setup.sh
-```
+### Code Formating
-Then to apply formatting to a given file:
+The preferred style of the C++ code in the
+[FCCAnalyses](https://hep-fcc.github.io/FCCAnalyses/) is LLVM, which is checked
+by a CI job.
+
+To apply formatting to a file:
```
clang-format -i -style=file /path/to/file.cpp
```
-
-Another way to obtain a recent version of `clang-format` is through downloading
-[Key4hep Spack instance](https://key4hep.github.io/key4hep-doc/spack-build-instructions-for-librarians/spack-setup.html#downloading-a-spack-instance).
diff --git a/addons/CMakeLists.txt b/addons/CMakeLists.txt
index dee331a9c4..4684dae6fe 100644
--- a/addons/CMakeLists.txt
+++ b/addons/CMakeLists.txt
@@ -1,5 +1,6 @@
add_subdirectory(FastJet)
add_subdirectory(ONNXRuntime)
+add_subdirectory(TMVAHelper)
set(ADDONS_LIBRARIES ${ADDONS_LIBRARIES} PARENT_SCOPE)
message(STATUS "add-ons--------------------------- ${ADDONS_LIBRARIES}")
diff --git a/addons/FastJet/CMakeLists.txt b/addons/FastJet/CMakeLists.txt
index 355201922c..05de02305c 100644
--- a/addons/FastJet/CMakeLists.txt
+++ b/addons/FastJet/CMakeLists.txt
@@ -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
diff --git a/addons/FastJet/python/jetClusteringHelper.py b/addons/FastJet/python/jetClusteringHelper.py
index 5618974006..ce814427c1 100644
--- a/addons/FastJet/python/jetClusteringHelper.py
+++ b/addons/FastJet/python/jetClusteringHelper.py
@@ -1,6 +1,7 @@
import json
import ROOT
+ROOT.gROOT.SetBatch(True)
class ExclusiveJetClusteringHelper:
def __init__(self, coll, njets, tag=""):
diff --git a/addons/ONNXRuntime/CMakeLists.txt b/addons/ONNXRuntime/CMakeLists.txt
index c420ee0bde..64021d8b7e 100644
--- a/addons/ONNXRuntime/CMakeLists.txt
+++ b/addons/ONNXRuntime/CMakeLists.txt
@@ -2,17 +2,17 @@ if(WITH_ONNX STREQUAL OFF)
return()
endif()
-find_package(ONNXRuntime QUIET)
find_package(nlohmann_json QUIET)
find_package(ROOT COMPONENTS ROOTVecOps QUIET)
-if(ONNXRuntime_FOUND AND nlohmann_json_FOUND)
+get_target_property(ONNXRUNTIME_INCLUDE_DIRS onnxruntime::onnxruntime INTERFACE_INCLUDE_DIRECTORIES)
+if(nlohmann_json_FOUND)
message(STATUS "includes-------------------------- onnxruntime: ${ONNXRUNTIME_INCLUDE_DIRS}")
elseif(WITH_ONNX STREQUAL AUTO)
- message(WARNING "ONNXRuntime and/or nlohmann's JSON libraries not found. Skipping ONNX-dependent analyzers.")
+ message(WARNING "nlohmann's JSON libraries not found. Skipping ONNX-dependent analyzers.")
set(WITH_ONNX OFF)
return()
else()
- message(FATAL_ERROR "Failed to locate ONNXRuntime and/or nlohmann's JSON library!")
+ message(FATAL_ERROR "nlohmann's JSON library!")
endif()
file(GLOB sources src/*.cc)
@@ -21,16 +21,22 @@ file(GLOB headers *.h)
fccanalyses_addon_build(ONNXRuntime
SOURCES ${sources} ${headers}
EXT_HEADERS ${ONNXRUNTIME_INCLUDE_DIRS}
- EXT_LIBS ROOT::ROOTVecOps ${ONNXRUNTIME_LIBRARIES} nlohmann_json::nlohmann_json
+ EXT_LIBS ROOT::ROOTVecOps nlohmann_json::nlohmann_json onnxruntime::onnxruntime
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)
# add all unit tests
add_executable(onnxruntime-unittest test/onnxtest.cpp)
target_link_libraries(onnxruntime-unittest PUBLIC FCCAnalyses gfortran PRIVATE Catch2::Catch2WithMain ONNXRuntime)
- target_include_directories(onnxruntime-unittest PUBLIC ${VDT_INCLUDE_DIR} ${ONNXRUNTIME_INCLUDE_DIRS})
+ target_include_directories(onnxruntime-unittest PUBLIC ${VDT_INCLUDE_DIR})
target_compile_definitions(onnxruntime-unittest PUBLIC "-DTEST_INPUT_DATA_DIR=${TEST_INPUT_DATA_DIR}")
include(Catch)
catch_discover_tests(onnxruntime-unittest
@@ -40,7 +46,7 @@ if(BUILD_TESTING)
)
endif()
# add all integration tests
- add_integration_test("examples/FCCee/weaver/analysis_inference.py")
+ # add_integration_test("examples/FCCee/weaver/analysis_inference.py")
endif()
file(GLOB _addon_python_files python/*.py)
diff --git a/addons/ONNXRuntime/ONNXRuntime.h b/addons/ONNXRuntime/ONNXRuntime.h
index 4ed42a6b55..28db49fbeb 100644
--- a/addons/ONNXRuntime/ONNXRuntime.h
+++ b/addons/ONNXRuntime/ONNXRuntime.h
@@ -1,18 +1,13 @@
#ifndef ONNXRuntime_ONNXRuntime_h
#define ONNXRuntime_ONNXRuntime_h
+#include "onnxruntime_cxx_api.h"
+
#include
#include
#include