-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathPlot_Corrections_2nd.py
More file actions
92 lines (74 loc) · 3.12 KB
/
Plot_Corrections_2nd.py
File metadata and controls
92 lines (74 loc) · 3.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
if isDT == False and isCSC == False:
print "Error! AlignmentName", alignmentName, "not found"
exit(-1)
g1 = MuonGeometry(xmlfile1)
g_ref = MuonGeometry(xmlfile_ref)
if isReport:
execfile(reportfile1)
report1 = reports
if not os.path.exists(folderName):
os.makedirs(folderName)
htmlPath = folderName
if not os.path.exists(htmlPath):
os.makedirs(htmlPath)
texPath = folderName+"/TEX/"
if not os.path.exists(texPath):
os.makedirs(texPath)
pngPath = folderName+"/PNG/"
if not os.path.exists(pngPath):
os.makedirs(pngPath)
pdfPath = folderName+"/PDF/"
if not os.path.exists(pdfPath):
os.makedirs(pdfPath)
svgPath = folderName+"/SVG/"
if not os.path.exists(svgPath):
os.makedirs(svgPath)
htmlName = "index.html"
#htmlName = alignmentName+".html"
htmlName_d = alignmentName+".d.html" # file for correction
if isReport:
htmlName_e = alignmentName+".e.html" # file for uncertainties
htmlName_p = alignmentName+".p.html" # file for pulls
texName = alignmentName+".tex"
texName_d = alignmentName+".d.tex" # file for correction
if isReport:
texName_e = alignmentName+".e.tex" # file for uncertainties
texName_p = alignmentName+".p.tex" # file for pulls
execfile("Util_InitAllHistos.py")
legend.SetHeader(plotsHeader)
# ******************************************************************************
# DTs
# ******************************************************************************
if isDT:
execfile("Plot_Corrections_DT.py")
# ******************************************************************************
# CSCs
# ******************************************************************************
elif isCSC:
execfile("Plot_Corrections_CSC.py")
else:
sys.exit(-1)
#*******************************************************************************
# Main output HTML file
#*******************************************************************************
htmlFile = htmlPath + htmlName
texFile = texPath + texName
PrintHtmlHeader(htmlFile)
PrintHtmlCode(htmlFile,"<font size=\"+2\">Summary for %s</font>" % alignmentName)
PrintHtmlCode(htmlFile,"<p>")
if isDT:
dtGroupTable.PrintHtml(htmlFile,summaryTable,summaryHtmlCaption, 0)
dtGroupTable.PrintTex(texFile,summaryTable, ("Summary table %s" % alignmentName), ("tab:summary_%s" % alignmentName), 1)
if isCSC:
cscGroupTable.PrintHtml(htmlFile,summaryTable,summaryHtmlCaption, 0)
cscGroupTable.PrintTex(texFile,summaryTable, ("Summary table %s" % alignmentName), ("tab:summary_%s" % alignmentName), 1)
print str(htmlFile)
print str(htmlName_d)
print str(correctionName)
PrintHtmlCode(htmlFile,"<p><hr width=\"100%\">")
PrintHtmlCode(htmlFile,"<p>Additional information:<ul>")
PrintHtmlCode(htmlFile,"<li><a href=\"%s\">%s</a></li>" % (htmlName_d,correctionName) )
if isReport:
PrintHtmlCode(htmlFile,"<li><a href=\"%s\">Alignment fit uncertainties</a></li>" % (htmlName_e) )
PrintHtmlCode(htmlFile,"<li><a href=\"%s\">Pulls</a></li>" % (htmlName_p) )
PrintHtmlTrailer(htmlFile)