files2=sorted(os.listdir(dir2),key=lambda file: (eval(file[:-4].split('_')[1]), eval(file[:-4].split('_')[3]), eval(file[:-4].split('_')[4])) ) files3=sorted(os.listdir(dir3),key=lambda file: (eval(file[:-4].split('_')[1]), eval(file[:-4].split('_')[3]), eval(file[:-4].split('_')[4])) ) print "\\begin{table}[!h] \n\centering \n\\begin{tabular}{llll} \n\hline" print "$H^{0}$ [GeV] & $X$ [GeV] & c$\\tau$ [cm] & $"+dict[option][0]+"$ [\%] \\\\" H,X=0,0 for file1,file2,file3 in zip(files1,files2,files3): strings=file1[:-4].split('_') if H!=strings[1] or X!=strings[3]: print '\hline' H,X,factor=strings[1],strings[3],strings[4] if factor not in ['0.1','1.0','10.0'] : continue main_ctau=map['_'.join(strings[:4])] ctau=main_ctau*eval(factor) if int(ctau)==ctau: ctau=int(ctau) data1 = pickle.load(open(dir1+'/'+file1))[dict[option][1]] data2 = pickle.load(open(dir2+'/'+file2))[dict[option][1]] data3 = pickle.load(open(dir3+'/'+file3))[dict[option][1]] data=[data1,data2,data3] string = " & ".join(stringValue(100*a[0],100*a[1],1) for a in data) print "%s & %s & %s & %s \\\\"%(H,X,ctau,string) print "\hline" print "\end{tabular} \n\end{table}"
'H_400_X_150':40,'H_400_X_50':8,'H_200_X_50':20, 'SQ_1500_CHI_494':17.3,'SQ_1000_CHI_148':5.9,'SQ_350_CHI_148':17.8,'SQ_1500_CHI_150':4.5, 'SQ_1000_CHI_500':22.7,'SQ_700_CHI_150':8.1,'SQ_700_CHI_500':27.9 } files=sorted(os.listdir(dir),key=lambda file: (eval(file[:-4].split('_')[1]), eval(file[:-4].split('_')[3]), eval(file[:-4].split('_')[4])) ) print "\\begin{table}[!h] \n\centering \n\\begin{tabular}{llll} \n\hline" #print "$H^{0}$ [GeV] & $X$ [GeV] & c$\\tau$ [cm] & Acceptance [\%] & $\epsilon$ [\%] & $\epsilon_{InAcceptance}$ [\%] \\\\" print "$H^{0}$ [GeV] & $X$ [GeV] & c$\\tau$ [cm] & $\epsilon$ [\%]\\\\" H,X=0,0 for file in files: strings=file[:-4].split('_') if H!=strings[1] or X!=strings[3]: print '\hline' H,X,factor=strings[1],strings[3],strings[4] if factor not in ['0.1','1.0','10.0'] : continue main_ctau=map['_'.join(strings[:4])] ctau=main_ctau*eval(factor) if int(ctau)==ctau: ctau=int(ctau) data = pickle.load(open(dir+'/'+file)) #string = " & ".join(stringValue(100*a[0],100*a[1],1) for a in data) string = stringValue(100*data[0][0],100*data[0][1],1) print "%s & %s & %s & %s \\\\"%(H,X,ctau,string) print "\hline" print "\end{tabular} \n\end{table}"