4 from array
import array
8 import ProviderHistoHelpers
11 SystematicNames = [
'Pileup_OffsetNPV',
'Pileup_OffsetMu']
13 jetDefs = {
'AntiKt4EMTopo':
'AntiKt4Topo_EMJES',
'AntiKt4LCTopo':
'AntiKt4Topo_LCJES'}
16 if not dirName.endswith(
"/"):
17 dirName = dirName +
"/"
21 rootFileList =
sorted(glob.glob(dirName+
"*.root"))
25 for aJetDef
in jetDefs.keys():
26 histos[jetDefs[aJetDef]] = {}
28 for file
in rootFileList :
29 rootFile = TFile(file,
"READ")
32 for aSystName
in SystematicNames:
33 systematicName = aSystName +
"_" + aJetDef
34 if systematicName
not in rootFile.GetKeyNames() :
36 histo = rootFile.Get(systematicName)
38 print "Failed to get histogram:",systematicName
43 histos[jetDefs[aJetDef]][aSystName] = histo
51 rootFile = TFile(
"/cluster/warehouse/kpachal/JetCalibration/JetUncertainties/JetUncertainties/inputs/Moriond2016/Pileup/compileVariousPileupTerms_KateJuly31.root",
"READ")
52 for term
in [
'Pileup_PtTerm_NPV',
'Pileup_PtTerm_Mu',
'Pileup_RhoTopology'] :
53 histo = rootFile.Get(term+
"_"+aJetDef)
55 histos[jetDefs[aJetDef]][term] = histo