JetCorrectionUncertainty#

class coffea.jetmet_tools.JetCorrectionUncertainty(**kwargs)[source]#

Bases: object

This class is a columnar implementation of the JetCorrectionUncertainty tool in CMSSW and FWLite. It calculates the jet energy scale uncertainty for a corrected jet in a given binning.

It implements the jet energy correction definition specified in the JES Uncertainty TWiki.

You can use this class as follows:

jcu = JetCorrectionUncertainty(name1=corrL1,...)
jetUncs = jcu.getUncertainty(JetParameter1=jet.parameter1,...)

in which jetUncs are the uncertainties, with the same shape as the input parameters. In order to see which parameters must be passed to getUncertainty, one can do jcu.signature.

You construct a JetCorrectionUncertainty by passing in a dict of names and functions. Names must be formatted as ‘<campaign>_<dataera>_<datatype>_<level>_<jettype>’. You can use coffea.lookup_tools’ extractor and evaluator to get the functions from some input files.

Attributes Summary

levels

list the different sources of uncertainty

signature

list the necessary jet properties that must be input to this function

Methods Summary

getUncertainty(**kwargs)

Returns the set of uncertainties for all input jets for all the levels (== sources)

Attributes Documentation

levels#

list the different sources of uncertainty

signature#

list the necessary jet properties that must be input to this function

Methods Documentation

getUncertainty(**kwargs)[source]#

Returns the set of uncertainties for all input jets for all the levels (== sources)

Use it like:

juncs = uncertainty.getUncertainty(JetProperty1=jet.property1,...)
#'juncs' will be formatted like [('SourceName', [[up_val down_val]_jet1 ... ]), ...]
#in a zip iterator