diff --git a/README.md b/README.md index b10bd2c3..a82f9fa4 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,6 @@ [![Lint and test](https://github.com/uhh-cms/hh2bbtautau/actions/workflows/lint_and_test.yaml/badge.svg)](https://github.com/uhh-cms/hh2bbtautau/actions/workflows/lint_and_test.yaml) [![License](https://img.shields.io/github/license/uhh-cms/hh2bbtautau.svg)](https://github.com/uhh-cms/hh2bbtautau/blob/master/LICENSE) - ### Quickstart A couple test tasks are listed below. @@ -44,6 +43,12 @@ law run cf.CreateDatacards \ --workers 3 ``` +### Useful links + +- [columnflow documentation](https://columnflow.readthedocs.io/en/latest/index.html) +- [Nano documentation](https://gitlab.cern.ch/cms-nanoAOD/nanoaod-doc) +- [Correctionlib files](https://gitlab.cern.ch/cms-nanoAOD/jsonpog-integration) +- [HLT info browser](https://cmshltinfo.app.cern.ch/path/HLT_MediumChargedIsoPFTau180HighPtRelaxedIso_Trk50_eta2p1_v) ### Development diff --git a/hbt/columnflow_patches.py b/hbt/columnflow_patches.py index be48971a..e55999d5 100644 --- a/hbt/columnflow_patches.py +++ b/hbt/columnflow_patches.py @@ -55,7 +55,34 @@ def htcondor_job_resources(self, job_num, branches): logger.debug(f"patched htcondor_job_resources of {HTCondorWorkflow.task_family}") +@memoize +def patch_user_parameters(): + """ + Adds user parameters to some tasks. + """ + from hbt.tasks.parameters import user_parameter_inst + from columnflow.tasks.framework.remote import ( + BundleRepo, + BundleSoftware, + BuildBashSandbox, + BundleBashSandbox, + BundleCMSSWSandbox, + ) + + for cls in [ + BundleRepo, + BundleSoftware, + BuildBashSandbox, + BundleBashSandbox, + BundleCMSSWSandbox, + ]: + cls.user_parameter = user_parameter_inst + + logger.debug("patched user parameters") + + @memoize def patch_all(): patch_bundle_repo_exclude_files() - patch_htcondor_workflow_naf_resources + patch_htcondor_workflow_naf_resources() + patch_user_parameters() diff --git a/hbt/tasks/parameters.py b/hbt/tasks/parameters.py index 8acb6918..936d3265 100644 --- a/hbt/tasks/parameters.py +++ b/hbt/tasks/parameters.py @@ -4,6 +4,8 @@ Custom, common parameters. """ +import getpass + import luigi @@ -15,3 +17,9 @@ default=False, description="escape some characters for markdown; default: False", ) +user_parameter_inst = luigi.Parameter( + default=getpass.getuser(), + description="the user running the current task, mainly for central schedulers to distinguish " + "between tasks that should or should not be run in parallel by multiple users; " + "default: current user", +)