コード例 #1
0
def get_signal_xs(ds, fs=0):

    if 'GGM_M3' in ds['short_name']:

        xs, unc = xsutils.get_xs_did(ds['did'])

        return xs

    elif 'GGM_mu' in ds['short_name']:

        xs, unc = xsutils.get_xs_did(ds['did'], fs=fs)

        return xs
コード例 #2
0
def get_xs(ds):

    xs = xsutils.get_xs_did(int(ds['did']))[0]

    if xs is None:
        print 'missing XS for this ID:', did
        return 0.0
    
    return xs
コード例 #3
0
def get_lumi_weight(ds, lumi, fs=None):

    lumi = float(lumi)

    weight = 1.
    if ds['project'] == 'mc15_13TeV':

        if 'GGM_mu' in ds['short_name'] and fs is not None:
            mu = int(re.findall(ur'GGM_mu_(\d*)', ds['short_name'])[0])
            sumw = xsutils.get_ewk_sumw(mu, fs)
        else:
            sumw = get_sumw(ds)
    
        xs = xsutils.get_xs_did(int(ds['did']), fs)[0]

        try:
            weight = (lumi * xs) / sumw
        except:
            weight = 0.

    return weight