Exemplo n.º 1
0
def getDeltaLut(scaleMap, obj1, obj2, cuts=None):
    precision = getPrecisionByName(scaleMap, obj1, obj2, 'Delta')

    rc = {}
    for cut in cuts:
        scale1 = getScaleByName(scaleMap, obj1, cut)
        scale2 = getScaleByName(scaleMap, obj2, cut)
        vec = tmEventSetup.DoubleVec()
        lut = tmEventSetup.LlongVec()
        n = tmEventSetup.getDeltaVector(vec, scale1, scale2)
        tmEventSetup.setLut(lut, vec, precision)
        rc[cut] = lut
    return rc
Exemplo n.º 2
0
def getMathUptLut(scaleMap, obj1, obj2, math=None):
    precision_math = getPrecisionByName(scaleMap, obj1, obj2, 'Math')

    rc = {}
    for cut, func in list(math.items()):
        scale1 = getScaleByName(scaleMap, obj1, cut)
        scale2 = getScaleByName(scaleMap, obj2, cut)
        vec = tmEventSetup.DoubleVec()
        lut = tmEventSetup.LlongVec()
        n = tmEventSetup.getDeltaVector(vec, scale1, scale2)
        func(vec, n)
        tmEventSetup.setLut(lut, vec, precision_math)
        rc[func.__name__] = lut

    precision_pt = getPrecisionByName(scaleMap, obj1, obj2, 'MassPt')
    if obj1 == obj2:
        key = '-'.join([obj1, 'UPT'])
        rc['Key'] = key
        rc[key] = getUptLut(scaleMap, obj1, precision_pt)

    return rc