4 from array
import array
8 import ProviderHistoHelpers
11 SystematicNameDictionary = {
12 'RelativeNonClosure_AFII_AntiKt4EMTopo' :
'RelativeNonClosure_AFII',
13 'RelativeNonClosure_AFII_AntiKt4LCTopo' :
'RelativeNonClosure_AFII'
17 '4EM' :
'AntiKt4Topo_EMJES',
19 '4LC' :
'AntiKt4Topo_LCJES',
24 if dirName.endswith(
".root") :
27 elif not dirName.endswith(
"/") :
28 dirName = dirName +
"/"
29 files =
sorted(glob.glob(dirName+
"*.root"))
33 for aFileName
in files:
36 for aFileDef,aJetDef
in jetDefDict.iteritems():
37 if aFileDef
in aFileName:
41 print "Failed to determine jet definition for file:",aFileName
46 inFile = TFile(aFileName,
"READ")
47 for aName,aSystName
in SystematicNameDictionary.iteritems():
48 if not aFileDef
in aName :
continue
49 systematicName = aSystName +
"_" + jetDef
50 histo = inFile.Get(aName)
52 print "Failed to get histogram:",systematicName
57 for ybin
in range(histo.GetNbinsY()+2) :
60 for xbin
in range(histo.GetNbinsX()+2) :
61 inbin = histo.GetBinContent(xbin,ybin)
67 histo.SetBinContent(xbin,ybin,freezeval)
71 histoSym.SetDirectory(0)
72 histos[jetDef][aSystName] = histoSym
73 print "Added hist with name",aSystName,
"for jetDef",jetDef
79 histos[jetDef][
"RelativeNonClosure_MC15"].
SetDirectory(0)