BTagScaleFactor#
- class coffea.btag_tools.BTagScaleFactor(filename, workingpoint, methods='comb,comb,incl', keep_df=False)[source]#
Bases:
objectA class holding one complete BTag scale factor for a given working point
- Parameters:
filename (
str) – The BTag-formatted CSV file to read (accepts .csv, .csv.gz, etc.) See pandas read_csv for all supported compressions.workingpoint (
strorint) – The working point, one of LOOSE, MEDIUM, TIGHT, or RESHAPE (0-3, respectively)methods (
str, optional) – The scale factor derivation method to use for each flavor, ‘b,c,light’ respectively. Defaults to ‘comb,comb,incl’keep_df (
bool, optional) – If set true, keep the parsed dataframe as an attribute (.df) for later inspection
Notes
Class constants for working points: LOOSE (0), MEDIUM (1), TIGHT (2), RESHAPE (3)
Class constants for flavors: FLAV_B (0), FLAV_C (1), FLAV_UDSG (2)
Attributes Summary
Methods Summary
__call__(systematic, flavor, eta, pt[, ...])Call self as a function.
eval(systematic, flavor, eta, pt[, discr, ...])Evaluate this scale factor as a function of jet properties
readcsv(filename)Reads a BTag-formmated CSV file into a pandas dataframe
Attributes Documentation
- FLAV_B = 0#
- FLAV_C = 1#
- FLAV_UDSG = 2#
- LOOSE = 0#
- MEDIUM = 1#
- RESHAPE = 3#
- TIGHT = 2#
Methods Documentation
- __call__(systematic, flavor, eta, pt, discr=None, ignore_missing=False)[source]#
Call self as a function.
- eval(systematic, flavor, eta, pt, discr=None, ignore_missing=False)[source]#
Evaluate this scale factor as a function of jet properties
- Parameters:
systematic (
str) – Which systematic to evaluate. Nominal correction is ‘central’, the options depend on the scale factor and methodflavor (
numpy.ndarrayorawkward.Array) – The generated jet hadron flavor, following the enumeration: 0: uds quark or gluon, 4: charm quark, 5: bottom quarketa (
numpy.ndarrayorawkward.Array) – The jet pseudorapitiypt (
numpy.ndarrayorawkward.Array) – The jet transverse momentumdiscr (
numpy.ndarrayorawkward.Array, optional) – The jet tagging discriminant value (default None), optional for all scale factors except the reshaping scale factorignore_missing (
bool, optional) – If set true, any values that have no correction will return 1. instead of throwing an exception. Out-of-bounds values are always clipped to the nearest bin.
- Returns:
out – An array with shape matching
pt, containing the per-jet scale factor- Return type: