ATLAS Offline Software
Functions | Variables
ParsePunchthroughInput Namespace Reference

Functions

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

Variables

dictionary SystematicNameDictionary
 
dictionary jetDefDict
 
list SystematicNameList = ['PunchThrough_MC15','PunchThrough_AFII']
 

Function Documentation

◆ GetKeyNames()

def ParsePunchthroughInput.GetKeyNames (   self,
  dir = "" 
)

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

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

◆ ReadPunchthroughHistograms()

def ParsePunchthroughInput.ReadPunchthroughHistograms (   dirName)

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

31 def 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

◆ jetDefDict

dictionary 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

dictionary 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.

ParsePunchthroughInput.ReadPunchthroughHistograms
def ReadPunchthroughHistograms(dirName)
Definition: Final2012/ParsePunchthroughInput.py:31
ParsePunchthroughInput.GetKeyNames
def GetKeyNames(self, dir="")
Definition: Final2012/ParsePunchthroughInput.py:10
DerivationFramework::TriggerMatchingUtils::sorted
std::vector< typename T::value_type > sorted(T begin, T end)
Helper function to create a sorted vector from an unsorted one.