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

Functions

 GetKeyNames (self, dir="")
 ReadPunchthroughHistograms (dirName)

Variables

 GetKeyNames
dict SystematicNameDictionary
dict jetDefDict
list SystematicNameList = ['PunchThrough_MC15','PunchThrough_AFII']

Function Documentation

◆ GetKeyNames()

ParsePunchthroughInput.GetKeyNames ( self,
dir = "" )

Definition at line 10 of file Final2012/ParsePunchthroughInput.py.

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

◆ ReadPunchthroughHistograms()

ParsePunchthroughInput.ReadPunchthroughHistograms ( dirName)

Definition at line 31 of file Final2012/ParsePunchthroughInput.py.

31def ReadPunchthroughHistograms(dirName):
32 if not dirName.endswith("/"):
33 dirName = dirName + "/"
34
35 # Run over the one file
36 rootFileList = sorted(glob.glob(dirName+"*.root"))
37 if len(rootFileList) != 1:
38 print "Found a number of root files not equal to 1 in dir:",dirName
39 return None
40 rootFile = TFile(rootFileList[0],"READ")
41
42 histos = {}
43 for aJetDef,aJetDefProv in jetDefDict.iteritems():
44 histos[aJetDefProv] = {}
45
46 for histName in rootFile.GetKeyNames():
47 if aJetDef not in histName: continue
48 for aKey,aVal in SystematicNameDictionary.iteritems():
49 histName = aJetDef+"_"+aKey
50 histo = rootFile.Get(histName)
51 if histo is None:
52 print "Failed to get histogram:",histName
53 return None
54 histo.SetName(aVal+"_"+aJetDefProv)
55 histo.SetDirectory(0)
56
57 histos[aJetDefProv][aVal] = histo
58
59 # Done reading, close the file
60 rootFile.Close()
61
62
76
77 return histos
78

Variable Documentation

◆ GetKeyNames

ParsePunchthroughInput.GetKeyNames

Definition at line 13 of file Final2012/ParsePunchthroughInput.py.

◆ jetDefDict

dict ParsePunchthroughInput.jetDefDict
Initial value:
1= {
2 'AntiKt4TopoEM' : 'AntiKt4Topo_EMJES',
3 'AntiKt6TopoEM' : 'AntiKt6Topo_EMJES',
4 'AntiKt4LCTopo' : 'AntiKt4Topo_LCJES',
5 'AntiKt6LCTopo' : 'AntiKt6Topo_LCJES'
6 }

Definition at line 21 of file Final2012/ParsePunchthroughInput.py.

◆ SystematicNameDictionary

dict ParsePunchthroughInput.SystematicNameDictionary
Initial value:
1= {
2 'PunchThroughUncertainties_interpolation_resp_eta_0' : 'PunchThroughCentral',
3 'PunchThroughUncertainties_interpolation_resp_eta_1' : 'PunchThroughCrack',
4 'PunchThroughUncertainties_interpolation_resp_eta_2' : 'PunchThroughForward'
5 }

Definition at line 15 of file Final2012/ParsePunchthroughInput.py.

◆ SystematicNameList

list ParsePunchthroughInput.SystematicNameList = ['PunchThrough_MC15','PunchThrough_AFII']

Definition at line 22 of file ICHEP2016/ParsePunchthroughInput.py.