TIMBER  beta
Tree Interface for Making Binned Events with RDataFrame
Public Member Functions | List of all members
Calibration Class Reference

Class to handle calibrations produced by C++ modules. More...

Inheritance diagram for Calibration:
Inheritance graph
[legend]
Collaboration diagram for Calibration:
Collaboration graph
[legend]

Public Member Functions

def __init__ (self, name, script, constructor=[], mainFunc='eval', corrtype=None, columnList=None, isClone=False)
 Constructor. More...
 
- Public Member Functions inherited from Correction
def __init__ (self, name, script='', constructor=[], mainFunc='eval', corrtype=None, columnList=None, isClone=False, cloneFuncInfo=None)
 Constructor. More...
 
def Clone (self, name, newMainFunc=None, newType=None)
 Makes a clone of current instance. More...
 
def GetType (self)
 Gets Correction type. More...
 
- Public Member Functions inherited from ModuleWorker
def __init__ (self, name, script, constructor=[], mainFunc='eval', columnList=None, isClone=False, cloneFuncInfo=None)
 Constructor. More...
 
def Clone (self, name, newMainFunc=None)
 Makes a clone of current instance. More...
 
def GetCall (self, evalArgs={}, toCheck=None)
 Gets the call to the method to be evaluated per-event. More...
 
def GetFuncNames (self)
 Gets list of function names in C++ script. More...
 
def GetMainFunc (self)
 Gets full main function name. More...
 
def MakeCall (self, inArgs={}, toCheck=None)
 Makes the call (stored in class instance) to the method with the branch/column names deduced or added from input. More...
 

Additional Inherited Members

- Public Attributes inherited from Correction
 existing
 bool Denotes if associated c++ has already been compiled
 
 name
 str Name of correction
 
- Public Attributes inherited from ModuleWorker
 name
 str Correction name
 

Detailed Description

Class to handle calibrations produced by C++ modules.

Uses clang in python to parse the C++ code and determine function names, namespaces, and argument names and types.

Writing the C++ modules has two requirements:

(1) the desired branch/column names must be specified or be used as the argument variable names to allow the framework to automatically determine what branch/column to use in GetCall(),

(2) the return must be a vector ordered as {nominal, up, down} for "weight" type and {up, down} for "uncert" type.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  name,
  script,
  constructor = [],
  mainFunc = 'eval',
  corrtype = None,
  columnList = None,
  isClone = False 
)

Constructor.

Parameters
name(str): Correction name.
script(str): Path to C++ script with function to calculate correction.
constructor([str], optional): List of arguments to script class constructor. Defaults to [].
mainFunc(str, optional): Name of the function to use inside script. Defaults to None and the class will try to deduce it.
corrtype(str, optional): Either "weight" (nominal weight to apply with an uncertainty), "corr" (only a correction), or "uncert" (only an uncertainty). Defaults to '' and the class will try to deduce it.
columnList([str], optional): List of column names to search mainFunc arguments against. Defaults to None and the standard NanoAOD columns from LoadColumnNames() will be used.
isClone(bool, optional): For internal use when cloning. Defaults to False. If True, will not duplicate compile the same script if two functions are needed in one C++ script.

The documentation for this class was generated from the following file: