Skip to content

Optional per-plot weight

Pieter David requested to merge piedavid/bamboo:plotweight into master

Closes https://gitlab.cern.ch/cp3-cms/bamboo/-/issues/78

Based on https://gitlab.cern.ch/cp3-cms/bamboo/-/merge_requests/163 (which has a lot of backend refactoring that made this easy), this one is only a the last commit.

With a very artificial example (filling jet pt's weighted by jet pt, divided by their sum) the printout looks as I think it should, but that only covers some of the cases for systematics. Anyway, pushing as WIP in case someone else wants to test, and such that we can discuss the interface; that example looks like

sumjpt = op.rng_sum(cleanedJets, lambda j : j.pt)
plots.append(Plot.make1D("2J_jetPtWgt",
    op.map(cleanedJets, lambda j : j.pt),
    hasTwoJets,
    EquidistantBinning(100, 0., 200.),
    weight=op.map(cleanedJets, lambda j : j.pt/sumjpt)
    ))
Edited by Pieter David

Merge request reports