This repository contains the scripts used to calculate the muon background veto probability (Pveto) for the disappearing tracks analysis using Run 3 ntuples.
The workflow is:
- Generate EOS filelists
- Submit HTCondor jobs
- Run the Pveto analysis over ntuples
- Produce per-job ROOT + JSON outputs
- Merge JSON outputs
- Produce LaTeX tables for the Analysis Note
| File | Purpose |
|---|---|
MuonBackground_v2_table16_pveto_json_pairfix_taujet.py |
Main Pveto analysis |
MergePvetoJsonAndMakeTables_v2.py |
Merge JSON outputs and make LaTeX tables |
make_muon_filelists.py |
Generate EOS filelists |
run_job.sh |
Condor worker job |
submit_dataset.sh |
Helper script for Condor submission |
Inside CMSSW:
cmsrel CMSSW_15_0_10
cd CMSSW_15_0_10/src
cmsenv
voms-proxy-init --voms cms --valid=168:00
cd DisappTrks_v2/BkgdEstimation/scriptsCreate the local python dependency directory:
mkdir python_env
python3 -m pip install --target python_env \
awkward \
uproot \
vector \
numpy \
fsspec-xrootdTest imports:
PYTHONPATH=$PWD/python_env:$PYTHONPATH python3 -c \
"import awkward, uproot, vector, numpy, fsspec_xrootd; print('imports OK')"Generate all filelists:
python3 make_muon_filelists.py --year allOr a specific dataset:
python3 make_muon_filelists.py --year 2023_DThis creates:
filelists/filelist_2023_C_Muons.txt
filelists/filelist_2023_D_Muons.txt
filelists/filelist_2024_Muons.txt
filelists/filelist_2025_Muons.txt
Create log directories:
mkdir -p logs/2023_C
mkdir -p logs/2023_D
mkdir -p logs/2024
mkdir -p logs/2025Output directories are created automatically by run_job.sh.
Each dataset has its own JDL:
submit_2023_C.jdl
submit_2023_D.jdl
submit_2024.jdl
submit_2025.jdl
The important line is:
arguments = $(ProcId) 2023_D
which specifies the dataset name.
The JDL should also contain:
should_transfer_files = YES
when_to_transfer_output = ON_EXIT
transfer_output_files = analysis_output
transfer_input_files = \
MuonBackground_v2_table16_pveto_json_pairfix_taujet.py,\
helper_functions.py,\
filelists,\
python_env
Queue size is supplied automatically by the helper script.
Use the helper script:
./submit_dataset.sh 2023_DThis script:
- Reads the correct filelist
- Counts the number of files
- Computes the number of Condor jobs
- Submits the jobs automatically
Check job status:
condor_qCheck held jobs:
condor_q -holdRemove jobs:
condor_rm <clusterid>Release held jobs:
condor_release -name <schedd> <clusterid>Per-job outputs are written to:
analysis_output/<dataset>/
Example:
analysis_output/2023_D/
Each job produces:
Muon_2023_D_Pveto_<job>.root
Muon_2023_D_Pveto_<job>.json
After all jobs finish, merge the JSON outputs:
python3 MergePvetoJsonAndMakeTables_v2.py \
--input-dir analysis_output/2023_D \
--output-dir merged_output/2023_DThis produces:
- merged Pveto counts
- cutflow LaTeX tables
- Pveto LaTeX tables
The merge script produces .tex files suitable for direct inclusion into the Analysis Note.
Example:
\input{pveto_2023D_muon_v2.tex}The muon veto must be applied at the pair level:
pair_dr > 0.15This is implemented in:
passes_muon_vetoinside the analysis script.
The estimate uses:
Negative Pveto values are clipped to zero following the analysis note convention.
Tau cleaning uses DeepTau IDs with:
- VSjet = Needs to be decided/done
- VSe = Needs to be decided/done
- VSmu = Needs to be decide/done
along with:
- decayModeFindingNewDMs
- rejection of decay modes 5 and 6
python_env/
logs/
analysis_output/
merged_output/
*.root
*.json
*.out
*.err
*.log
filelists/filelist_*.txtGenerate filelists:
python3 make_muon_filelists.py --year 2023_DSubmit jobs:
bash submit_dataset.sh 2023_DMerge outputs:
python3 MergePvetoJsonAndMakeTables_v2.py \
--input-dir analysis_output/2023_D \
--output-dir merged_output/2023_DInclude table in AN:
\input{pveto_2023D_muon_v2.tex}