Skip to content

Commit

Permalink
BTV developments. C_tt_workflow & QCD_soft_mu workflow. QCD studies (c…
Browse files Browse the repository at this point in the history
…ms-btv-pog#101)

* feat: Add new wfs & 2D correlations

-scripts:Added 2D_plotter and a correlation plot maker used in the QCD studies
-utils: added to AK4_parameters LSF for 22, 23; new hists for QCD smu wf and ttsemilep_valid_sf
-helpers: update_branch fixed ProbC, added definitions_for_corr
-workflows: added new workflows ttsemilep_valid_sf (additional c selection) and QCD soft muon wf



* feat: Add new ci

* Fix from comments

* Polishing documentation
  • Loading branch information
ValVau authored Oct 22, 2024
1 parent 5f069b5 commit cdb64f9
Show file tree
Hide file tree
Showing 25 changed files with 17,669 additions and 6,257 deletions.
11 changes: 1 addition & 10 deletions .github/workflows/BTA_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,7 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: update submodules
env:
SSHKEY: ${{ secrets.GIT_CERN_SSH_PRIVATE }}
run: |
mkdir $HOME/.ssh
echo "$SSHKEY" > $HOME/.ssh/id_rsa
chmod 600 $HOME/.ssh/id_rsa
echo "HOST *" > ~/.ssh/config
echo "StrictHostKeyChecking no" >> ~/.ssh/config
git submodule update --init --recursive

- uses: cvmfs-contrib/github-action-cvmfs@v4
with:
cvmfs_repositories: 'grid.cern.ch'
Expand Down
42 changes: 17 additions & 25 deletions .github/workflows/QCD_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,7 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: update submodules
env:
SSHKEY: ${{ secrets.GIT_CERN_SSH_PRIVATE }}
run: |
mkdir $HOME/.ssh
echo "$SSHKEY" > $HOME/.ssh/id_rsa
ls -lrt $HOME/.ssh
chmod 600 $HOME/.ssh/id_rsa
echo "HOST *" > ~/.ssh/config
echo "StrictHostKeyChecking no" >> ~/.ssh/config
git submodule update --init --recursive

- uses: cvmfs-contrib/github-action-cvmfs@v4
with:
cvmfs_repositories: 'grid.cern.ch'
Expand Down Expand Up @@ -117,17 +107,19 @@ jobs:
fi
python runner.py --workflow QCD_sf --json metadata/test_bta_run3.json --executor iterative $opts
# - name: QCD mu workflows with correctionlib
# run: |
# message=$(git log -1 --pretty=format:'%s')
# if [[ $string == *"ci:skip array"* ]]; then
# opts=$(echo "$opts" | sed 's/--isArray //g')
# fi
# if [[ $string == *"ci:skip syst"* ]]; then
# opts=$(echo "$opts" | sed 's/--isSyst all//g')
# elif [[ $string == *"ci:JERC_split"* ]]; then
# opts=$(echo "$opts" | sed 's/--isSyst all/--isSyst JERC_split/g')
# elif [[ $string == *"ci:weight_only"* ]]; then
# opts=$(echo "$opts" | sed 's/--isSyst all/--isSyst weight_only/g')
# fi
# python runner.py --workflow QCD_mu --json metadata/test_bta_run3.json --executor iterative --overwrite $opts
- name: QCD soft mu workflows with correctionlib
run: |
message=$(git log -1 --pretty=format:'%s')
if [[ $string == *"ci:skip array"* ]]; then
opts=$(echo "$opts" | sed 's/--isArray //g')
fi
if [[ $string == *"ci:skip syst"* ]]; then
opts=$(echo "$opts" | sed 's/--isSyst all//g')
elif [[ $string == *"ci:JERC_split"* ]]; then
opts=$(echo "$opts" | sed 's/--isSyst all/--isSyst JERC_split/g')
elif [[ $string == *"ci:weight_only"* ]]; then
opts=$(echo "$opts" | sed 's/--isSyst all/--isSyst weight_only/g')
fi
python runner.py --workflow QCD_smu_sf --json metadata/test_bta_run3.json --executor iterative --overwrite $opts
11 changes: 1 addition & 10 deletions .github/workflows/ctag_DY_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,7 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: update submodules
env:
SSHKEY: ${{ secrets.GIT_CERN_SSH_PRIVATE }}
run: |
mkdir $HOME/.ssh
echo "$SSHKEY" > $HOME/.ssh/id_rsa
chmod 600 $HOME/.ssh/id_rsa
echo "HOST *" > ~/.ssh/config
echo "StrictHostKeyChecking no" >> ~/.ssh/config
git submodule update --init --recursive

- uses: cvmfs-contrib/github-action-cvmfs@v4
with:
cvmfs_repositories: 'grid.cern.ch'
Expand Down
12 changes: 1 addition & 11 deletions .github/workflows/ctag_Wc_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,7 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: update submodules
env:
SSHKEY: ${{ secrets.GIT_CERN_SSH_PRIVATE }}
run: |
mkdir $HOME/.ssh
echo "$SSHKEY" > $HOME/.ssh/id_rsa
ls -lrt $HOME/.ssh
chmod 600 $HOME/.ssh/id_rsa
echo "HOST *" > ~/.ssh/config
echo "StrictHostKeyChecking no" >> ~/.ssh/config
git submodule update --init --recursive

- uses: cvmfs-contrib/github-action-cvmfs@v4
with:
cvmfs_repositories: 'grid.cern.ch'
Expand Down
11 changes: 1 addition & 10 deletions .github/workflows/ctag_ttbar_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,7 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: update submodules
env:
SSHKEY: ${{ secrets.GIT_CERN_SSH_PRIVATE }}
run: |
mkdir $HOME/.ssh
echo "$SSHKEY" > $HOME/.ssh/id_rsa
chmod 600 $HOME/.ssh/id_rsa
echo "HOST *" > ~/.ssh/config
echo "StrictHostKeyChecking no" >> ~/.ssh/config
git submodule update --init --recursive

- uses: cvmfs-contrib/github-action-cvmfs@v4
with:
cvmfs_repositories: 'grid.cern.ch'
Expand Down
26 changes: 16 additions & 10 deletions .github/workflows/ttbar_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,7 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: update submodules
env:
SSHKEY: ${{ secrets.GIT_CERN_SSH_PRIVATE }}
run: |
mkdir $HOME/.ssh
echo "$SSHKEY" > $HOME/.ssh/id_rsa
chmod 600 $HOME/.ssh/id_rsa
echo "HOST *" > ~/.ssh/config
echo "StrictHostKeyChecking no" >> ~/.ssh/config
git submodule update --init --recursive

- uses: cvmfs-contrib/github-action-cvmfs@v4
with:
cvmfs_repositories: 'grid.cern.ch'
Expand Down Expand Up @@ -112,6 +103,21 @@ jobs:
opts=$(echo "$opts" | sed 's/--isSyst all/--isSyst weight_only/g')
fi
python runner.py --workflow ttsemilep_sf --json metadata/test_bta_run3.json --limit 1 --executor iterative $opts
- name: semileptonic + c ttbar workflows with correctionlib
run: |
string=$(git log -1 --pretty=format:'%s')
if [[ $string == *"ci:skip array"* ]]; then
opts=$(echo "$opts" | sed 's/--isArray //g')
fi
if [[ $string == *"ci:skip syst"* ]]; then
opts=$(echo "$opts" | sed 's/--isSyst all//g')
elif [[ $string == *"ci:JERC_split"* ]]; then
opts=$(echo "$opts" | sed 's/--isSyst all/--isSyst JERC_split/g')
elif [[ $string == *"ci:weight_only"* ]]; then
opts=$(echo "$opts" | sed 's/--isSyst all/--isSyst weight_only/g')
fi
python runner.py --workflow c_ttsemilep_sf --json metadata/test_bta_run3.json --limit 1 --executor iterative $opts

- name: btag dileptonic ttbar workflows with correctionlib
Expand Down
11 changes: 1 addition & 10 deletions .github/workflows/validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,7 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: update submodules
env:
SSHKEY: ${{ secrets.GIT_CERN_SSH_PRIVATE }}
run: |
mkdir $HOME/.ssh
echo "$SSHKEY" > $HOME/.ssh/id_rsa
chmod 600 $HOME/.ssh/id_rsa
echo "HOST *" > ~/.ssh/config
echo "StrictHostKeyChecking no" >> ~/.ssh/config
git submodule update --init --recursive

- uses: cvmfs-contrib/github-action-cvmfs@v4
with:
cvmfs_repositories: 'grid.cern.ch'
Expand Down
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -644,6 +644,23 @@ Extract the ROCs for different tagger and efficiencies from validation workflow
python scripts/validation_plot.py -i $INPUT_COFFEA -v $VERSION
```
### Correlation plots study
You can perform a study of linear correlations of b-tagging input variables. Additionally, soft muon variables may be added into the study by requesting `--SMu` argument. If you wan to limit the outputs only to DeepFlavB, PNetB and RobustParTAK4B, you can use the `--limit_outputs` option. If you want to use only the set of variables used for tagger training, not just all the input variables, then use the option `--limit_inputs`. To limit number of files read, make use of option `--max_files`. In case your study requires splitting samples by flavour, use `--flavour_split`. `--split_region_b` performs a sample splitting based on the DeepFlavB >/< 0.5
```python
python correlation_plots.py $input_folder [--max_files $nmax_files --SMu --limit_inputs --limit_outputs --specify_MC --flavour_split --split_region_b]
```
### 2D plots (Correlation study-related)
To further investigate the correlations, one can create the 2D plots of the variables used in this study. Inputs and optional arguments are the same as for the correlation plots study.
```python
python 2Dhistogramms.py $input_folder [--max_files $nmax_files --SMu --limit_inputs --limit_outputs --specify_MC --flavour_split --split_region_b]
```
## Store histograms from coffea file
Use `scripts/make_template.py` to dump 1D/2D histogram from `.coffea` to `TH1D/TH2D` with hist. MC histograms can be reweighted to according to luminosity value given via `--lumi`. You can also merge several files
Expand Down
Loading

0 comments on commit cdb64f9

Please sign in to comment.