Pileup reweighting
If we stick to the principle that MC corrections should go in the analysis module, it could be added to the prepareTrees
method, e.g. like the JEC in this example, e.g.
if self.isMC(sample):
puTag = None
if era == "2016":
puTag = "Moriond17_25ns" ## summer16
elif era == "2017":
## ...
## more granular setting (based on e.g. the sample name) is also possible
puWeight = ... ## load the file with the right tag and construct a helper object and expression
noSel = noSel.refine("mcpuWeight", weight=(t.genWeight, puWeight))
The second part is probably common enough to be put into a helper method getPUWeight(puTag, nTrueInt)
or getPUWeight(puFile, nTrueInt)
in bamboo.analysisutils
.
Edited by Pieter David