4 from array
import array
8 import ProviderHistoHelpers
13 return [key.GetName()
for key
in gDirectory.GetListOfKeys()]
14 TFile.GetKeyNames = GetKeyNames
16 jetDefList = [
'AntiKt4Topo_EMJES',
'AntiKt6Topo_EMJES',
'AntiKt4Topo_LCJES',
'AntiKt6Topo_LCJES']
19 if not dirName.endswith(
"/"):
20 dirName = dirName +
"/"
23 emFileList =
sorted(glob.glob(dirName+
"EM*/*.root"))
24 lcFileList =
sorted(glob.glob(dirName+
"LC*/*.root"))
25 if len(emFileList) != 1:
26 print "Found a number of EM root files not equal to 1 in dir:",dirName
28 if len(lcFileList) != 1:
29 print "Found a number of LC root files not equal to 1 in dir:",dirName
31 emFile = TFile(emFileList[0],
"READ")
32 lcFile = TFile(lcFileList[0],
"READ")
35 for aJetDef
in jetDefList:
39 if "EMJES" in aJetDef:
41 elif "LCJES" in aJetDef:
44 print "Unexpected jet def:",aJetDef
47 for histName
in rootFile.GetKeyNames():
48 if aJetDef
not in histName:
continue
49 histo = rootFile.Get(histName)
51 print "Failed to get histogram:",histName
53 histo.SetName(histName+
"_1D")
56 histos[aJetDef][re.sub(
"_%s"%(aJetDef),
"",histName)].
SetDirectory(0)