def vary_argus_single(opts, tabname): tab = THSTable() tabprefix = 'dir_818ipbv12' tab.column_append_from_dict('Mode', 'fname,fnamebar') titles = ['argus_low', 'std', 'argus_high'] tab.column_append_from_files(titles[0], 'N1,N2', fitbase, tabprefix+'/argus_low', 'd', 's', 'txt') tab.column_append_from_files(titles[1], 'N1,N2', fitbase, tabprefix, 'd', 's', 'txt') tab.column_append_from_files(titles[2], 'N1,N2', fitbase, tabprefix+'/argus_high', 'd', 's', 'txt') std = titles[1] colA = titles[0] colB = titles[2] headA = 'diff(%s)' %colA headB = 'diff(%s)' %colB headC = 'max-diff(%)' tab.column_append_by_diff_pct(headA, colA, std) tab.column_append_by_diff_pct(headB, colB, std) tab.column_append_by_max(headC, headA, headB) tab.columns_delete([headA, headB]) tab.columns_trim(titles, rnd='1.') # texhead = r'''Mode & \multicolumn{3}{c}{Yield} & max-diff \\ # & ARGUS Low & Std & ARGUS High & (\%) ''' texhead = r'''Mode & \multicolumn{3}{c}{Yield} & max-diff \\ & ARGUS Low & Std & ARGUS High & (\%) ''' tab.output(tabname, texhead)
def yieldDTResidualsDataDp(opts, tabname, label): bffilename = 'bf_stat_sys' bffile = tools.set_file( extbase=attr.brfpath, prefix='dir_'+label, comname=bffilename) tab = THSTable() tab.column_append_from_dict('Mode', 'fname,fnamebar', 'double-dp') tab.column_append(parse_result(bffile, 'residual_double_dp'), 'Residual', rnd = '1.') tab.output(tabname, trans_dict=attr.BF_Ratio_dict)
def st_eff_yield(opts, tabname, label): tab = THSTable() tab.column_append_from_dict('Mode', 'fname,fnamebar') tabfile = os.path.join(cbxtabpath, '818ipbv12', 'singletag_sigmc_eff.txt') tab.column_append_from_tab_file('Efficiency(%)', tabfile, 'Efficiency(%)') tabfile = os.path.join(cbxtabpath, label, 'singletag_data_yield.txt') tab.column_append_from_tab_file('Data Yield', tabfile, 'Gamma 25.2 MeV') tab.column_append_from_tab_file('Background', tabfile, 'Bkgd') texhead = r'''Single tag mode & Efficiency(\%) & Data yield & Background ''' tab.output(tabname, texhead)
def dt_dz_eff_yield(opts, tabname, label): tab = THSTable() tab.column_append_from_dict('Mode', 'fname,fnamebar', 'double-dz') tabfile = os.path.join(cbxtabpath, '818ipbv12', 'doubletageff.txt') tab.column_append_from_tab_file('Efficiency(%)', tabfile, 'Efficiency(%)', row=':10') tabfile = os.path.join(cbxtabpath, label, 'datadoubletagyields.txt') tab.column_append_from_tab_file('Data Yield', tabfile, '25.2 MeV', row=':10') tab.column_append_from_tab_file('Background', tabfile, 'Bkgd', row='10:') texhead = r'''Double tag mode & Efficiency(\%) & Data yield & Background ''' tab.output(tabname, texhead)
def singletag_data_yield_widede(opts, tabname): tab = THSTable() tabprefix = 'dir_818ipbv12' tab.column_append_from_dict('Mode', 'fname,fnamebar') tab.column_append_from_files('Yield1(regular)', 'N1,N2', fitbase, tabprefix, 'd', 's', 'txt', rnd='1.') tab.column_append_from_files('Yield2(widede)', 'N1,N2', fitbase, tabprefix+'/widede', 'd', 's', 'txt', rnd='1.') tab.column_append_by_divide('Yield1/Yield2', 'Yield1(regular)', 'Yield2(widede)', 'Efcy', '.0001') tab.column_append_from_files('eff1(regular)', 'N1,N2', fitbase, tabprefix, 's', 's', 'txt', rnd='1.') tab.column_append_from_files('eff2(widede)', 'N1,N2', fitbase, tabprefix+'/widede', 's', 's', 'txt', rnd='1.') tab.column_append_by_divide('eff1/eff2', 'eff1(regular)', 'eff2(widede)', 'Efcy', '.0001') tab.column_append_by_divide('Ratio', 'Yield1/Yield2', 'eff1/eff2', 'Indp', '.001') tab.columns_delete(['Yield1(regular)', 'Yield2(widede)', 'eff1(regular)', 'eff2(widede)']) texhead = r'''Mode & Yield1/Yield2 & eff1/eff2 & Ratio''' tab.output(tabname, texhead)