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

Add tasks to run fit/combine commands and tools within cf environment. #1

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

jomatthi
Copy link
Contributor

@jomatthi jomatthi commented Jun 6, 2024

This PR adds tasks that run the different steps for the fitting procedure to calculate top tagging SFs and the impacts of the nuisance parameters on the fit:

  • topsf.CreateWorkspace: sets up the workspace using a datacard and a physics model
  • topsf.GenToys: generate toys using the workspace and set parameters
  • topsf.MultiDimFit: performs a multi dimensional fit, expected, with and without frozen systematics
  • topsf.PostFitShapesFromWorkspace: calculates expected pre- and postfit shapes
  • topsf.Impacts: calculates expected impacts and collects them in a .json file
  • topsf.PlotImpacts: plots the impacts for each POI

A sample bash command that should trigger the whole workflow:

args=(
    "--version" "${version}"
    "--poi" "SF__0o1q__UL17__pt_300_400,SF__2q__UL17__pt_300_400,SF__0o1q__UL17__pt_400_480,SF__2q__UL17__pt_400_480,SF__3q__UL17__pt_300_400,SF__3q__UL17__pt_400_480"
    "--inference-model" "uhh2"
    "--producers" "weights,features"
    "--topsf.CreateWorkspace-pt-bins" "pt_300_400,pt_400_480"
    "--topsf.CreateWorkspace-physics-model" "topsf.inference.combine_physics_model:topsf_model"
    "--topsf.CreateWorkspace-merge-scenarios" "3q:ThetaLike,2q:ThetaLike,0o1q:ThetaLike"
    "--topsf.MultiDimFit-fit-name" "_exp"
    "--topsf.GenToys-freeze-gen-parameters" "SF__0o1q__UL17__pt_300_400,SF__2q__UL17__pt_300_400,SF__0o1q__UL17__pt_400_480,SF__2q__UL17__pt_400_480,SF__3q__UL17__pt_300_400,SF__3q__UL17__pt_400_480"
    "--topsf.GenToys-set-parameters" "SF__0o1q__UL17__pt_300_400=1.,SF__2q__UL17__pt_300_400=1.,SF__0o1q__UL17__pt_400_480=1.,SF__2q__UL17__pt_400_480=1.,SF__3q__UL17__pt_300_400=1.,SF__3q__UL17__pt_400_480=1."
    "--topsf.GenToys-gen-name" "_toys"
    "--topsf.Impacts-asimov-data" "True"
    "--topsf.Impacts-do-initial-fit" "True"
)

command_to_run="law run topsf.PlotImpacts ${args[@]}"
confirm_and_run "$command_to_run"

In addition to the task files, a simple bash script confirm_and_run.sh is included in this PR that asks the user whether to skip a command or to run it, even with additional parameters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant