15def ReadCurrentHistograms(aSystFile,newjetsdict=[]):
16
17
18 useJetCollections = ["AntiKt4EMTopo","AntiKt4LCTopo"]
19
20
21 systematicFile = TFile(aSystFile,"READ")
22
23 if newjetsdict!=[] :
24 useJetCollections = newjetsdict
25
26 histos = {}
27 for key in systematicFile.GetKeyNames() :
28
29
30 foundJetType = False
31 print "looping through useJetCollections",useJetCollections
32 for type in useJetCollections :
33 if key.endswith(type) :
34 jettype = type
35 foundJetType = True
36 if not foundJetType :
37 print "No jet type matches"
38 continue
39 if jettype not in histos :
40 print "Adding extra dict..."
41 histos[jettype] = {}
42
43
44 systname = key.replace("_"+jettype,"")
45
46 histo = systematicFile.Get(key)
47 histo.SetDirectory(0)
48 histos[jettype][systname] = histo
49
50
51 return histos
52
53
54
55