10 return [key.GetName()
for key
in gDirectory.GetListOfKeys()]
11 TFile.GetKeyNames = GetKeyNames
15 print "Too few arguments. Expected the following:"
16 print " 1. Input root file 1"
17 print " 2. Input root file 2"
18 print " 3. Output plot file (.root)"
21 inFile1 = TFile.Open(sys.argv[1],
"READ")
22 inFile2 = TFile.Open(sys.argv[2],
"READ")
23 outFile = TFile.Open(sys.argv[3],
"RECREATE")
26 for histName
in inFile1.GetKeyNames():
27 if histName
not in inFile2.GetKeyNames():
28 print "Histogram in file1 but not file2:",histName
29 for histName
in inFile2.GetKeyNames():
30 if histName
not in inFile1.GetKeyNames():
31 print "Histogram in file2 but not file1:",histName
34 for histName
in inFile1.GetKeyNames():
35 if histName
in inFile2.GetKeyNames():
36 hist1 = inFile1.Get(histName)
37 hist2 = inFile2.Get(histName)
39 if fabs(hist1.GetMaximum()) > 1.e-4
or fabs(hist1.GetMinimum()) > 1.e-4:
40 print "Histogram values differ:",histName