コード例 #1
0
ファイル: compare.py プロジェクト: zhixing1996/dhad
def brf_data_results(opts, tabname, args):
    '''
    -----------------------------
        Results of the Data Fit 
    -----------------------------
    '''

    label_A = args[0]
    label_B = args[1]
    
    verbose  = opts.verbose

    bffilename = 'bf_stat_sys'
        
    labels = []
    labels.append(label_A)
    labels.append(label_B)

    tab = DHadTable()
    paras = False

    for label in labels:
        if '281ipb' in label:
            factor =  0.000001
        elif '537ipb' in label:
            factor =  0.000001*281/537
        elif '818ipb' in label or 'v13' in label:
            factor =  0.000001*281/818
        else:
            raise NameError(label)

        if '818ipb' in label_A and '818ipb' in label_B:
            factor = 0.000001
        if '818ipb' in label_A and 'v13' in label_B: 
            factor = 0.000001            

        bffile = os.path.join(attr.brfpath, label, bffilename)
        if not paras:
            tab.column_append(tools.parse_result(bffile, 'paras'),
                              'Parameters')
            paras = True
        tab.column_append(tools.parse_result(bffile, 'value'), 'value', rnd='.00001' )
        tab.column_append(tools.parse_result(bffile, 'stat'),  'stat')
        tab.column_append(tools.parse_result(bffile, 'syst'),  'syst')
        tab.columns_join3('Fitted Value', 'value', 'stat',  'syst')
        tab.column_trim('Fitted Value', row=['ND0D0Bar', 'ND+D-'],
                        rnd='.0001', factor=factor, opt='(cell)x1E6')
        tab.column_trim('Fitted Value', rnd='.00001',
                        except_row=['ND0D0Bar', 'ND+D-'])
        tab.column_append(tools.parse_result(bffile, 'err_frac'),
                          'Frac. Err', rnd='.1', opt='(cell%)')
        tab.columns_join(label, 'Fitted Value','Frac. Err', str=' ')
    tab.column_append_by_diff_sigma('Difference', label_B,label_A)
    tab.output(tabname, test=opts.test)
コード例 #2
0
ファイル: compare.py プロジェクト: zhixing1996/dhad
def pdg2009(args):
    '''
    --------------------------------------------------------
        Results of the Data Fit Compare with PDG 2009
    --------------------------------------------------------
    '''

    label = args[0]
    
    verbose  = opts.verbose

    bffilename = 'bf_stat_sys'
        
    bffile = os.path.join(attr.brfpath, label, bffilename)

    tab = DHadTable()
    tab.column_append(tools.parse_result(bffile, 'paras'), 'Parameters')
    tab.column_append(tools.parse_result(bffile, 'value'), 'value')

    tab.column_append(tools.parse_result(bffile, 'stat'),  'stat')
    tab.column_append(tools.parse_result(bffile, 'syst'),  'syst')
    tab.columns_join3('Fitted Value', 'value', 'stat',  'syst')

    tab.column_trim('Fitted Value', row = ['ND0D0Bar', 'ND+D-'],
                    rnd = '.001', factor = 0.000001, opt = '(cell)x10E6')
    tab.column_trim('Fitted Value', rnd = '.0001',
                    except_row = ['ND0D0Bar', 'ND+D-'])

    tab.column_append(tools.parse_result(bffile, 'err_frac'),
                      'Frac. Err', rnd = '.1', opt = '(cell%)')
    tab.columns_join('Fitted Value','Fitted Value','Frac. Err', str=' ')

    tab.column_append(attr.PDG2009_NBF, 'PDG 2009')
    tab.column_append_by_diff_sigma('Difference', 'Fitted Value', 'PDG 2009')

    tab.output(_tabname)