ATLAS Offline Software
Functions | Variables
ParsePileupInput Namespace Reference

Functions

def ReadPileupHistograms (dirName)
 

Variables

list SystematicNames = ['Pileup_PtTerm_NPV','Pileup_PtTerm_Mu','Pileup_OffsetNPV','Pileup_OffsetMu','Pileup_RhoTopology']
 
list jetDefs = ['AntiKt4Topo_EMJES','AntiKt6Topo_EMJES','AntiKt4Topo_LCJES','AntiKt6Topo_LCJES']
 

Function Documentation

◆ ReadPileupHistograms()

def ParsePileupInput.ReadPileupHistograms (   dirName)

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

15 def ReadPileupHistograms(dirName):
16  if not dirName.endswith("/"):
17  dirName = dirName + "/"
18 
19  # We're just taking it from the old ROOT file...
20  # Ensure there is just one such file
21  rootFileList = sorted(glob.glob(dirName+"*.root"))
22  if len(rootFileList) != 1:
23  print "Directory contains multiple or no root files - was expecting one:",dirName
24  return None
25  rootFile = TFile(rootFileList[0],"READ")
26 
27  histos = {}
28  for aJetDef in jetDefs:
29  histos[aJetDef] = {}
30 
31  # Loop over the desired systematics
32  for aSystName in SystematicNames:
33  systematicName = aSystName + "_" + aJetDef
34  histo = rootFile.Get(systematicName)
35  if histo is None:
36  print "Failed to get histogram:",systematicName
37  return None
38  histo.SetDirectory(0)
39 
40  histos[aJetDef][aSystName] = histo
41 
42  # Done reading, close the file
43  rootFile.Close()
44 
45  return histos
46 
47 
48 

Variable Documentation

◆ jetDefs

dictionary ParsePileupInput.jetDefs = ['AntiKt4Topo_EMJES','AntiKt6Topo_EMJES','AntiKt4Topo_LCJES','AntiKt6Topo_LCJES']

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

◆ SystematicNames

list ParsePileupInput.SystematicNames = ['Pileup_PtTerm_NPV','Pileup_PtTerm_Mu','Pileup_OffsetNPV','Pileup_OffsetMu','Pileup_RhoTopology']

Definition at line 11 of file Final2012/ParsePileupInput.py.

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.
ParsePileupInput.ReadPileupHistograms
def ReadPileupHistograms(dirName)
Definition: Final2012/ParsePileupInput.py:15