Example #1
0
from wilson import Wilson
import wcxf
from flavio.statistics.likelihood import Likelihood, FastLikelihood
from flavio.statistics.probability import NormalDistribution
from flavio.statistics.functions import pull
import warnings
import pandas as pd
import numpy as np
from collections import OrderedDict
from math import ceil
from .util import tree, get_datapath
from multipledispatch import dispatch
import os

# by default, smelli uses leading log accuracy for SMEFT running!
Wilson.set_default_option('smeft_accuracy', 'leadinglog')


class GlobalLikelihood(object):
    """Class that provides a global likelihood in SMEFT Wilson
    coefficient space.

    User methods:

    - `log_likelihood`: return an instance of LieklihoodResult
    given a dictionary of Wilson coefficients at a given scale
    - `log_likelihood_wcxf`: return an instance of LieklihoodResult
    given the path to a WCxf file
    - `log_likelihood_wilson`: return an instance of LieklihoodResult+
    given an instance of `wilson.Wilson`
Example #2
0
import smelli
from ULR2WC import ULR2WC
from wilson import Wilson
import numpy as np
from time import perf_counter
from convergentor import Convergentor

gl = smelli.GlobalLikelihood(include_likelihoods=[
    'likelihood_lfu_fccc.yaml', 'fast_likelihood_quarks.yaml',
    'likelihood_lfv.yaml', 'likelihood_lfu_fcnc.yaml',
    'fast_likelihood_leptons.yaml'
],
                             Nexp=2000)
Wilson.set_default_option('smeft_accuracy', 'integrate')

GeV = 1.
TeV = 1000 * GeV

import pickle
pickle_dir = 'datasets/'
log_dir = 'logs/'


def depicklit(filename, dirname=pickle_dir):
    with open(dirname + filename, 'rb') as f:
        return pickle.load(f)


def picklit(dataset, filename, dirname=pickle_dir):
    with open(dirname + filename, 'wb') as f:
        pickle.dump(dataset, f)