Skip to content

Initial correctionlib support

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

First part of #84, related to #85

Mostly for testing correctionlib, with pileup reweighting as a simple case to start. I also updated the pileup reweighting helper script to output the new format, I will check with the LUM POG about making that (compatible with) the official files.

Current status: this works

# bambooRun -v -i --module=../examples/nanozmumu.py:NanoZMuMu ..//examples/test1.yml
# ...
In [1]: from bamboo.analysisutils import makePileupWeight

In [2]: puw = makePileupWeight(("/home/ucl/cp3/pdavid/scratch/bamboodev/corrlib_0622/testUL.json", "Collisions16_UltraLegacy_goldenJSON"), tree.Pileup_nTrueInt, systName="puReWeight", sel=noSel)
DEBUG:bamboo.dataframebackend:Defining new symbol with interpreter: auto myFun2 = correction::CorrectionSet::from_file("/afs/cern.ch/user/p/piedavid/private/bamboodev/testUL.json");
DEBUG:bamboo.dataframebackend:Defining new symbol with interpreter: auto myFun3 = myFun2->at("Collisions16_UltraLegacy_goldenJSON");

In [3]: puw.op.get_cppStr(noSel._fbe.selDFs[noSel.name].fdnd)
Out[3]: 'myFun3->evaluate({ Pileup_nTrueInt, "nominal" })'
Edited by Pieter David

Merge request reports