histo_utils#

mkShapesRDF.shapeAnalysis.histo_utils.fold(h, ifrom, ito)[source][source]#

Folds a histogram bin content and sumw2

Parameters:
hROOT.TH1, ROOT.TH2, ROOT.TH3

input histogram, will be modified in place

ifromint

index of bin where to copy from. Will be then set to 0

itoint

index of bin where to copy.

mkShapesRDF.shapeAnalysis.histo_utils.postPlot(hTotal, doFold, unroll=True)[source][source]#

Takes TH1, TH2 or TH3, folds if necessary and unrolls

Parameters:
hTotalROOT.TH1, ROOT.TH2, ROOT.TH3

input histogram

doFoldbool

0 do not fold, 1 fold underflow, 2 fold overflow, 3 fold everything

unrollbool, optional

if dimension >= 2 unrolls to 1D, by default True

Returns:
ROOT.TH1

folded and unrolled histogram

mkShapesRDF.shapeAnalysis.histo_utils.postProcessNuisances(filename, samples, aliases, variables, cuts, nuisances)[source][source]#

Post process nuisances of type weight_[envelope/rms/square]. For each nuisance/cut/variable/sample will take many histograms in input and only save Up and Down histograms

Parameters:
filenamestr

path to input root file

samplesdict

configuration samples

aliasesdict

configuration aliases

variablesdict

configuration variables

cutsdict

configuration cuts

nuisancesdict

configuration nuisances