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

Functions

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

Variables

list SystematicNames = ['EtaIntercalibration_TotalStat','EtaIntercalibration_Modelling']
dict jetDefDict
 GetKeyNames

Function Documentation

◆ GetKeyNames()

ParseEtaIntercalInput.GetKeyNames ( self,
dir = "" )

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

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

◆ ReadEtaIntercalibrationHistograms()

ParseEtaIntercalInput.ReadEtaIntercalibrationHistograms ( dirName)

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

19def ReadEtaIntercalibrationHistograms(dirName):
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

◆ GetKeyNames

ParseEtaIntercalInput.GetKeyNames

◆ jetDefDict

dict 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

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

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