4 from array
import array
8 import ProviderHistoHelpers
11 SystematicNameDictionary = {
12 'herwigpp' :
'bJES_Generator',
13 'distorted_geometry' :
'bJES_Geometry',
14 'FTFP_BERT' :
'bJES_HadIntModel'
18 'AntiKt4TopoEM' :
'AntiKt4Topo_EMJES',
19 'AntiKt6TopoEM' :
'AntiKt6Topo_EMJES',
20 'AntiKt4LCTopo' :
'AntiKt4Topo_LCJES',
21 'AntiKt6LCTopo' :
'AntiKt6Topo_LCJES'
25 if not dirName.endswith(
"/"):
26 dirName = dirName +
"/"
31 files =
sorted(glob.glob(dirName+
"b-JES*GSC.root"))
32 for aFileName
in files:
35 for aFileDef,aJetDef
in jetDefDict.iteritems():
36 if aFileDef
in aFileName:
40 print "Failed to determine jet definition for file:",aFileName
45 inFile = TFile(aFileName,
"READ")
46 for aName,aSystName
in SystematicNameDictionary.iteritems():
47 systematicName = aSystName +
"_" + jetDef
48 histo = inFile.Get(aName)
50 print "Failed to get histogram:",systematicName
54 histo2D.SetDirectory(0)
57 for ptBin
in range(1,histo2D.GetNbinsX()+1):
58 for etaBin
in range(1,histo2D.GetNbinsY()+1):
59 histo2D.SetBinContent(ptBin,etaBin,1-histo2D.GetBinContent(ptBin,etaBin))
61 histos[jetDef][aSystName] = histo2D
68 for aDef,aHistoSet
in histos.iteritems():