Beispiel #1
0
import yaml
# import various analysis scripts
import sql_decay_ward as decay

if __name__=="__main__":
    # read yaml #
    # master
    f = open('./grand_decay_fit.yml' ,'r')
    params = yaml.load(f)
    f.close()
    ens = params['grand_ensemble'].keys()[0]
    stream = params['grand_ensemble'][ens]['stream']
    ml = params['grand_ensemble'][ens]['ml']
    ms = params['grand_ensemble'][ens]['ms']
    # decay parameter file
    user_flag = c51.user_list()
    f = open('./decay.yml','r')
    decay_params = yaml.load(f)
    f.close()
    decay_params['decay_ward_fit']['ens'] =  {"tag": ens, "stream": stream}
    # log in sql #
    psqlpwd = pwd.passwd()
    psql = sql.pysql('cchang5','cchang5',psqlpwd)
    ### read data ###
    x_list = dict()
    data = []
    # mres
    for m in ml:
        mp, pp = decay.read_mres_bs(psql,decay_params,m)
        if len(data) != 0:
            x_list['mp_%s' %str(m)] = len(data[0]) + np.arange(len(mp[0]))
Beispiel #2
0
        constant = Z0_p*np.sqrt(2.)*(2.*ml+2.*mres_pion)/E0**(3./2.)
    else:
        ms = params['decay_ward_fit']['ms']
        constant = Z0_p*np.sqrt(2.)*(ml+ms+mres_pion+mres_etas)/E0**(3./2.)
    return constant

def concatgv(corr1, corr2):
    concat = np.concatenate((corr1,corr2),axis=1)
    concat_gv = c51.make_gvars(concat)
    corr1 = concat_gv[:len(concat_gv)/2]
    corr2 = concat_gv[len(concat_gv)/2:]
    return corr1, corr2

if __name__=='__main__':
    # read master
    user_flag = c51.user_list()
    f = open('./sqlmaster.yml.%s' %(user_flag),'r')
    params = yaml.load(f)
    f.close()
    # yaml entires
    fitmeta = params['decay_ward_fit']
    # log in sql
    psqlpwd = pwd.passwd()
    psql = sql.pysql('cchang5','cchang5',psqlpwd)
    # fit mres
    # ml mres
    mp, pp = read_mres_bs(psql,params,fitmeta['ml'])
    gv_mp, gv_pp = concatgv(mp, pp)
    #res = fit_mres_bs(psql,params,fitmeta['ml'],gv_mp,gv_pp)
    #print res['mres_fit']
    #buffdict = gv.BufferDict()