Пример #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
Пример #2
0
def getCaloMuonConversionLut(scaleMap, calo, cuts):
  rc = {}
  for cut in cuts:
    scale_calo = getScaleByName(scaleMap, calo, cut)
    scale_muon = getScaleByName(scaleMap, tmGrammar.MU, cut)
    lut = tmEventSetup.LlongVec()

    if cut == tmGrammar.ETA:
      tmEventSetup.getCaloMuonEtaConversionLut(lut, scale_calo, scale_muon)
      rc[tmGrammar.ETA] = lut

    elif cut == tmGrammar.PHI:
      tmEventSetup.getCaloMuonPhiConversionLut(lut, scale_calo, scale_muon)
      rc[tmGrammar.PHI] = lut

  return rc
Пример #3
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
Пример #4
0
def getUptLut(scaleMap, obj, precision):
    lut = tmEventSetup.LlongVec()
    scale = getScaleByName(scaleMap, obj, 'UPT')
    tmEventSetup.getLut(lut, scale, precision)
    return lut
Пример #5
0
def getLut(scale, precision):
    lut = tmEventSetup.LlongVec()
    tmEventSetup.getLut(lut, scale, precision.getNbits())
    return lut