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',
"AntiKt4Topo_LCJES"]
21 for jetDef
in jetDefList :
23 inFile = TFile(fileName,
"READ")
24 uncNames = [
"SingleParticle_HighPt"]
25 jetCollections = {
"AntiKt4EMTopo" :
"AntiKt4Topo_EMJES",
"AntiKt4LCTopo" :
"AntiKt4Topo_LCJES"}
26 for name
in uncNames :
27 for jetCollection
in jetCollections.keys() :
28 getJetType = jetCollections[jetCollection]
29 fetchName = name+
"_"+getJetType
30 hist = inFile.Get(fetchName)
31 print "retrieved",fetchName
33 histos[jetCollections[jetCollection]][name] = hist
39 if os.path.isdir(dirName):
40 fileList =
sorted(glob.glob(dirName+
"*.root"))
41 if len(fileList) > 1 :
45 file = TFile(fileList[0],
"READ")
47 file = TFile(dirName,
"READ")
62 for aJetDef
in jetDefList:
76 for histName
in rootFile.GetKeyNames():
77 if aJetDef
not in histName:
continue
78 histo = rootFile.Get(histName)
80 print "Failed to get histogram:",histName
82 histo.SetName(histName+
"_1D")
85 histos[aJetDef][re.sub(
"_%s"%(aJetDef),
"",histName)].
SetDirectory(0)