Skip to content

Commit

Permalink
Merge pull request #76 from TopEFT/adding-ci
Browse files Browse the repository at this point in the history
Adding ci
  • Loading branch information
bryates authored Aug 20, 2021
2 parents a33a48d + 4281e5e commit abec9d1
Show file tree
Hide file tree
Showing 5 changed files with 141 additions and 3 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: CI

on:
push:
schedule:
- cron: '0 1 * * *' # Test every day at 1AM

jobs:
Full_Analysis:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Add conda to system path
run: |
echo $CONDA/bin >> $GITHUB_PATH
- name: Install dependencies
run: |
conda env update --file environment.yml --name base
- name: Conda list
run: |
conda list
- name: Install topcoffea package
run: |
pip install -e .
- name: Download root files
run: |
wget http://www.crc.nd.edu/~ywan2/root_files/NAOD-00000_18449.root
- name: Run processors over test files with futures executor
run: |
cd analysis/topEFT
time python run.py ../../topcoffea/json/test_samples/UL17_private_ttH_for_CI.json -o output_check_yields
- name: Get yields
run: |
cd analysis/topEFT
python get_yield_json.py -f histos/output_check_yields.pkl.gz -n output_check_yields
- name: Compare yields
run: |
cd analysis/topEFT
python comp_yields.py test/UL17_private_ttH_for_CI_yields.json output_check_yields.json -t1 "Ref yields" -t2 "New yields"
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
[![CI](https://github.com/TopEFT/topcoffea/actions/workflows/main.yml/badge.svg)](https://github.com/TopEFT/topcoffea/actions/workflows/main.yml)

# topcoffea
Top quark analyses using the Coffea framework

Expand Down Expand Up @@ -31,9 +33,8 @@ bash conda-install.sh
```
Next, run `unset PYTHONPATH` to avoid conflicts. Then run the following commands to set up the conda environment:
```
conda create --name topcoffea-env python
conda activate topcoffea-env
conda install -y -c conda-forge ndcctools conda-pack dill xrootd coffea
conda env create -f environment.yml
conda activate coffea-env
```

### How to start
Expand Down
40 changes: 40 additions & 0 deletions analysis/topEFT/test/UL17_private_ttH_for_CI_yields.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"ttH": {
"2lss_m": [
20.677004545468762,
4.1828132785350285e-15
],
"2lss_p": [
19.870077477553295,
4.1003832114823895e-15
],
"3l_m_offZ_1b": [
3.964872301886027,
1.8316364125419964e-15
],
"3l_m_offZ_2b": [
4.53462424039309,
1.95882356067898e-15
],
"3l_onZ_1b": [
1.766004732614043,
1.222420425560399e-15
],
"3l_onZ_2b": [
1.9007979982164087,
1.2682143103404668e-15
],
"3l_p_offZ_1b": [
4.72934896615817,
2.000439156165079e-15
],
"3l_p_offZ_2b": [
5.609943207055785,
2.1787324345487895e-15
],
"4l": [
0.7206380524728832,
7.808781337601581e-16
]
}
}
11 changes: 11 additions & 0 deletions environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: coffea-env
channels:
- defaults
- conda-forge
dependencies:
- python
- coffea
- ndcctools
- conda-pack
- dill
- xrootd
38 changes: 38 additions & 0 deletions topcoffea/json/test_samples/UL17_private_ttH_for_CI.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"xsec": 0.2151,
"year": "2017",
"treeName": "Events",
"histAxisName": "ttHJet_privateUL16APV",
"options": "",
"WCnames": [
"cpt",
"ctp",
"cptb",
"cQlMi",
"cQq81",
"cQq11",
"cQl3i",
"ctq8",
"ctlTi",
"ctq1",
"ctli",
"cQq13",
"cbW",
"cpQM",
"cpQ3",
"ctei",
"cQei",
"ctW",
"ctlSi",
"cQq83",
"ctZ",
"ctG"
],
"files": [
"../../NAOD-00000_18449.root"
],
"nEvents": 7993714,
"nGenEvents": 40553247.0,
"nSumOfWeights": 40553247,
"isData": false
}

0 comments on commit abec9d1

Please sign in to comment.