本文整理匯總了Python中tools.DHadTable.column_append_from_tab_file方法的典型用法代碼示例。如果您正苦於以下問題:Python DHadTable.column_append_from_tab_file方法的具體用法?Python DHadTable.column_append_from_tab_file怎麽用?Python DHadTable.column_append_from_tab_file使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類tools.DHadTable
的用法示例。
在下文中一共展示了DHadTable.column_append_from_tab_file方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: ratios_signal
# 需要導入模塊: from tools import DHadTable [as 別名]
# 或者: from tools.DHadTable import column_append_from_tab_file [as 別名]
def ratios_signal(args):
if args[0] == '537ipb/281ipb' and args[1] == '537ipbv2/281ipb':
tabfilename1 = 'compare_yields_signal_divide_537ipb_9.03_regular12.txt'
title1 = args[0]
headname1 = title1
tabfilename2 = 'compare_yields_signal_divide_537ipbv2_9.03_regular12.txt'
title2 = args[1]
headname2 = title2
else:
raise NameError(args)
tabfile1 = os.path.join(attr.tabpath, tabfilename1)
tabfile2 = os.path.join(attr.tabpath, tabfilename2)
if opts.set and opts.set == 'info':
print 'here'
tab = DHadTable()
tab.column_append_from_tab_file('Mode', tabfile1, 'Mode')
tab.column_append_from_tab_file(title1, tabfile1, headname1)
tab.column_append_from_tab_file(title2, tabfile2, headname2)
tab.column_append_by_diff_sigma_pct('diff(%)', title2, title1)
tab.output(_tabname)
示例2: diff
# 需要導入模塊: from tools import DHadTable [as 別名]
# 或者: from tools.DHadTable import column_append_from_tab_file [as 別名]
def diff(args):
label= None
if opts.set:
for li in opts.set.split(':'):
name = li.split('=')[0]
value = li.split('=')[1]
sys.stdout.write('Set %s = %s \n' % (name, value))
if name == 'label':
label = value
if label:
labels = label.split(',')
label_A = labels[0]
label_B = labels[1]
tab_A = 'compare_%s.txt' % args[0]
tab_B = 'compare_%s.txt' % args[1]
tabfile_A = os.path.join(attr.tabpath, tab_A)
tabfile_B = os.path.join(attr.tabpath, tab_B)
tab = DHadTable()
tab.column_append_from_tab_file('Mode', tabfile_A, 'Mode')
tab.column_append_from_tab_file(label_A, tabfile_A, 'diff(%)')
tab.column_append_from_tab_file(label_B, tabfile_B, 'diff(%)')
tab.column_append_by_diff('diff', label_B,label_A)
tab.output(_tabname)
示例3: evt_log
# 需要導入模塊: from tools import DHadTable [as 別名]
# 或者: from tools.DHadTable import column_append_from_tab_file [as 別名]
def evt_log(args):
print args
if args[0] not in ['data'] :
raise NameError(args)
dt_type = args[0]
tag = args[1]
label = args[2]
evtpath = attr.evtpath()
if '/' in label:
ver = label.split('/')[0]
label = label.split('/')[1]
evtpath = attr.evtpath(ver)
prefix = 'dir_' + label
evttab = 'entries_evt' + '_'.join(args).replace('/', '_') + '.tab'
tab = DHadTable()
tab.column_append_from_tab_file('Mode', evttab)
tab.output()
sys.exit()
示例4: fsr_syst
# 需要導入模塊: from tools import DHadTable [as 別名]
# 或者: from tools.DHadTable import column_append_from_tab_file [as 別名]
def fsr_syst(args):
'''
--------------------
FSR systematics
--------------------
'''
tab_name = 'FSR_syst'
tabbase = os.path.join(attr.base, '7.06', 'tab')
tab = DHadTable()
tab.column_append_from_dict('Mode', 'fname,fnamebar')
tab_file = os.path.join(tabbase, 'noFSR_single_signal_eff.txt')
columnA = 'Efficiency without FSR(%)'
tab.column_append_from_tab_file(columnA, tab_file)
columnB = 'Efficiency with FSR(%)'
tab.column_append_from_tab_file(columnB, tab_file)
tab.column_append_by_diff('diff(%)', columnA, columnB, factor=100)
tab.column_append_by_times_number('diff X 30%', 'diff(%)', '0.3',
rnd='.01')
tab.rows_join_by_max('diff X 30%')
tab.output(tab_name)
示例5: compare_yields_data_signal_divide_537ipb
# 需要導入模塊: from tools import DHadTable [as 別名]
# 或者: from tools.DHadTable import column_append_from_tab_file [as 別名]
def compare_yields_data_signal_divide_537ipb(args):
sys.stdout.write('dhad.table: Creating %s ...\n' % _tabname)
tabpath1 = os.path.join(
attr.base, '7.06', 'tab')
tabfile1 = os.path.join(
tabpath1, 'compare_yields_data_divide_281ipb_537ipb.txt')
tabfile2 = os.path.join(
attr.tabpath, 'compare_yields_signal_divide_537ipb_9.03_regular12.txt')
tab = DHadTable()
tab.column_append_from_tab_file('Mode', tabfile1, 'Mode')
tab.column_append_from_tab_file('Data', tabfile1, '537ipb/281ipb')
tab.column_append_from_tab_file('Signal', tabfile2, '537ipb/281ipb')
tab.column_append_by_diff_sigma_pct('diff(%)', 'Signal', 'Data')
tab.output(_tabname)
示例6: signal_line_shape_syst
# 需要導入模塊: from tools import DHadTable [as 別名]
# 或者: from tools.DHadTable import column_append_from_tab_file [as 別名]
def signal_line_shape_syst(args):
'''
--------------------------------------------------
Signal line shape systematics
--------------------------------------------------
'''
tab_name = 'signal_line_shape_syst'
tabbase = os.path.join(attr.base, '7.06', 'tab')
tab = DHadTable()
tab.column_append_from_dict('Mode', 'fname,fnamebar')
tab_file_A = os.path.join(
tabbase, 'yields_M_3.7713_regular_M_3.7723_data_Single.txt')
name_A = 'Mass(+/-0.5 MeV)%'
column = 'max-diff(%)'
tab.column_append_from_tab_file(name_A, tab_file_A, column)
tab_file_B = os.path.join(
tabbase, 'yields_Gamma_0.0261_regular_Gamma_0.0311_data_Single.txt')
name_B = 'Gamma(+/-2.5 MeV)%'
tab.column_append_from_tab_file(name_B, tab_file_B, column)
tab_file_C = os.path.join(
tabbase, 'yields_R_8.3_regular_R_16.3_data_Single.txt')
name_C = 'R(+/- 4)%'
tab.column_append_from_tab_file(name_C, tab_file_C, column)
name_D = 'Total(%)'
tab.column_append_by_add_quadrature3(name_D, name_A,
name_B, name_C, rnd='.01')
tab.rows_join_by_max(name_D)
tab.output(tab_name)