コード例 #1
0
ファイル: plotImpacts.py プロジェクト: senka/HTT_20162017
def GetRounded(nom, e_hi, e_lo):
    if e_hi < 0.0:
        e_hi = 0.0
    if e_lo < 0.0:
        e_lo = 0.0
    rounded = rounding.PDGRoundAsym(nom, e_hi if e_hi != 0.0 else 1.0, e_lo if e_lo != 0.0 else 1.0)
    s_nom = rounding.downgradePrec(rounded[0],rounded[2])
    s_hi = rounding.downgradePrec(rounded[1][0][0],rounded[2]) if e_hi != 0.0 else '0'
    s_lo = rounding.downgradePrec(rounded[1][0][1],rounded[2]) if e_lo != 0.0 else '0'
    return (s_nom, s_hi, s_lo)
コード例 #2
0
ファイル: plotDiffXSec.py プロジェクト: ajgilbert/Acorn
def GetRounded(nom, e_hi, e_lo):
    if e_hi < 0.0:
        e_hi = 0.0
    if e_lo < 0.0:
        e_lo = 0.0
    rounded = rounding.roundMultiple(
        nom, [e_hi if e_hi != 0.0 else 1.0, e_lo if e_lo != 0.0 else 1.0],
        'PDG')
    # print rounded
    s_nom = rounding.downgradePrec(rounded[0], rounded[2])
    s_hi = rounding.downgradePrec(rounded[1][0],
                                  rounded[2]) if e_hi != 0.0 else '0'
    s_lo = rounding.downgradePrec(rounded[1][1],
                                  rounded[2]) if e_lo != 0.0 else '0'
    return (s_nom, s_hi, s_lo)