Skip to content
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

add functionality to use arbitrary number of friend trees #230

Merged
merged 18 commits into from
Sep 7, 2023
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
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
56 changes: 51 additions & 5 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ env:
ERAS: 2018
SCOPES: "mt,mm,et"
SHIFTS: "all"
FRIEND_SCOPES: "mt,mm"
FRIEND_CONFIG: unittest_friends
SINGLE_FRIEND_SCOPES: "mt,mm"
SINGLE_FRIEND_CONFIG: unittest_friends
TWO_FRIENDS_SCOPES: "mt"
TWO_FRIENDS_CONFIG: unittest_friends_2
FRIEND_SHIFTS: "nominal,jesUncTotalUp,jesUncTotalDown,tauMuFakeEsDown"

jobs:
Expand Down Expand Up @@ -65,7 +67,7 @@ jobs:
shell: bash
run: cd ${{github.workspace}}/build && ctest -V --label-regex "ntuple.*."

build_friends:
build_single_friend:
runs-on: ubuntu-20.04
container:
image: rootproject/root:6.28.04-arch
Expand Down Expand Up @@ -99,15 +101,59 @@ jobs:

- name: Configure CMake
shell: bash
run: cd ${{github.workspace}}/build && cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DANALYSIS=$ANALYSIS -DCONFIG=$FRIEND_CONFIG -DSAMPLES=$SAMPLES -DERAS=$ERAS -DSCOPES=$FRIEND_SCOPES -DSHIFTS=$FRIEND_SHIFTS -DOPTIMIZED=false
run: cd ${{github.workspace}}/build && cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DANALYSIS=$ANALYSIS -DCONFIG=$SINGLE_FRIEND_CONFIG -DSAMPLES=$SAMPLES -DERAS=$ERAS -DSCOPES=$SINGLE_FRIEND_SCOPES -DSHIFTS=$FRIEND_SHIFTS -DOPTIMIZED=false -DQUANTITIESMAP="dummy"

- name: Build
shell: bash
run: cd ${{github.workspace}}/build && make install -j 2

- name: Test
shell: bash
run: cd ${{github.workspace}}/build && ctest -V --label-regex "friends.*."
run: cd ${{github.workspace}}/build && ctest -V --label-regex "single_friend.*."

build_two_friends:
runs-on: ubuntu-20.04
container:
image: rootproject/root:6.28.04-arch
options: --user 0 # run as root

steps:
- name: update Arch keyring
run: pacman -Sc --noconfirm && pacman -Syy --noconfirm && pacman -Sy archlinux-keyring --noconfirm

- name: Install missing software
run: pacman -Syu --noconfirm cmake make git python-pip openmp openmpi boost openssh --ignore root --ignore openssl


- name: Install python packages
run: python -m ensurepip --default-pip && python -m pip install GitPython --break-system-packages && python -m pip install git+https://github.com/cms-nanoAOD/correctionlib.git --break-system-packages

- name: Clone project
uses: actions/checkout@v3
with:
ssh-key: ${{ secrets.CERN_GITLAB_PRIVATE_KEY }}
submodules: "recursive"
ssh-strict: "false"
ssh-known-hosts: "[gitlab.cern.ch]:7999 ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAubVS0czgKaPkC5cfB75CI3XjgWBv7pj2ILiZezVf8okkCAYr+bf4w6VrH2pyv3NRUW5Mm8U/3zoSNcrYIqhFFpz6R62/3xt8hMrPKJKstbt1lSIr8QhEyD24SJEKugMi560BWRPkTzXrrFgxz0X4vuKKytpvihRsccZ7F1JaX76UCWEJ3Xr2BFCEnnN6gj9nvFr4gvSMneunWVLGw2KcHwS1OJfnWBlp3fB0rYWSxZAoVjcjZjvv3hioEftaTapff2PkdQIX//N9Cc555FzdmMzixTvU5j/i+QvjxWVbEBNSKI6te6udC4fYUZMePs2QQnqw9mXUQtaQtw+HV7utuw=="

- name: Create Build Environment
shell: bash
run: cmake -E make_directory ${{github.workspace}}/build

- name: adding a system path
run: echo "$HOME/.local/bin" >> $GITHUB_PATH

- name: Configure CMake
shell: bash
run: cd ${{github.workspace}}/build && cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DANALYSIS=$ANALYSIS -DCONFIG=$TWO_FRIENDS_CONFIG -DSAMPLES=$SAMPLES -DERAS=$ERAS -DSCOPES=$TWO_FRIENDS_SCOPES -DSHIFTS=$FRIEND_SHIFTS -DOPTIMIZED=false -DQUANTITIESMAP="dummy"

- name: Build
shell: bash
run: cd ${{github.workspace}}/build && make install -j 2

- name: Test
shell: bash
run: cd ${{github.workspace}}/build && ctest -V --label-regex "two_friends.*."


python_format:
Expand Down
8 changes: 6 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ if (NOT DEFINED SHIFTS)
endif()

if (NOT DEFINED QUANTITIESMAP)
message(STATUS "No quantities map specified, none will be used. If you want to produce friends, you have to specify a quantities map e.g. -DQUANTITIESMAP=quantities_map.json. The input can be a json file or a root file (for debugging purposes).")
message(STATUS "No quantities map specified, none will be used. If you want to produce friends, you have to specify quantities maps for all friend files e.g. -DQUANTITIESMAP=quantities_map_1.json,quantities_map_2.json. The input can be a comma-separated list of JSON files and/or root files (for debugging purposes).")
set(FRIENDS "false")
set(QUANTITIESMAP "none")
else()
Expand Down Expand Up @@ -254,7 +254,11 @@ if (NOT DEFINED INSTALLDIR)
set(INSTALLDIR ${CMAKE_CURRENT_BINARY_DIR}/bin)
endif()
set(GENERATE_CPP_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
set(GENERATE_CPP_INPUT_TEMPLATE "${CMAKE_SOURCE_DIR}/code_generation/analysis_template.cxx")
if (FRIENDS)
set(GENERATE_CPP_INPUT_TEMPLATE "${CMAKE_SOURCE_DIR}/code_generation/analysis_template_friends.cxx")
else()
set(GENERATE_CPP_INPUT_TEMPLATE "${CMAKE_SOURCE_DIR}/code_generation/analysis_template.cxx")
endif()
set(GENERATE_CPP_SUBSET_TEMPLATE "${CMAKE_SOURCE_DIR}/code_generation/subset_template.cxx")

message(STATUS "")
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
{
"2018": {
"dyjets": {
"et": {
"": [
"id_wgt_mu_friend_1",
"iso_wgt_mu_friend_1"
],
"jesUncTotalDown": [
"id_wgt_mu_friend_1",
"iso_wgt_mu_friend_1"
],
"jesUncTotalUp": [
"id_wgt_mu_friend_1",
"iso_wgt_mu_friend_1"
],
"metUnclusteredEnDown": [
"iso_wgt_mu_friend_1",
"id_wgt_mu_friend_1"
],
"metUnclusteredEnUp": [
"iso_wgt_mu_friend_1",
"id_wgt_mu_friend_1"
],
"tauES_1prong0pizeroDown": [
"iso_wgt_mu_friend_1",
"id_wgt_mu_friend_1"
],
"tauMuFakeEsDown": [
"iso_wgt_mu_friend_1",
"id_wgt_mu_friend_1"
],
"vsEleBarrelDown": [
"id_wgt_mu_friend_1",
"iso_wgt_mu_friend_1"
],
"vsJetTau30to35Down": [
"id_wgt_mu_friend_1",
"iso_wgt_mu_friend_1"
],
"vsMuWheel1Down": [
"id_wgt_mu_friend_1",
"iso_wgt_mu_friend_1"
]
},
"mt": {
"": [
"id_wgt_mu_friend_1",
"iso_wgt_mu_friend_1"
],
"jesUncTotalDown": [
"id_wgt_mu_friend_1",
"iso_wgt_mu_friend_1"
],
"jesUncTotalUp": [
"id_wgt_mu_friend_1",
"iso_wgt_mu_friend_1"
],
"metUnclusteredEnDown": [
"iso_wgt_mu_friend_1",
"id_wgt_mu_friend_1"
],
"metUnclusteredEnUp": [
"iso_wgt_mu_friend_1",
"id_wgt_mu_friend_1"
],
"tauES_1prong0pizeroDown": [
"iso_wgt_mu_friend_1",
"id_wgt_mu_friend_1"
],
"tauMuFakeEsDown": [
"iso_wgt_mu_friend_1",
"id_wgt_mu_friend_1"
],
"vsEleBarrelDown": [
"id_wgt_mu_friend_1",
"iso_wgt_mu_friend_1"
],
"vsJetTau30to35Down": [
"id_wgt_mu_friend_1",
"iso_wgt_mu_friend_1"
],
"vsMuWheel1Down": [
"id_wgt_mu_friend_1",
"iso_wgt_mu_friend_1"
]
},
"mm": {
"": [
"id_wgt_mu_friend_1",
"iso_wgt_mu_friend_1"
],
"jesUncTotalDown": [
"id_wgt_mu_friend_1",
"iso_wgt_mu_friend_1"
],
"jesUncTotalUp": [
"id_wgt_mu_friend_1",
"iso_wgt_mu_friend_1"
],
"metUnclusteredEnDown": [
"iso_wgt_mu_friend_1",
"id_wgt_mu_friend_1"
],
"metUnclusteredEnUp": [
"iso_wgt_mu_friend_1",
"id_wgt_mu_friend_1"
],
"tauES_1prong0pizeroDown": [
"iso_wgt_mu_friend_1",
"id_wgt_mu_friend_1"
],
"tauMuFakeEsDown": [
"iso_wgt_mu_friend_1",
"id_wgt_mu_friend_1"
],
"vsEleBarrelDown": [
"id_wgt_mu_friend_1",
"iso_wgt_mu_friend_1"
],
"vsJetTau30to35Down": [
"id_wgt_mu_friend_1",
"iso_wgt_mu_friend_1"
],
"vsMuWheel1Down": [
"id_wgt_mu_friend_1",
"iso_wgt_mu_friend_1"
]
}
}
}
}
Loading
Loading