Skip to content

Use inheritance in the plotter modules

Sebastien Wertz requested to merge inheritance into master

@umolinat @kcormier This touches a lot of things you guys are working on, so I suggest if you have ongoing unmerged work, that you make PRs soon and we'll merge them first and I'll rebase this on top.

@kcormier I haven't adapted the unfoldingPlotter yet, but I can add it after you've submitted your latest changes.

This is an attempt at defining a hierarchy of "base" modules that define most of what we need later on, to avoid repetitions and mistakes.

  • baseTtbbPlotter:
    • Defines extra arguments and functions all modules will need (e.g. loading sample list, reducing job splitting, handling systematics)
    • Adds the genWeights (should always be used)
    • Adds the theory systematics (if asked)
    • Splits the TT components (if asked)
    • Postprocessing: make a backup of the results, remove the unmerged batch output files, creates the QCD scale envelope (if needed), handle the Top systematics from alternative samples, remove the overlap in the sample list between 4FS and 5FS for ttB
  • recoBaseTtbbPlotter:
    • Defines which b-tag SF patches should be used
    • Adds the PU weights and defines the basis selections (flags, 1 electron/muon)
    • Defines all the basic reco-level objects neeed (leptons, jets etc.) and attaches them to self
  • genBaseTtbbPlotter:
    • Defines all the basic gen-level objects neeed (leptons, jets etc.) and attaches them to self

In the end the plotters should either inherit from recoBaseTtbbPlotter (if using only reco-level information), or from genBaseTtbbPlotter (if using only gen-level information), or from both. In the latter case some care should be taken to ensure the reco-level cuts are applied only after all the gen-level information is defined, see the as example.

The various selection stages and the plot lists still have to be defined in the actual plotters inheriting from the above.

Also add a "test" mode (use --test): run interactively (i.e. not on batch) with only 1 file from max. 1 MC sample and 1 data sample from 1 era. This should make it easier to quickly run a local test before submitting a large production.

Edited by Sebastien Wertz

Merge request reports