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

update readthedocs config #260

Merged
merged 18 commits into from
Apr 17, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
45 changes: 45 additions & 0 deletions .github/workflows/build_unittest_container.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# CI step to build the unittest container to be used for the other CI steps
# publish the container in the github container registry

name: Checks

# This workflow should only run when the Dockerfile changes
on:
push:
paths:
- docker/Dockerfile
pull_request:
paths:
- docker/Dockerfile
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}-crown-unittest

jobs:
build_unittest_container:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build and push Docker image
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
with:
context: .
file: docker/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
65 changes: 15 additions & 50 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,28 +25,12 @@ env:

jobs:
build_project:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
container:
image: rootproject/root:6.28.10-ubuntu22.04
image: ghcr.io/kit-cms/crown-crown-unittest:pr-260
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 pip install GitPython --break-system-packages && python -m pip install git+https://github.com/cms-nanoAOD/correctionlib.git --break-system-packages

- name: update ubuntu
run: apt-get -y update
- name: install packages
run: apt-get install -y git cmake make python3-pip openmpi-bin libopenmpi-dev libboost-all-dev openssh-client
- name: install python packages
run: python3 -m pip install GitPython && python3 -m pip install git+https://github.com/cms-nanoAOD/correctionlib.git

- name: Clone project
uses: actions/checkout@v3
with:
Expand All @@ -64,7 +48,7 @@ jobs:

- name: Configure CMake
shell: bash
run: cd ${{github.workspace}}/build && cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DANALYSIS=$ANALYSIS -DCONFIG=$CONFIG -DSAMPLES=$SAMPLES -DERAS=$ERAS -DSCOPES=$SCOPES -DSHIFTS=$SHIFTS -DOPTIMIZED=false
run: cd ${{github.workspace}}/build && cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DANALYSIS=$ANALYSIS -DCONFIG=$CONFIG -DSAMPLES=$SAMPLES -DERAS=$ERAS -DSCOPES=$SCOPES -DSHIFTS=$SHIFTS -DOPTIMIZED=false -DONNXRUNTIME_INCLUDE_DIR=/opt/onnxruntime

- name: Build
shell: bash
Expand All @@ -75,21 +59,12 @@ jobs:
run: cd ${{github.workspace}}/build && ctest -V --label-regex "ntuple.*."

build_single_friend:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
container:
image: rootproject/root:6.28.04-arch
image: ghcr.io/kit-cms/crown-crown-unittest:pr-260
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 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
Expand All @@ -108,7 +83,7 @@ jobs:

- name: Configure CMake
shell: bash
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"
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" -DONNXRUNTIME_INCLUDE_DIR=/opt/onnxruntime

- name: Build
shell: bash
Expand All @@ -119,22 +94,12 @@ jobs:
run: cd ${{github.workspace}}/build && ctest -V --label-regex "single_friend.*."

build_two_friends:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
container:
image: rootproject/root:6.28.04-arch
image: ghcr.io/kit-cms/crown-crown-unittest:pr-260
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 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:
Expand All @@ -152,7 +117,7 @@ jobs:

- 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"
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" -DONNXRUNTIME_INCLUDE_DIR=/opt/onnxruntime

- name: Build
shell: bash
Expand All @@ -164,9 +129,9 @@ jobs:


python_format:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
container:
image: rootproject/root:6.26.00-ubuntu20.04
image: ghcr.io/kit-cms/crown-crown-unittest:pr-260
options: --user 0 # run as root

steps:
Expand All @@ -183,9 +148,9 @@ jobs:
run: cd $GITHUB_WORKSPACE && bash checks/python-formatting.sh

cpp_format:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
container:
image: rootproject/root:6.26.00-ubuntu20.04
image: ghcr.io/kit-cms/crown-crown-unittest:pr-260
options: --user 0 # run as root

steps:
Expand All @@ -202,9 +167,9 @@ jobs:
run: cd $GITHUB_WORKSPACE && bash checks/cpp-formatting.sh

docs:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
container:
image: rootproject/root:6.26.00-ubuntu20.04
image: ghcr.io/kit-cms/crown-crown-unittest:pr-260
options: --user 0 # run as root

steps:
Expand Down
8 changes: 7 additions & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,18 @@
# Required
version: 2

# Set the OS, Python version and other tools you might need

build:
os: ubuntu-22.04
tools:
python: "3.10"

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/sphinx_source/conf.py

# Optionally set the version of Python and requirements required to build your docs
python:
version: 3.8
install:
- requirements: docs/sphinx_source/requirements.txt
2 changes: 1 addition & 1 deletion analysis_configurations/unittest/producers/genparticles.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@
name="gen_match_2",
call="quantities::tau::genmatch({df}, {output}, 1, {input})",
input=[q.dileptonpair, nanoAOD.Tau_genMatch],
output=[q.gen_match_2],
output=[q.tau_gen_match_2],
scopes=["mt", "et", "tt"],
)
gen_taujet_pt_1 = Producer(
Expand Down
4 changes: 2 additions & 2 deletions analysis_configurations/unittest/producers/pairquantities.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@
name="gen_match_1",
call="quantities::tau::genmatch({df}, {output}, 0, {input})",
input=[q.dileptonpair, nanoAOD.Tau_genMatch],
output=[q.gen_match_1],
output=[q.tau_gen_match_1],
scopes=["tt"],
)
taujet_pt_1 = Producer(
Expand Down Expand Up @@ -318,7 +318,7 @@
name="taugen_match_2",
call="quantities::tau::genmatch({df}, {output}, 1, {input})",
input=[q.dileptonpair, nanoAOD.Tau_genMatch],
output=[q.gen_match_2],
output=[q.tau_gen_match_2],
scopes=["mt", "et", "tt"],
)
taujet_pt_2 = Producer(
Expand Down
21 changes: 11 additions & 10 deletions analysis_configurations/unittest/producers/scalefactors.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,62 +111,63 @@
},
)


############################
# Tau ID/ISO SF
# The readout is done via correctionlib
############################
Tau_1_VsJetTauID_SF = ExtendedVectorProducer(
name="Tau_1_VsJetTauID_SF",
call='scalefactor::tau::id_vsJet_tt({df}, {input}, {vec_open}{tau_dms}{vec_close}, "{vsjet_tau_id_WP}", "{tau_sf_vsjet_tauDM0}", "{tau_sf_vsjet_tauDM1}", "{tau_sf_vsjet_tauDM10}", "{tau_sf_vsjet_tauDM11}", "{tau_vsjet_sf_dependence}", {output}, "{tau_sf_file}", "{tau_id_discriminator}")',
input=[q.pt_1, q.tau_decaymode_1, q.gen_match_1],
call='scalefactor::tau::id_vsJet_tt({df}, {input}, {vec_open}{tau_dms}{vec_close}, "{vsjet_tau_id_WP}", "{tau_sf_vsjet_tauDM0}", "{tau_sf_vsjet_tauDM1}", "{tau_sf_vsjet_tauDM10}", "{tau_sf_vsjet_tauDM11}", "{tau_vsjet_sf_dependence}", "{tau_vsjet_vseleWP}", {output}, "{tau_sf_file}", "{tau_id_discriminator}")',
input=[q.pt_1, q.tau_decaymode_1, q.tau_gen_match_1],
output="tau_1_vsjet_sf_outputname",
scope=["tt"],
vec_config="vsjet_tau_id",
)
Tau_1_VsEleTauID_SF = ExtendedVectorProducer(
name="Tau_1_VsEleTauID_SF",
call='scalefactor::tau::id_vsEle({df}, {input}, {vec_open}{tau_dms}{vec_close}, "{vsele_tau_id_WP}", "{tau_sf_vsele_barrel}", "{tau_sf_vsele_endcap}", {output}, "{tau_sf_file}", "{tau_id_discriminator}")',
input=[q.eta_1, q.tau_decaymode_1, q.gen_match_1],
input=[q.eta_1, q.tau_decaymode_1, q.tau_gen_match_1],
output="tau_1_vsele_sf_outputname",
scope=["tt"],
vec_config="vsele_tau_id",
)
Tau_1_VsMuTauID_SF = ExtendedVectorProducer(
name="Tau_1_VsMuTauID_SF",
call='scalefactor::tau::id_vsMu({df}, {input}, {vec_open}{tau_dms}{vec_close}, "{vsmu_tau_id_WP}", "{tau_sf_vsmu_wheel1}", "{tau_sf_vsmu_wheel2}", "{tau_sf_vsmu_wheel3}", "{tau_sf_vsmu_wheel4}", "{tau_sf_vsmu_wheel5}", {output}, "{tau_sf_file}", "{tau_id_discriminator}")',
input=[q.eta_1, q.tau_decaymode_1, q.gen_match_1],
input=[q.eta_1, q.tau_decaymode_1, q.tau_gen_match_1],
output="tau_1_vsmu_sf_outputname",
scope=["tt"],
vec_config="vsmu_tau_id",
)
Tau_2_VsJetTauID_lt_SF = ExtendedVectorProducer(
name="Tau_2_VsJetTauID_lt_SF",
call='scalefactor::tau::id_vsJet_lt({df}, {input}, {vec_open}{tau_dms}{vec_close}, "{vsjet_tau_id_WP}", "{tau_sf_vsjet_tau30to35}", "{tau_sf_vsjet_tau35to40}", "{tau_sf_vsjet_tau40to500}", "{tau_sf_vsjet_tau500to1000}", "{tau_sf_vsjet_tau1000toinf}", "{tau_vsjet_sf_dependence}", {output}, "{tau_sf_file}", "{tau_id_discriminator}")',
input=[q.pt_2, q.tau_decaymode_2, q.gen_match_2],
call='scalefactor::tau::id_vsJet_lt({df}, {input}, {vec_open}{tau_dms}{vec_close}, "{vsjet_tau_id_WP}", "{tau_sf_vsjet_tau30to35}", "{tau_sf_vsjet_tau35to40}", "{tau_sf_vsjet_tau40to500}", "{tau_sf_vsjet_tau500to1000}", "{tau_sf_vsjet_tau1000toinf}", "{tau_vsjet_sf_dependence}", "{tau_vsjet_vseleWP}", {output}, "{tau_sf_file}", "{tau_id_discriminator}")',
input=[q.pt_2, q.tau_decaymode_2, q.tau_gen_match_2],
output="tau_2_vsjet_sf_outputname",
scope=["et", "mt"],
vec_config="vsjet_tau_id",
)
Tau_2_VsJetTauID_tt_SF = ExtendedVectorProducer(
name="Tau_2_VsJetTauID_tt_SF",
call='scalefactor::tau::id_vsJet_tt({df}, {input}, {vec_open}{tau_dms}{vec_close}, "{vsjet_tau_id_WP}", "{tau_sf_vsjet_tauDM0}", "{tau_sf_vsjet_tauDM1}", "{tau_sf_vsjet_tauDM10}", "{tau_sf_vsjet_tauDM11}", "{tau_vsjet_sf_dependence}", {output}, "{tau_sf_file}", "{tau_id_discriminator}")',
input=[q.pt_2, q.tau_decaymode_2, q.gen_match_2],
call='scalefactor::tau::id_vsJet_tt({df}, {input}, {vec_open}{tau_dms}{vec_close}, "{vsjet_tau_id_WP}", "{tau_sf_vsjet_tauDM0}", "{tau_sf_vsjet_tauDM1}", "{tau_sf_vsjet_tauDM10}", "{tau_sf_vsjet_tauDM11}", "{tau_vsjet_sf_dependence}", "{tau_vsjet_vseleWP}", {output}, "{tau_sf_file}", "{tau_id_discriminator}")',
input=[q.pt_2, q.tau_decaymode_2, q.tau_gen_match_2],
output="tau_2_vsjet_sf_outputname",
scope=["tt"],
vec_config="vsjet_tau_id",
)
Tau_2_VsEleTauID_SF = ExtendedVectorProducer(
name="Tau_2_VsEleTauID_SF",
call='scalefactor::tau::id_vsEle({df}, {input}, {vec_open}{tau_dms}{vec_close}, "{vsele_tau_id_WP}", "{tau_sf_vsele_barrel}", "{tau_sf_vsele_endcap}", {output}, "{tau_sf_file}", "{tau_id_discriminator}")',
input=[q.eta_2, q.tau_decaymode_2, q.gen_match_2],
input=[q.eta_2, q.tau_decaymode_2, q.tau_gen_match_2],
output="tau_2_vsele_sf_outputname",
scope=["et", "mt", "tt"],
vec_config="vsele_tau_id",
)
Tau_2_VsMuTauID_SF = ExtendedVectorProducer(
name="Tau_2_VsMuTauID_SF",
call='scalefactor::tau::id_vsMu({df}, {input}, {vec_open}{tau_dms}{vec_close}, "{vsmu_tau_id_WP}", "{tau_sf_vsmu_wheel1}", "{tau_sf_vsmu_wheel2}", "{tau_sf_vsmu_wheel3}", "{tau_sf_vsmu_wheel4}", "{tau_sf_vsmu_wheel5}", {output}, "{tau_sf_file}", "{tau_id_discriminator}")',
input=[q.eta_2, q.tau_decaymode_2, q.gen_match_2],
input=[q.eta_2, q.tau_decaymode_2, q.tau_gen_match_2],
output="tau_2_vsmu_sf_outputname",
scope=["et", "mt", "tt"],
vec_config="vsmu_tau_id",
Expand Down
4 changes: 2 additions & 2 deletions analysis_configurations/unittest/quantities/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@
iso_2 = Quantity("iso_2")
decaymode_1 = Quantity("decaymode_1")
decaymode_2 = Quantity("decaymode_2")
gen_match_1 = Quantity("gen_match_1")
gen_match_2 = Quantity("gen_match_2")
tau_gen_match_1 = Quantity("tau_gen_match_1")
tau_gen_match_2 = Quantity("tau_gen_match_2")
gen_tau_pt_1 = Quantity("gen_tau_pt_1")
gen_tau_pt_2 = Quantity("gen_tau_pt_2")
gen_tau_eta_1 = Quantity("gen_tau_eta_1")
Expand Down
Loading
Loading