ATLAS Offline Software
Loading...
Searching...
No Matches
ParseCurrentFile Namespace Reference

Functions

 GetKeyNames (self, dir="")
 ReadCurrentHistograms (aSystFile, newjetsdict=[])

Variables

 GetKeyNames

Function Documentation

◆ GetKeyNames()

ParseCurrentFile.GetKeyNames ( self,
dir = "" )

Definition at line 10 of file ICHEP2016/ParseCurrentFile.py.

10def GetKeyNames(self,dir=""):
11 self.cd(dir)
12 return [key.GetName() for key in gDirectory.GetListOfKeys()]

◆ ReadCurrentHistograms()

ParseCurrentFile.ReadCurrentHistograms ( aSystFile,
newjetsdict = [] )

Definition at line 15 of file ICHEP2016/ParseCurrentFile.py.

15def ReadCurrentHistograms(aSystFile,newjetsdict=[]):
16
17 # Dictionary to translate from Bogdan's names to provider names
18 useJetCollections = ["AntiKt4EMTopo","AntiKt4LCTopo"]
19
20 # Just one file here with everything in it.
21 systematicFile = TFile(aSystFile,"READ")
22
23 if newjetsdict!=[] :
24 useJetCollections = newjetsdict
25
26 histos = {}
27 for key in systematicFile.GetKeyNames() :
28
29 # Only keep things of the jet collections we are using.
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 # Only keep things for which we do not have a more current version.
44 systname = key.replace("_"+jettype,"")
45
46 histo = systematicFile.Get(key)
47 histo.SetDirectory(0)
48 histos[jettype][systname] = histo
49
50 # Done, return dictionary of histos
51 return histos
52
53
54
55

Variable Documentation

◆ GetKeyNames

ParseCurrentFile.GetKeyNames

Definition at line 13 of file ICHEP2016/ParseCurrentFile.py.