ATLAS Offline Software
Loading...
Searching...
No Matches
CreatePhysValWebPage Namespace Reference

Functions

 row_major (alist, sublen)
 col_major (alist, sublen)
 html_table (lol)
 list_to_html_table (alist, sublength, column_major=False)

Variables

 parser = argparse.ArgumentParser(description='Create the Physics Validation web page:', usage='%(prog)s -i ROC/ ')
 help
 default
 args = parser.parse_args()
 folder = os.path.abspath(args.input_dir)
 format = args.format
 nHisto = int(args.number_of_histo)
 files = glob.glob(format)
 my_htm_page = list_to_html_table(files, nHisto)
 hs = open("FTAG_PhysValWebPage.html", 'w')
str folder_eff = folder+"/eff_vs_Lxy"
str folder_pt = folder+"/eff_vs_pt_ttbar"
int is_ttbar = 1
str mypage = "<html><table>"

Function Documentation

◆ col_major()

CreatePhysValWebPage.col_major ( alist,
sublen )

Definition at line 23 of file CreatePhysValWebPage.py.

23def col_major(alist, sublen):
24 numrows = (len(alist)+sublen-1) // sublen
25 return [alist[i::sublen] for i in range(numrows)]
26
27#example:
28#L = ['one','two','three','four','five','six','seven','eight','nine']
29#for r in row_major(L, 3): print r
30#for r in col_major(L, 3): print r
31#for r in row_major(L, 4): print r
32

◆ html_table()

CreatePhysValWebPage.html_table ( lol)

Definition at line 33 of file CreatePhysValWebPage.py.

33def html_table(lol):
34 string = '<html><table>'
35 for sublist in lol:
36 string += '<tr><th> '
37 #print (sublist)
38 list_len = len(sublist)
39
40 #First the headers
41 for file in sublist:
42 idx = sublist.index(file)
43 print("Histo: " + sublist[idx])
44 list_end = list_len - idx
45 if list_end != 1:
46 string += '<p style=\"color:#0000FF\";>'+ str(file)+ '<p> </th><th>'
47 else:
48 #print("End Of List!")
49 string += '<p style=\"color:#0000FF\";>'+ str(file)+ '<p> </th></tr> '
50
51 #Then the plots
52 string += '<tr><td> '
53 for file in sublist:
54 idx = sublist.index(file)
55 list_end = list_len - idx
56 if list_end != 1:
57 string += '<a href="'+str(file)+'"> <img alt="'+str(file)+'" src="'+str(file)+'" width="400" height="300"></a> </td><th>'
58 else:
59 string += '<a href="'+str(file)+'"> <img alt="'+str(file)+'" src="'+str(file)+'" width="400" height="300"></a> </td><tr>'
60
61 #print("string= "+string)
62 #print(".........")
63 string += '</table></html>'
64 return string
65
void print(char *figname, TCanvas *c1)

◆ list_to_html_table()

CreatePhysValWebPage.list_to_html_table ( alist,
sublength,
column_major = False )

Definition at line 66 of file CreatePhysValWebPage.py.

66def list_to_html_table(alist, sublength, column_major=False):
67 if column_major:
68 lol = col_major(alist, sublength)
69 else:
70 lol = row_major(alist, sublength)
71 return(html_table(lol))

◆ row_major()

CreatePhysValWebPage.row_major ( alist,
sublen )

Definition at line 20 of file CreatePhysValWebPage.py.

20def row_major(alist, sublen):
21 return [alist[i:i+sublen] for i in range(0, len(alist), sublen)]
22

Variable Documentation

◆ args

CreatePhysValWebPage.args = parser.parse_args()

Definition at line 76 of file CreatePhysValWebPage.py.

◆ default

CreatePhysValWebPage.default

Definition at line 13 of file CreatePhysValWebPage.py.

◆ files

CreatePhysValWebPage.files = glob.glob(format)

Definition at line 93 of file CreatePhysValWebPage.py.

◆ folder

CreatePhysValWebPage.folder = os.path.abspath(args.input_dir)

Definition at line 77 of file CreatePhysValWebPage.py.

◆ folder_eff

str CreatePhysValWebPage.folder_eff = folder+"/eff_vs_Lxy"

Definition at line 108 of file CreatePhysValWebPage.py.

◆ folder_pt

str CreatePhysValWebPage.folder_pt = folder+"/eff_vs_pt_ttbar"

Definition at line 121 of file CreatePhysValWebPage.py.

◆ format

CreatePhysValWebPage.format = args.format

Definition at line 84 of file CreatePhysValWebPage.py.

◆ help

CreatePhysValWebPage.help

Definition at line 13 of file CreatePhysValWebPage.py.

◆ hs

CreatePhysValWebPage.hs = open("FTAG_PhysValWebPage.html", 'w')

Definition at line 103 of file CreatePhysValWebPage.py.

◆ is_ttbar

int CreatePhysValWebPage.is_ttbar = 1

Definition at line 122 of file CreatePhysValWebPage.py.

◆ my_htm_page

CreatePhysValWebPage.my_htm_page = list_to_html_table(files, nHisto)

Definition at line 101 of file CreatePhysValWebPage.py.

◆ mypage

str CreatePhysValWebPage.mypage = "<html><table>"

Definition at line 147 of file CreatePhysValWebPage.py.

◆ nHisto

CreatePhysValWebPage.nHisto = int(args.number_of_histo)

Definition at line 85 of file CreatePhysValWebPage.py.

◆ parser

CreatePhysValWebPage.parser = argparse.ArgumentParser(description='Create the Physics Validation web page:', usage='%(prog)s -i ROC/ ')

Definition at line 12 of file CreatePhysValWebPage.py.