6 execfile(
"geometryXMLparser.py")
7 execfile(
"plotscripts.py")
12 if len(cargs) < 5
or len(cargs) > 7:
13 print "Draws differences between two xml geometries (or between single xml geometry and ideal) for all six variables."
14 print "usage: ./diffTwoXMLs.py label selector geom2.xml geom1.xml report2.py report1.py"
15 print "or ./diffTwoXMLs.py label selector geom2.xml geom1.xml report.py"
16 print "or ./diffTwoXMLs.py label selector geom.xml report.py"
17 print "where selector is one of ALL, DT, CSC, CSCE1, CSCE2"
18 print "The label will be included into the filename as diffTwoXMLs_label_selector.png"
20 print "Special consistency test mode with respect to corrections in the report:"
21 print "If the label starts with \"vsReport_\", the delta corrections from report2 would be substracted from the XML differences."
23 print "./diffTwoXMLs.py diffReport_label selector geom2.xml geom1.xml report.py"
27 def ALL(dt, wheel, station, sector):
return True
29 def ALL(csc, endcap, station, ring, chamber):
return True
31 def DT(dt, wheel, station, sector):
return dt ==
"DT"
32 def DT_st1(dt, wheel, station, sector):
return dt ==
"DT" and station == 1
33 def DT_st2(dt, wheel, station, sector):
return dt ==
"DT" and station == 2
34 def DT_st3(dt, wheel, station, sector):
return dt ==
"DT" and station == 3
35 def DT_st4(dt, wheel, station, sector):
return dt ==
"DT" and station == 4
37 def CSC(csc, endcap, station, ring, chamber):
return csc ==
"CSC"
38 def CSCE1(csc, endcap, station, ring, chamber):
return csc ==
"CSC" and endcap==1
39 def CSCE2(csc, endcap, station, ring, chamber):
return csc ==
"CSC" and endcap==2
44 if label.find(
"vsReport_") == 0: diffReport =
True
50 reportfile2 = cargs[4]
57 reportfile2 = cargs[5]
58 g1 = MuonGeometry(xmlfile1)
64 reportfile2 = cargs[5]
65 reportfile1 = cargs[6]
66 g1 = MuonGeometry(xmlfile1)
70 g2 = MuonGeometry(xmlfile2)
74 c1 = ROOT.TCanvas(
"c1",
"c1",1000,600)
80 eval(
"DBdiff(g2, g1, r2, r1, %s, selection=%s, phi=False, bins=251)" % (ranges, selection))
84 ranges =
"window=0.02"
85 eval(
"DBdiff(g2, g1, r2, r1, %s, selection=%s, phi=False, bins=1001, reportdiff=True, inlog=True)" % (ranges, selection))
89 c1.Print(
"diffTwoXMLs_%s_%s.png" % (label, selection))