Ejemplo n.º 1
0
which will create

    em_yields_table.tex
    et_yields_table.tex
    mm_yields_table.tex
    mt_yields_table.tex

Author: Evan K. Friis, UW Madison
'''

import math
from HiggsAnalysis.HiggsToTauTau.DataCard import DataCard
from HiggsAnalysis.HiggsToTauTau.sigfigs import sigfigs

dc = DataCard('megacard.txt')


def quad(*xs):
    return math.sqrt(sum(x * x for x in xs))


def render(x):
    ''' Render x (an uncertainties object) with correct sig figs '''
    if isinstance(x, int):
        return '%i' % x
    else:
        #return r'$%s \pm %s$' % (int(x.nominal_value), int(x.std_dev()))
        # Never round greater than unity.  Always include at least 1 sig digit.
        return r'$%s \pm %s$' % (sigfigs(
            x.nominal_value, x.std_dev(), 1, max_sig_fig=0))
Ejemplo n.º 2
0
which will create

    em_yields_table.tex
    et_yields_table.tex
    mm_yields_table.tex
    mt_yields_table.tex

Author: Evan K. Friis, UW Madison
'''

import math
from HiggsAnalysis.HiggsToTauTau.DataCard import DataCard
from HiggsAnalysis.HiggsToTauTau.sigfigs import sigfigs

dc = DataCard('megacard.txt')


def quad(*xs):
    return math.sqrt(sum(x * x for x in xs))


def render(x):
    ''' Render x (an uncertainties object) with correct sig figs '''
    if isinstance(x, int):
        return '%i' % x
    else:
        #return r'$%s \pm %s$' % (int(x.nominal_value), int(x.std_dev()))
        # Never round greater than unity.  Always include at least 1 sig digit.
        return r'$%s \pm %s$' % (sigfigs(
            x.nominal_value, x.std_dev(), 1, max_sig_fig=0))
Ejemplo n.º 3
0
which will create

    em_yields_table.tex
    et_yields_table.tex
    mm_yields_table.tex
    mt_yields_table.tex

Author: Evan K. Friis, UW Madison
"""

import math
from HiggsAnalysis.HiggsToTauTau.DataCard import DataCard
from HiggsAnalysis.HiggsToTauTau.sigfigs import sigfigs

dc = DataCard("megacard.txt")


def quad(*xs):
    return math.sqrt(sum(x * x for x in xs))


def render(x):
    """ Render x (an uncertainties object) with correct sig figs """
    if isinstance(x, int):
        return "%i" % x
    else:
        # return r'$%s \pm %s$' % (int(x.nominal_value), int(x.std_dev()))
        # Never round greater than unity.  Always include at least 1 sig digit.
        return r"$%s \pm %s$" % (sigfigs(x.nominal_value, x.std_dev(), 1, max_sig_fig=0))
Ejemplo n.º 4
0
    em_yields_table.tex
    et_yields_table.tex
    mm_yields_table.tex
    mt_yields_table.tex

Author: Jan Steggemann, based on template by Evan K. Friis
'''

import math
from HiggsAnalysis.HiggsToTauTau.DataCard import DataCard
from HiggsAnalysis.HiggsToTauTau.sigfigs import sigfigs
from sobWeightedCombine import SOBPlotter
import ROOT

dc = DataCard('sm_megacard.txt')

def quad(*xs):
    return math.sqrt(sum(x*x for x in xs))

def render(x):
    ''' Render x (an uncertainties object) with correct sig figs '''
    if isinstance(x, int):
        return '%i' % x
    else:
        #return r'$%s \pm %s$' % (int(x.nominal_value), int(x.std_dev()))
        # Never round greater than unity.  Always include at least 1 sig digit.
        return r'$%s \pm %s$' % (sigfigs(x.nominal_value, x.std_dev(), 1, max_sig_fig=0))

def render_values(table):
    # Convert all objects to strings
which will create

    em_yields_table.tex
    et_yields_table.tex
    mm_yields_table.tex
    mt_yields_table.tex

Author: Evan K. Friis, UW Madison
'''

import math
from HiggsAnalysis.HiggsToTauTau.DataCard import DataCard
from HiggsAnalysis.HiggsToTauTau.sigfigs import sigfigs

dc = DataCard('megacard.txt')

def quad(*xs):
    return math.sqrt(sum(x*x for x in xs))

def render(x):
    ''' Render x (an uncertainties object) with correct sig figs '''
    if isinstance(x, int):
        return '%i' % x
    else:
        #return r'$%s \pm %s$' % (int(x.nominal_value), int(x.std_dev()))
        # Never round greater than unity.  Always include at least 1 sig digit.
        return r'$%s \pm %s$' % (sigfigs(x.nominal_value, x.std_dev(), 1, max_sig_fig=0))

def render_values(table):
    # Convert all objects to strings