ATLAS Offline Software
Functions | Variables
ParseEtaIntercalInput Namespace Reference

Functions

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

Variables

list SystematicNames = ['EtaIntercalibration_TotalStat','EtaIntercalibration_Modelling']
 
dictionary jetDefDict
 

Function Documentation

◆ GetKeyNames()

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

Definition at line 8 of file January2018_specialStatTerms/ParseEtaIntercalInput.py.

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

◆ ReadEtaIntercalibrationHistograms()

def ParseEtaIntercalInput.ReadEtaIntercalibrationHistograms (   dirName)

Definition at line 19 of file Final2012/ParseEtaIntercalInput.py.

20  if not dirName.endswith("/"):
21  dirName = dirName + "/"
22 
23  # Run over each file (one per jet definition)
24  histos = {}
25  files = sorted(glob.glob(dirName+"*.root"))
26  for aFileName in files:
27  # Determine the jet definition
28  jetDef = ""
29  for aFileDef,aJetDef in jetDefDict.iteritems():
30  if aFileDef in aFileName:
31  jetDef = aJetDef
32  break
33  if jetDef == "":
34  print "Failed to determine jet definition for file:",aFileName
35  return None
36  histos[jetDef] = {}
37 
38  # Read in the histograms of interest from the file
39  inFile = TFile(aFileName,"READ")
40  for aName in SystematicNames:
41  systematicName = aName + "_" + jetDef
42  histo = inFile.Get(systematicName)
43  if histo is None:
44  print "Failed to get histogram:",systematicName
45  return None
46  histo.SetName(systematicName+"_old")
47 
48  # Histo has different range, extend it
49  histoNew = ProviderHistoHelpers.ExtendPtRangeOfHisto(histo,systematicName)
50  histoNew.SetDirectory(0)
51  histos[jetDef][aName] = histoNew
52 
53  # Done reading, close the file
54  inFile.Close()
55 
56  return histos

Variable Documentation

◆ jetDefDict

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

Definition at line 12 of file Final2012/ParseEtaIntercalInput.py.

◆ SystematicNames

dictionary ParseEtaIntercalInput.SystematicNames = ['EtaIntercalibration_TotalStat','EtaIntercalibration_Modelling']

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

ParseEtaIntercalInput.ReadEtaIntercalibrationHistograms
def ReadEtaIntercalibrationHistograms(dirName)
Definition: Final2012/ParseEtaIntercalInput.py:19
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.
ProviderHistoHelpers.ExtendPtRangeOfHisto
def ExtendPtRangeOfHisto(histo, histoName)
Definition: Final2012/ProviderHistoHelpers.py:97
ParseEtaIntercalInput.GetKeyNames
def GetKeyNames(self, dir="")
Definition: January2018_specialStatTerms/ParseEtaIntercalInput.py:8